@nium/nium-sdk 0.1.8 → 0.1.10

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 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
@@ -197,7 +197,8 @@ var initConfig = null;
197
197
  var ENV_URLS = {
198
198
  local: "http://localhost:3000",
199
199
  qa: "https://onboard-qa.nium.com",
200
- sandbox: "https://onboard-sandbox.nium.com/",
200
+ preprod: "https://onboard-preprod.nium.com",
201
+ sandbox: "https://onboard-sandbox.nium.com",
201
202
  production: "https://onboard.nium.com"
202
203
  };
203
204
  var ELEMENT_ROUTES = {
@@ -245,6 +246,9 @@ var createElement = async (type, options = {}) => {
245
246
  if (options.intent === "update_beneficiary" && !options.beneficiaryHashId) {
246
247
  throw new Error("@nium/nium-sdk: beneficiaryHashId is required for update_beneficiary intent");
247
248
  }
249
+ if (options.intent === "update_beneficiary" && options.prefill) {
250
+ throw new Error("@nium/nium-sdk: prefill is not allowed for update_beneficiary intent. Existing data is fetched automatically.");
251
+ }
248
252
  url.searchParams.set("intent", options.intent);
249
253
  }
250
254
  if (options.beneficiaryHashId) {
package/dist/index.mjs CHANGED
@@ -169,7 +169,8 @@ var initConfig = null;
169
169
  var ENV_URLS = {
170
170
  local: "http://localhost:3000",
171
171
  qa: "https://onboard-qa.nium.com",
172
- sandbox: "https://onboard-sandbox.nium.com/",
172
+ preprod: "https://onboard-preprod.nium.com",
173
+ sandbox: "https://onboard-sandbox.nium.com",
173
174
  production: "https://onboard.nium.com"
174
175
  };
175
176
  var ELEMENT_ROUTES = {
@@ -217,6 +218,9 @@ var createElement = async (type, options = {}) => {
217
218
  if (options.intent === "update_beneficiary" && !options.beneficiaryHashId) {
218
219
  throw new Error("@nium/nium-sdk: beneficiaryHashId is required for update_beneficiary intent");
219
220
  }
221
+ if (options.intent === "update_beneficiary" && options.prefill) {
222
+ throw new Error("@nium/nium-sdk: prefill is not allowed for update_beneficiary intent. Existing data is fetched automatically.");
223
+ }
220
224
  url.searchParams.set("intent", options.intent);
221
225
  }
222
226
  if (options.beneficiaryHashId) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@nium/nium-sdk",
3
- "version": "0.1.8",
3
+ "version": "0.1.10",
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
+ }