From 3fbd475ed2c72f9791d877183c7eb773ca4bdbaf Mon Sep 17 00:00:00 2001 From: Daniel Date: Fri, 4 May 2018 10:22:32 +0200 Subject: [PATCH] Merge remote-tracking branch 'origin/master' into v5 --- DEVELOPER.md | 6 +- package-lock.json | 19 + scripts/docs/dgeni/processors/jekyll.js | 14 +- .../dgeni/templates/native_menu.template.html | 2 +- scripts/templates/wrap-min.tmpl | 1 - scripts/templates/wrap.tmpl | 1 - .../plugins/android-full-screen/index.ts | 2 +- src/@ionic-native/plugins/appodeal/index.ts | 2 + .../plugins/call-directory/index.ts | 100 ++ src/@ionic-native/plugins/clipboard/index.ts | 2 +- src/@ionic-native/plugins/facebook/index.ts | 22 - src/@ionic-native/plugins/firebase/index.ts | 18 +- src/@ionic-native/plugins/ftp/index.ts | 2 +- src/@ionic-native/plugins/star-prnt/index.ts | 985 ++++++++++++++++++ .../plugins/tealium-adidentifier/index.ts | 59 ++ .../plugins/tealium-installreferrer/index.ts | 59 ++ src/@ionic-native/plugins/tealium/index.ts | 220 ++++ src/@ionic-native/plugins/uptime/index.ts | 1 - src/@ionic-native/plugins/web-intent/index.ts | 9 +- src/ionic-native/plugins/in-app-review | 47 + 20 files changed, 1521 insertions(+), 50 deletions(-) create mode 100644 src/@ionic-native/plugins/call-directory/index.ts create mode 100644 src/@ionic-native/plugins/star-prnt/index.ts create mode 100644 src/@ionic-native/plugins/tealium-adidentifier/index.ts create mode 100644 src/@ionic-native/plugins/tealium-installreferrer/index.ts create mode 100644 src/@ionic-native/plugins/tealium/index.ts create mode 100644 src/ionic-native/plugins/in-app-review diff --git a/DEVELOPER.md b/DEVELOPER.md index ba6e164d6..d7b164051 100644 --- a/DEVELOPER.md +++ b/DEVELOPER.md @@ -115,11 +115,11 @@ You need to run `npm run build` in the `ionic-native` project, this will create ### Cleaning the code -You need to run `npm run lint` to analyze the code and ensure it's consistency with the repository style. Fix any errors before submitting a PR. +You need to run `npm run lint` to analyze the code and ensure its consistency with the repository style. Fix any errors before submitting a PR. ### 'Wrapping' Up -That's it! The only thing left to do is rigorously document the plugin and it's usage. Take a look at some of the other plugins for good documentation styles. +That's it! The only thing left to do is rigorously document the plugin and its usage. Take a look at some of the other plugins for good documentation styles. ## Commit Message Format @@ -218,4 +218,4 @@ Example: ```ts @CordovaFunctionOverride() someMethod(): Observable { return; } -``` \ No newline at end of file +``` diff --git a/package-lock.json b/package-lock.json index 10211cbbb..5b1ad25b3 100644 --- a/package-lock.json +++ b/package-lock.json @@ -7711,6 +7711,16 @@ "integrity": "sha1-P02uSpH6wxX3EGL4UhzCOfE2YoA=", "dev": true }, + "JSONStream": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/JSONStream/-/JSONStream-1.3.1.tgz", + "integrity": "sha1-cH92HgHa6eFvG8+TcDt4xwlmV5o=", + "dev": true, + "requires": { + "jsonparse": "1.3.1", + "through": "2.3.8" + } + }, "jsprim": { "version": "1.4.1", "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.1.tgz", @@ -11421,6 +11431,15 @@ } } }, + "string_decoder": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.0.3.tgz", + "integrity": "sha512-4AH6Z5fzNNBcH+6XDMfA/BTt87skxqJlO0lAh3Dker5zThcAxG6mKz+iGu308UKoPPQ8Dcqx/4JhujzltRa+hQ==", + "dev": true, + "requires": { + "safe-buffer": "5.1.1" + } + }, "string-width": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-1.0.2.tgz", diff --git a/scripts/docs/dgeni/processors/jekyll.js b/scripts/docs/dgeni/processors/jekyll.js index aea994359..4d800065b 100644 --- a/scripts/docs/dgeni/processors/jekyll.js +++ b/scripts/docs/dgeni/processors/jekyll.js @@ -10,6 +10,12 @@ module.exports = function jekyll(renderDocsProcessor) { // pretty up and sort the docs object for menu generation docs = docs.filter(doc => (!!doc.name && !!doc.outputPath) || doc.docType === 'index-page'); + docs.push({ + docType: 'class', + URL: 'https://github.com/ionic-team/ionic-native-google-maps/blob/master/documents/README.md', + name: 'Google Maps', + }); + docs.sort((a, b) => { const textA = a.name ? a.name.toUpperCase() : '', textB = b.name ? b.name.toUpperCase() : ''; @@ -18,14 +24,20 @@ module.exports = function jekyll(renderDocsProcessor) { }); docs.forEach(doc => { + if (!doc.outputPath) { + return; + } + doc.outputPath = doc.outputPath.toLowerCase().replace(/\s/g, '-'); doc.URL = doc.outputPath.replace('docs//', 'docs/') .replace('/index.md', '') .replace('content/', ''); // add trailing slash to plugin pages if(!doc.URL.endsWith("/") && !doc.URL.endsWith(".html")) { - doc.URL = doc.URL+'/'; + doc.URL = doc.URL + '/'; } + + doc.URL = '/' + doc.URL; }); const betaDocs = []; diff --git a/scripts/docs/dgeni/templates/native_menu.template.html b/scripts/docs/dgeni/templates/native_menu.template.html index a52a56559..2c8e5c15f 100644 --- a/scripts/docs/dgeni/templates/native_menu.template.html +++ b/scripts/docs/dgeni/templates/native_menu.template.html @@ -6,5 +6,5 @@ <@- for doc in docs @><@ if doc.URL and doc.private != true @>
  • - <$ doc.name $><@ if doc.paid == true @> <@ endif @><@ if doc.beta == true @> β<@ endif @> + <$ doc.name $><@ if doc.paid == true @> <@ endif @><@ if doc.beta == true @> β<@ endif @>
  • <@ endif @><@ endfor @> diff --git a/scripts/templates/wrap-min.tmpl b/scripts/templates/wrap-min.tmpl index db88c1d9c..4548c510d 100644 --- a/scripts/templates/wrap-min.tmpl +++ b/scripts/templates/wrap-min.tmpl @@ -5,7 +5,6 @@ * - Add/Change information below * - Document usage (importing, executing main functionality) * - Remove any imports that you are not using - * - Add this file to /src/index.ts (follow style of other plugins) * - Remove all the comments included in this template, EXCEPT the @Plugin wrapper docs and any other docs you added * - Remove this note * diff --git a/scripts/templates/wrap.tmpl b/scripts/templates/wrap.tmpl index db88c1d9c..4548c510d 100644 --- a/scripts/templates/wrap.tmpl +++ b/scripts/templates/wrap.tmpl @@ -5,7 +5,6 @@ * - Add/Change information below * - Document usage (importing, executing main functionality) * - Remove any imports that you are not using - * - Add this file to /src/index.ts (follow style of other plugins) * - Remove all the comments included in this template, EXCEPT the @Plugin wrapper docs and any other docs you added * - Remove this note * diff --git a/src/@ionic-native/plugins/android-full-screen/index.ts b/src/@ionic-native/plugins/android-full-screen/index.ts index d1920100c..c81e1034c 100644 --- a/src/@ionic-native/plugins/android-full-screen/index.ts +++ b/src/@ionic-native/plugins/android-full-screen/index.ts @@ -44,7 +44,7 @@ export enum AndroidSystemUiFlags { * * this.androidFullScreen.isImmersiveModeSupported() * .then(() => console.log('Immersive mode supported')) - * .catch(err => console.log(error)); + * .catch(err => console.log(err)); * * ``` */ diff --git a/src/@ionic-native/plugins/appodeal/index.ts b/src/@ionic-native/plugins/appodeal/index.ts index 7d9bb0e12..6dc922d63 100644 --- a/src/@ionic-native/plugins/appodeal/index.ts +++ b/src/@ionic-native/plugins/appodeal/index.ts @@ -1,6 +1,8 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; import { Observable } from 'rxjs'; import { Injectable } from '@angular/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; +import { Observable } from 'rxjs/Observable'; /** * @name Appodeal diff --git a/src/@ionic-native/plugins/call-directory/index.ts b/src/@ionic-native/plugins/call-directory/index.ts new file mode 100644 index 000000000..573b5d1b3 --- /dev/null +++ b/src/@ionic-native/plugins/call-directory/index.ts @@ -0,0 +1,100 @@ +import { Injectable } from '@angular/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; + +export interface CallDirectoryItem { + label: string; + number: string; +} + +/** + * @name Call Directory + * @description + * This plugin can add phone numbers to an Callkit call directory extension. Call `reloadExtension` after using `addIdentification` and `removeIdentification` + * to process the changes in the call directory extension. + * + * @usage + * ```typescript + * import { CallDirectory } from '@ionic-native/call-directory'; + * + * + * constructor(private callDirectory: CallDirectory) { } + * + * + * let items = [{label: "Hello", number: "123"}]; + * this.callDirectory.addIdentification(items) + * .then((res: any) => console.log(res)) + * .catch((error: any) => console.error(error)); + * + * this.callDirectory.reloadExtension() + * .then(res: string) => console.log(res)) + * .catch((error: any) => console.error(error)); + * ``` + */ +@Plugin({ + pluginName: 'CallDirectory', + plugin: 'cordova-plugin-call-directory', + pluginRef: 'CallDirectory', + repo: 'https://github.com/GEDYSIntraWare/cordova-plugin-call-directory', + install: 'cordova plugin add cordova-plugin-call-directory --variable EXT_NAME="Cordova-Directory" --variable ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES="NO"', + installVariables: ['EXT_NAME', 'ALWAYS_EMBED_SWIFT_STANDARD_LIBRARIES'], + platforms: ['iOS'] +}) +@Injectable() +export class CallDirectory extends IonicNativePlugin { + + /** + * Check if the call directory extension is available and enabled + * @return {Promise} Returns a promise with result + */ + @Cordova() + isAvailable(): Promise { + return; + } + + /** + * Add identification numbers + * @param {Array} items Set of numbers with labels + * @return {Promise} Returns a promise that resolves when numbers are added + */ + @Cordova() + addIdentification(items: Array): Promise { + return; + } + + /** + * Remove identification numbers + * @param {Array} items Set of numbers with arbitrary label + * @return {Promise} Returns a promise that resolves when numbers are removed + */ + @Cordova() + removeIdentification(items: Array): Promise { + return; + } + + /** + * Remove all items from call directory. Refreshes immediately. + * @return {Promise} Returns a promise after refresh with message + */ + @Cordova() + removeAllIdentification(): Promise { + return; + } + + /** + * Get all numbers and labels in call directory + * @return {Array} Returns a promise that resolves with an array of all items + */ + @Cordova() + getAllItems(): Promise> { + return; + } + + /** + * Reload extension to process queued changes + * @return {Promise} Returns a promise after refresh with message + */ + @Cordova() + reloadExtension(): Promise { + return; + } +} diff --git a/src/@ionic-native/plugins/clipboard/index.ts b/src/@ionic-native/plugins/clipboard/index.ts index 80cbdce4f..3e87d787e 100644 --- a/src/@ionic-native/plugins/clipboard/index.ts +++ b/src/@ionic-native/plugins/clipboard/index.ts @@ -26,7 +26,7 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; * alert('Error: ' + reject); * } * ); - * + * * this.clipboard.clear(); * ``` */ diff --git a/src/@ionic-native/plugins/facebook/index.ts b/src/@ionic-native/plugins/facebook/index.ts index d29cb1d72..7d6dc7308 100644 --- a/src/@ionic-native/plugins/facebook/index.ts +++ b/src/@ionic-native/plugins/facebook/index.ts @@ -302,26 +302,4 @@ export class Facebook extends IonicNativePlugin { return; } - /** - * Open App Invite dialog. Does not require login. - * - * For more information see: - * - * the App Invites Overview - https://developers.facebook.com/docs/app-invites/overview - * the App Links docs - https://developers.facebook.com/docs/applinks - * - * - * @param {Object} options An object containing an [App Link](https://developers.facebook.com/docs/applinks) URL to your app and an optional image URL. - * @param {string} options.url [App Link](https://developers.facebook.com/docs/applinks) to your app - * @param {string} [options.picture] image to be displayed in the App Invite dialog - * @returns {Promise} Returns a Promise that resolves with the result data, or rejects with an error - */ - @Cordova() - appInvite(options: { - url: string, - picture: string - }): Promise { - return; - } - } diff --git a/src/@ionic-native/plugins/firebase/index.ts b/src/@ionic-native/plugins/firebase/index.ts index a6457c007..4bae1124c 100644 --- a/src/@ionic-native/plugins/firebase/index.ts +++ b/src/@ionic-native/plugins/firebase/index.ts @@ -307,32 +307,20 @@ export class Firebase extends IonicNativePlugin { return; } - /** - * Sends an SMS to the user with the SMS verification code and returns the Verification ID required to sign in using phone authentication - * @param {string} phoneNumber - * @returns {Promise} - */ - @Cordova({ - platforms: ['iOS'] - }) - getVerificationID(phoneNumber: string): Promise { - return; - } - /** * Sends an SMS to the user with the SMS verification code and returns the Verification ID required to sign in using phone authentication * @param {string} phoneNumber The phone number, including '+' and country code - * @param {number} timeoutDuration The timeout in sec - no more SMS will be sent to this number until this timeout expires + * @param {number} timeoutDuration (Android only) The timeout in sec - no more SMS will be sent to this number until this timeout expires * @returns {Promise} */ @Cordova({ - platforms: ['Android'], + platforms: ['Android', 'iOS'], successIndex: 2, errorIndex: 3 }) verifyPhoneNumber( phoneNumber: string, - timeoutDuration: number + timeoutDuration: number = 0 ): Promise { return; } diff --git a/src/@ionic-native/plugins/ftp/index.ts b/src/@ionic-native/plugins/ftp/index.ts index 6f7bd762f..4035dab64 100644 --- a/src/@ionic-native/plugins/ftp/index.ts +++ b/src/@ionic-native/plugins/ftp/index.ts @@ -1,6 +1,6 @@ import { Injectable } from '@angular/core'; import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; -import { Observable } from 'rxjs'; +import { Observable } from 'rxjs/Observable'; /** * @name FTP diff --git a/src/@ionic-native/plugins/star-prnt/index.ts b/src/@ionic-native/plugins/star-prnt/index.ts new file mode 100644 index 000000000..777e7c936 --- /dev/null +++ b/src/@ionic-native/plugins/star-prnt/index.ts @@ -0,0 +1,985 @@ +import { Injectable } from '@angular/core'; +import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; +import { Observable } from 'rxjs/Observable'; + +export interface Printer { + /** + * Printer model name and model number + */ + modelName?: string; + + /** + * Printer Mac Address + */ + macAddress?: string; + + /** + * Printer port name used to create a new port instance of SMPort or StarIOExtManager + */ + portName?: string; + /** + * USB Serial Number (USB Printers Only) + */ + USBSerialNumber?: string; +} +/** + * Array of Printer objects returned by the portDiscovery() function + */ +export interface Printers extends Array {} + +export interface PrinterStatus { + /** + * Printer Online/Offline status + */ + offline?: boolean; + + /** + * Printer model name and model number + */ + ModelName?: string; + + /** + * Printer cover status + */ + coverOpen?: boolean; + + /** + * Printer Paper Cutter status + */ + cutterError?: boolean; + + /** + * Printer Paper status + */ + receiptPaperEmpty?: boolean; + + /** + * Printer Firmware information + */ + FirmwareVersion?: string; +} + +export interface PrintObj { + /** + * string containing the text to print, Example: "Star Clothing Boutique\n123 Star Road\nCity, State 12345\n\n" + */ + text: string; + + /** + * Sends a PartialCutWithFeed command to the printer, defaults to true + */ + cutReceipt?: boolean; + + /** + * sends a appendPeripheral command to the printer for channels No1 and No2 - Defaults to true + */ + openCashDrawer?: boolean; +} +export interface RasterObj extends PrintObj { + /** + * Font size number, defaults to 25 + */ + fontSize?: number; + + /** + * Paper width (Units: Dots). 2 inches: 384, 3 inches: 576, 4 inches: 832, ESCPos 3 inches: 512, Dot 3 inches: 210. Defaults to 576 + */ + paperWidth?: number; +} +export interface ImageObj { + /** + * Image URI to print, this can be obtained via the camera or photo library or as a static resource saved on the phone memory + */ + uri: string; + + /** + * Image width (Units: Dots) defaults to 576 + */ + paperWidth?: number; + + /** + * Sends a PartialCutWithFeed command to the printer, defaults to true + */ + cutReceipt?: boolean; + + /** + * sends a appendPeripheral command to the printer for channels No1 and No2 - Defaults to true + */ + openCashDrawer?: boolean; +} +export interface PrintCommand { + + /** + * Characther encoding is used to getByte data from all subsequent commands. Default 'US-ASCII' + * Choose the format of the return value Defined in StarPRNT.Encoding or the Encoding enum. + * Example: {appendEncoding:'US-ASCII'} + */ + appendEncoding?: string; + + /** + * Select command of the code page is generated and added to the commands property. + * Choose the format of the return value Defined in StarPRNT.CodePageType or the CodePageType enum. + * Example: {appendCodePage:'CP858'} + */ + appendCodePage?: string; + + /** + * Data (Text) is added to the command buffer. Example: {append:"Star Clothing Boutique\n123 Star Road\nCity, State 12345\n\n"} + */ + append?: string; + + /** + * Data (Text) is added to the command buffer. Example: {appendRaw:"Star Clothing Boutique\n123 Star Road\nCity, State 12345\n\n"} + */ + appendRaw?: string; + + /** + * Data (Command) is added to the command buffer. Takes an array of bytes. + * Example: {appendBytes:[0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x2e]} + */ + appendBytes?: Array; + + /** + * Data (Command) is added to the command buffer. Takes an array of bytes. + * Example: {appendRawBytes:[0x48, 0x65, 0x6c, 0x6c, 0x6f, 0x20, 0x57, 0x6f, 0x72, 0x6c, 0x64, 0x2e]} + */ + appendRawBytes?: Array; + + /** + * Set command of the character space is generated and added to the command buffer. Character Spacs (Unit: Dots) Example: 4 + */ + appendCharacterSpace?: number; + + /** + * Select command of the emphasis mode is generated and added to the command buffer. Example: {appendEmphasis:"SALE\n"} + */ + appendEmphasis?: string; + + /** + * Enable emphasis mode is generated and added to the command buffer. Example: {enableEmphasis:true} + */ + enableEmphasis?: boolean; + + /** + * Select command of the invert mode is generated and added to the command buffer. Example: {appendInvert:"Refunds and Exchanges\n"} + */ + appendInvert?: string; + /** + * Enable invert mode is generated and added to the command buffer. Example: {enableInvert:true} + */ + enableInvert?: boolean; + /** + * Select command of the under line mode is generated and added to the command buffer. Example: {appendUnderline:"30 days"} + */ + appendUnderline?: string; + /** + * Enable under line mode is generated and added to the command buffer. Example: {enableUnderline:true} + */ + enableUnderline?: boolean; + + /** + * Select command of the international character mode is generated and added to the command buffer. + * Choose the format of the return value Defined in StarPRNT.InternationalType or the InternationalType enum. + * 'UK' | 'USA' | 'France' | 'Germany' | 'Denmark' | 'Sweden' | 'Italy' | 'Spain' | 'Japan' | 'Norway' | 'Denmark2' | 'Spain2' | 'LatinAmerica' | 'Korea' | 'Ireland' | 'Legal' + * Example {appendInternational:InternationalType.UK} + */ + appendInternational?: string; + + /** + * Line feed command is generated and added to the command buffer. Paper feed units (Units: Lines) Example: 2 + */ + appendLineFeed?: number; + + /** + * Unit feed command is generated and added to the command buffer. Paper feed units (Units: Dots) Example: 64 + */ + appendUnitFeed?: number; + + /** + * Set command of the line space is generated and added to the command buffer. Line spaces (Units: Dots) Example: 32 + */ + appendLineSpace?: number; + + /** + * Select command of the font style is generated and added to the command buffer. + * Choose the format of the return value defined in StarPRNT.FontStyleType or the FontStyleType enum. 'A' | 'B' + * Example: {appendFontStyle:FontStyleType.A} + */ + appendFontStyle?: string; + + /** + * Paper cut command is generated and added to the command buffer. + * Choose the format of the return value defined in StarPRNT.CutPaperAction or the CutPaperAction enum. 'FullCut' | 'FullCutWithFeed' | 'PartialCut' | 'PartialCutWithFeed' + * Example: {appendCutPaper:CutPaperAction.PartialCutWithFeed} + */ + appendCutPaper?: string; + + /** + * Black mark command is generated and added to the command buffer. + * Choose the format of the return value defined in StarPRNT.BlackMarkType or the BlackMarkType enum. 'Valid' | 'Invalid' | 'ValidWithDetection' + * Example: {appendBlackMark: BlackMarkType.Valid} + */ + appendBlackMark?: string; + + /** + * Absolute position command is generated and added to the command buffer. (Unit: Dots). Send in conjunction with the data property to append absolute position just to that string + * Example1: Append data with Absolute position {appendAbsolutePosition:40, data: "Text with absolute position"} + * Example2: Append absolute position to subsequent commands: {appendAbsolutePosition:40} + */ + appendAbsolutePosition?: number; + + /** + * Alignment command is generated and added to the command buffer. Send in conjunction with the data property to append alignment position just to that string + * Choose the format of the return value defined in StarPRNT.AlignmentPosition or the AlignmentPosition enum. 'Left' | 'Center' | 'Right'. + * Example1 Append data with Alignment position: {appendAlignment:AlignmentPosition.Center, data: "Text with centered position"} + * Example2 Append absolute position to subsequent commands: {appendAlignment:AlignmentPosition.Center} + */ + appendAlignment?: string; + + /** + * Horizontal tab set/clear command is generated and added to the command buffer. (Only works for certain printer models, check the starSDK documentation for details) + * Array of horizontal tab positions (Units: ANK character pitch). Specifying empty array deletes all currently set horizontal tab positions. + * Example: {appendHorizontalTabPosition:[15, 35]} + * Delete positions Example: {appendHorizontalTabPosition:[]} + */ + appendHorizontalTabPosition?: Array; + + /** + * Print command of the logo is generated and added to the command buffer. The logo has to be uploaded to the printer using the Star Print utility. + * Send in conjuction with the logoSize property to set the logo size + * Example: {appendLogo:1} + * Example with LogoSize: {appendLogo:1, logoSize:LogoSize.DoubleWidthDoubleHeight} + */ + appendLogo?: number; + + /** + * Property to be used with the appendLogo command. + * Choose the format of the return value defined in StarPRNT.LogoSize or the LogoSize enum. 'Normal' | 'DoubleWidth' | 'DoubleHeight' | 'DoubleWidthDoubleHeight'; + * Example: {appendLogo:1, logoSize:LogoSize.DoubleWidthDoubleHeight} + */ + logoSize?: string; + + /** + * Print command of the barcode is generated and added to the command buffer. + * Additional Properties: BarcodeSymbology, BarcodeWidth, height, hri, absolutePosition, alignment. + * Example: {appendBarcode:"{BStar", BarcodeSymbology:BarcodeSymbology.Code128, BarcodeWidth:BarcodeWidth.Mode2, height:40, hri:true } + * Example with absolutePosition: {appendBarcode:"{BStar", BarcodeSymbology:BarcodeSymbology.Code128, BarcodeWidth:BarcodeWidth.Mode2, height:40, hri:true, absolutePosition:40 } + * Example with alignment:{appendBarcode:"{BStar", BarcodeSymbology:BarcodeSymbology.Code128, BarcodeWidth:BarcodeWidth.Mode2, height:40, hri:true, alignment:alignment:AlignmentPosition.Center } + */ + appendBarcode?: string; + + /** + * Property to be used with the appendBarcode command. + * Choose the format of the return value defined in StarPRNT.BarcodeSymbology or the BarcodeSymbology enum. + * 'Code128' | 'Code39' | 'Code93' | 'ITF' | 'JAN8' | 'JAN13' | 'NW7' | 'UPCA' | 'UPCE' | + * Example: {appendBarcode:'{BStar', BarcodeSymbology:BarcodeSymbology.Code128} + */ + BarcodeSymbology?: string; + + /** + * Property to be used with the appendBarcode command. + * Choose the format of the return value defined in StarPRNT.BarcodeWidth or the BarcodeWidth enum. + * Mode1 | Mode2 | Mode3 | Mode4 | Mode5 | Mode6 | Mode7 | Mode8 | Mode9 + * Example: {appendBarcode:'{BStar', BarcodeWidth:BarcodeWidth.Mode2} + */ + BarcodeWidth?: string; + + /** + * Property to be used with the appendBarcode command. + * Under-bar characters. true = Valid, false = Invalid + * Example: {appendBarcode:'{BStar', hri:true} + */ + hri?: boolean; + + /** + * Property to be used with the appendBarcode command or the appendMultiple command (Units:Dots) + * appendBarcode Example: {appendBarcode:'{BStar', height:40} + * appendMultiple: {appendMultiple:'text to print', height:40} + */ + height?: number; + + /** + * Property to be used with the appendBitmap command or the appendMultiple command (Units:Dots) + * appendBitmap Example: {appendBitmap:uri, width:576} + * appendMultiple: {appendMultiple:'text to print', width:40} + */ + width?: number; + + /** + * Property to be used with the appendBitmap command, the appendBarcode command, or the appendQrCode command (Units:Dots) + * appendBitmap Example: {appendBitmap:uri, absolutePosition:40}. + * appendBarcode Example: {appendBarcode:'{BStar', absolutePosition:40}. + * appendQrCode Example: {appendQrCode:'{BStar', absolutePosition:40}. + */ + absolutePosition?: number; + + /** + * Property to be used with the appendBitmap command, the appendBarcode command, or the appendQrCode command (Units:Dots) + * Choose the format of the return value defined in StarPRNT.AlignmentPosition or the AlignmentPosition enum. 'Left' | 'Center' | 'Right'. + * appendBitmap Example: {appendBitmap:uri, alignment:AlignmentPosition.Center}. + * appendBarcode Example: {appendBarcode:'{BStar', alignment:AlignmentPosition.Center}. + * appendQrCode Example: {appendQrCode:'{BStar', alignment:AlignmentPosition.Center}. + */ + alignment?: string; + + /** + * Select command of the multiple mode is generated and added to the command buffer. + * Additional properties: width:number, height:number + * Example: {appendMultiple:" $156.95\n", width:2, height:2}. + */ + appendMultiple?: string; + + /** + * Enable multiple mode is generated and added to the command buffer. + * Additional properties: width:number, height:number + * Example: {enableMultiple:true, width:2, height:2} + * Disable Example: {enableMultiple:false} + */ + enableMultiple?: boolean; + + /** + * Print command of the QR code is generated and added to the command buffer. + * Additional Properties: QrCodeModel, QrCodeLevel, cell, absolutePosition, alignment. + * Example: {appendQrCode:"{BStar", QrCodeModel:"No2", QrCodeLevel:"L", cell: 8}. + * Example with absolutePosition: {appendQrCode:"{BStar", QrCodeModel:"No2", QrCodeLevel:"L", cell: 8, absolutePosition: 40 }. + * Example with alignment: {appendQrCode:"{BStar", QrCodeModel:"No2", QrCodeLevel:"L", cell: 8, alignment:"Center" }. + */ + appendQrCode?: string; + + /** + * Property to be used with the appendQrCode command. + * Choose the format of the return value defined in StarPRNT.QrCodeModel or the QrCodeModel enum. 'No1' | 'No2' Default 'No2' + * Example: {appendQrCode:'{BStar', QrCodeModel:QrCodeModel.No1} + */ + QrCodeModel?: string; + + /** + * Property to be used with the appendQrCode command. + * Choose the format of the return value defined in StarPRNT.QrCodeLevel or the QrCodeLevel enum. 'No1' | 'No2'. Default 'H' + * Example: {appendQrCode:'{BStar', QrCodeLevel:QrCodeLevel.H} + */ + QrCodeLevel?: string; + + /** + * Property to be used with the appendQrCode command. QRCode Cell size. Default 4. + * Example: {appendQrCode:'{BStar', cell:8} + */ + cell?: number; + + /** + * Print command of the bitmap is generated and added to the command buffer. Takes a string image URI + * this can be obtained via the camera or photo library or as a static resource saved on the phone memory. + * Additional Properties: diffusion, width, bothScale, rotation, absolutePosition, alignment. + * Example: {appendBitmap:uri, diffusion: true, width:576, bothScale: true} + * Example with absolutePosition: {appendBitmap:uri, diffusion: true, width:576, bothScale: true, absolutePosition: 40 }. + * Example with alignment: {appendBitmap:uri, diffusion: true, width:576, bothScale: true, alignment:"Center" }. + */ + appendBitmap?: string; + + /** + * Property to be used with the appendBitmap command. Random dither: true = Valid, false = Invalid. Default true. + * Example: {appendBitmap:uri, diffusion: false } + */ + diffusion?: boolean; + + /** + * Property to be used with the appendBitmap command. Height is changed according to the conversion rate of the width property. + * true = Valid, false = Invalid. Default true. + * Example: {appendBitmap:uri, bothScale: true } + */ + bothScale?: boolean; + + /** + * Property to be used with the appendBitmap command. + * Choose the format of the return value defined in StarPRNT.BitmapConverterRotation or the BitmapConverterRotation enum. + * 'Normal' | 'Left90' | 'Right90' | 'Rotate180' + * Example: {appendBitmap:uri, rotation: BitmapConverterRotation.Left90 } + */ + rotation?: string; + + /** + * sends a appendPeripheral command to the printer for channel number: Example: 1 = No1, 2 = No2 + */ + openCashDrawer?: number; +} + +/** + * Emulation constants + */ +export enum Emulation { + /** mPOP, SM-L200, SM-L300, SM-S210i, SM-S220i, SM-S230i, SM-T300i/T300, SM-T400i */ + StarPRNT = 'StarPRNT', + /** SM-L200, SM-L300 */ + StarPRNTL = 'StarPRNTL', + /** FVP10, TSP650II, TSP700II, TSP800II */ + StarLine = 'StarLine', + /** TSP100 */ + StarGraphic = 'StarGraphic', + /** BSC10 */ + EscPos = 'EscPos', + /** SM-S210i, SM-S220i, SM-S230i, SM-T300i/T300, SM-T400i */ + EscPosMobile = 'EscPosMobile', + /** SP700 */ + StarDotImpact = 'StarDotImpact', +} + +/** + * Encoding constants + */ +export enum Encoding { + /** English */ + USASCII = 'US-ASCII', + /** French, German, Portuguese, Spanish */ + Windows1252 = 'Windows-1252', + /** Japanese */ + ShiftJIS = 'Shift-JIS', + /** Russian */ + Windows1251 = 'Windows-1251', + /** Simplified Chinese */ + GB2312 = 'GB2312', + /** Traditional Chinese */ + Big5 = 'Big5', + /** UFT8 */ + UTF8 = 'UTF-8' +} + +/** + * CodePageType constants + */ +export enum CodePageType { + CP737 = 'CP737', + CP772 = 'CP772', + CP774 = 'CP774', + CP851 = 'CP851', + CP852 = 'CP852', + CP855 = 'CP855', + CP857 = 'CP857', + CP858 = 'CP858', + CP860 = 'CP860', + CP861 = 'CP861', + CP862 = 'CP862', + CP863 = 'CP863', + CP864 = 'CP864', + CP865 = 'CP865', + CP869 = 'CP869', + CP874 = 'CP874', + CP928 = 'CP928', + CP932 = 'CP932', + CP999 = 'CP999', + CP1001 = 'CP1001', + CP1250 = 'CP1250', + CP1251 = 'CP1251', + CP1252 = 'CP1252', + CP2001 = 'CP2001', + CP3001 = 'CP3001', + CP3002 = 'CP3002', + CP3011 = 'CP3011', + CP3012 = 'CP3012', + CP3021 = 'CP3021', + CP3041 = 'CP3041', + CP3840 = 'CP3840', + CP3841 = 'CP3841', + CP3843 = 'CP3843', + CP3845 = 'CP3845', + CP3846 = 'CP3846', + CP3847 = 'CP3847', + CP3848 = 'CP3848', + UTF8 = 'UTF8', + Blank = 'Blank' +} + +/** + * InternationalType constants + */ +export enum InternationalType { + UK = 'UK', + USA = 'USA', + France = 'France', + Germany = 'Germany', + Denmark = 'Denmark', + Sweden = 'Sweden', + Italy = 'Italy', + Spain = 'Spain', + Japan = 'Japan', + Norway = 'Norway', + Denmark2 = 'Denmark2', + Spain2 = 'Spain2', + LatinAmerica = 'LatinAmerica', + Korea = 'Korea', + Ireland = 'Ireland', + Legal = 'Legal' +} + +/** + * FontStyleType constants. + */ +export enum FontStyleType { + /** Font-A (12 x 24 dots) / Specify 7 x 9 font (half dots) */ + A = 'A', + /** Font-B (9 x 24 dots) / Specify 5 x 9 font (2P-1) */ + B = 'B' +} + +/** + * CutPaperAction constants. + */ +export enum CutPaperAction { + FullCut = 'FullCut', + FullCutWithFeed = 'FullCutWithFeed', + PartialCut = 'PartialCut', + PartialCutWithFeed = 'PartialCutWithFeed' +} + +/** + * BlackMarkType constants. + */ +export enum BlackMarkType { + Valid = 'Valid', + Invalid = 'Invalid', + ValidWithDetection = 'ValidWithDetection' +} + +/** + * LogoSize constants + */ +export enum LogoSize { + Normal = 'Normal', + DoubleWidth = 'DoubleWidth', + DoubleHeight = 'DoubleHeight', + DoubleWidthDoubleHeight = 'DoubleWidthDoubleHeight' +} + +/** + * AlignmentPosition constants + */ +export enum AlignmentPosition { + Left = 'Left', + Center = 'Center', + Right = 'Right' +} + +/** + * BarcodeSymbology constants + */ +export enum BarcodeSymbology { + Code128 = 'Code128', + Code39 = 'Code39', + Code93 = 'Code93', + ITF = 'ITF', + JAN8 = 'JAN8', + JAN13 = 'JAN13', + NW7 = 'NW7', + UPCA = 'UPCA', + UPCE = 'UPCE' +} + +/** + * BarcodeWidth constants + */ +export enum BarcodeWidth { + Mode1 = 'Mode1', + Mode2 = 'Mode2', + Mode3 = 'Mode3', + Mode4 = 'Mode4', + Mode5 = 'Mode5', + Mode6 = 'Mode6', + Mode7 = 'Mode7', + Mode8 = 'Mode8', + Mode9 = 'Mode9' +} + +/** + * QrCodeModel constants + */ +export enum QrCodeModel { + No1 = 'No1', + No2 = 'No2' +} + +/** + * QrCodeLevel constants + */ +export enum QrCodeLevel { + H = 'H', + L = 'L', + M = 'M', + Q = 'Q' +} + +/** + * BitmapConverterRotation constants + */ +export enum BitmapConverterRotation { + Normal = 'Normal', + Left90 = 'Left90', + Right90 = 'Right90', + Rotate180 = 'Rotate180' +} + +/** + * Push a new PrintCommand object to the array for a separate instruction to the printer. Example [{append:"text"}, {"openCashDrawer: 1"}] + */ +export interface CommandsArray extends Array {} + +/** + * @name StarPRNT + * @description + * * Ionic Native wrappers for the starprnt cordova plugin for Star Micronics Bluetooth/LAN printers + * + * @usage + * ```typescript + * import { StarPRNT } from '@ionic-native/star-prnt'; + * + * + * constructor(private starprnt: StarPRNT) { } + * + * ... + * + * + * this.starprnt.portDiscovery('all') + * .then((res: any) => console.log(res)) + * .catch((error: any) => console.error(error)); + * + * ``` + */ +@Plugin({ + pluginName: 'StarPRNT', + plugin: 'cordova-plugin-starprnt', // npm package name, example: cordova-plugin-camera + pluginRef: 'starprnt', // the variable reference to call the plugin, example: navigator.geolocation + repo: 'https://github.com/auctifera-josed/starprnt', // the github repository URL for the plugin + platforms: ['Android', 'iOS'] // Array of platforms supported, example: ['Android', 'iOS'] +}) +@Injectable() +export class StarPRNT extends IonicNativePlugin { + + /** + * Constant for Emulation + */ + Emulation = { + StarPRNT: 'StarPRNT', + StarPRNTL: 'StarPRNTL', + StarLine: 'StarLine', + StarGraphic: 'StarGraphic', + EscPos: 'EscPos', + EscPosMobile: 'EscPosMobile', + StarDotImpact: 'StarDotImpact', + }; + + /** + * Constant for possible Encoding + */ + Encoding = { + USASCII: 'US-ASCII', + Windows1252: 'Windows-1252', + ShiftJIS: 'Shift-JIS', + Windows1251: 'Windows-1251', + GB2312: 'GB2312', + Big5: 'Big5', + UTF8: 'UTF-8' + }; + + /** + * CodePageType constants + */ + CodePageType = { + CP737: 'CP737', + CP772: 'CP772', + CP774: 'CP774', + CP851: 'CP851', + CP852: 'CP852', + CP855: 'CP855', + CP857: 'CP857', + CP858: 'CP858', + CP860: 'CP860', + CP861: 'CP861', + CP862: 'CP862', + CP863: 'CP863', + CP864: 'CP864', + CP865: 'CP865', + CP869: 'CP869', + CP874: 'CP874', + CP928: 'CP928', + CP932: 'CP932', + CP999: 'CP999', + CP1001: 'CP1001', + CP1250: 'CP1250', + CP1251: 'CP1251', + CP1252: 'CP1252', + CP2001: 'CP2001', + CP3001: 'CP3001', + CP3002: 'CP3002', + CP3011: 'CP3011', + CP3012: 'CP3012', + CP3021: 'CP3021', + CP3041: 'CP3041', + CP3840: 'CP3840', + CP3841: 'CP3841', + CP3843: 'CP3843', + CP3845: 'CP3845', + CP3846: 'CP3846', + CP3847: 'CP3847', + CP3848: 'CP3848', + UTF8: 'UTF8', + Blank: 'Blank' + }; + + /** + * Constant for possible InternationalType + */ + InternationalType = { + UK: 'UK', + USA: 'USA', + France: 'France', + Germany: 'Germany', + Denmark: 'Denmark', + Sweden: 'Sweden', + Italy: 'Italy', + Spain: 'Spain', + Japan: 'Japan', + Norway: 'Norway', + Denmark2: 'Denmark2', + Spain2: 'Spain2', + LatinAmerica: 'LatinAmerica', + Korea: 'Korea', + Ireland: 'Ireland', + Legal: 'Legal' + }; + + /** + * Constant for possible FontStyleType + */ + FontStyleType = { + /** Font-A (12 x 24 dots) / Specify 7 x 9 font (half dots) */ + A: 'A', + /** Font-B (9 x 24 dots) / Specify 5 x 9 font (2P-1) */ + B: 'B' + }; + + /** + * Constant for possible CutPaperAction + */ + CutPaperAction = { + FullCut: 'FullCut', + FullCutWithFeed: 'FullCutWithFeed', + PartialCut: 'PartialCut', + PartialCutWithFeed: 'PartialCutWithFeed' + }; + + /** + * Constant for possible BlackMarkType + */ + BlackMarkType = { + Valid: 'Valid', + Invalid: 'Invalid', + ValidWithDetection: 'ValidWithDetection' + }; + + /** + * Constant for possible AlignmentPosition + */ + AlignmentPosition = { + Left: 'Left', + Center: 'Center', + Right: 'Right' + }; + + /** + * Constant for possible LogoSize + */ + LogoSize = { + Normal: 'Normal', + DoubleWidth: 'DoubleWidth', + DoubleHeight: 'DoubleHeight', + DoubleWidthDoubleHeight: 'DoubleWidthDoubleHeight' + }; + + /** + * Constant for possible BarcodeSymbology + */ + BarcodeSymbology = { + Code128: 'Code128', + Code39: 'Code39', + Code93: 'Code93', + ITF: 'ITF', + JAN8: 'JAN8', + JAN13: 'JAN13', + NW7: 'NW7', + UPCA: 'UPCA', + UPCE: 'UPCE' + }; + + /** + * Constant for possible BarcodeWidth + */ + BarcodeWidth = { + Mode1: 'Mode1', + Mode2: 'Mode2', + Mode3: 'Mode3', + Mode4: 'Mode4', + Mode5: 'Mode5', + Mode6: 'Mode6', + Mode7: 'Mode7', + Mode8: 'Mode8', + Mode9: 'Mode9' + }; + + /** + * Constant for possible QrCodeModel + */ + QrCodeModel = { + No1: 'No1', + No2: 'No2' + }; + + /** + * Constant for possible QrCodeLevel + */ + QrCodeLevel = { + H: 'H', + L: 'L', + M: 'M', + Q: 'Q' + }; + + /** + * Constant for possible BitmapConverterRotation + */ + BitmapConverterRotation = { + Normal: 'Normal', + Left90: 'Left90', + Right90: 'Right90', + Rotate180: 'Rotate180' + }; + + /** + * Find available printers + * @param {string} type Interface Type: All, LAN, Bluetooth, USB + * @return {Promise} Returns a promise that resolves with an array of printers + */ + @Cordova() + portDiscovery(type: string): Promise { + return; + } + + /** + * Checks the status of the printer + * @param {string} port Printer name i.e BT:StarMicronics + * @param {string} emulation StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact" + * @return {Promise} Returns a promise that resolves with the PrinterStatus object + */ + @Cordova() + checkStatus(port: string, emulation: string): Promise { + return; + } + + /** + * Prints plain text + * @param {string} port Printer name i.e BT:StarMicronics. Send null to use a printer connected via StarIOExtManager using the connect() function + * @param {string} emulation StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact" + * @param {PrintObj} printObj text:string, cutReceipt?:boolean, openCashDrawer?:boolean + * @return {Promise} Success! if printed correctly or error message string returned by the SDK. + */ + @Cordova() + printRawText( + port: string, + emulation: string, + printObj: PrintObj + ): Promise { + return; + } + + /** + * Converts the text into a bitmap image and sends it to the printer + * @param {string} port Printer name i.e BT:StarMicronics. Send null to use a printer connected via StarIOExtManager using the connect() function + * @param {string} emulation StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact" + * @param {RasterObj} rasterObj text:string, cutReceipt?:boolean, openCashDrawer?:boolean, fontSize:number, paperWidth:number + * @return {Promise} Success! if printed correctly or error message string returned by the SDK. + */ + @Cordova() + printRasterReceipt( + port: string, + emulation: string, + rasterObj: RasterObj + ): Promise { + return; + } + + /** + * Gets an image from a string URI and converts it to bitmap to send it to the printer + * @param {string} port Printer name i.e BT:StarMicronics. Send null to use a printer connected via StarIOExtManager using the connect() function + * @param {string} emulation StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact" + * @param {ImageObj} imageObj uri:string, paperWidth?:number, cutReceipt?:boolean, openCashDrawer?:boolean + * @return {Promise} Success! if printed correctly or error message string returned by the SDK. + */ + @Cordova() + printImage( + port: string, + emulation: string, + imageObj: ImageObj + ): Promise { + return; + } + + /** + * sends an appendPeripheral command to the printer for channels No1 and No2 + * @param {string} port Printer name i.e BT:StarMicronics. Send null to use a printer connected via StarIOExtManager using the connect() function + * @param {string} emulation StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact" + * @return {Promise} Success! if opened or error message string returned by the SDK. + */ + @Cordova() + openCashDrawer(port: string, emulation: string): Promise { + return; + } + + /** + * Sends an Array of commands to the command buffer using the Android ICommandBuilderInterface or iOS ISCBBuilderInterface + * @param {string} port Printer name i.e BT:StarMicronics. Send null to use a printer connected via StarIOExtManager using the connect() function + * @param {string} emulation StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact" + * @param {CommandsArray} commandsArray each command in the array should be an instance of the PrintCommand object. Example [{append:"text"}, {"openCashDrawer: 1"}] + * @return {Promise} Success! if printed correctly or error message string returned by the SDK. + */ + @Cordova() + print( + port: string, + emulation: string, + commandsArray: CommandsArray + ): Promise { + return; + } + + /** + * Allows you to connect to the printer, keep the connection alive and receive status updates through an observable + * @param {string} port printer name i.e BT:StarMicronics. + * @param {string} emulation StarPrinter Emulation type: "StarPRNT", "StarPRNTL", "StarLine", "StarGraphic", "EscPos", "EscPosMobile", "StarDotImpact" + * @return {Observable} Success! if connected or error message string returned by the SDK. + */ + @Cordova({ + observable: true, + callbackStyle: 'node' + }) + connect(port: string, emulation: string): Observable { + return; + } + + /** + * Returns an observable with the device status events. Only fires when a printer is connnected through the connect() function + * @return {Observable} dataType: printerOnline, printerOffline, printerImpossible, printerPaperEmpty, printerPaperNearEmpty, printerPaperReady, printerCoverOpen, printerCoverClose, cashDrawerOpen, cashDrawerClose + */ + @Cordova({ + eventObservable: true, + event: 'starPrntData' + }) + getStatus(): Observable { + return; + } + + /** + * Allows to disconnect (close the connection to the peripherals), this is useful to avoid keeping alive a connection when not in the app to save device battery + * (energy consumption). You should call this function when the app is paused or closed. + * @return {Promise} Success! if connected or error message string returned by the SDK. + */ + @Cordova() + disconnect(): Promise { + return; + } +} diff --git a/src/@ionic-native/plugins/tealium-adidentifier/index.ts b/src/@ionic-native/plugins/tealium-adidentifier/index.ts new file mode 100644 index 000000000..ead5311ed --- /dev/null +++ b/src/@ionic-native/plugins/tealium-adidentifier/index.ts @@ -0,0 +1,59 @@ +import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; +import { Injectable } from '@angular/core'; + +/** + * @paid + * @name TealiumAdIdentifier + * @description + * This module depends on the [Tealium Cordova Plugin](https://github.com/tealium/cordova-plugin). Without it, this module will not do anything. + * Makes the IDFA and Google Ad Identifier available in the Tealium data layer. + * + * @usage + * ``` + * import { TealiumAdIdentifier } from '@ionic-native/tealium-adidentifier'; + * + * + * constructor(private adIdentifier: TealiumAdIdentifier) { } + * + * ... + * + * + * this.adIdentifier.setPersistent("main"); + * this.adIdentifier.setVolatile("main"); + * + * ``` + */ + +@Plugin({ + pluginName: 'TealiumAdIdentifier', + plugin: 'tealium-cordova-adidentifier', // npm package name, example: cordova-plugin-camera + pluginRef: 'window.tealiumAdIdentifier', // the variable reference to call the plugin, example: navigator.geolocation + repo: 'https://github.com/Tealium/cordova-plugin', // the github repository URL for the plugin + platforms: ['Android', 'iOS'], // Array of platforms supported, example: ['Android', 'iOS'] + install: '', // OPTIONAL install command, in case the plugin requires variables +}) + +@Injectable() +export class TealiumAdIdentifier extends IonicNativePlugin { + + /** + * This function stores the ad identifier information as persistent data + * @param instanceName {string} Your arbitrary Tealium instance name provided at init time + * @return {Promise} Returns a promise that resolves when something happens + */ + @Cordova() + setPersistent(instanceName: string): Promise { + return; + } + + /** + * This function stores the ad identifier information as volatile data + * @param instanceName {string} Your arbitrary Tealium instance name provided at init time + * @return {Promise} Returns a promise that resolves when something happens + */ + @Cordova() + setVolatile(instanceName: string): Promise { + return; + } + +} diff --git a/src/@ionic-native/plugins/tealium-installreferrer/index.ts b/src/@ionic-native/plugins/tealium-installreferrer/index.ts new file mode 100644 index 000000000..edd828a05 --- /dev/null +++ b/src/@ionic-native/plugins/tealium-installreferrer/index.ts @@ -0,0 +1,59 @@ +import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; +import { Injectable } from '@angular/core'; + +/** + * @paid + * @name TealiumInstallReferrer + * @description + * This module depends on the [Tealium Cordova Plugin](https://github.com/tealium/cordova-plugin). Without it, this module will not do anything. + * Implements a Broadcast Receiver for the INSTALL_REFERRER intent. + * + * @usage + * ``` + * import { TealiumInstallReferrer } from '@ionic-native/tealium-installreferrer'; + * + * + * constructor(private installReferrer: TealiumInstallReferrer) { } + * + * + * this.installReferrer.setPersistent("main"); + * this.installReferrer.setVolatile("main"); + * + * + * + * ``` + */ + +@Plugin({ + pluginName: 'TealiumInstallReferrer', + plugin: 'tealium-cordova-installreferrer', // npm package name, example: cordova-plugin-camera + pluginRef: 'window.tealiumInstallReferrer', // the variable reference to call the plugin, example: navigator.geolocation + repo: 'https://github.com/Tealium/cordova-plugin', // the github repository URL for the plugin + platforms: ['Android'], // Array of platforms supported, example: ['Android', 'iOS'] + install: '', // OPTIONAL install command, in case the plugin requires variables +}) + +@Injectable() +export class TealiumInstallReferrer extends IonicNativePlugin { + + /** + * This function stores the install referrer information as persistent data + * @param instanceName {string} Your arbitrary Tealium instance name provided at init time + * @return {Promise} Returns a promise that resolves when something happens + */ + @Cordova() + setPersistent(instanceName: string): Promise { + return; + } + + /** + * This function stores the install referrer information as volatile data + * @param instanceName {string} Your arbitrary Tealium instance name provided at init time + * @return {Promise} Returns a promise that resolves when something happens + */ + @Cordova() + setVolatile(instanceName: string): Promise { + return; + } + +} diff --git a/src/@ionic-native/plugins/tealium/index.ts b/src/@ionic-native/plugins/tealium/index.ts new file mode 100644 index 000000000..c0daa2507 --- /dev/null +++ b/src/@ionic-native/plugins/tealium/index.ts @@ -0,0 +1,220 @@ +import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; +import { Injectable } from '@angular/core'; + +export interface TealConfig { + /** + * Your Tealium account name + */ + account: string; + /** + * Your Tealium profile name + */ + profile: string; + /** + * Your Tealium environment name (dev, qa, prod) + */ + environment: string; + /** + * Arbitrary instance name string. Must be consistent for all calls to Tealium API. + */ + instance: string; + /** + * Enables ("true") or disables ("false") lifecycle reporting. Default true if omitted. + */ + isLifecycleEnabled?: string; + /** + * Not usually required. Sets a custom URL override for dispatches to UDH. + */ + collectDispatchURL?: string; + /** + * Your Tealium UDH profile. Only active if you do not have collectDispatchURL set. + */ + collectDispatchProfile?: string; + /** + * Enables ("true") or disables ("false") Crash Reporter module for Android. Default false if omitted. + */ + isCrashReporterEnabled?: string; +} + +/** + * @paid + * @name Tealium + * @description + * This plugin provides a TypeScript wrapper around the [Tealium](https://www.tealium.com) Cordova plugin for Ionic Native. + * + * For full documentation, see [https://community.tealiumiq.com/t5/Mobile-Libraries/Tealium-for-Cordova/ta-p/17618](https://community.tealiumiq.com/t5/Mobile-Libraries/Tealium-for-Cordova/ta-p/17618) + * @usage + * ``` + * import { Tealium, TealConfig } from '@ionic-native/tealium'; + * + * + * constructor(private tealium: Tealium) { } + * + * ... + * + * let tealConfig: TealConfig = { + * account: "", + * profile: "", + * environment: "", // usually "dev", "qa" or "prod" + * isLifecycleEnabled: "true", // pass "false" to disable lifecycle tracking + * isCrashReporterEnabled: "false", // pass "true" to enable crash reporter (Android only) + * instance: "{ + * this.tealium.trackView({"screen_name": "homescreen"}); + * }); + * + * ``` + * @interfaces + * TealConfig + */ + +@Plugin({ + pluginName: 'Tealium', + plugin: 'tealium-cordova-plugin', // npm package name, example: cordova-plugin-camera + pluginRef: 'window.tealium', // the variable reference to call the plugin, example: navigator.geolocation + repo: 'https://github.com/Tealium/cordova-plugin', // the github repository URL for the plugin + platforms: ['Android', 'iOS'], // Array of platforms supported, example: ['Android', 'iOS'] + install: '', // OPTIONAL install command, in case the plugin requires variables +}) + +@Injectable() +export class Tealium extends IonicNativePlugin { + + /** + * This function initializes the Tealium Cordova plugin. + * This should usually be done inside the "deviceReady" handler. + * @param config {TealConfig} + * @return {Promise} Returns a promise that resolves when something happens + */ + @Cordova() + init(config: TealConfig): Promise { + return; // We add return; here to avoid any IDE / Compiler errors + } + + /** + * This function tracks a view event in the Tealium Cordova plugin + * @param dataObject {any} The JSON data object containing your key-value pairs + * @param instanceName {string} Your arbitrary Tealium instance name provided at init time + * @return {Promise} Returns a promise that resolves when something happens + */ + @Cordova() + trackView(dataObject: any, instanceName: string): Promise { + return; + } + + /** + * This function tracks a link event in the Tealium Cordova plugin + * @param dataObject {any} The JSON data object containing your key-value pairs + * @param instanceName {string} Your arbitrary Tealium instance name provided at init time + * @return {Promise} Returns a promise that resolves when something happens + */ + @Cordova() + trackEvent(dataObject: any, instanceName: string): Promise { + return; + } + + /** + * This function tracks a custom event in the Tealium Cordova plugin + * @param eventType {string} The event type, link or view + * @param dataObject {any} The JSON data object containing your key-value pairs + * @param instanceName {string} Your arbitrary Tealium instance name provided at init time + * @return {Promise} Returns a promise that resolves when something happens + */ + @Cordova() + track(eventType: string, dataObject: any, instanceName: string): Promise { + return; + } + + /** + * This function adds data to the Tealium persistent data store + * @param keyName {string} The key name that this data will be stored under for later retrieval + * @param value {any} The value to be stored as persistent data + * @param instanceName {string} Your arbitrary Tealium instance name provided at init time + * @return {Promise} Returns a promise that resolves when something happens + */ + @Cordova() + addPersistent(keyName: string, value: string | string[] | any, instanceName: string): Promise { + return; + } + + /** + * This function adds data to the Tealium volatile data store + * @param keyName {string} The key name that this data will be stored under for later retrieval + * @param value {any} The value to be stored as volatile data + * @param instanceName {string} Your arbitrary Tealium instance name provided at init time + * @return {Promise} Returns a promise that resolves when something happens + */ + @Cordova() + addVolatile(keyName: string, value: string | string[], instanceName: string): Promise { + return; + } + + /** + * This function removes data from the Tealium volatile data store + * @param keyName {string} The key name that this data will removed from the Tealium data store + * @param instanceName {string} Your arbitrary Tealium instance name provided at init time + * @return {Promise} Returns a promise that resolves when something happens + */ + @Cordova() + removeVolatile(keyName: string, instanceName: string): Promise { + return; + } + + /** + * This function removes data from the Tealium persistent data store + * @param keyName {string} The key name that this data will removed from the Tealium data store + * @param instanceName {string} Your arbitrary Tealium instance name provided at init time + * @return {Promise} Returns a promise that resolves when something happens + */ + @Cordova() + removePersistent(keyName: string, instanceName: string): Promise { + return; + } + + /** + * This function retrieves a value from the Tealium Persistent data store + * @param keyName {string} The key name that this data will retrieved from the Tealium data store + * @param instanceName {string} Your arbitrary Tealium instance name provided at init time + * @param callback {any} A callback function that will be called when the data has been retrieved + * @return {Promise} Returns a promise that resolves when something happens + */ + @Cordova() + getPersistent(keyName: string, instanceName: string, callback: any): Promise { + return; + } +/** + * This function retrieves a value from the Tealium Volatile data store + * @param keyName {string} The key name that this data will retrieved from the Tealium data store + * @param instanceName {string} Your arbitrary Tealium instance name provided at init time + * @param callback {any} A callback function that will be called when the data has been retrieved + * @return {Promise} Returns a promise that resolves when something happens + */ + @Cordova() + getVolatile(keyName: string, instanceName: string, callback: any): Promise { + return; + } + + /** + * This function adds a remote command for later execution + * @param commandName {string} The command name for this Remote Command + * @param instanceName {string} Your arbitrary Tealium instance name provided at init time + * @param callback {any} A callback function that will be called when the data has been retrieved + * @return {Promise} Returns a promise that resolves when something happens + */ + @Cordova() + addRemoteCommand(commandName: string, instanceName: string, callback: any): Promise { + return; + } + + /** + * This function retrieves the Tealium Visitor ID + * @return {Promise} Returns a promise that resolves when something happens + */ + @Cordova() + getVisitorId(): Promise { + return; + } + +} diff --git a/src/@ionic-native/plugins/uptime/index.ts b/src/@ionic-native/plugins/uptime/index.ts index a2458b78e..f0709dd7c 100644 --- a/src/@ionic-native/plugins/uptime/index.ts +++ b/src/@ionic-native/plugins/uptime/index.ts @@ -8,7 +8,6 @@ import { Cordova, IonicNativePlugin, Plugin } from '@ionic-native/core'; * * @usage * ```typescript - * ionic cordova plugin add cordova-plugin-uptime * import { Uptime } from '@ionic-native/uptime'; * * constructor(private uptime: Uptime) { } diff --git a/src/@ionic-native/plugins/web-intent/index.ts b/src/@ionic-native/plugins/web-intent/index.ts index 0db287afc..97e52c451 100644 --- a/src/@ionic-native/plugins/web-intent/index.ts +++ b/src/@ionic-native/plugins/web-intent/index.ts @@ -200,9 +200,14 @@ export class WebIntent extends IonicNativePlugin { /** * Registers a broadcast receiver for the specified filters * @param filters {any} + * @returns {Observable} */ - @Cordova({ sync: true }) - registerBroadcastReceiver(filters: any): void {} + @Cordova({ + observable: true + }) + registerBroadcastReceiver(filters: any): Observable { + return; + } /** * Unregisters a broadcast receiver diff --git a/src/ionic-native/plugins/in-app-review b/src/ionic-native/plugins/in-app-review new file mode 100644 index 000000000..1681eacda --- /dev/null +++ b/src/ionic-native/plugins/in-app-review @@ -0,0 +1,47 @@ +import { Injectable } from '@angular/core'; +import { Plugin, Cordova, IonicNativePlugin } from '@ionic-native/core'; + +/** + * @name In App Review + * @description + * This plugin does use the iOS class SKStore​Review​Controller to open the inApp review popup available since iOS 10.3 + * + * This functionality only works on iOS devices + * + * + * @usage + * ```typescript + * import { InAppReview } from '@ionic-native/in-app-review'; + * + * + * constructor(private inAppReview: InAppReview) { } + * + * ... + * + * + * this.inAppReview.requestReview() + * .then((res: any) => console.log(res)) + * .catch((error: any) => console.error(error)); + * + * ``` + */ +@Plugin({ + pluginName: 'InAppReview', + plugin: 'com.omarben.inappreview', + pluginRef: 'inappreview', + repo: 'https://github.com/omaxlive/com.omarben.inappreview', + platforms: ['iOS'] +}) +@Injectable() +export class InAppReview extends IonicNativePlugin { + + /** + * Open the inApp review popup + * @return {Promise} Returns a promise that resolves when something happens + */ + @Cordova() + requestReview(): Promise { + return; // We add return; here to avoid any IDE / Compiler errors + } + +}