@idpass/smartscanner-capacitor 0.5.0-beta.2 → 0.5.0-beta.5

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -16,12 +16,11 @@ yarn add @idpass/smartscanner-capacitor
16
16
 
17
17
  ## Usage
18
18
 
19
- The plugin can be used through Capacitor's `Plugins` object, which is the registry of all available plugins.
19
+ The plugin can be used by accessing SmartScannerPlugin from @idpass/smartscanner-capacitor directly.
20
20
 
21
21
  ```js
22
- import { Plugins } from '@capacitor/core';
22
+ import { SmartScannerPlugin } from '@idpass/smartscanner-capacitor';
23
23
 
24
- const { SmartScannerPlugin } = Plugins;
25
24
  ```
26
25
 
27
26
  MRZ scanning example:
@@ -1,3 +1,2 @@
1
1
  <manifest package="org.idpass.smartscanner.capacitor.smartscannercapacitorplugin">
2
2
  </manifest>
3
-
@@ -2,7 +2,12 @@ package org.idpass.smartscanner.capacitor
2
2
 
3
3
  import android.app.Activity
4
4
  import android.content.Intent
5
- import com.getcapacitor.*
5
+ import com.getcapacitor.JSObject;
6
+ import com.getcapacitor.Plugin;
7
+ import com.getcapacitor.PluginCall;
8
+ import com.getcapacitor.PluginMethod;
9
+ import com.getcapacitor.annotation.CapacitorPlugin;
10
+ import com.getcapacitor.annotation.Permission;
6
11
  import com.google.gson.Gson
7
12
  import org.idpass.smartscanner.lib.SmartScannerActivity
8
13
  import org.idpass.smartscanner.lib.scanner.config.ScannerOptions
@@ -10,7 +15,21 @@ import org.json.JSONException
10
15
  import org.json.JSONObject
11
16
  import timber.log.Timber
12
17
 
