@delopay/sdk 0.285.0 → 0.289.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/dist/index.cjs CHANGED
@@ -42,6 +42,7 @@ __export(index_exports, {
42
42
  BRANDING_EXPORT_FORMAT: () => BRANDING_EXPORT_FORMAT,
43
43
  BRANDING_EXPORT_VERSION: () => BRANDING_EXPORT_VERSION,
44
44
  BUILTIN_PAYMENT_ICON_KEYS: () => BUILTIN_PAYMENT_ICON_KEYS,
45
+ Branding: () => Branding,
45
46
  BuyerBlocklist: () => BuyerBlocklist,
46
47
  BuyerConversations: () => BuyerConversations,
47
48
  BuyerEvidenceReviews: () => BuyerEvidenceReviews,
@@ -63,6 +64,7 @@ __export(index_exports, {
63
64
  CheckoutMethods: () => CheckoutMethods,
64
65
  CheckoutRecovery: () => CheckoutRecovery,
65
66
  CheckoutSession: () => CheckoutSession,
67
+ CheckoutTemplates: () => CheckoutTemplates,
66
68
  CostRules: () => CostRules,
67
69
  DEFAULT_BADGES: () => DEFAULT_BADGES,
68
70
  DEFAULT_BADGES_DARK: () => DEFAULT_BADGES_DARK,
@@ -164,6 +166,7 @@ __export(index_exports, {
164
166
  anyOf: () => anyOf,
165
167
  applyBrandingVariables: () => applyBrandingVariables,
166
168
  asAirwallexCardPreset: () => asAirwallexCardPreset,
169
+ brandingAssetPath: () => brandingAssetPath,
167
170
  buildBrandingExport: () => buildBrandingExport,
168
171
  builtinPaymentIconDataUri: () => builtinPaymentIconDataUri,
169
172
  builtinPaymentIconSvg: () => builtinPaymentIconSvg,
@@ -5251,6 +5254,49 @@ var Users = class {
5251
5254
  body: params
5252
5255
  });
5253
5256
  }
5257
+ /**
5258
+ * A member's permission overrides in your merchant: every area that can be
5259
+ * overridden at their level, with what their roles give, the level set for
5260
+ * them, and what they have. `GET /user/employees/{user_id}/permission-overrides`
5261
+ *
5262
+ * Needs the *Users* read permission, and answers only for a member
5263
+ * `listUsersInLineage` shows you (any other id is a 404 `UR_68`).
5264
+ * `can_edit`, `can_raise` and each area's `grantable_level` say what you
5265
+ * may change.
5266
+ */
5267
+ async getMemberPermissionOverrides(userId) {
5268
+ return this.request(
5269
+ "GET",
5270
+ `/user/employees/${encodeURIComponent(userId)}/permission-overrides`
5271
+ );
5272
+ }
5273
+ /**
5274
+ * Replace a member's permission overrides. An area left out goes back to
5275
+ * what their roles give. `PUT /user/employees/{user_id}/permission-overrides`
5276
+ *
5277
+ * Needs the *Users* write permission and a member within your reach, other
5278
+ * than yourself. Keeping or lowering is always allowed; a gain must stay
5279
+ * within what you hold in that area, and a gain above the member's roles
5280
+ * needs `can_raise`. The change is audited and applies to the member's next
5281
+ * request. A refusal is a `UR_68` whose `data` is
5282
+ * `{ reason: 'permission_overrides', refusal }` (see
5283
+ * {@link PermissionOverrideRefusal}).
5284
+ */
5285
+ async updateMemberPermissionOverrides(userId, params) {
5286
+ return this.request(
5287
+ "PUT",
5288
+ `/user/employees/${encodeURIComponent(userId)}/permission-overrides`,
5289
+ { body: params }
5290
+ );
5291
+ }
5292
+ /**
5293
+ * The permission overrides your own session acts under, sorted by area.
5294
+ * An area named here has exactly that level, whatever a broader legacy area
5295
+ * of the role would suggest. `GET /user/role/permission-overrides`
5296
+ */
5297
+ async getOwnPermissionOverrides() {
5298
+ return this.request("GET", "/user/role/permission-overrides");
5299
+ }
5254
5300
  /** Sign in via OIDC. `POST /user/oidc` */
5255
5301
  async signInOidc(params) {
5256
5302
  return this.request("POST", "/user/oidc", { body: params });
@@ -5475,7 +5521,8 @@ var IdentityVerifications = class {
5475
5521
  }
5476
5522
  /**
5477
5523
  * One verification. With `force_sync: true`, a verification the provider
5478
- * can still change (pending or in review) is read from the provider first.
5524
+ * can still change (pending or in review, or a subject under ongoing AML
5525
+ * monitoring) is read from the provider first.
5479
5526
  *
5480
5527
  * `GET /identity-verifications/{verification_id}`
5481
5528
  */
@@ -5487,8 +5534,9 @@ var IdentityVerifications = class {
5487
5534
  }
5488
5535
  /**
5489
5536
  * A subject's latest verification in one environment (live unless
5490
- * `test_mode: true`), with its checks. This is what risk rules read.
5491
- * `verification` is `null` when the subject has none.
5537
+ * `test_mode: true`), with its checks, and the subject's verification under
5538
+ * ongoing AML monitoring. This is what risk rules read. `verification` and
5539
+ * `aml_monitoring` are `null` when the subject has none.
5492
5540
  *
5493
5541
  * `GET /identity-verifications/subjects/{subject_reference}`
5494
5542
  */
@@ -5513,6 +5561,78 @@ var IdentityVerifications = class {
5513
5561
  { query, ...options }
5514
5562
  );
5515
5563
  }
5564
+ /**
5565
+ * Switch ongoing AML monitoring of a verification's subject. The provider
5566
+ * then keeps re-screening the subject against sanctions, PEP and
5567
+ * adverse-media lists, and every change it reports is recorded. Only a
5568
+ * verified person or business can be enrolled; monitoring can be switched
5569
+ * off at any time. Needs permission to edit customers.
5570
+ *
5571
+ * `POST /identity-verifications/{verification_id}/aml-monitoring`
5572
+ */
5573
+ async setAmlMonitoring(verificationId, params, options) {
5574
+ return this.request(
5575
+ "POST",
5576
+ `/identity-verifications/${encodeURIComponent(verificationId)}/aml-monitoring`,
5577
+ { body: params, ...options }
5578
+ );
5579
+ }
5580
+ /**
5581
+ * Every change of the subject's AML result the provider reported while the
5582
+ * subject was monitored, newest first, at most 100.
5583
+ *
5584
+ * `GET /identity-verifications/{verification_id}/aml-events`
5585
+ */
5586
+ async amlEvents(verificationId, options) {
5587
+ return this.request(
5588
+ "GET",
5589
+ `/identity-verifications/${encodeURIComponent(verificationId)}/aml-events`,
5590
+ options
5591
+ );
5592
+ }
5593
+ /**
5594
+ * A payment's screening by the transaction monitoring of the shop's
5595
+ * screening account. Recorded only: it never holds or refuses the payment.
5596
+ * Answers 404 when the payment has no screening. Needs permission to read
5597
+ * payments.
5598
+ *
5599
+ * `GET /identity-verifications/payment-screenings/{payment_id}`
5600
+ */
5601
+ async paymentScreening(paymentId, options) {
5602
+ return this.request(
5603
+ "GET",
5604
+ `/identity-verifications/payment-screenings/${encodeURIComponent(paymentId)}`,
5605
+ options
5606
+ );
5607
+ }
5608
+ /**
5609
+ * Whether an account screens its shop's payments. Needs permission to read
5610
+ * connectors.
5611
+ *
5612
+ * `GET /identity-verifications/accounts/{merchant_connector_id}/payment-screening`
5613
+ */
5614
+ async paymentScreeningSetting(merchantConnectorId, options) {
5615
+ return this.request(
5616
+ "GET",
5617
+ `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/payment-screening`,
5618
+ options
5619
+ );
5620
+ }
5621
+ /**
5622
+ * Switch screening of the account's shop's payments. Switched on, every
5623
+ * payment of the shop that succeeds from then on is screened shortly after,
5624
+ * in the payment's own environment. A shop has at most one screening
5625
+ * account. Needs permission to edit connectors.
5626
+ *
5627
+ * `PUT /identity-verifications/accounts/{merchant_connector_id}/payment-screening`
5628
+ */
5629
+ async updatePaymentScreeningSetting(merchantConnectorId, params, options) {
5630
+ return this.request(
5631
+ "PUT",
5632
+ `/identity-verifications/accounts/${encodeURIComponent(merchantConnectorId)}/payment-screening`,
5633
+ { body: params, ...options }
5634
+ );
5635
+ }
5516
5636
  };
5517
5637
 
5518
5638
  // src/resources/webhooks.ts
@@ -6251,6 +6371,110 @@ var ShopLabels = class {
6251
6371
  }
6252
6372
  };
6253
6373
 
6374
+ // src/resources/checkoutTemplates.ts
6375
+ var CheckoutTemplates = class {
6376
+ constructor(request) {
6377
+ this.request = request;
6378
+ }
6379
+ /**
6380
+ * The merchant's templates, each with the shops on it and whether each
6381
+ * runs the template's current settings.
6382
+ * `GET /checkout-templates/{merchantId}`
6383
+ */
6384
+ async list(merchantId) {
6385
+ return this.request("GET", `/checkout-templates/${encodeURIComponent(merchantId)}`);
6386
+ }
6387
+ /**
6388
+ * Create a template, empty or copied from a shop's current settings. The
6389
+ * shop copied from is not changed.
6390
+ * `POST /checkout-templates/{merchantId}`
6391
+ */
6392
+ async create(merchantId, params) {
6393
+ return this.request("POST", `/checkout-templates/${encodeURIComponent(merchantId)}`, {
6394
+ body: params
6395
+ });
6396
+ }
6397
+ /** `GET /checkout-templates/{merchantId}/{templateId}` */
6398
+ async retrieve(merchantId, templateId) {
6399
+ return this.request(
6400
+ "GET",
6401
+ `/checkout-templates/${encodeURIComponent(merchantId)}/${encodeURIComponent(templateId)}`
6402
+ );
6403
+ }
6404
+ /**
6405
+ * Rename a template. A name another template of the merchant holds is
6406
+ * refused.
6407
+ * `POST /checkout-templates/{merchantId}/{templateId}`
6408
+ */
6409
+ async rename(merchantId, templateId, params) {
6410
+ return this.request(
6411
+ "POST",
6412
+ `/checkout-templates/${encodeURIComponent(merchantId)}/${encodeURIComponent(templateId)}`,
6413
+ { body: params }
6414
+ );
6415
+ }
6416
+ /**
6417
+ * Delete a template. Refused while a shop is on it.
6418
+ * `DELETE /checkout-templates/{merchantId}/{templateId}`
6419
+ */
6420
+ async delete(merchantId, templateId) {
6421
+ return this.request(
6422
+ "DELETE",
6423
+ `/checkout-templates/${encodeURIComponent(merchantId)}/${encodeURIComponent(templateId)}`
6424
+ );
6425
+ }
6426
+ /**
6427
+ * Put shops on the template and copy its settings into them; a shop on
6428
+ * another template moves. Each shop is reported on its own: one with
6429
+ * `blockers` is left unchanged. `dry_run` changes nothing and reports what
6430
+ * would change.
6431
+ * `POST /checkout-templates/{merchantId}/{templateId}/shops`
6432
+ */
6433
+ async assign(merchantId, templateId, params) {
6434
+ return this.request(
6435
+ "POST",
6436
+ `/checkout-templates/${encodeURIComponent(merchantId)}/${encodeURIComponent(templateId)}/shops`,
6437
+ {
6438
+ body: params
6439
+ }
6440
+ );
6441
+ }
6442
+ /**
6443
+ * Take a shop off the template. It keeps every setting it has, as its own.
6444
+ * `DELETE /checkout-templates/{merchantId}/{templateId}/shops/{profileId}`
6445
+ */
6446
+ async unassign(merchantId, templateId, profileId) {
6447
+ return this.request(
6448
+ "DELETE",
6449
+ `/checkout-templates/${encodeURIComponent(merchantId)}/${encodeURIComponent(templateId)}/shops/${encodeURIComponent(profileId)}`
6450
+ );
6451
+ }
6452
+ /**
6453
+ * Copy the template's current settings into its shops, all or the ones
6454
+ * named.
6455
+ * `POST /checkout-templates/{merchantId}/{templateId}/apply`
6456
+ */
6457
+ async apply(merchantId, templateId, params = {}) {
6458
+ return this.request(
6459
+ "POST",
6460
+ `/checkout-templates/${encodeURIComponent(merchantId)}/${encodeURIComponent(templateId)}/apply`,
6461
+ {
6462
+ body: params
6463
+ }
6464
+ );
6465
+ }
6466
+ /**
6467
+ * The template a shop is on, if any. Readable by the shop's own members.
6468
+ * `GET /checkout-templates/{merchantId}/shops/{profileId}`
6469
+ */
6470
+ async ofShop(merchantId, profileId) {
6471
+ return this.request(
6472
+ "GET",
6473
+ `/checkout-templates/${encodeURIComponent(merchantId)}/shops/${encodeURIComponent(profileId)}`
6474
+ );
6475
+ }
6476
+ };
6477
+
6254
6478
  // src/resources/buyerConversations.ts
6255
6479
  var BuyerConversations = class {
6256
6480
  constructor(request) {
@@ -9502,6 +9726,41 @@ var Live = class {
9502
9726
  }
9503
9727
  };
9504
9728
 
9729
+ // src/resources/deploymentBranding.ts
9730
+ function brandingAssetPath(asset, version) {
9731
+ const path = `/branding/assets/${encodeURIComponent(asset)}`;
9732
+ return version ? `${path}?v=${encodeURIComponent(version)}` : path;
9733
+ }
9734
+ var Branding = class {
9735
+ constructor(request, baseUrl) {
9736
+ this.request = request;
9737
+ this.baseUrl = baseUrl;
9738
+ }
9739
+ /**
9740
+ * The saved branding. A `null` field means "keep your own default".
9741
+ *
9742
+ * Branding is cosmetic, so treat any failure as "nothing saved": routers
9743
+ * from before this route answer 404, and a page must never wait long for
9744
+ * it. Pass a `signal` (e.g. `AbortSignal.timeout(2500)`) to bound the call
9745
+ * including its retries; a `timeout` alone applies to each attempt.
9746
+ *
9747
+ * `GET /branding`
9748
+ */
9749
+ async retrieve(options) {
9750
+ return this.request("GET", "/branding", { ...options });
9751
+ }
9752
+ /**
9753
+ * The address of one branding image or font file on this client's base
9754
+ * URL, for an `<img src>` or a `@font-face` `src`. See
9755
+ * {@link brandingAssetPath}.
9756
+ *
9757
+ * `GET /branding/assets/{asset}`
9758
+ */
9759
+ assetUrl(asset, version) {
9760
+ return `${this.baseUrl}${brandingAssetPath(asset, version)}`;
9761
+ }
9762
+ };
9763
+
9505
9764
  // src/client.ts
9506
9765
  var PRODUCTION_URL = "https://api.delopay.net";
9507
9766
  var SANDBOX_URL = "https://sandbox.delopay.net";
@@ -9781,6 +10040,7 @@ var Delopay = class {
9781
10040
  this.messageTemplates = new MessageTemplates(request);
9782
10041
  this.risk = new Risk(request);
9783
10042
  this.live = new Live(request, openStream);
10043
+ this.branding = new Branding(request, this.baseUrl);
9784
10044
  this.subscriptions = new Subscriptions(request);
9785
10045
  this.buyerPortal = new BuyerPortal(request);
9786
10046
  this.buyerAccount = new BuyerAccount(request);
@@ -9792,6 +10052,7 @@ var Delopay = class {
9792
10052
  this.sellToRestrictions = new SellToRestrictions(request);
9793
10053
  this.buyerBlocklist = new BuyerBlocklist(request);
9794
10054
  this.shopLabels = new ShopLabels(request);
10055
+ this.checkoutTemplates = new CheckoutTemplates(request);
9795
10056
  this.buyerConversations = new BuyerConversations(request);
9796
10057
  this.buyerEvidence = new BuyerEvidenceReviews(request);
9797
10058
  this.checkoutRecovery = new CheckoutRecovery(request);
@@ -14063,6 +14324,25 @@ var CheckoutSession = class {
14063
14324
  headers: this.bearerHeaders(options?.headers)
14064
14325
  });
14065
14326
  }
14327
+ /**
14328
+ * Reserve this payment attempt before a hosted card form contacts Stripe,
14329
+ * Airwallex, or NomuPay. Send the provider object rendered to this checkout
14330
+ * and retain the same `flow_id` across retries and any 3-D Secure step.
14331
+ *
14332
+ * Only `authorized: true` permits the form to contact its processor. A
14333
+ * competing flow receives `false` and must reload; an unresolved provider
14334
+ * outcome stays reserved, regardless of elapsed time. A buyer-blocklist
14335
+ * refusal throws a `DelopayError` with code `DE_14`.
14336
+ *
14337
+ * `POST /payment-link/{merchantId}/{paymentId}/browser-card-claim`
14338
+ */
14339
+ async claimBrowserCard(params, options) {
14340
+ return this.client.request("POST", `${this.linkBase}/browser-card-claim`, {
14341
+ body: params,
14342
+ ...options,
14343
+ headers: this.bearerHeaders(options?.headers)
14344
+ });
14345
+ }
14066
14346
  /**
14067
14347
  * Confirm the Stripe card form's PaymentIntent through the router, for a
14068
14348
  * checkout payload with `card_connector_server_confirm: true`. Stripe refuses
@@ -14084,6 +14364,10 @@ var CheckoutSession = class {
14084
14364
  * and that secret confirms nothing without the secret key — then call this
14085
14365
  * again without a payment method to finalize.
14086
14366
  *
14367
+ * Reserve the attempt with {@link claimBrowserCard} first. Send its granted
14368
+ * `flow_id` as `browser_flow_id` on both the initial and post-action confirm;
14369
+ * an omitted, null or nonholder flow is refused with `400` and code `IR_16`.
14370
+ *
14087
14371
  * A PaymentMethod rules out what `stripe.createPaymentMethod` cannot
14088
14372
  * produce: Stripe names Amazon Pay and Klarna in the Express Checkout
14089
14373
  * Element, which need `stripe.createConfirmationToken` instead. Neither can
@@ -14947,6 +15231,7 @@ var encodeNativePanes = encodePanes;
14947
15231
  BRANDING_EXPORT_FORMAT,
14948
15232
  BRANDING_EXPORT_VERSION,
14949
15233
  BUILTIN_PAYMENT_ICON_KEYS,
15234
+ Branding,
14950
15235
  BuyerBlocklist,
14951
15236
  BuyerConversations,
14952
15237
  BuyerEvidenceReviews,
@@ -14968,6 +15253,7 @@ var encodeNativePanes = encodePanes;
14968
15253
  CheckoutMethods,
14969
15254
  CheckoutRecovery,
14970
15255
  CheckoutSession,
15256
+ CheckoutTemplates,
14971
15257
  CostRules,
14972
15258
  DEFAULT_BADGES,
14973
15259
  DEFAULT_BADGES_DARK,
@@ -15069,6 +15355,7 @@ var encodeNativePanes = encodePanes;
15069
15355
  anyOf,
15070
15356
  applyBrandingVariables,
15071
15357
  asAirwallexCardPreset,
15358
+ brandingAssetPath,
15072
15359
  buildBrandingExport,
15073
15360
  builtinPaymentIconDataUri,
15074
15361
  builtinPaymentIconSvg,