@nium/nium-sdk 0.1.8 → 0.1.9
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/dist/index.d.mts +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.js +3 -0
- package/dist/index.mjs +3 -0
- package/package.json +8 -8
package/dist/index.d.mts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Environments supported by the SDK */
|
|
2
|
-
type NiumEnv = 'local' | 'sandbox' | 'qa' | 'production';
|
|
2
|
+
type NiumEnv = 'local' | 'sandbox' | 'qa' | 'production' | string;
|
|
3
3
|
/** Module types that map to web-onboard routes */
|
|
4
4
|
type NiumElementType = 'payment' | 'tax' | 'identity' | 'full';
|
|
5
5
|
/** Configuration passed to `init()` */
|
package/dist/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
/** Environments supported by the SDK */
|
|
2
|
-
type NiumEnv = 'local' | 'sandbox' | 'qa' | 'production';
|
|
2
|
+
type NiumEnv = 'local' | 'sandbox' | 'qa' | 'production' | string;
|
|
3
3
|
/** Module types that map to web-onboard routes */
|
|
4
4
|
type NiumElementType = 'payment' | 'tax' | 'identity' | 'full';
|
|
5
5
|
/** Configuration passed to `init()` */
|
package/dist/index.js
CHANGED
|
@@ -245,6 +245,9 @@ var createElement = async (type, options = {}) => {
|
|
|
245
245
|
if (options.intent === "update_beneficiary" && !options.beneficiaryHashId) {
|
|
246
246
|
throw new Error("@nium/nium-sdk: beneficiaryHashId is required for update_beneficiary intent");
|
|
247
247
|
}
|
|
248
|
+
if (options.intent === "update_beneficiary" && options.prefill) {
|
|
249
|
+
throw new Error("@nium/nium-sdk: prefill is not allowed for update_beneficiary intent. Existing data is fetched automatically.");
|
|
250
|
+
}
|
|
248
251
|
url.searchParams.set("intent", options.intent);
|
|
249
252
|
}
|
|
250
253
|
if (options.beneficiaryHashId) {
|
package/dist/index.mjs
CHANGED
|
@@ -217,6 +217,9 @@ var createElement = async (type, options = {}) => {
|
|
|
217
217
|
if (options.intent === "update_beneficiary" && !options.beneficiaryHashId) {
|
|
218
218
|
throw new Error("@nium/nium-sdk: beneficiaryHashId is required for update_beneficiary intent");
|
|
219
219
|
}
|
|
220
|
+
if (options.intent === "update_beneficiary" && options.prefill) {
|
|
221
|
+
throw new Error("@nium/nium-sdk: prefill is not allowed for update_beneficiary intent. Existing data is fetched automatically.");
|
|
222
|
+
}
|
|
220
223
|
url.searchParams.set("intent", options.intent);
|
|
221
224
|
}
|
|
222
225
|
if (options.beneficiaryHashId) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nium/nium-sdk",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.9",
|
|
4
4
|
"description": "NIUM Onboarding SDK - Embed hosted onboarding forms with a clean JavaScript API",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -8,6 +8,12 @@
|
|
|
8
8
|
"files": [
|
|
9
9
|
"dist"
|
|
10
10
|
],
|
|
11
|
+
"scripts": {
|
|
12
|
+
"build": "tsup src/index.ts --format cjs,esm --dts --clean",
|
|
13
|
+
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
14
|
+
"type": "tsc --noEmit",
|
|
15
|
+
"lint": "eslint src/"
|
|
16
|
+
},
|
|
11
17
|
"devDependencies": {
|
|
12
18
|
"@rollup/rollup-darwin-arm64": "^4.60.1",
|
|
13
19
|
"tsup": "^8.0.0",
|
|
@@ -16,11 +22,5 @@
|
|
|
16
22
|
"license": "UNLICENSED",
|
|
17
23
|
"publishConfig": {
|
|
18
24
|
"access": "public"
|
|
19
|
-
},
|
|
20
|
-
"scripts": {
|
|
21
|
-
"build": "tsup src/index.ts --format cjs,esm --dts --clean",
|
|
22
|
-
"dev": "tsup src/index.ts --format cjs,esm --dts --watch",
|
|
23
|
-
"type": "tsc --noEmit",
|
|
24
|
-
"lint": "eslint src/"
|
|
25
25
|
}
|
|
26
|
-
}
|
|
26
|
+
}
|