idpay-b2b-sdk 2.0.2 → 2.1.0
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/assets/.version.d.ts +2 -0
- package/index.d.ts +1 -1
- package/index.esm.d.ts +1 -1
- package/index.esm.js +1 -1
- package/index.js +1 -1
- package/lib/index.d.ts +36 -0
- package/package.json +2 -2
package/index.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./index";
|
|
1
|
+
export * from "./lib/index";
|
package/index.esm.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export * from "./index";
|
|
1
|
+
export * from "./lib/index";
|
package/index.esm.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
|
|
1
|
+
var e="2.1.0";let t,o,n,s,i=!1,c=!1;const r="IFRAME",a="REDIRECT",l="SILENT",d="dev",u="uat",p="prod",S={[d]:"https://idpay-dev.unico.io",[u]:"https://idpay-uat.unico.io",[p]:"https://idpay.unico.io"},y=async d=>{let{token:u,useCurrentOrigin:y,env:h=p,type:k=r}=d;switch(t=k,o=y?window.location.origin:S[h],await(()=>{if(s)return Promise.resolve();s=document.createElement("script"),s.src=`${o}/sdk-assets/index.js`;const e=new Promise((e=>{s.onload=e}));return document.body.appendChild(s),Promise.all([e])})(),UnicoSDKAssets.trackEvent(UnicoSDKAssets.EVENT_TYPES.INITIALIZE),t){case l:n=await UnicoSDKAssets.clientBoxControl.initSilent();break;case a:break;default:await(()=>{const e=document.createElement("link");e.setAttribute("href",`${o}/sdk-assets/assets/styles.css`),e.setAttribute("rel","stylesheet");const t=new Promise((t=>{e.onload=t}));return document.head.appendChild(e),Promise.all([t])})(),UnicoSDKAssets.clientBoxControl.create({host:o,token:u,sdkVersion:e})}if(i=!0,c&&D(c),n)return n},D=s=>{let{transactionId:r,token:d,onFinish:u}=s;const p={transactionId:r,token:d,onFinish:u,host:o,sdkVersion:e,collectionId:n};if(console.log("open",p),i)switch(UnicoSDKAssets.trackEvent(UnicoSDKAssets.EVENT_TYPES.START_FLOW,p),t){case l:UnicoSDKAssets.clientBoxControl.verify(p);break;case a:UnicoSDKAssets.clientBoxControl.redirect(r,d,o,e);break;default:UnicoSDKAssets.clientBoxControl.open(p)}else c=p},h=()=>{UnicoSDKAssets.clientBoxControl.close()},k={init:async e=>(console.log(">>> initByUnicoSDK > options:",e),y(e)),close:h,open:D},A={init:async e=>(console.log(">>> initIDPaySDK > options:",e),y({...e,token:null})),close:h,open:D},E={init:async e=>(console.warn("Warning: The `init()` function is deprecated and will be removed in future versions. Please initialize directly on the product object, e.g., `IDPaySDK.init({ ... })` or `ByUnicoSDK.init({ ... })`. See our documentation for more details."),y(e)),close:h,open:D};export{k as ByUnicoSDK,A as IDPaySDK,E as UnicoSDK};
|
package/index.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UnicoSDK={})}(this,(function(e){"use strict";var t="2.0
|
|
1
|
+
!function(e,t){"object"==typeof exports&&"undefined"!=typeof module?t(exports):"function"==typeof define&&define.amd?define(["exports"],t):t((e="undefined"!=typeof globalThis?globalThis:e||self).UnicoSDK={})}(this,(function(e){"use strict";var t="2.1.0";let o,n,i,s,c=!1,r=!1;const l="IFRAME",a="REDIRECT",d="SILENT",u="dev",p="uat",S="prod",f={[u]:"https://idpay-dev.unico.io",[p]:"https://idpay-uat.unico.io",[S]:"https://idpay.unico.io"},y=async e=>{let{token:u,useCurrentOrigin:p,env:y=S,type:h=l}=e;switch(o=h,n=p?window.location.origin:f[y],await(()=>{if(s)return Promise.resolve();s=document.createElement("script"),s.src=`${n}/sdk-assets/index.js`;const e=new Promise((e=>{s.onload=e}));return document.body.appendChild(s),Promise.all([e])})(),UnicoSDKAssets.trackEvent(UnicoSDKAssets.EVENT_TYPES.INITIALIZE),o){case d:i=await UnicoSDKAssets.clientBoxControl.initSilent();break;case a:break;default:await(()=>{const e=document.createElement("link");e.setAttribute("href",`${n}/sdk-assets/assets/styles.css`),e.setAttribute("rel","stylesheet");const t=new Promise((t=>{e.onload=t}));return document.head.appendChild(e),Promise.all([t])})(),UnicoSDKAssets.clientBoxControl.create({host:n,token:u,sdkVersion:t})}if(c=!0,r&&D(r),i)return i},D=e=>{let{transactionId:s,token:l,onFinish:u}=e;const p={transactionId:s,token:l,onFinish:u,host:n,sdkVersion:t,collectionId:i};if(console.log("open",p),c)switch(UnicoSDKAssets.trackEvent(UnicoSDKAssets.EVENT_TYPES.START_FLOW,p),o){case d:UnicoSDKAssets.clientBoxControl.verify(p);break;case a:UnicoSDKAssets.clientBoxControl.redirect(s,l,n,t);break;default:UnicoSDKAssets.clientBoxControl.open(p)}else r=p},h=()=>{UnicoSDKAssets.clientBoxControl.close()},K={init:async e=>(console.log(">>> initByUnicoSDK > options:",e),y(e)),close:h,open:D},k={init:async e=>(console.log(">>> initIDPaySDK > options:",e),y({...e,token:null})),close:h,open:D},m={init:async e=>(console.warn("Warning: The `init()` function is deprecated and will be removed in future versions. Please initialize directly on the product object, e.g., `IDPaySDK.init({ ... })` or `ByUnicoSDK.init({ ... })`. See our documentation for more details."),y(e)),close:h,open:D};e.ByUnicoSDK=K,e.IDPaySDK=k,e.UnicoSDK=m}));
|
package/lib/index.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
export namespace ByUnicoSDK {
|
|
2
|
+
export { initByUnicoSDK as init };
|
|
3
|
+
export { close };
|
|
4
|
+
export { open };
|
|
5
|
+
}
|
|
6
|
+
export namespace IDPaySDK {
|
|
7
|
+
export { initIDPaySDK as init };
|
|
8
|
+
export { close };
|
|
9
|
+
export { open };
|
|
10
|
+
}
|
|
11
|
+
export namespace UnicoSDK {
|
|
12
|
+
export { init };
|
|
13
|
+
export { close };
|
|
14
|
+
export { open };
|
|
15
|
+
}
|
|
16
|
+
declare function initByUnicoSDK(options: any): Promise<any>;
|
|
17
|
+
declare function close(): void;
|
|
18
|
+
declare function open({ transactionId, token, onFinish }: {
|
|
19
|
+
transactionId: any;
|
|
20
|
+
token: any;
|
|
21
|
+
onFinish: any;
|
|
22
|
+
}): void;
|
|
23
|
+
declare function initIDPaySDK(options: any): Promise<any>;
|
|
24
|
+
/**
|
|
25
|
+
* @deprecated
|
|
26
|
+
* The `init()` function is deprecated.
|
|
27
|
+
* Please initialize directly on the product object.
|
|
28
|
+
*
|
|
29
|
+
* Examples:
|
|
30
|
+
* - `IDPaySDK.init({ ... })`
|
|
31
|
+
* - `ByUnicoSDK.init({ ... })`
|
|
32
|
+
*
|
|
33
|
+
* See our documentation for more details.
|
|
34
|
+
*/
|
|
35
|
+
declare function init(options: any): Promise<any>;
|
|
36
|
+
export {};
|
package/package.json
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "idpay-b2b-sdk",
|
|
3
|
-
"version": "2.0
|
|
3
|
+
"version": "2.1.0",
|
|
4
4
|
"main": "./index.js",
|
|
5
5
|
"module": "./index.esm.js",
|
|
6
6
|
"types": "./index.d.ts",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
9
|
-
"url": "https://github.com/acesso-io/frontend.git",
|
|
9
|
+
"url": "git+https://github.com/acesso-io/frontend.git",
|
|
10
10
|
"directory": "libs/pay/sdk/idpay-b2b-sdk"
|
|
11
11
|
},
|
|
12
12
|
"publishConfig": {
|