13
- @NativePlugin(requestCodes = [SmartScannerPlugin.REQUEST_OP_SCANNER])
18
+ @CapacitorPlugin(
19
+ name = "SmartScanner",
20
+ requestCodes = [SmartScannerPlugin.REQUEST_OP_SCANNER],
21
+ permissions = {
22
+ @Permission(
23
+ strings = { Manifest.permission.ACCESS_NETWORK_STATE },
24
+ alias = "network"
25
+ ),
26
+ @Permission(strings = { Manifest.permission.INTERNET }, alias = "internet"),
27
+ @Permission(
28
+ strings = { Manifest.permission.CAMERA },
29
+ alias = "camera"
30
+ )
31
+ }
32
+ )
14
33
  class SmartScannerPlugin : Plugin() {
15
34
 
16
35
  companion object {
@@ -1 +1,2 @@
1
+ export {};
1
2
  //# sourceMappingURL=definitions.js.map
@@ -1,4 +1,4 @@
1
1
  import type { SmartScannerPlugin } from "./definitions";
2
- declare const SmartScannerPlugin: SmartScannerPlugin;
2
+ declare const SmartScanner: SmartScannerPlugin;
3
3
  export * from "./definitions";
4
- export { SmartScannerPlugin };
4
+ export { SmartScanner };
package/dist/esm/index.js CHANGED
@@ -1,5 +1,7 @@
1
1
  import { registerPlugin } from "@capacitor/core";
2
- const SmartScannerPlugin = registerPlugin("SmartScanner", {
3
- web: () => import("./web").then((m) => new m.SmartScannerPluginWeb()),
2
+ const SmartScanner = registerPlugin('SmartScanner', {
3
+ web: () => import("./web").then((m) => new m.SmartScannerPluginWeb())
4
4
  });
5
+ export * from "./definitions";
6
+ export { SmartScanner };
5
7
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjD,MAAM,kBAAkB,GAAG,cAAc,CACvC,cAAc,EACd;IACE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,qBAAqB,EAAE,CAAC;CACtE,CACF,CAAC"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAGjD,MAAM,YAAY,GAAG,cAAc,CACjC,cAAc,EACd;IACE,GAAG,EAAE,GAAG,EAAE,CAAC,MAAM,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,IAAI,CAAC,CAAC,qBAAqB,EAAE,CAAC;CACtE,CACF,CAAC;AAEF,cAAc,eAAe,CAAC;AAC9B,OAAO,EAAE,YAAY,EAAE,CAAC"}
package/dist/esm/web.js CHANGED
@@ -2,10 +2,7 @@ import { WebPlugin } from '@capacitor/core';
2
2
  export * from './web';
3
3
  export class SmartScannerPluginWeb extends WebPlugin {
4
4
  constructor() {
5
- super({
6
- name: 'SmartScannerPlugin',
7
- platforms: ['web'],
8
- });
5
+ super();
9
6
  }
10
7
  async echo(options) {
11
8
  console.log('ECHO', options);
@@ -1 +1 @@
1
- {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,cAAc,OAAO,CAAC;AAEtB,MAAM,OAAO,qBAAsB,SAAQ,SAAS;IAClD;QACE,KAAK,CAAC;YACJ,IAAI,EAAE,oBAAoB;YAC1B,SAAS,EAAE,CAAC,KAAK,CAAC;SACnB,CAAC,CAAC;IACL,CAAC;IAED,KAAK,CAAC,IAAI,CAAC,OAA0B;QACnC,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7B,OAAO,OAAO,CAAC;IACjB,CAAC;IAED,KAAK,CAAC,cAAc,CAAC,OAAyC;QAC5D,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;CACF"}
1
+ {"version":3,"file":"web.js","sourceRoot":"","sources":["../../src/web.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAG5C,cAAc,OAAO,CAAC;AAEtB,MAAM,OAAO,qBAAsB,SAAQ,SAAS;IAClD;QACE,KAAK,EAAE,CAAC;IACV,CAAC;IAEM,KAAK,CAAC,IAAI,CAAC,OAA0B;QAC1C,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;QAC7B,OAAO,OAAO,CAAC;IACjB,CAAC;IAEM,KAAK,CAAC,cAAc,CAAC,OAAyC;QACnE,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IACzC,CAAC;CACF"}
@@ -1,17 +1,16 @@
1
1
  'use strict';
2
2
 
3
+ Object.defineProperty(exports, '__esModule', { value: true });
4
+
3
5
  var core = require('@capacitor/core');
4
6
 
5
- const SmartScannerPlugin = core.registerPlugin("SmartScanner", {
6
- web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.SmartScannerPluginWeb()),
7
+ const SmartScanner = core.registerPlugin('SmartScanner', {
8
+ web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.SmartScannerPluginWeb())
7
9
  });
8
10
 
9
11
  class SmartScannerPluginWeb extends core.WebPlugin {
10
12
  constructor() {
11
- super({
12
- name: 'SmartScannerPlugin',
13
- platforms: ['web'],
14
- });
13
+ super();
15
14
  }
16
15
  async echo(options) {
17
16
  console.log('ECHO', options);
@@ -26,4 +25,6 @@ var web = /*#__PURE__*/Object.freeze({
26
25
  __proto__: null,
27
26
  SmartScannerPluginWeb: SmartScannerPluginWeb
28
27
  });
28
+
29
+ exports.SmartScanner = SmartScanner;
29
30
  //# sourceMappingURL=plugin.cjs.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from \"@capacitor/core\";\nconst SmartScannerPlugin = registerPlugin(\"SmartScanner\", {\n web: () => import(\"./web\").then((m) => new m.SmartScannerPluginWeb()),\n});\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport * from './web';\nexport class SmartScannerPluginWeb extends WebPlugin {\n constructor() {\n super({\n name: 'SmartScannerPlugin',\n platforms: ['web'],\n });\n }\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async executeScanner(options) {\n console.log('executeScanner', options);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;AACA,MAAM,kBAAkB,GAAGA,mBAAc,CAAC,cAAc,EAAE;AAC1D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,qBAAqB,EAAE,CAAC;AACzE,CAAC,CAAC;;ACDK,MAAM,qBAAqB,SAASC,cAAS,CAAC;AACrD,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,CAAC;AACd,YAAY,IAAI,EAAE,oBAAoB;AACtC,YAAY,SAAS,EAAE,CAAC,KAAK,CAAC;AAC9B,SAAS,CAAC,CAAC;AACX,KAAK;AACL,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACrC,QAAQ,OAAO,OAAO,CAAC;AACvB,KAAK;AACL,IAAI,MAAM,cAAc,CAAC,OAAO,EAAE;AAClC,QAAQ,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;AAC/C,KAAK;AACL;;;;;;;"}
1
+ {"version":3,"file":"plugin.cjs.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from \"@capacitor/core\";\nconst SmartScanner = registerPlugin('SmartScanner', {\n web: () => import(\"./web\").then((m) => new m.SmartScannerPluginWeb())\n});\nexport * from \"./definitions\";\nexport { SmartScanner };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport * from './web';\nexport class SmartScannerPluginWeb extends WebPlugin {\n constructor() {\n super();\n }\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async executeScanner(options) {\n console.log('executeScanner', options);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;;;;AACK,MAAC,YAAY,GAAGA,mBAAc,CAAC,cAAc,EAAE;AACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,qBAAqB,EAAE,CAAC;AACzE,CAAC;;ACDM,MAAM,qBAAqB,SAASC,cAAS,CAAC;AACrD,IAAI,WAAW,GAAG;AAClB,QAAQ,KAAK,EAAE,CAAC;AAChB,KAAK;AACL,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;AACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;AACrC,QAAQ,OAAO,OAAO,CAAC;AACvB,KAAK;AACL,IAAI,MAAM,cAAc,CAAC,OAAO,EAAE;AAClC,QAAQ,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;AAC/C,KAAK;AACL;;;;;;;;;"}
package/dist/plugin.js CHANGED
@@ -1,16 +1,13 @@
1
- (function (core) {
1
+ var IdpassSmartscannerCapacitor = (function (exports, core) {
2
2
  'use strict';
3
3
 
4
- const SmartScannerPlugin = core.registerPlugin("SmartScanner", {
5
- web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.SmartScannerPluginWeb()),
4
+ const SmartScanner = core.registerPlugin('SmartScanner', {
5
+ web: () => Promise.resolve().then(function () { return web; }).then((m) => new m.SmartScannerPluginWeb())
6
6
  });
7
7
 
8
8
  class SmartScannerPluginWeb extends core.WebPlugin {
9
9
  constructor() {
10
- super({
11
- name: 'SmartScannerPlugin',
12
- platforms: ['web'],
13
- });
10
+ super();
14
11
  }
15
12
  async echo(options) {
16
13
  console.log('ECHO', options);
@@ -26,5 +23,11 @@
26
23
  SmartScannerPluginWeb: SmartScannerPluginWeb
27
24
  });
28
25
 
29
- }(capacitorExports));
26
+ exports.SmartScanner = SmartScanner;
27
+
28
+ Object.defineProperty(exports, '__esModule', { value: true });
29
+
30
+ return exports;
31
+
32
+ })({}, capacitorExports);
30
33
  //# sourceMappingURL=plugin.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from \"@capacitor/core\";\nconst SmartScannerPlugin = registerPlugin(\"SmartScanner\", {\n web: () => import(\"./web\").then((m) => new m.SmartScannerPluginWeb()),\n});\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport * from './web';\nexport class SmartScannerPluginWeb extends WebPlugin {\n constructor() {\n super({\n name: 'SmartScannerPlugin',\n platforms: ['web'],\n });\n }\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async executeScanner(options) {\n console.log('executeScanner', options);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;IACA,MAAM,kBAAkB,GAAGA,mBAAc,CAAC,cAAc,EAAE;IAC1D,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,qBAAqB,EAAE,CAAC;IACzE,CAAC,CAAC;;ICDK,MAAM,qBAAqB,SAASC,cAAS,CAAC;IACrD,IAAI,WAAW,GAAG;IAClB,QAAQ,KAAK,CAAC;IACd,YAAY,IAAI,EAAE,oBAAoB;IACtC,YAAY,SAAS,EAAE,CAAC,KAAK,CAAC;IAC9B,SAAS,CAAC,CAAC;IACX,KAAK;IACL,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,OAAO,OAAO,CAAC;IACvB,KAAK;IACL,IAAI,MAAM,cAAc,CAAC,OAAO,EAAE;IAClC,QAAQ,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IAC/C,KAAK;IACL;;;;;;;;;;;"}
1
+ {"version":3,"file":"plugin.js","sources":["esm/index.js","esm/web.js"],"sourcesContent":["import { registerPlugin } from \"@capacitor/core\";\nconst SmartScanner = registerPlugin('SmartScanner', {\n web: () => import(\"./web\").then((m) => new m.SmartScannerPluginWeb())\n});\nexport * from \"./definitions\";\nexport { SmartScanner };\n//# sourceMappingURL=index.js.map","import { WebPlugin } from '@capacitor/core';\nexport * from './web';\nexport class SmartScannerPluginWeb extends WebPlugin {\n constructor() {\n super();\n }\n async echo(options) {\n console.log('ECHO', options);\n return options;\n }\n async executeScanner(options) {\n console.log('executeScanner', options);\n }\n}\n//# sourceMappingURL=web.js.map"],"names":["registerPlugin","WebPlugin"],"mappings":";;;AACK,UAAC,YAAY,GAAGA,mBAAc,CAAC,cAAc,EAAE;IACpD,IAAI,GAAG,EAAE,MAAM,mDAAe,CAAC,IAAI,CAAC,CAAC,CAAC,KAAK,IAAI,CAAC,CAAC,qBAAqB,EAAE,CAAC;IACzE,CAAC;;ICDM,MAAM,qBAAqB,SAASC,cAAS,CAAC;IACrD,IAAI,WAAW,GAAG;IAClB,QAAQ,KAAK,EAAE,CAAC;IAChB,KAAK;IACL,IAAI,MAAM,IAAI,CAAC,OAAO,EAAE;IACxB,QAAQ,OAAO,CAAC,GAAG,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC;IACrC,QAAQ,OAAO,OAAO,CAAC;IACvB,KAAK;IACL,IAAI,MAAM,cAAc,CAAC,OAAO,EAAE;IAClC,QAAQ,OAAO,CAAC,GAAG,CAAC,gBAAgB,EAAE,OAAO,CAAC,CAAC;IAC/C,KAAK;IACL;;;;;;;;;;;;;;;;;"}
package/package.json CHANGED
@@ -1,8 +1,8 @@
1
1
  {
2
2
  "name": "@idpass/smartscanner-capacitor",
3
- "version": "0.5.0-beta.2",
3
+ "version": "0.5.0-beta.5",
4
4
  "description": "Capacitor plugin for the SmartScanner Core library to scan MRZ, NFC and barcodes",
5
- "main": "dist/plugin.js",
5
+ "main": "dist/plugin.cjs.js",
6
6
  "module": "dist/esm/index.js",
7
7
  "types": "dist/esm/index.d.ts",
8
8
  "scripts": {
@@ -16,23 +16,23 @@
16
16
  },
17
17
  "author": "NewLogic",
18
18
  "license": "Apache-2.0",
19
- "devDependencies": {
19
+ "dependencies": {
20
20
  "@capacitor/android": "^4.0.1",
21
21
  "@capacitor/cli": "^4.0.1",
22
22
  "@capacitor/core": "^4.0.1",
23
- "@capacitor/ios": "^4.0.1",
24
- "@ionic/prettier-config": "^1.0.0",
25
- "@ionic/swiftlint-config": "^1.0.0",
23
+ "@capacitor/ios": "^4.0.1"
24
+ },
25
+ "devDependencies": {
26
+ "@ionic/eslint-config": "^0.3.0",
27
+ "@ionic/prettier-config": "^1.0.1",
28
+ "@ionic/swiftlint-config": "^1.1.2",
26
29
  "@rollup/plugin-node-resolve": "^8.1.0",
27
- "prettier": "^2.0.5",
28
- "prettier-plugin-java": "^0.8.0",
29
- "rimraf": "^3.0.0",
30
- "rollup": "^2.21.0",
30
+ "eslint": "^7.11.0",
31
+ "prettier": "~2.2.0",
32
+ "rimraf": "^3.0.2",
33
+ "rollup": "^2.32.0",
31
34
  "swiftlint": "^1.0.1",
32
- "typescript": "~3.8.3"
33
- },
34
- "peerDependencies": {
35
- "@capacitor/core": "^4.0.1"
35
+ "typescript": "~4.0.3"
36
36
  },
37
37
  "files": [
38
38
  "dist/",
@@ -56,6 +56,9 @@
56
56
  },
57
57
  "prettier": "@ionic/prettier-config",
58
58
  "swiftlint": "@ionic/swiftlint-config",
59
+ "eslintConfig": {
60
+ "extends": "@ionic/eslint-config/recommended"
61
+ },
59
62
  "repository": {
60
63
  "type": "git",
61
64
  "url": "https://github.com/idpass/smartscanner-capacitor.git"
@@ -65,8 +68,5 @@
65
68
  },
66
69
  "publishConfig": {
67
70
  "access": "public"
68
- },
69
- "dependencies": {
70
- "np": "^7.6.2"
71
71
  }
72
72
  }
File without changes