superapp-miniapp-invoke-native 1.0.39 → 1.0.41

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
@@ -1,6 +1,6 @@
1
1
  # superapp-miniapp-invoke-native
2
2
 
3
- Superapp中,小程序调用Native 接口的封装,如OSP项目中,需要调用Native的相机扫描,镭射扫描,获取RBAC的数据等
3
+ Superapp 中,小程序调用 Native 接口的封装,如 OSP 项目中,需要调用 Native 的相机扫描,镭射扫描,获取 RBAC 的数据等
4
4
 
5
5
  ## Getting started
6
6
 
@@ -42,40 +42,50 @@ Use the built-in continuous integration in GitLab.
42
42
  - [ ] [Use pull-based deployments for improved Kubernetes management](https://docs.gitlab.com/ee/user/clusters/agent/)
43
43
  - [ ] [Set up protected environments](https://docs.gitlab.com/ee/ci/environments/protected_environments.html)
44
44
 
45
- ***
45
+ ---
46
46
 
47
47
  # Editing this README
48
48
 
49
- When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
49
+ When you're ready to make this README your own, just edit this file and use the handy template below (or feel free to structure it however you want - this is just a starting point!). Thank you to [makeareadme.com](https://www.makeareadme.com/) for this template.
50
50
 
51
51
  ## Suggestions for a good README
52
+
52
53
  Every project is different, so consider which of these sections apply to yours. The sections used in the template are suggestions for most open source projects. Also keep in mind that while a README can be too long and detailed, too long is better than too short. If you think your README is too long, consider utilizing another form of documentation rather than cutting out information.
53
54
 
54
55
  ## Name
56
+
55
57
  Choose a self-explaining name for your project.
56
58
 
57
59
  ## Description
60
+
58
61
  Let people know what your project can do specifically. Provide context and add a link to any reference visitors might be unfamiliar with. A list of Features or a Background subsection can also be added here. If there are alternatives to your project, this is a good place to list differentiating factors.
59
62
 
60
63
  ## Badges
64
+
61
65
  On some READMEs, you may see small images that convey metadata, such as whether or not all the tests are passing for the project. You can use Shields to add some to your README. Many services also have instructions for adding a badge.
62
66
 
63
67
  ## Visuals
68
+
64
69
  Depending on what you are making, it can be a good idea to include screenshots or even a video (you'll frequently see GIFs rather than actual videos). Tools like ttygif can help, but check out Asciinema for a more sophisticated method.
65
70
 
66
71
  ## Installation
72
+
67
73
  Within a particular ecosystem, there may be a common way of installing things, such as using Yarn, NuGet, or Homebrew. However, consider the possibility that whoever is reading your README is a novice and would like more guidance. Listing specific steps helps remove ambiguity and gets people to using your project as quickly as possible. If it only runs in a specific context like a particular programming language version or operating system or has dependencies that have to be installed manually, also add a Requirements subsection.
68
74
 
69
75
  ## Usage
76
+
70
77
  Use examples liberally, and show the expected output if you can. It's helpful to have inline the smallest example of usage that you can demonstrate, while providing links to more sophisticated examples if they are too long to reasonably include in the README.
71
78
 
72
79
  ## Support
80
+
73
81
  Tell people where they can go to for help. It can be any combination of an issue tracker, a chat room, an email address, etc.
74
82
 
75
83
  ## Roadmap
84
+
76
85
  If you have ideas for releases in the future, it is a good idea to list them in the README.
77
86
 
78
87
  ## Contributing
88
+
79
89
  State if you are open to contributions and what your requirements are for accepting them.
80
90
 
81
91
  For people who want to make changes to your project, it's helpful to have some documentation on how to get started. Perhaps there is a script that they should run or some environment variables that they need to set. Make these steps explicit. These instructions could also be useful to your future self.
@@ -83,10 +93,13 @@ For people who want to make changes to your project, it's helpful to have some d
83
93
  You can also document commands to lint the code or run tests. These steps help to ensure high code quality and reduce the likelihood that the changes inadvertently break something. Having instructions for running tests is especially helpful if it requires external setup, such as starting a Selenium server for testing in a browser.
84
94
 
85
95
  ## Authors and acknowledgment
96
+
86
97
  Show your appreciation to those who have contributed to the project.
87
98
 
88
99
  ## License
100
+
89
101
  For open source projects, say how it is licensed.
90
102
 
91
103
  ## Project status
104
+
92
105
  If you have run out of energy or time for your project, put a note at the top of the README saying that development has slowed down or stopped completely. Someone may choose to fork your project or volunteer to step in as a maintainer or owner, allowing your project to keep going. You can also make an explicit request for maintainers.
package/lib/main.d.ts CHANGED
@@ -1,4 +1,55 @@
1
- export type * from './src/type';
2
- import NativeApi from './src/init';
3
- declare const _default: NativeApi;
4
- export default _default;
1
+ export declare type ContextType = {
2
+ params: string;
3
+ };
4
+
5
+ declare const _default: NativeApi;
6
+ export default _default;
7
+
8
+ declare class InitialContextPlugins implements InitialContextPluginsType {
9
+ nativeAppInfoConfig: NativeAppInfoConfigType;
10
+ static defaultNativeAppInfoConfig: NativeAppInfoConfigType;
11
+ constructor();
12
+ getIsNativeHandle(): Promise<boolean>;
13
+ specifiedPageHandle(specifiedPageParams: SpecifiedPageType): Promise<void>;
14
+ nativeAppInfoHandle(nativeAppInfoConfig: NativeAppInfoConfigType): Promise<any>;
15
+ }
16
+
17
+ declare interface InitialContextPluginsType {
18
+ getIsNativeHandle: () => Promise<boolean>;
19
+ specifiedPageHandle: ({ cb }: SpecifiedPageType) => void;
20
+ nativeAppInfoHandle: (nativeAppInfoConfig: NativeAppInfoConfigType) => Promise<any>;
21
+ }
22
+
23
+ declare class NativeApi extends InitialContextPlugins {
24
+ constructor();
25
+ getIsNativeHandle(): Promise<boolean>;
26
+ specifiedPageHandle(specifiedPageParams: SpecifiedPageType): Promise<void>;
27
+ nativeAppInfoHandle(nativeAppInfoConfig: NativeAppInfoConfigType): Promise<any>;
28
+ }
29
+
30
+ export declare interface NativeAppInfoConfigType {
31
+ mockServerInfo: {
32
+ env: string;
33
+ area: string;
34
+ };
35
+ mockData?: {
36
+ data_info: any;
37
+ data_store: {
38
+ name: string;
39
+ code: string;
40
+ };
41
+ data_language: {
42
+ code: string;
43
+ id: string;
44
+ name: string;
45
+ [key: string]: string;
46
+ };
47
+ [key: string]: any;
48
+ };
49
+ }
50
+
51
+ declare interface SpecifiedPageType {
52
+ cb: (params: any) => void;
53
+ }
54
+
55
+ export { }
package/lib/main.js CHANGED
@@ -1,6 +1,6 @@
1
- var se = Object.defineProperty;
2
- var oe = (t, e, r) => e in t ? se(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
- var _ = (t, e, r) => (oe(t, typeof e != "symbol" ? e + "" : e, r), r);
1
+ var ae = Object.defineProperty;
2
+ var oe = (t, e, r) => e in t ? ae(t, e, { enumerable: !0, configurable: !0, writable: !0, value: r }) : t[e] = r;
3
+ var E = (t, e, r) => (oe(t, typeof e != "symbol" ? e + "" : e, r), r);
4
4
  /*! Capacitor: https://capacitorjs.com/ - MIT License */
5
5
  const ie = (t) => {
6
6
  const e = /* @__PURE__ */ new Map();
@@ -8,20 +8,20 @@ const ie = (t) => {
8
8
  const r = t.CapacitorPlatforms || {
9
9
  currentPlatform: { name: "web" },
10
10
  platforms: e
11
- }, o = (a, i) => {
12
- r.platforms.set(a, i);
13
- }, n = (a) => {
14
- r.platforms.has(a) && (r.currentPlatform = r.platforms.get(a));
11
+ }, o = (s, i) => {
12
+ r.platforms.set(s, i);
13
+ }, n = (s) => {
14
+ r.platforms.has(s) && (r.currentPlatform = r.platforms.get(s));
15
15
  };
16
16
  return r.addPlatform = o, r.setPlatform = n, r;
17
- }, le = (t) => t.CapacitorPlatforms = ie(t), R = /* @__PURE__ */ le(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {});
18
- R.addPlatform;
19
- R.setPlatform;
20
- var L;
17
+ }, le = (t) => t.CapacitorPlatforms = ie(t), z = /* @__PURE__ */ le(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {});
18
+ z.addPlatform;
19
+ z.setPlatform;
20
+ var k;
21
21
  (function(t) {
22
22
  t.Unimplemented = "UNIMPLEMENTED", t.Unavailable = "UNAVAILABLE";
23
- })(L || (L = {}));
24
- class E extends Error {
23
+ })(k || (k = {}));
24
+ class D extends Error {
25
25
  constructor(e, r, o) {
26
26
  super(e), this.message = e, this.code = r, this.data = o;
27
27
  }
@@ -30,90 +30,90 @@ const ce = (t) => {
30
30
  var e, r;
31
31
  return t != null && t.androidBridge ? "android" : !((r = (e = t == null ? void 0 : t.webkit) === null || e === void 0 ? void 0 : e.messageHandlers) === null || r === void 0) && r.bridge ? "ios" : "web";
32
32
  }, de = (t) => {
33
- var e, r, o, n, a;
34
- const i = t.CapacitorCustomPlatform || null, s = t.Capacitor || {}, u = s.Plugins = s.Plugins || {}, l = t.CapacitorPlatforms, O = () => i !== null ? i.name : ce(t), b = ((e = l == null ? void 0 : l.currentPlatform) === null || e === void 0 ? void 0 : e.getPlatform) || O, j = () => b() !== "web", z = ((r = l == null ? void 0 : l.currentPlatform) === null || r === void 0 ? void 0 : r.isNativePlatform) || j, Q = (c) => {
35
- const d = H.get(c);
33
+ var e, r, o, n, s;
34
+ const i = t.CapacitorCustomPlatform || null, a = t.Capacitor || {}, u = a.Plugins = a.Plugins || {}, l = t.CapacitorPlatforms, U = () => i !== null ? i.name : ce(t), b = ((e = l == null ? void 0 : l.currentPlatform) === null || e === void 0 ? void 0 : e.getPlatform) || U, A = () => b() !== "web", J = ((r = l == null ? void 0 : l.currentPlatform) === null || r === void 0 ? void 0 : r.isNativePlatform) || A, Q = (c) => {
35
+ const d = S.get(c);
36
36
  return !!(d != null && d.platforms.has(b()) || B(c));
37
37
  }, X = ((o = l == null ? void 0 : l.currentPlatform) === null || o === void 0 ? void 0 : o.isPluginAvailable) || Q, Y = (c) => {
38
38
  var d;
39
- return (d = s.PluginHeaders) === null || d === void 0 ? void 0 : d.find((y) => y.name === c);
40
- }, B = ((n = l == null ? void 0 : l.currentPlatform) === null || n === void 0 ? void 0 : n.getPluginHeader) || Y, Z = (c) => t.console.error(c), V = (c, d, y) => Promise.reject(`${y} does not have an implementation of "${d}".`), H = /* @__PURE__ */ new Map(), ee = (c, d = {}) => {
41
- const y = H.get(c);
39
+ return (d = a.PluginHeaders) === null || d === void 0 ? void 0 : d.find((y) => y.name === c);
40
+ }, B = ((n = l == null ? void 0 : l.currentPlatform) === null || n === void 0 ? void 0 : n.getPluginHeader) || Y, Z = (c) => t.console.error(c), V = (c, d, y) => Promise.reject(`${y} does not have an implementation of "${d}".`), S = /* @__PURE__ */ new Map(), ee = (c, d = {}) => {
41
+ const y = S.get(c);
42
42
  if (y)
43
43
  return console.warn(`Capacitor plugin "${c}" already registered. Cannot register plugins twice.`), y.proxy;
44
- const P = b(), C = B(c);
45
- let w;
46
- const re = async () => (!w && P in d ? w = typeof d[P] == "function" ? w = await d[P]() : w = d[P] : i !== null && !w && "web" in d && (w = typeof d.web == "function" ? w = await d.web() : w = d.web), w), ne = (f, g) => {
47
- var m, v;
48
- if (C) {
49
- const h = C == null ? void 0 : C.methods.find((p) => g === p.name);
50
- if (h)
51
- return h.rtype === "promise" ? (p) => s.nativePromise(c, g.toString(), p) : (p, x) => s.nativeCallback(c, g.toString(), p, x);
44
+ const P = b(), L = B(c);
45
+ let h;
46
+ const re = async () => (!h && P in d ? h = typeof d[P] == "function" ? h = await d[P]() : h = d[P] : i !== null && !h && "web" in d && (h = typeof d.web == "function" ? h = await d.web() : h = d.web), h), ne = (f, m) => {
47
+ var g, p;
48
+ if (L) {
49
+ const v = L == null ? void 0 : L.methods.find((w) => m === w.name);
50
+ if (v)
51
+ return v.rtype === "promise" ? (w) => a.nativePromise(c, m.toString(), w) : (w, $) => a.nativeCallback(c, m.toString(), w, $);
52
52
  if (f)
53
- return (m = f[g]) === null || m === void 0 ? void 0 : m.bind(f);
53
+ return (g = f[m]) === null || g === void 0 ? void 0 : g.bind(f);
54
54
  } else {
55
55
  if (f)
56
- return (v = f[g]) === null || v === void 0 ? void 0 : v.bind(f);
57
- throw new E(`"${c}" plugin is not implemented on ${P}`, L.Unimplemented);
56
+ return (p = f[m]) === null || p === void 0 ? void 0 : p.bind(f);
57
+ throw new D(`"${c}" plugin is not implemented on ${P}`, k.Unimplemented);
58
58
  }
59
- }, S = (f) => {
60
- let g;
61
- const m = (...v) => {
62
- const h = re().then((p) => {
63
- const x = ne(p, f);
64
- if (x) {
65
- const U = x(...v);
66
- return g = U == null ? void 0 : U.remove, U;
59
+ }, T = (f) => {
60
+ let m;
61
+ const g = (...p) => {
62
+ const v = re().then((w) => {
63
+ const $ = ne(w, f);
64
+ if ($) {
65
+ const H = $(...p);
66
+ return m = H == null ? void 0 : H.remove, H;
67
67
  } else
68
- throw new E(`"${c}.${f}()" is not implemented on ${P}`, L.Unimplemented);
68
+ throw new D(`"${c}.${f}()" is not implemented on ${P}`, k.Unimplemented);
69
69
  });
70
- return f === "addListener" && (h.remove = async () => g()), h;
70
+ return f === "addListener" && (v.remove = async () => m()), v;
71
71
  };
72
- return m.toString = () => `${f.toString()}() { [capacitor code] }`, Object.defineProperty(m, "name", {
72
+ return g.toString = () => `${f.toString()}() { [capacitor code] }`, Object.defineProperty(g, "name", {
73
73
  value: f,
74
74
  writable: !1,
75
75
  configurable: !1
76
- }), m;
77
- }, G = S("addListener"), J = S("removeListener"), ae = (f, g) => {
78
- const m = G({ eventName: f }, g), v = async () => {
79
- const p = await m;
80
- J({
76
+ }), g;
77
+ }, G = T("addListener"), F = T("removeListener"), se = (f, m) => {
78
+ const g = G({ eventName: f }, m), p = async () => {
79
+ const w = await g;
80
+ F({
81
81
  eventName: f,
82
- callbackId: p
83
- }, g);
84
- }, h = new Promise((p) => m.then(() => p({ remove: v })));
85
- return h.remove = async () => {
86
- console.warn("Using addListener() without 'await' is deprecated."), await v();
87
- }, h;
88
- }, T = new Proxy({}, {
89
- get(f, g) {
90
- switch (g) {
82
+ callbackId: w
83
+ }, m);
84
+ }, v = new Promise((w) => g.then(() => w({ remove: p })));
85
+ return v.remove = async () => {
86
+ console.warn("Using addListener() without 'await' is deprecated."), await p();
87
+ }, v;
88
+ }, I = new Proxy({}, {
89
+ get(f, m) {
90
+ switch (m) {
91
91
  case "$$typeof":
92
92
  return;
93
93
  case "toJSON":
94
94
  return () => ({});
95
95
  case "addListener":
96
- return C ? ae : G;
96
+ return L ? se : G;
97
97
  case "removeListener":
98
- return J;
98
+ return F;
99
99
  default:
100
- return S(g);
100
+ return T(m);
101
101
  }
102
102
  }
103
103
  });
104
- return u[c] = T, H.set(c, {
104
+ return u[c] = I, S.set(c, {
105
105
  name: c,
106
- proxy: T,
106
+ proxy: I,
107
107
  platforms: /* @__PURE__ */ new Set([
108
108
  ...Object.keys(d),
109
- ...C ? [P] : []
109
+ ...L ? [P] : []
110
110
  ])
111
- }), T;
112
- }, te = ((a = l == null ? void 0 : l.currentPlatform) === null || a === void 0 ? void 0 : a.registerPlugin) || ee;
113
- return s.convertFileSrc || (s.convertFileSrc = (c) => c), s.getPlatform = b, s.handleError = Z, s.isNativePlatform = z, s.isPluginAvailable = X, s.pluginMethodNoop = V, s.registerPlugin = te, s.Exception = E, s.DEBUG = !!s.DEBUG, s.isLoggingEnabled = !!s.isLoggingEnabled, s.platform = s.getPlatform(), s.isNative = s.isNativePlatform(), s;
114
- }, ue = (t) => t.Capacitor = de(t), A = /* @__PURE__ */ ue(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {}), N = A.registerPlugin;
115
- A.Plugins;
116
- class M {
111
+ }), I;
112
+ }, te = ((s = l == null ? void 0 : l.currentPlatform) === null || s === void 0 ? void 0 : s.registerPlugin) || ee;
113
+ return a.convertFileSrc || (a.convertFileSrc = (c) => c), a.getPlatform = b, a.handleError = Z, a.isNativePlatform = J, a.isPluginAvailable = X, a.pluginMethodNoop = V, a.registerPlugin = te, a.Exception = D, a.DEBUG = !!a.DEBUG, a.isLoggingEnabled = !!a.isLoggingEnabled, a.platform = a.getPlatform(), a.isNative = a.isNativePlatform(), a;
114
+ }, ue = (t) => t.Capacitor = de(t), O = /* @__PURE__ */ ue(typeof globalThis < "u" ? globalThis : typeof self < "u" ? self : typeof window < "u" ? window : typeof global < "u" ? global : {}), N = O.registerPlugin;
115
+ O.Plugins;
116
+ class _ {
117
117
  constructor(e) {
118
118
  this.listeners = {}, this.windowListeners = {}, e && (console.warn(`Capacitor WebPlugin "${e.name}" config object was deprecated in v3 and will be removed in v4.`), this.config = e);
119
119
  }
@@ -121,10 +121,10 @@ class M {
121
121
  this.listeners[e] || (this.listeners[e] = []), this.listeners[e].push(r);
122
122
  const n = this.windowListeners[e];
123
123
  n && !n.registered && this.addWindowListener(n);
124
- const a = async () => this.removeListener(e, r), i = Promise.resolve({ remove: a });
124
+ const s = async () => this.removeListener(e, r), i = Promise.resolve({ remove: s });
125
125
  return Object.defineProperty(i, "remove", {
126
126
  value: async () => {
127
- console.warn("Using addListener() without 'await' is deprecated."), await a();
127
+ console.warn("Using addListener() without 'await' is deprecated."), await s();
128
128
  }
129
129
  }), i;
130
130
  }
@@ -152,10 +152,10 @@ class M {
152
152
  };
153
153
  }
154
154
  unimplemented(e = "not implemented") {
155
- return new A.Exception(e, L.Unimplemented);
155
+ return new O.Exception(e, k.Unimplemented);
156
156
  }
157
157
  unavailable(e = "not available") {
158
- return new A.Exception(e, L.Unavailable);
158
+ return new O.Exception(e, k.Unavailable);
159
159
  }
160
160
  async removeListener(e, r) {
161
161
  const o = this.listeners[e];
@@ -171,21 +171,21 @@ class M {
171
171
  e && (window.removeEventListener(e.windowEventName, e.handler), e.registered = !1);
172
172
  }
173
173
  }
174
- const F = (t) => encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape), K = (t) => t.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
175
- class fe extends M {
174
+ const K = (t) => encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g, decodeURIComponent).replace(/[()]/g, escape), R = (t) => t.replace(/(%[\dA-F]{2})+/gi, decodeURIComponent);
175
+ class fe extends _ {
176
176
  async getCookies() {
177
177
  const e = document.cookie, r = {};
178
178
  return e.split(";").forEach((o) => {
179
179
  if (o.length <= 0)
180
180
  return;
181
- let [n, a] = o.replace(/=/, "CAP_COOKIE").split("CAP_COOKIE");
182
- n = K(n).trim(), a = K(a).trim(), r[n] = a;
181
+ let [n, s] = o.replace(/=/, "CAP_COOKIE").split("CAP_COOKIE");
182
+ n = R(n).trim(), s = R(s).trim(), r[n] = s;
183
183
  }), r;
184
184
  }
185
185
  async setCookie(e) {
186
186
  try {
187
- const r = F(e.key), o = F(e.value), n = `; expires=${(e.expires || "").replace("expires=", "")}`, a = (e.path || "/").replace("path=", ""), i = e.url != null && e.url.length > 0 ? `domain=${e.url}` : "";
188
- document.cookie = `${r}=${o || ""}${n}; path=${a}; ${i};`;
187
+ const r = K(e.key), o = K(e.value), n = `; expires=${(e.expires || "").replace("expires=", "")}`, s = (e.path || "/").replace("path=", ""), i = e.url != null && e.url.length > 0 ? `domain=${e.url}` : "";
188
+ document.cookie = `${r}=${o || ""}${n}; path=${s}; ${i};`;
189
189
  } catch (r) {
190
190
  return Promise.reject(r);
191
191
  }
@@ -217,77 +217,77 @@ class fe extends M {
217
217
  N("CapacitorCookies", {
218
218
  web: () => new fe()
219
219
  });
220
- const ge = async (t) => new Promise((e, r) => {
220
+ const me = async (t) => new Promise((e, r) => {
221
221
  const o = new FileReader();
222
222
  o.onload = () => {
223
223
  const n = o.result;
224
224
  e(n.indexOf(",") >= 0 ? n.split(",")[1] : n);
225
225
  }, o.onerror = (n) => r(n), o.readAsDataURL(t);
226
- }), pe = (t = {}) => {
226
+ }), we = (t = {}) => {
227
227
  const e = Object.keys(t);
228
- return Object.keys(t).map((n) => n.toLocaleLowerCase()).reduce((n, a, i) => (n[a] = t[e[i]], n), {});
229
- }, me = (t, e = !0) => t ? Object.entries(t).reduce((o, n) => {
230
- const [a, i] = n;
231
- let s, u;
228
+ return Object.keys(t).map((n) => n.toLocaleLowerCase()).reduce((n, s, i) => (n[s] = t[e[i]], n), {});
229
+ }, ge = (t, e = !0) => t ? Object.entries(t).reduce((o, n) => {
230
+ const [s, i] = n;
231
+ let a, u;
232
232
  return Array.isArray(i) ? (u = "", i.forEach((l) => {
233
- s = e ? encodeURIComponent(l) : l, u += `${a}=${s}&`;
234
- }), u.slice(0, -1)) : (s = e ? encodeURIComponent(i) : i, u = `${a}=${s}`), `${o}&${u}`;
235
- }, "").substr(1) : null, we = (t, e = {}) => {
236
- const r = Object.assign({ method: t.method || "GET", headers: t.headers }, e), n = pe(t.headers)["content-type"] || "";
233
+ a = e ? encodeURIComponent(l) : l, u += `${s}=${a}&`;
234
+ }), u.slice(0, -1)) : (a = e ? encodeURIComponent(i) : i, u = `${s}=${a}`), `${o}&${u}`;
235
+ }, "").substr(1) : null, he = (t, e = {}) => {
236
+ const r = Object.assign({ method: t.method || "GET", headers: t.headers }, e), n = we(t.headers)["content-type"] || "";
237
237
  if (typeof t.data == "string")
238
238
  r.body = t.data;
239
239
  else if (n.includes("application/x-www-form-urlencoded")) {
240
- const a = new URLSearchParams();
241
- for (const [i, s] of Object.entries(t.data || {}))
242
- a.set(i, s);
243
- r.body = a.toString();
240
+ const s = new URLSearchParams();
241
+ for (const [i, a] of Object.entries(t.data || {}))
242
+ s.set(i, a);
243
+ r.body = s.toString();
244
244
  } else if (n.includes("multipart/form-data")) {
245
- const a = new FormData();
245
+ const s = new FormData();
246
246
  if (t.data instanceof FormData)
247
- t.data.forEach((s, u) => {
248
- a.append(u, s);
247
+ t.data.forEach((a, u) => {
248
+ s.append(u, a);
249
249
  });
250
250
  else
251
- for (const s of Object.keys(t.data))
252
- a.append(s, t.data[s]);
253
- r.body = a;
251
+ for (const a of Object.keys(t.data))
252
+ s.append(a, t.data[a]);
253
+ r.body = s;
254
254
  const i = new Headers(r.headers);
255
255
  i.delete("content-type"), r.headers = i;
256
256
  } else
257
257
  (n.includes("application/json") || typeof t.data == "object") && (r.body = JSON.stringify(t.data));
258
258
  return r;
259
259
  };
260
- class ve extends M {
260
+ class pe extends _ {
261
261
  /**
262
262
  * Perform an Http request given a set of options
263
263
  * @param options Options to build the HTTP request
264
264
  */
265
265
  async request(e) {
266
- const r = we(e, e.webFetchExtra), o = me(e.params, e.shouldEncodeUrlParams), n = o ? `${e.url}?${o}` : e.url, a = await fetch(n, r), i = a.headers.get("content-type") || "";
267
- let { responseType: s = "text" } = a.ok ? e : {};
268
- i.includes("application/json") && (s = "json");
266
+ const r = he(e, e.webFetchExtra), o = ge(e.params, e.shouldEncodeUrlParams), n = o ? `${e.url}?${o}` : e.url, s = await fetch(n, r), i = s.headers.get("content-type") || "";
267
+ let { responseType: a = "text" } = s.ok ? e : {};
268
+ i.includes("application/json") && (a = "json");
269
269
  let u, l;
270
- switch (s) {
270
+ switch (a) {
271
271
  case "arraybuffer":
272
272
  case "blob":
273
- l = await a.blob(), u = await ge(l);
273
+ l = await s.blob(), u = await me(l);
274
274
  break;
275
275
  case "json":
276
- u = await a.json();
276
+ u = await s.json();
277
277
  break;
278
278
  case "document":
279
279
  case "text":
280
280
  default:
281
- u = await a.text();
281
+ u = await s.text();
282
282
  }
283
- const O = {};
284
- return a.headers.forEach((b, j) => {
285
- O[j] = b;
283
+ const U = {};
284
+ return s.headers.forEach((b, A) => {
285
+ U[A] = b;
286
286
  }), {
287
287
  data: u,
288
- headers: O,
289
- status: a.status,
290
- url: a.url
288
+ headers: U,
289
+ status: s.status,
290
+ url: s.url
291
291
  };
292
292
  }
293
293
  /**
@@ -327,7 +327,7 @@ class ve extends M {
327
327
  }
328
328
  }
329
329
  N("CapacitorHttp", {
330
- web: () => new ve()
330
+ web: () => new pe()
331
331
  });
332
332
  /*! Ionic Portals: https://ionic.io/portals - Commercial License */
333
333
  N("Portals", {
@@ -335,104 +335,113 @@ N("Portals", {
335
335
  return Pe;
336
336
  }).then((t) => new t.PortalsWeb())
337
337
  });
338
- function D() {
339
- return A.getPlatform() === "android" ? JSON.parse(AndroidInitialContext.initialContext()) : window.portalInitialContext;
338
+ function W() {
339
+ return O.getPlatform() === "android" ? JSON.parse(AndroidInitialContext.initialContext()) : window.portalInitialContext;
340
340
  }
341
- class he extends M {
341
+ class ve extends _ {
342
342
  // eslint-disable-next-line
343
343
  async publishNative(e) {
344
344
  }
345
345
  }
346
346
  const Pe = /* @__PURE__ */ Object.freeze({
347
347
  __proto__: null,
348
- PortalsWeb: he
348
+ PortalsWeb: ve
349
349
  });
350
- var k = /* @__PURE__ */ ((t) => (t.DEV = "dev", t.SIT = "sit", t.UAT = "uat", t.PROD = "prod", t.TEST = "test", t))(k || {}), I = /* @__PURE__ */ ((t) => (t.EU = "eu", t.ASIA = "asia", t))(I || {});
350
+ var C = /* @__PURE__ */ ((t) => (t.DEV = "dev", t.SIT = "sit", t.UAT = "uat", t.PROD = "prod", t.TEST = "test", t))(C || {}), j = /* @__PURE__ */ ((t) => (t.EU = "eu", t.ASIA = "asia", t))(j || {});
351
351
  const q = (t) => {
352
352
  var e, r;
353
- if (!(typeof window > "u") && D && (e = D()) != null && e.value) {
354
- const o = ((r = D()) == null ? void 0 : r.value) ?? null;
355
- o && t && t(o);
353
+ if (!(typeof window > "u") && W && (e = W()) != null && e.value) {
354
+ const o = ((r = W()) == null ? void 0 : r.value) ?? null;
355
+ if (!o) {
356
+ console.error("native initialContext is undefine");
357
+ return;
358
+ }
359
+ if (!t) {
360
+ console.error("initialContext call back is undefine");
361
+ return;
362
+ }
363
+ t(o);
356
364
  }
357
365
  }, be = (t, { asiaUatData: e, euSitData: r, euUatData: o }) => {
358
- var s, u;
359
- const n = (s = t.mockServerInfo) == null ? void 0 : s.env, a = (u = t.mockServerInfo) == null ? void 0 : u.area;
360
- console.log("nativeApiConfig===", t);
366
+ var a, u;
367
+ const n = (a = t.mockServerInfo) == null ? void 0 : a.env, s = (u = t.mockServerInfo) == null ? void 0 : u.area;
361
368
  let i = null;
362
- return !n || !a || (I.ASIA === a ? k.UAT === n && (i = e) : I.EU === a && (k.SIT === n ? i = r : k.UAT === n && (i = o))), i;
369
+ return !n || !s || (j.ASIA === s ? C.UAT === n && (i = e) : j.EU === s && (C.SIT === n ? i = r : C.UAT === n && (i = o))), i;
363
370
  }, ye = ({ cb: t }) => {
364
- setTimeout(() => {
365
- q((e) => {
366
- if (!(e != null && e.params))
367
- return;
368
- const r = JSON.parse(e.params) ?? null;
369
- if (!r)
371
+ q((e) => {
372
+ if (console.log("12312"), !(e != null && e.params)) {
373
+ console.error("native params is undefine");
374
+ return;
375
+ }
376
+ const r = JSON.parse(e.params) ?? null;
377
+ if (!r)
378
+ return;
379
+ const { params: o, routeName: n } = r;
380
+ if (!(!o || !n)) {
381
+ if (!t) {
382
+ console.error("call back is undefine");
370
383
  return;
371
- const { params: o, routeName: n } = r;
372
- !o || !n || t && t(r);
373
- });
384
+ }
385
+ t(r);
386
+ }
374
387
  });
375
- }, Ce = () => {
388
+ }, Le = () => {
376
389
  let t = !1;
377
390
  return q((e) => {
378
391
  t = !!(e != null && e.isNative);
379
392
  }), t;
380
- }, Le = (t) => new Promise(async (e) => {
393
+ }, ke = (t) => new Promise(async (e) => {
381
394
  let r = null;
382
- console.log("nativeApiConfig.mockData===", t.mockData), t.mockData ? r = t.mockData : r = be(t, {
395
+ t != null && t.mockData ? r = t.mockData : r = be(t, {
383
396
  asiaUatData: await import("./chunk/1b5f5213.js"),
384
397
  euSitData: await import("./chunk/7615ea07.js"),
385
398
  euUatData: await import("./chunk/02340160.js")
386
399
  }), e(r ? r != null && r.default ? r == null ? void 0 : r.default : r : null);
387
- }), ke = () => {
400
+ }), Ce = () => {
388
401
  let t = null;
389
402
  return q((e) => {
390
- e ? t = {
391
- data_info: e.data_info ? JSON.parse(e.data_info) : null,
392
- data_store: e.data_store ? JSON.parse(e.data_store) : null,
393
- data_language: e.data_language ? JSON.parse(e.data_language) : null
394
- } : t = null;
403
+ t = e ?? null;
395
404
  }), t;
396
- }, $ = class $ {
405
+ }, x = class x {
397
406
  constructor() {
398
- _(this, "nativeApiConfig");
399
- this.nativeApiConfig = $.defaultNativeApiConfig;
407
+ E(this, "nativeAppInfoConfig");
408
+ this.nativeAppInfoConfig = x.defaultNativeAppInfoConfig;
400
409
  }
401
410
  // getIsNativeHandle
402
411
  async getIsNativeHandle() {
403
- return await Ce();
412
+ return await Le();
404
413
  }
405
414
  // specifiedPageHandle
406
- async specifiedPageHandle({ cb: e }) {
407
- await ye({ cb: e });
415
+ async specifiedPageHandle(e) {
416
+ await ye(e);
408
417
  }
409
418
  // nativeAppInfo
410
- async nativeAppInfo(e) {
411
- return this.nativeApiConfig = e, await this.getIsNativeHandle() ? await ke() : await Le(this.nativeApiConfig);
419
+ async nativeAppInfoHandle(e) {
420
+ return this.nativeAppInfoConfig = e != null && e.mockServerInfo || e != null && e.mockData ? e : x.defaultNativeAppInfoConfig, await this.getIsNativeHandle() ? await Ce() : await ke(this.nativeAppInfoConfig);
412
421
  }
413
422
  };
414
- _($, "defaultNativeApiConfig", {
423
+ E(x, "defaultNativeAppInfoConfig", {
415
424
  mockServerInfo: {
416
- area: I.ASIA,
417
- env: k.UAT
425
+ area: j.ASIA,
426
+ env: C.UAT
418
427
  }
419
428
  });
420
- let W = $;
421
- class Ae extends W {
429
+ let M = x;
430
+ class xe extends M {
422
431
  constructor() {
423
432
  super();
424
433
  }
425
434
  async getIsNativeHandle() {
426
435
  return await super.getIsNativeHandle();
427
436
  }
428
- async specifiedPageHandle({ cb: e }) {
429
- return await super.specifiedPageHandle({ cb: e });
437
+ async specifiedPageHandle(e) {
438
+ return await super.specifiedPageHandle(e);
430
439
  }
431
- async nativeAppInfo(e) {
432
- return await super.nativeAppInfo(e);
440
+ async nativeAppInfoHandle(e) {
441
+ return await super.nativeAppInfoHandle(e);
433
442
  }
434
443
  }
435
- const xe = new Ae();
444
+ const Ue = new xe();
436
445
  export {
437
- xe as default
446
+ Ue as default
438
447
  };
package/lib/main.umd.cjs CHANGED
@@ -1 +1 @@
1
- "use strict";var ae=Object.defineProperty;var oe=(t,e,r)=>e in t?ae(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var _=(t,e,r)=>(oe(t,typeof e!="symbol"?e+"":e,r),r);/*! Capacitor: https://capacitorjs.com/ - MIT License */const ie=t=>{const e=new Map;e.set("web",{name:"web"});const r=t.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:e},o=(s,i)=>{r.platforms.set(s,i)},n=s=>{r.platforms.has(s)&&(r.currentPlatform=r.platforms.get(s))};return r.addPlatform=o,r.setPlatform=n,r},le=t=>t.CapacitorPlatforms=ie(t),R=le(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});R.addPlatform;R.setPlatform;var L;(function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"})(L||(L={}));class E extends Error{constructor(e,r,o){super(e),this.message=e,this.code=r,this.data=o}}const ce=t=>{var e,r;return t!=null&&t.androidBridge?"android":!((r=(e=t==null?void 0:t.webkit)===null||e===void 0?void 0:e.messageHandlers)===null||r===void 0)&&r.bridge?"ios":"web"},de=t=>{var e,r,o,n,s;const i=t.CapacitorCustomPlatform||null,a=t.Capacitor||{},u=a.Plugins=a.Plugins||{},l=t.CapacitorPlatforms,O=()=>i!==null?i.name:ce(t),b=((e=l==null?void 0:l.currentPlatform)===null||e===void 0?void 0:e.getPlatform)||O,j=()=>b()!=="web",z=((r=l==null?void 0:l.currentPlatform)===null||r===void 0?void 0:r.isNativePlatform)||j,Q=c=>{const d=H.get(c);return!!(d!=null&&d.platforms.has(b())||B(c))},X=((o=l==null?void 0:l.currentPlatform)===null||o===void 0?void 0:o.isPluginAvailable)||Q,Y=c=>{var d;return(d=a.PluginHeaders)===null||d===void 0?void 0:d.find(y=>y.name===c)},B=((n=l==null?void 0:l.currentPlatform)===null||n===void 0?void 0:n.getPluginHeader)||Y,Z=c=>t.console.error(c),V=(c,d,y)=>Promise.reject(`${y} does not have an implementation of "${d}".`),H=new Map,ee=(c,d={})=>{const y=H.get(c);if(y)return console.warn(`Capacitor plugin "${c}" already registered. Cannot register plugins twice.`),y.proxy;const P=b(),C=B(c);let w;const re=async()=>(!w&&P in d?w=typeof d[P]=="function"?w=await d[P]():w=d[P]:i!==null&&!w&&"web"in d&&(w=typeof d.web=="function"?w=await d.web():w=d.web),w),ne=(f,g)=>{var p,v;if(C){const h=C==null?void 0:C.methods.find(m=>g===m.name);if(h)return h.rtype==="promise"?m=>a.nativePromise(c,g.toString(),m):(m,x)=>a.nativeCallback(c,g.toString(),m,x);if(f)return(p=f[g])===null||p===void 0?void 0:p.bind(f)}else{if(f)return(v=f[g])===null||v===void 0?void 0:v.bind(f);throw new E(`"${c}" plugin is not implemented on ${P}`,L.Unimplemented)}},S=f=>{let g;const p=(...v)=>{const h=re().then(m=>{const x=ne(m,f);if(x){const U=x(...v);return g=U==null?void 0:U.remove,U}else throw new E(`"${c}.${f}()" is not implemented on ${P}`,L.Unimplemented)});return f==="addListener"&&(h.remove=async()=>g()),h};return p.toString=()=>`${f.toString()}() { [capacitor code] }`,Object.defineProperty(p,"name",{value:f,writable:!1,configurable:!1}),p},G=S("addListener"),J=S("removeListener"),se=(f,g)=>{const p=G({eventName:f},g),v=async()=>{const m=await p;J({eventName:f,callbackId:m},g)},h=new Promise(m=>p.then(()=>m({remove:v})));return h.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await v()},h},T=new Proxy({},{get(f,g){switch(g){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return C?se:G;case"removeListener":return J;default:return S(g)}}});return u[c]=T,H.set(c,{name:c,proxy:T,platforms:new Set([...Object.keys(d),...C?[P]:[]])}),T},te=((s=l==null?void 0:l.currentPlatform)===null||s===void 0?void 0:s.registerPlugin)||ee;return a.convertFileSrc||(a.convertFileSrc=c=>c),a.getPlatform=b,a.handleError=Z,a.isNativePlatform=z,a.isPluginAvailable=X,a.pluginMethodNoop=V,a.registerPlugin=te,a.Exception=E,a.DEBUG=!!a.DEBUG,a.isLoggingEnabled=!!a.isLoggingEnabled,a.platform=a.getPlatform(),a.isNative=a.isNativePlatform(),a},ue=t=>t.Capacitor=de(t),A=ue(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),N=A.registerPlugin;A.Plugins;class M{constructor(e){this.listeners={},this.windowListeners={},e&&(console.warn(`Capacitor WebPlugin "${e.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=e)}addListener(e,r){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(r);const n=this.windowListeners[e];n&&!n.registered&&this.addWindowListener(n);const s=async()=>this.removeListener(e,r),i=Promise.resolve({remove:s});return Object.defineProperty(i,"remove",{value:async()=>{console.warn("Using addListener() without 'await' is deprecated."),await s()}}),i}async removeAllListeners(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,r){const o=this.listeners[e];o&&o.forEach(n=>n(r))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,r){this.windowListeners[r]={registered:!1,windowEventName:e,pluginEventName:r,handler:o=>{this.notifyListeners(r,o)}}}unimplemented(e="not implemented"){return new A.Exception(e,L.Unimplemented)}unavailable(e="not available"){return new A.Exception(e,L.Unavailable)}async removeListener(e,r){const o=this.listeners[e];if(!o)return;const n=o.indexOf(r);this.listeners[e].splice(n,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}}const F=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),K=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class fe extends M{async getCookies(){const e=document.cookie,r={};return e.split(";").forEach(o=>{if(o.length<=0)return;let[n,s]=o.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");n=K(n).trim(),s=K(s).trim(),r[n]=s}),r}async setCookie(e){try{const r=F(e.key),o=F(e.value),n=`; expires=${(e.expires||"").replace("expires=","")}`,s=(e.path||"/").replace("path=",""),i=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${r}=${o||""}${n}; path=${s}; ${i};`}catch(r){return Promise.reject(r)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(r){return Promise.reject(r)}}async clearCookies(){try{const e=document.cookie.split(";")||[];for(const r of e)document.cookie=r.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(e){return Promise.reject(e)}}async clearAllCookies(){try{await this.clearCookies()}catch(e){return Promise.reject(e)}}}N("CapacitorCookies",{web:()=>new fe});const ge=async t=>new Promise((e,r)=>{const o=new FileReader;o.onload=()=>{const n=o.result;e(n.indexOf(",")>=0?n.split(",")[1]:n)},o.onerror=n=>r(n),o.readAsDataURL(t)}),me=(t={})=>{const e=Object.keys(t);return Object.keys(t).map(n=>n.toLocaleLowerCase()).reduce((n,s,i)=>(n[s]=t[e[i]],n),{})},pe=(t,e=!0)=>t?Object.entries(t).reduce((o,n)=>{const[s,i]=n;let a,u;return Array.isArray(i)?(u="",i.forEach(l=>{a=e?encodeURIComponent(l):l,u+=`${s}=${a}&`}),u.slice(0,-1)):(a=e?encodeURIComponent(i):i,u=`${s}=${a}`),`${o}&${u}`},"").substr(1):null,we=(t,e={})=>{const r=Object.assign({method:t.method||"GET",headers:t.headers},e),n=me(t.headers)["content-type"]||"";if(typeof t.data=="string")r.body=t.data;else if(n.includes("application/x-www-form-urlencoded")){const s=new URLSearchParams;for(const[i,a]of Object.entries(t.data||{}))s.set(i,a);r.body=s.toString()}else if(n.includes("multipart/form-data")){const s=new FormData;if(t.data instanceof FormData)t.data.forEach((a,u)=>{s.append(u,a)});else for(const a of Object.keys(t.data))s.append(a,t.data[a]);r.body=s;const i=new Headers(r.headers);i.delete("content-type"),r.headers=i}else(n.includes("application/json")||typeof t.data=="object")&&(r.body=JSON.stringify(t.data));return r};class ve extends M{async request(e){const r=we(e,e.webFetchExtra),o=pe(e.params,e.shouldEncodeUrlParams),n=o?`${e.url}?${o}`:e.url,s=await fetch(n,r),i=s.headers.get("content-type")||"";let{responseType:a="text"}=s.ok?e:{};i.includes("application/json")&&(a="json");let u,l;switch(a){case"arraybuffer":case"blob":l=await s.blob(),u=await ge(l);break;case"json":u=await s.json();break;case"document":case"text":default:u=await s.text()}const O={};return s.headers.forEach((b,j)=>{O[j]=b}),{data:u,headers:O,status:s.status,url:s.url}}async get(e){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))}async post(e){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))}async put(e){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))}async patch(e){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))}async delete(e){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))}}N("CapacitorHttp",{web:()=>new ve});/*! Ionic Portals: https://ionic.io/portals - Commercial License */N("Portals",{web:()=>Promise.resolve().then(function(){return Pe}).then(t=>new t.PortalsWeb)});function D(){return A.getPlatform()==="android"?JSON.parse(AndroidInitialContext.initialContext()):window.portalInitialContext}class he extends M{async publishNative(e){}}const Pe=Object.freeze({__proto__:null,PortalsWeb:he});var k=(t=>(t.DEV="dev",t.SIT="sit",t.UAT="uat",t.PROD="prod",t.TEST="test",t))(k||{}),I=(t=>(t.EU="eu",t.ASIA="asia",t))(I||{});const q=t=>{var e,r;if(!(typeof window>"u")&&D&&(e=D())!=null&&e.value){const o=((r=D())==null?void 0:r.value)??null;o&&t&&t(o)}},be=(t,{asiaUatData:e,euSitData:r,euUatData:o})=>{var a,u;const n=(a=t.mockServerInfo)==null?void 0:a.env,s=(u=t.mockServerInfo)==null?void 0:u.area;console.log("nativeApiConfig===",t);let i=null;return!n||!s||(I.ASIA===s?k.UAT===n&&(i=e):I.EU===s&&(k.SIT===n?i=r:k.UAT===n&&(i=o))),i},ye=({cb:t})=>{setTimeout(()=>{q(e=>{if(!(e!=null&&e.params))return;const r=JSON.parse(e.params)??null;if(!r)return;const{params:o,routeName:n}=r;!o||!n||t&&t(r)})})},Ce=()=>{let t=!1;return q(e=>{t=!!(e!=null&&e.isNative)}),t},Le=t=>new Promise(async e=>{let r=null;console.log("nativeApiConfig.mockData===",t.mockData),t.mockData?r=t.mockData:r=be(t,{asiaUatData:await Promise.resolve().then(()=>require("./umd/fbb879ae.umd.cjs")),euSitData:await Promise.resolve().then(()=>require("./umd/7c40191f.umd.cjs")),euUatData:await Promise.resolve().then(()=>require("./umd/5ca52608.umd.cjs"))}),e(r?r!=null&&r.default?r==null?void 0:r.default:r:null)}),ke=()=>{let t=null;return q(e=>{e?t={data_info:e.data_info?JSON.parse(e.data_info):null,data_store:e.data_store?JSON.parse(e.data_store):null,data_language:e.data_language?JSON.parse(e.data_language):null}:t=null}),t},$=class ${constructor(){_(this,"nativeApiConfig");this.nativeApiConfig=$.defaultNativeApiConfig}async getIsNativeHandle(){return await Ce()}async specifiedPageHandle({cb:e}){await ye({cb:e})}async nativeAppInfo(e){return this.nativeApiConfig=e,await this.getIsNativeHandle()?await ke():await Le(this.nativeApiConfig)}};_($,"defaultNativeApiConfig",{mockServerInfo:{area:I.ASIA,env:k.UAT}});let W=$;class Ae extends W{constructor(){super()}async getIsNativeHandle(){return await super.getIsNativeHandle()}async specifiedPageHandle({cb:e}){return await super.specifiedPageHandle({cb:e})}async nativeAppInfo(e){return await super.nativeAppInfo(e)}}const Oe=new Ae;module.exports=Oe;
1
+ "use strict";var ae=Object.defineProperty;var oe=(t,e,r)=>e in t?ae(t,e,{enumerable:!0,configurable:!0,writable:!0,value:r}):t[e]=r;var E=(t,e,r)=>(oe(t,typeof e!="symbol"?e+"":e,r),r);/*! Capacitor: https://capacitorjs.com/ - MIT License */const ie=t=>{const e=new Map;e.set("web",{name:"web"});const r=t.CapacitorPlatforms||{currentPlatform:{name:"web"},platforms:e},o=(s,i)=>{r.platforms.set(s,i)},n=s=>{r.platforms.has(s)&&(r.currentPlatform=r.platforms.get(s))};return r.addPlatform=o,r.setPlatform=n,r},le=t=>t.CapacitorPlatforms=ie(t),z=le(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{});z.addPlatform;z.setPlatform;var k;(function(t){t.Unimplemented="UNIMPLEMENTED",t.Unavailable="UNAVAILABLE"})(k||(k={}));class D extends Error{constructor(e,r,o){super(e),this.message=e,this.code=r,this.data=o}}const ce=t=>{var e,r;return t!=null&&t.androidBridge?"android":!((r=(e=t==null?void 0:t.webkit)===null||e===void 0?void 0:e.messageHandlers)===null||r===void 0)&&r.bridge?"ios":"web"},de=t=>{var e,r,o,n,s;const i=t.CapacitorCustomPlatform||null,a=t.Capacitor||{},u=a.Plugins=a.Plugins||{},l=t.CapacitorPlatforms,U=()=>i!==null?i.name:ce(t),b=((e=l==null?void 0:l.currentPlatform)===null||e===void 0?void 0:e.getPlatform)||U,A=()=>b()!=="web",J=((r=l==null?void 0:l.currentPlatform)===null||r===void 0?void 0:r.isNativePlatform)||A,Q=c=>{const d=S.get(c);return!!(d!=null&&d.platforms.has(b())||B(c))},X=((o=l==null?void 0:l.currentPlatform)===null||o===void 0?void 0:o.isPluginAvailable)||Q,Y=c=>{var d;return(d=a.PluginHeaders)===null||d===void 0?void 0:d.find(y=>y.name===c)},B=((n=l==null?void 0:l.currentPlatform)===null||n===void 0?void 0:n.getPluginHeader)||Y,Z=c=>t.console.error(c),V=(c,d,y)=>Promise.reject(`${y} does not have an implementation of "${d}".`),S=new Map,ee=(c,d={})=>{const y=S.get(c);if(y)return console.warn(`Capacitor plugin "${c}" already registered. Cannot register plugins twice.`),y.proxy;const P=b(),L=B(c);let h;const re=async()=>(!h&&P in d?h=typeof d[P]=="function"?h=await d[P]():h=d[P]:i!==null&&!h&&"web"in d&&(h=typeof d.web=="function"?h=await d.web():h=d.web),h),ne=(f,m)=>{var g,v;if(L){const p=L==null?void 0:L.methods.find(w=>m===w.name);if(p)return p.rtype==="promise"?w=>a.nativePromise(c,m.toString(),w):(w,$)=>a.nativeCallback(c,m.toString(),w,$);if(f)return(g=f[m])===null||g===void 0?void 0:g.bind(f)}else{if(f)return(v=f[m])===null||v===void 0?void 0:v.bind(f);throw new D(`"${c}" plugin is not implemented on ${P}`,k.Unimplemented)}},T=f=>{let m;const g=(...v)=>{const p=re().then(w=>{const $=ne(w,f);if($){const H=$(...v);return m=H==null?void 0:H.remove,H}else throw new D(`"${c}.${f}()" is not implemented on ${P}`,k.Unimplemented)});return f==="addListener"&&(p.remove=async()=>m()),p};return g.toString=()=>`${f.toString()}() { [capacitor code] }`,Object.defineProperty(g,"name",{value:f,writable:!1,configurable:!1}),g},G=T("addListener"),F=T("removeListener"),se=(f,m)=>{const g=G({eventName:f},m),v=async()=>{const w=await g;F({eventName:f,callbackId:w},m)},p=new Promise(w=>g.then(()=>w({remove:v})));return p.remove=async()=>{console.warn("Using addListener() without 'await' is deprecated."),await v()},p},I=new Proxy({},{get(f,m){switch(m){case"$$typeof":return;case"toJSON":return()=>({});case"addListener":return L?se:G;case"removeListener":return F;default:return T(m)}}});return u[c]=I,S.set(c,{name:c,proxy:I,platforms:new Set([...Object.keys(d),...L?[P]:[]])}),I},te=((s=l==null?void 0:l.currentPlatform)===null||s===void 0?void 0:s.registerPlugin)||ee;return a.convertFileSrc||(a.convertFileSrc=c=>c),a.getPlatform=b,a.handleError=Z,a.isNativePlatform=J,a.isPluginAvailable=X,a.pluginMethodNoop=V,a.registerPlugin=te,a.Exception=D,a.DEBUG=!!a.DEBUG,a.isLoggingEnabled=!!a.isLoggingEnabled,a.platform=a.getPlatform(),a.isNative=a.isNativePlatform(),a},ue=t=>t.Capacitor=de(t),O=ue(typeof globalThis<"u"?globalThis:typeof self<"u"?self:typeof window<"u"?window:typeof global<"u"?global:{}),q=O.registerPlugin;O.Plugins;class N{constructor(e){this.listeners={},this.windowListeners={},e&&(console.warn(`Capacitor WebPlugin "${e.name}" config object was deprecated in v3 and will be removed in v4.`),this.config=e)}addListener(e,r){this.listeners[e]||(this.listeners[e]=[]),this.listeners[e].push(r);const n=this.windowListeners[e];n&&!n.registered&&this.addWindowListener(n);const s=async()=>this.removeListener(e,r),i=Promise.resolve({remove:s});return Object.defineProperty(i,"remove",{value:async()=>{console.warn("Using addListener() without 'await' is deprecated."),await s()}}),i}async removeAllListeners(){this.listeners={};for(const e in this.windowListeners)this.removeWindowListener(this.windowListeners[e]);this.windowListeners={}}notifyListeners(e,r){const o=this.listeners[e];o&&o.forEach(n=>n(r))}hasListeners(e){return!!this.listeners[e].length}registerWindowListener(e,r){this.windowListeners[r]={registered:!1,windowEventName:e,pluginEventName:r,handler:o=>{this.notifyListeners(r,o)}}}unimplemented(e="not implemented"){return new O.Exception(e,k.Unimplemented)}unavailable(e="not available"){return new O.Exception(e,k.Unavailable)}async removeListener(e,r){const o=this.listeners[e];if(!o)return;const n=o.indexOf(r);this.listeners[e].splice(n,1),this.listeners[e].length||this.removeWindowListener(this.windowListeners[e])}addWindowListener(e){window.addEventListener(e.windowEventName,e.handler),e.registered=!0}removeWindowListener(e){e&&(window.removeEventListener(e.windowEventName,e.handler),e.registered=!1)}}const K=t=>encodeURIComponent(t).replace(/%(2[346B]|5E|60|7C)/g,decodeURIComponent).replace(/[()]/g,escape),R=t=>t.replace(/(%[\dA-F]{2})+/gi,decodeURIComponent);class fe extends N{async getCookies(){const e=document.cookie,r={};return e.split(";").forEach(o=>{if(o.length<=0)return;let[n,s]=o.replace(/=/,"CAP_COOKIE").split("CAP_COOKIE");n=R(n).trim(),s=R(s).trim(),r[n]=s}),r}async setCookie(e){try{const r=K(e.key),o=K(e.value),n=`; expires=${(e.expires||"").replace("expires=","")}`,s=(e.path||"/").replace("path=",""),i=e.url!=null&&e.url.length>0?`domain=${e.url}`:"";document.cookie=`${r}=${o||""}${n}; path=${s}; ${i};`}catch(r){return Promise.reject(r)}}async deleteCookie(e){try{document.cookie=`${e.key}=; Max-Age=0`}catch(r){return Promise.reject(r)}}async clearCookies(){try{const e=document.cookie.split(";")||[];for(const r of e)document.cookie=r.replace(/^ +/,"").replace(/=.*/,`=;expires=${new Date().toUTCString()};path=/`)}catch(e){return Promise.reject(e)}}async clearAllCookies(){try{await this.clearCookies()}catch(e){return Promise.reject(e)}}}q("CapacitorCookies",{web:()=>new fe});const me=async t=>new Promise((e,r)=>{const o=new FileReader;o.onload=()=>{const n=o.result;e(n.indexOf(",")>=0?n.split(",")[1]:n)},o.onerror=n=>r(n),o.readAsDataURL(t)}),we=(t={})=>{const e=Object.keys(t);return Object.keys(t).map(n=>n.toLocaleLowerCase()).reduce((n,s,i)=>(n[s]=t[e[i]],n),{})},ge=(t,e=!0)=>t?Object.entries(t).reduce((o,n)=>{const[s,i]=n;let a,u;return Array.isArray(i)?(u="",i.forEach(l=>{a=e?encodeURIComponent(l):l,u+=`${s}=${a}&`}),u.slice(0,-1)):(a=e?encodeURIComponent(i):i,u=`${s}=${a}`),`${o}&${u}`},"").substr(1):null,he=(t,e={})=>{const r=Object.assign({method:t.method||"GET",headers:t.headers},e),n=we(t.headers)["content-type"]||"";if(typeof t.data=="string")r.body=t.data;else if(n.includes("application/x-www-form-urlencoded")){const s=new URLSearchParams;for(const[i,a]of Object.entries(t.data||{}))s.set(i,a);r.body=s.toString()}else if(n.includes("multipart/form-data")){const s=new FormData;if(t.data instanceof FormData)t.data.forEach((a,u)=>{s.append(u,a)});else for(const a of Object.keys(t.data))s.append(a,t.data[a]);r.body=s;const i=new Headers(r.headers);i.delete("content-type"),r.headers=i}else(n.includes("application/json")||typeof t.data=="object")&&(r.body=JSON.stringify(t.data));return r};class ve extends N{async request(e){const r=he(e,e.webFetchExtra),o=ge(e.params,e.shouldEncodeUrlParams),n=o?`${e.url}?${o}`:e.url,s=await fetch(n,r),i=s.headers.get("content-type")||"";let{responseType:a="text"}=s.ok?e:{};i.includes("application/json")&&(a="json");let u,l;switch(a){case"arraybuffer":case"blob":l=await s.blob(),u=await me(l);break;case"json":u=await s.json();break;case"document":case"text":default:u=await s.text()}const U={};return s.headers.forEach((b,A)=>{U[A]=b}),{data:u,headers:U,status:s.status,url:s.url}}async get(e){return this.request(Object.assign(Object.assign({},e),{method:"GET"}))}async post(e){return this.request(Object.assign(Object.assign({},e),{method:"POST"}))}async put(e){return this.request(Object.assign(Object.assign({},e),{method:"PUT"}))}async patch(e){return this.request(Object.assign(Object.assign({},e),{method:"PATCH"}))}async delete(e){return this.request(Object.assign(Object.assign({},e),{method:"DELETE"}))}}q("CapacitorHttp",{web:()=>new ve});/*! Ionic Portals: https://ionic.io/portals - Commercial License */q("Portals",{web:()=>Promise.resolve().then(function(){return Pe}).then(t=>new t.PortalsWeb)});function W(){return O.getPlatform()==="android"?JSON.parse(AndroidInitialContext.initialContext()):window.portalInitialContext}class pe extends N{async publishNative(e){}}const Pe=Object.freeze({__proto__:null,PortalsWeb:pe});var C=(t=>(t.DEV="dev",t.SIT="sit",t.UAT="uat",t.PROD="prod",t.TEST="test",t))(C||{}),j=(t=>(t.EU="eu",t.ASIA="asia",t))(j||{});const _=t=>{var e,r;if(!(typeof window>"u")&&W&&(e=W())!=null&&e.value){const o=((r=W())==null?void 0:r.value)??null;if(!o){console.error("native initialContext is undefine");return}if(!t){console.error("initialContext call back is undefine");return}t(o)}},be=(t,{asiaUatData:e,euSitData:r,euUatData:o})=>{var a,u;const n=(a=t.mockServerInfo)==null?void 0:a.env,s=(u=t.mockServerInfo)==null?void 0:u.area;let i=null;return!n||!s||(j.ASIA===s?C.UAT===n&&(i=e):j.EU===s&&(C.SIT===n?i=r:C.UAT===n&&(i=o))),i},ye=({cb:t})=>{_(e=>{if(console.log("12312"),!(e!=null&&e.params)){console.error("native params is undefine");return}const r=JSON.parse(e.params)??null;if(!r)return;const{params:o,routeName:n}=r;if(!(!o||!n)){if(!t){console.error("call back is undefine");return}t(r)}})},Le=()=>{let t=!1;return _(e=>{t=!!(e!=null&&e.isNative)}),t},ke=t=>new Promise(async e=>{let r=null;t!=null&&t.mockData?r=t.mockData:r=be(t,{asiaUatData:await Promise.resolve().then(()=>require("./umd/fbb879ae.umd.cjs")),euSitData:await Promise.resolve().then(()=>require("./umd/7c40191f.umd.cjs")),euUatData:await Promise.resolve().then(()=>require("./umd/5ca52608.umd.cjs"))}),e(r?r!=null&&r.default?r==null?void 0:r.default:r:null)}),Ce=()=>{let t=null;return _(e=>{t=e??null}),t},x=class x{constructor(){E(this,"nativeAppInfoConfig");this.nativeAppInfoConfig=x.defaultNativeAppInfoConfig}async getIsNativeHandle(){return await Le()}async specifiedPageHandle(e){await ye(e)}async nativeAppInfoHandle(e){return this.nativeAppInfoConfig=e!=null&&e.mockServerInfo||e!=null&&e.mockData?e:x.defaultNativeAppInfoConfig,await this.getIsNativeHandle()?await Ce():await ke(this.nativeAppInfoConfig)}};E(x,"defaultNativeAppInfoConfig",{mockServerInfo:{area:j.ASIA,env:C.UAT}});let M=x;class xe extends M{constructor(){super()}async getIsNativeHandle(){return await super.getIsNativeHandle()}async specifiedPageHandle(e){return await super.specifiedPageHandle(e)}async nativeAppInfoHandle(e){return await super.nativeAppInfoHandle(e)}}const Oe=new xe;module.exports=Oe;
package/package.json CHANGED
@@ -1,12 +1,17 @@
1
1
  {
2
2
  "name": "superapp-miniapp-invoke-native",
3
3
  "type": "module",
4
- "version": "1.0.39",
4
+ "version": "1.0.41",
5
5
  "description": "Superapp中,小程序调用Native 接口的封装,如OSP项目中,需要调用Native的相机扫描,镭射扫描,获取RBAC的数据等",
6
6
  "scripts": {
7
7
  "dev": "vite",
8
8
  "build": "vite build",
9
- "up": "vite build && yarn publish"
9
+ "up": "vite build && yarn publish",
10
+ "prepare": "husky install",
11
+ "prettier": "prettier --write .",
12
+ "eslint": "eslint . --ext .vue,.jsx,.cjs,.mjs,.ts,.tsx,.cts,.mts --fix --ignore-path .gitignore",
13
+ "lint": "npm run prettier & npm run eslint",
14
+ "commit": "cz"
10
15
  },
11
16
  "repository": {
12
17
  "type": "git",
@@ -27,7 +32,18 @@
27
32
  "types": "./lib/main.d.ts"
28
33
  },
29
34
  "devDependencies": {
35
+ "@commitlint/cli": "^18.2.0",
36
+ "@commitlint/config-conventional": "^18.1.0",
30
37
  "@types/node": "^20.8.10",
38
+ "@typescript-eslint/eslint-plugin": "^6.10.0",
39
+ "@typescript-eslint/parser": "^6.10.0",
40
+ "commitizen": "^4.3.0",
41
+ "cz-conventional-changelog": "^3.3.0",
42
+ "eslint": "^8.22.0",
43
+ "eslint-config-prettier": "^8.5.0",
44
+ "eslint-plugin-prettier": "^4.2.1",
45
+ "husky": "^8.0.0",
46
+ "prettier": "^2.7.1",
31
47
  "typescript": "^5.2.2",
32
48
  "vite": "^4.5.0",
33
49
  "vite-plugin-dts": "^3.6.3"
@@ -37,5 +53,10 @@
37
53
  "@ionic/portals": "^0.8.1",
38
54
  "vue": "^3.3.8",
39
55
  "vue-router": "^4.2.5"
56
+ },
57
+ "config": {
58
+ "commitizen": {
59
+ "path": "node_modules/cz-conventional-changelog"
60
+ }
40
61
  }
41
62
  }
@@ -1,2 +0,0 @@
1
- export declare class CameraScanPlugins {
2
- }
@@ -1,2 +0,0 @@
1
- export declare class CameraScanMultiplePlugins {
2
- }
@@ -1,13 +0,0 @@
1
- import { Router } from 'vue-router';
2
- import { PluginCallback } from '@capacitor/core';
3
- declare const _default: (fun: PluginCallback) => void;
4
- export default _default;
5
- export declare const nativeBackBtnApiHandle: (cd: (value: string) => void) => void;
6
- interface defaultType {
7
- backBtnHandle?: (value: string) => void;
8
- router?: Router;
9
- }
10
- export declare const backBtnApiHook: ({ backBtnHandle, router }: defaultType) => {
11
- backBtnSpeciallyHandle: () => void;
12
- backBtnFun: () => void;
13
- };
@@ -1,2 +0,0 @@
1
- declare const _default: (data: any) => void;
2
- export default _default;
@@ -1,3 +0,0 @@
1
- import { PluginCallback } from '@capacitor/core';
2
- declare const _default: (fun: PluginCallback) => void;
3
- export default _default;
@@ -1,13 +0,0 @@
1
- import type { PluginCallback } from '@capacitor/core';
2
- import type { MinAppType, TitleType, isClickType, subMaskType } from '../../plugins/communicate';
3
- declare class CommunicatePlugins {
4
- homeIsClick(isClick: isClickType): Promise<void>;
5
- openMinApp(minApp: MinAppType): Promise<void>;
6
- showTitle(title: TitleType): Promise<void>;
7
- showSubMask(subMask: subMaskType): Promise<void>;
8
- backBtnHandle(cd: PluginCallback): void;
9
- homeBtnHandle(cd: PluginCallback): void;
10
- setFabHandle(data: any): void;
11
- }
12
- declare const _default: CommunicatePlugins;
13
- export default _default;
@@ -1,3 +0,0 @@
1
- import type { NativeApiConfigType } from '../../../type';
2
- export declare const getNativeAppInfoDev: (nativeApiConfig: NativeApiConfigType) => Promise<unknown>;
3
- export declare const getNativeAppInfo: () => any;
@@ -1,68 +0,0 @@
1
- declare const _default: {
2
- data_info: {
3
- bu: {
4
- default_tenant_code: string;
5
- tenants: {
6
- store_detail_list: {
7
- name: string;
8
- code: string;
9
- }[];
10
- name: string;
11
- stores: string[];
12
- timezone: string;
13
- code: string;
14
- }[];
15
- };
16
- menus: {
17
- code: string;
18
- id: string;
19
- name: string;
20
- parent_id: string;
21
- }[];
22
- serverInfo: {
23
- serverArea: string;
24
- serverEnv: string;
25
- };
26
- token: {
27
- access_token: string;
28
- expires_in: number;
29
- refresh_token: string;
30
- scope: string;
31
- token_type: string;
32
- };
33
- user: {
34
- create_time: string;
35
- email: string;
36
- gender: string;
37
- id: string;
38
- introduction: string;
39
- language: string;
40
- last_modify_time: string;
41
- password_strength_name: string;
42
- password_validity_period: string;
43
- password_validity_period_time: string;
44
- phone: string;
45
- real_name: string;
46
- special: string;
47
- status: string;
48
- tenant_id: string;
49
- time_zone: string;
50
- type: string;
51
- user_name: string;
52
- errorCode: number;
53
- errorMessage: string;
54
- requseCodeTag: number;
55
- success: boolean;
56
- };
57
- };
58
- data_store: {
59
- name: string;
60
- code: string;
61
- };
62
- data_language: {
63
- code: string;
64
- id: string;
65
- name: string;
66
- };
67
- };
68
- export default _default;
@@ -1,74 +0,0 @@
1
- declare const _default: {
2
- data_info: {
3
- bu: {
4
- default_tenant_code: string;
5
- tenants: {
6
- code: string;
7
- name: string;
8
- store_detail_list: {
9
- buCode: string;
10
- code: string;
11
- name: string;
12
- }[];
13
- stores: string[];
14
- timezone: string;
15
- }[];
16
- errorCode: number;
17
- errorMessage: string;
18
- requseCodeTag: number;
19
- success: boolean;
20
- };
21
- menus: {
22
- code: string;
23
- id: string;
24
- name: string;
25
- parent_id: string;
26
- }[];
27
- serverInfo: {
28
- serverArea: string;
29
- serverEnv: string;
30
- };
31
- token: {
32
- access_token: string;
33
- expires_in: number;
34
- refresh_token: string;
35
- scope: string;
36
- token_type: string;
37
- };
38
- user: {
39
- create_time: string;
40
- email: string;
41
- gender: string;
42
- id: string;
43
- introduction: string;
44
- language: string;
45
- last_modify_time: string;
46
- password_strength_name: string;
47
- password_validity_period: string;
48
- password_validity_period_time: string;
49
- phone: string;
50
- real_name: string;
51
- special: string;
52
- status: string;
53
- tenant_id: string;
54
- time_zone: string;
55
- type: string;
56
- user_name: string;
57
- errorCode: number;
58
- errorMessage: string;
59
- requseCodeTag: number;
60
- success: boolean;
61
- };
62
- };
63
- data_store: {
64
- buCode: string;
65
- code: string;
66
- name: string;
67
- };
68
- data_language: {
69
- code: string;
70
- id: string;
71
- name: string;
72
- };
73
- };
74
- export default _default;
@@ -1,74 +0,0 @@
1
- declare const _default: {
2
- data_info: {
3
- bu: {
4
- default_tenant_code: string;
5
- tenants: {
6
- code: string;
7
- name: string;
8
- store_detail_list: {
9
- buCode: string;
10
- code: string;
11
- name: string;
12
- }[];
13
- stores: string[];
14
- timezone: string;
15
- }[];
16
- errorCode: number;
17
- errorMessage: string;
18
- requseCodeTag: number;
19
- success: boolean;
20
- };
21
- menus: {
22
- code: string;
23
- id: string;
24
- name: string;
25
- parent_id: string;
26
- }[];
27
- serverInfo: {
28
- serverArea: string;
29
- serverEnv: string;
30
- };
31
- token: {
32
- access_token: string;
33
- expires_in: number;
34
- refresh_token: string;
35
- scope: string;
36
- token_type: string;
37
- };
38
- user: {
39
- create_time: string;
40
- email: string;
41
- gender: string;
42
- id: string;
43
- introduction: string;
44
- language: string;
45
- last_modify_time: string;
46
- password_strength_name: string;
47
- password_validity_period: string;
48
- password_validity_period_time: string;
49
- phone: string;
50
- real_name: string;
51
- special: string;
52
- status: string;
53
- tenant_id: string;
54
- time_zone: string;
55
- type: string;
56
- user_name: string;
57
- errorCode: number;
58
- errorMessage: string;
59
- requseCodeTag: number;
60
- success: boolean;
61
- };
62
- };
63
- data_store: {
64
- buCode: string;
65
- code: string;
66
- name: string;
67
- };
68
- data_language: {
69
- code: string;
70
- id: string;
71
- name: string;
72
- };
73
- };
74
- export default _default;
@@ -1,4 +0,0 @@
1
- import { PluginCallback } from '@capacitor/core';
2
- import type { NativeApiConfigType } from '../../../type';
3
- export declare const getInitialContextHandle: (cb: PluginCallback) => void;
4
- export declare const getLocationMockDataHandle: (nativeApiConfig: NativeApiConfigType, { asiaUatData, euSitData, euUatData }: any) => any;
@@ -1,15 +0,0 @@
1
- import type { NativeApiConfigType } from '../../type';
2
- import type { SpecifiedPageType } from './specifiedPage';
3
- export interface InitialContextPluginsType {
4
- getIsNativeHandle: () => Promise<boolean>;
5
- specifiedPageHandle: ({ cb }: SpecifiedPageType) => void;
6
- nativeAppInfo: (nativeApiConfig: NativeApiConfigType) => Promise<any>;
7
- }
8
- export default class InitialContextPlugins implements InitialContextPluginsType {
9
- nativeApiConfig: NativeApiConfigType;
10
- static defaultNativeApiConfig: NativeApiConfigType;
11
- constructor();
12
- getIsNativeHandle(): Promise<boolean>;
13
- specifiedPageHandle({ cb }: SpecifiedPageType): Promise<void>;
14
- nativeAppInfo(nativeApiConfig: NativeApiConfigType): Promise<any>;
15
- }
@@ -1,2 +0,0 @@
1
- declare const _default: () => boolean;
2
- export default _default;
@@ -1,5 +0,0 @@
1
- export interface SpecifiedPageType {
2
- cb: (params?: any) => void;
3
- }
4
- declare const _default: ({ cb }: SpecifiedPageType) => void;
5
- export default _default;
@@ -1,2 +0,0 @@
1
- export declare class LaserScanPlugins {
2
- }
@@ -1,11 +0,0 @@
1
- export declare enum SERVE_ENV {
2
- DEV = "dev",
3
- SIT = "sit",
4
- UAT = "uat",
5
- PROD = "prod",
6
- TEST = "test"
7
- }
8
- export declare enum SERVE_AREA {
9
- EU = "eu",
10
- ASIA = "asia"
11
- }
@@ -1,9 +0,0 @@
1
- import InitialContextPlugins from '../apiHandle/initialContext';
2
- import type { NativeApiConfigType } from '../type';
3
- import type { SpecifiedPageType } from '../apiHandle/initialContext/specifiedPage';
4
- export default class NativeApi extends InitialContextPlugins {
5
- constructor();
6
- getIsNativeHandle(): Promise<boolean>;
7
- specifiedPageHandle({ cb }: SpecifiedPageType): Promise<void>;
8
- nativeAppInfo(nativeApiConfig: NativeApiConfigType): Promise<any>;
9
- }
@@ -1,3 +0,0 @@
1
- import type { InitialContextPluginsType } from '../apiHandle/initialContext';
2
- export interface NativeApiType extends InitialContextPluginsType {
3
- }
@@ -1,22 +0,0 @@
1
- export interface NativeApiConfigType {
2
- mockServerInfo: {
3
- env: string;
4
- area: string;
5
- };
6
- mockData?: {
7
- data_info: any;
8
- data_store: {
9
- name: string;
10
- code: string;
11
- };
12
- data_language: {
13
- [key: string]: string;
14
- code: string;
15
- id: string;
16
- name: string;
17
- };
18
- };
19
- }
20
- export type ContextType = {
21
- params: string;
22
- };
File without changes
package/module.d.ts DELETED
@@ -1 +0,0 @@
1
- declare module "superapp-miniapp-invoke-native";