@delopay/sdk 0.393.0 → 0.400.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.
@@ -1115,6 +1115,64 @@ var Connectors = class {
1115
1115
  { body: params }
1116
1116
  );
1117
1117
  }
1118
+ /**
1119
+ * Read how the return addresses of a connector's payment provider name the
1120
+ * merchant, per environment.
1121
+ * `GET /account/{merchantId}/connectors/{connectorId}/return-address`
1122
+ *
1123
+ * A return address is where the provider sends the buyer back after a step
1124
+ * it hosts. It belongs to the merchant, the provider and the environment,
1125
+ * so every connector account of that provider follows it.
1126
+ */
1127
+ async getReturnAddress(merchantId, connectorId) {
1128
+ return this.request(
1129
+ "GET",
1130
+ `/account/${encodeURIComponent(merchantId)}/connectors/${encodeURIComponent(connectorId)}/return-address`
1131
+ );
1132
+ }
1133
+ /**
1134
+ * Validate a proposed return address without saving it.
1135
+ * `POST /account/{merchantId}/connectors/{connectorId}/return-address/preview`
1136
+ *
1137
+ * Nothing is reserved: a generated identifier in the answer is an example.
1138
+ * Needs the same permission as saving.
1139
+ *
1140
+ * @example
1141
+ * ```typescript
1142
+ * const preview = await delopay.connectors.previewReturnAddress('mer_abc', 'mca_xyz', {
1143
+ * environment: 'live',
1144
+ * mode: 'anonymous',
1145
+ * share_webhook_identifier: true,
1146
+ * });
1147
+ * if (!preview.valid) console.warn(preview.errors);
1148
+ * ```
1149
+ */
1150
+ async previewReturnAddress(merchantId, connectorId, params) {
1151
+ return this.request(
1152
+ "POST",
1153
+ `/account/${encodeURIComponent(merchantId)}/connectors/${encodeURIComponent(connectorId)}/return-address/preview`,
1154
+ { body: params }
1155
+ );
1156
+ }
1157
+ /**
1158
+ * Save the return address of a connector's payment provider for one
1159
+ * environment.
1160
+ * `PUT /account/{merchantId}/connectors/{connectorId}/return-address`
1161
+ *
1162
+ * Payments started afterwards get return addresses of the new form; every
1163
+ * address already handed to the provider keeps working. A refused proposal
1164
+ * answers 422 with error code `IR_06` and the message
1165
+ * `Return address refused: field:code,…`. A caller who may not edit every
1166
+ * connector account of the provider answers 403. Address changes are
1167
+ * limited per provider and environment (`rate_limit`).
1168
+ */
1169
+ async updateReturnAddress(merchantId, connectorId, params) {
1170
+ return this.request(
1171
+ "PUT",
1172
+ `/account/${encodeURIComponent(merchantId)}/connectors/${encodeURIComponent(connectorId)}/return-address`,
1173
+ { body: params }
1174
+ );
1175
+ }
1118
1176
  /**
1119
1177
  * Every webhook the connector's payment provider lists for its credentials
1120
1178
  * in one environment: Delopay's own, other connector accounts', former
@@ -2806,6 +2864,23 @@ var Payments = class {
2806
2864
  async buyerRisk(paymentId, options) {
2807
2865
  return this.request("GET", `/payments/${encodeURIComponent(paymentId)}/buyer-risk`, options);
2808
2866
  }
2867
+ /**
2868
+ * Lift the holds put on an authorized payment when a chargeback prevention
2869
+ * alert or an AML hit on the same buyer arrived after it was scored and the
2870
+ * shop's `buyer_risk_source_changes` setting asked to hold it. Until then a
2871
+ * capture is refused with `IR_16`; after the release the payment can be
2872
+ * captured or cancelled as usual. A payment with no hold answers an empty
2873
+ * list. A caller scoped to one shop releases only that shop's payments.
2874
+ *
2875
+ * `POST /payments/{paymentId}/buyer-risk/release`
2876
+ */
2877
+ async releaseBuyerRiskHold(paymentId, options) {
2878
+ return this.request(
2879
+ "POST",
2880
+ `/payments/${encodeURIComponent(paymentId)}/buyer-risk/release`,
2881
+ options
2882
+ );
2883
+ }
2809
2884
  /**
2810
2885
  * What the payment's checkout client was, for AI shopping agents: a
2811
2886
  * verified agent (with its operator, protocol and key), an agent signature
@@ -5569,6 +5644,56 @@ var Users = class {
5569
5644
  body: params
5570
5645
  });
5571
5646
  }
5647
+ /**
5648
+ * One team member's sign-in history: successes and failures with method,
5649
+ * address, location and device, filtered, sorted and paged as
5650
+ * `listLoginActivity` is. `GET /user/employees/{user_id}/login-activity`
5651
+ *
5652
+ * Needs the *Users* write permission. Answers only for a member
5653
+ * `listUsersInLineage` shows you; any other id is a 404 `UR_68` with
5654
+ * `data.reason: 'member_not_found'`. Sign-ins belong to the account, so
5655
+ * they are shown only for an account wholly in this merchant: refused with
5656
+ * a 400 `UR_68` `member_has_access_elsewhere` for an account that also
5657
+ * holds a role elsewhere, and `member_not_activated` for one that is only
5658
+ * invited. `TeamMemberDetails.can_view_sign_ins` answers the same rule.
5659
+ */
5660
+ async listTeamMemberLoginActivity(userId, params) {
5661
+ const path2 = `/user/employees/${encodeURIComponent(userId)}/login-activity`;
5662
+ if (params === void 0) {
5663
+ return this.request("GET", path2);
5664
+ }
5665
+ return this.request("GET", path2, {
5666
+ query: csvQuery(params, ["event_type", "auth_method"])
5667
+ });
5668
+ }
5669
+ /**
5670
+ * One team member's live sessions: neither signed out nor expired.
5671
+ * `is_current` marks the caller's own session only.
5672
+ * `GET /user/employees/{user_id}/sessions`
5673
+ *
5674
+ * Same permission and refusals as `listTeamMemberLoginActivity`.
5675
+ */
5676
+ async listTeamMemberSessions(userId) {
5677
+ return this.request("GET", `/user/employees/${encodeURIComponent(userId)}/sessions`);
5678
+ }
5679
+ /**
5680
+ * Sign a team member out everywhere: ends every session and token of the
5681
+ * member, at this merchant and at every other merchant the account belongs
5682
+ * to. `POST /user/employees/{user_id}/sessions/revoke-all`
5683
+ *
5684
+ * The account stays active and its password unchanged, so the member can
5685
+ * sign in again at once. Allowed on exactly the members whose password you
5686
+ * may reset with `resetTeamMemberPassword`, and refused with the same
5687
+ * `UR_68` reasons ({@link TeamMemberRefusal}).
5688
+ * `TeamMemberDetails.can_sign_out` answers the same rule. Recorded in the
5689
+ * audit log.
5690
+ */
5691
+ async revokeTeamMemberSessions(userId) {
5692
+ return this.request(
5693
+ "POST",
5694
+ `/user/employees/${encodeURIComponent(userId)}/sessions/revoke-all`
5695
+ );
5696
+ }
5572
5697
  /**
5573
5698
  * Which checkout payment methods a member may change in your merchant.
5574
5699
  * `GET /user/employees/{user_id}/method-access`
@@ -7295,6 +7420,150 @@ function shopPath(profileId) {
7295
7420
  return `/industries/shops/${encodeURIComponent(profileId)}`;
7296
7421
  }
7297
7422
 
7423
+ // src/resources/payoutDestinations.ts
7424
+ var PayoutDestinations = class {
7425
+ constructor(request) {
7426
+ this.request = request;
7427
+ }
7428
+ /**
7429
+ * The caller's own destinations, masked, and the methods offered to them.
7430
+ *
7431
+ * `GET /payout-destinations/me`
7432
+ */
7433
+ async listMine() {
7434
+ return this.request("GET", "/payout-destinations/me");
7435
+ }
7436
+ /**
7437
+ * Save a destination. The method must be offered; at most 20 per member.
7438
+ *
7439
+ * `POST /payout-destinations/me`
7440
+ */
7441
+ async createMine(params) {
7442
+ return this.request("POST", "/payout-destinations/me", { body: params });
7443
+ }
7444
+ /**
7445
+ * Replace a destination's details at the version read.
7446
+ *
7447
+ * `PUT /payout-destinations/me/{destinationId}`
7448
+ */
7449
+ async updateMine(destinationId, params) {
7450
+ return this.request("PUT", `/payout-destinations/me/${encodeURIComponent(destinationId)}`, {
7451
+ body: params
7452
+ });
7453
+ }
7454
+ /**
7455
+ * Make a destination the preferred one; the others lose it.
7456
+ *
7457
+ * `POST /payout-destinations/me/{destinationId}/preferred`
7458
+ */
7459
+ async preferMine(destinationId, version) {
7460
+ return this.request(
7461
+ "POST",
7462
+ `/payout-destinations/me/${encodeURIComponent(destinationId)}/preferred`,
7463
+ { body: { version } }
7464
+ );
7465
+ }
7466
+ /**
7467
+ * Delete a destination. Final: the history keeps who, when and which
7468
+ * fields, never a value.
7469
+ *
7470
+ * `DELETE /payout-destinations/me/{destinationId}?version=`
7471
+ */
7472
+ async deleteMine(destinationId, version) {
7473
+ await this.request("DELETE", `/payout-destinations/me/${encodeURIComponent(destinationId)}`, {
7474
+ query: { version }
7475
+ });
7476
+ }
7477
+ /**
7478
+ * One's own destination in plain text. Recorded in the history first.
7479
+ *
7480
+ * `POST /payout-destinations/me/{destinationId}/reveal`
7481
+ */
7482
+ async revealMine(destinationId) {
7483
+ return this.request(
7484
+ "POST",
7485
+ `/payout-destinations/me/${encodeURIComponent(destinationId)}/reveal`
7486
+ );
7487
+ }
7488
+ /**
7489
+ * The methods offered to the caller.
7490
+ *
7491
+ * `GET /payout-destinations/methods`
7492
+ */
7493
+ async offeredMethods() {
7494
+ return this.request("GET", "/payout-destinations/methods");
7495
+ }
7496
+ /**
7497
+ * The merchant's list and, with `shop_id`, one shop's. A shop role reads
7498
+ * its own shop only.
7499
+ *
7500
+ * `GET /payout-destinations/methods/settings`
7501
+ */
7502
+ async retrieveMethodsSettings(params) {
7503
+ return this.request("GET", "/payout-destinations/methods/settings", {
7504
+ query: params
7505
+ });
7506
+ }
7507
+ /**
7508
+ * Set the methods offered at the merchant or at one shop.
7509
+ *
7510
+ * `PUT /payout-destinations/methods/settings`
7511
+ */
7512
+ async updateMethodsSettings(params) {
7513
+ return this.request("PUT", "/payout-destinations/methods/settings", { body: params });
7514
+ }
7515
+ /**
7516
+ * The team's destinations the caller manages, masked: every member for a
7517
+ * merchant-level role, the members reaching the caller's shop for a shop
7518
+ * role.
7519
+ *
7520
+ * `GET /payout-destinations`
7521
+ */
7522
+ async listTeam(params) {
7523
+ return this.request("GET", "/payout-destinations", { query: params });
7524
+ }
7525
+ /**
7526
+ * A managed member's destination in plain text. Recorded in the history
7527
+ * first.
7528
+ *
7529
+ * `POST /payout-destinations/{destinationId}/reveal`
7530
+ */
7531
+ async revealTeam(destinationId) {
7532
+ return this.request("POST", `/payout-destinations/${encodeURIComponent(destinationId)}/reveal`);
7533
+ }
7534
+ /**
7535
+ * Confirm a changed destination was seen, at the version read.
7536
+ *
7537
+ * `POST /payout-destinations/{destinationId}/acknowledge`
7538
+ */
7539
+ async acknowledgeTeam(destinationId, version) {
7540
+ return this.request(
7541
+ "POST",
7542
+ `/payout-destinations/${encodeURIComponent(destinationId)}/acknowledge`,
7543
+ { body: { version } }
7544
+ );
7545
+ }
7546
+ /**
7547
+ * Link a revenue-share holder to a team member, or unlink it (`null`). The
7548
+ * member must be an active member of the merchant whose role reads Payouts.
7549
+ *
7550
+ * `PUT /revenue-shares/holders/{holderId}/member`
7551
+ */
7552
+ async linkRevenueShareHolder(holderId, userId) {
7553
+ return this.request("PUT", `/revenue-shares/holders/${encodeURIComponent(holderId)}/member`, {
7554
+ body: { user_id: userId }
7555
+ });
7556
+ }
7557
+ /**
7558
+ * The share terms of the holders linked to the caller. Read-only.
7559
+ *
7560
+ * `GET /revenue-shares/mine`
7561
+ */
7562
+ async listMyRevenueShares() {
7563
+ return this.request("GET", "/revenue-shares/mine");
7564
+ }
7565
+ };
7566
+
7298
7567
  // src/resources/checkoutTemplates.ts
7299
7568
  var CheckoutTemplates = class {
7300
7569
  constructor(request) {
@@ -11392,6 +11661,7 @@ var Delopay = class {
11392
11661
  this.persons = new Persons(request);
11393
11662
  this.shopLabels = new ShopLabels(request);
11394
11663
  this.industries = new Industries(request);
11664
+ this.payoutDestinations = new PayoutDestinations(request);
11395
11665
  this.checkoutTemplates = new CheckoutTemplates(request);
11396
11666
  this.buyerConversations = new BuyerConversations(request);
11397
11667
  this.buyerEvidence = new BuyerEvidenceReviews(request);
@@ -17405,6 +17675,7 @@ export {
17405
17675
  Persons,
17406
17676
  ShopLabels,
17407
17677
  Industries,
17678
+ PayoutDestinations,
17408
17679
  CheckoutTemplates,
17409
17680
  BuyerConversations,
17410
17681
  BuyerEvidenceReviews,
@@ -17685,4 +17956,4 @@ export {
17685
17956
  decodeNativePanes,
17686
17957
  encodeNativePanes
17687
17958
  };
17688
- //# sourceMappingURL=chunk-VOYGZ2V6.js.map
17959
+ //# sourceMappingURL=chunk-AZRXI3FB.js.map