@delopay/sdk 0.38.0 → 0.40.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.d.cts CHANGED
@@ -2760,9 +2760,11 @@ declare class Events {
2760
2760
  * overrides; platform-wide fee programs are administered by Delopay and
2761
2761
  * not exposed here.
2762
2762
  *
2763
- * `fees.rules` manages the merchant-owned Euclid fee-rule program (a single
2764
- * active program per merchant), which takes precedence over the flat schedules
2765
- * above. Build the program with the `feeProgram()` helper.
2763
+ * `fees.rules` manages the merchant-owned Euclid fee-rule program, which takes
2764
+ * precedence over the flat schedules above. A program is scoped either to one
2765
+ * shop (`profile_id`) or merchant-wide; a shop-scoped program wins for that
2766
+ * shop, otherwise the merchant-wide one applies. Build the program with the
2767
+ * `feeProgram()` helper.
2766
2768
  */
2767
2769
  declare class Fees {
2768
2770
  private readonly request;
@@ -2797,8 +2799,10 @@ declare class Fees {
2797
2799
  delete(feeId: string): Promise<FeeScheduleResponse>;
2798
2800
  }
2799
2801
  /**
2800
- * Manages a merchant's single active Euclid fee-rule program. Build the
2801
- * `algorithm` with `feeProgram()`. The SDK injects `fee_owner: 'merchant'`.
2802
+ * Manages a merchant's Euclid fee-rule programs (merchant-wide or per-shop, one
2803
+ * active program per scope). Build the `algorithm` with `feeProgram()`. The SDK
2804
+ * injects `fee_owner: 'merchant'`; set `profile_id` on the input to scope a
2805
+ * program to a shop.
2802
2806
  */
2803
2807
  declare class FeeRulesManager {
2804
2808
  private readonly request;
@@ -2812,18 +2816,23 @@ declare class FeeRulesManager {
2812
2816
  */
2813
2817
  upsert(params: PlatformFeeRuleInput, merchantId: string): Promise<PlatformFeeRuleRecord>;
2814
2818
  /**
2815
- * Retrieve the merchant's active fee-rule program, or `null` if none.
2819
+ * Retrieve the active fee-rule program for a scope, or `null` if none.
2816
2820
  *
2817
2821
  * @param merchantId - The merchant account ID.
2822
+ * @param profileId - Optional shop (`profile_id`) scope. Omit for the
2823
+ * merchant-wide program; pass a shop id to get that shop's program.
2818
2824
  */
2819
- retrieve(merchantId: string): Promise<PlatformFeeRuleRecord | null>;
2825
+ retrieve(merchantId: string, profileId?: string): Promise<PlatformFeeRuleRecord | null>;
2820
2826
  /**
2821
- * Deactivate the merchant's active fee-rule program (falls back to the flat
2822
- * fee schedules / volume tier). Idempotent.
2827
+ * Deactivate a fee-rule program (falls back to the flat fee schedules /
2828
+ * volume tier). Idempotent.
2823
2829
  *
2824
2830
  * @param merchantId - The merchant account ID.
2831
+ * @param profileId - Optional shop (`profile_id`) scope. Omit to target the
2832
+ * merchant-wide program; pass a shop id to delete only that shop's program
2833
+ * (other shops' programs are left intact).
2825
2834
  */
2826
- delete(merchantId: string): Promise<void>;
2835
+ delete(merchantId: string, profileId?: string): Promise<void>;
2827
2836
  }
2828
2837
 
2829
2838
  /** View and revoke recurring payment mandates. */
package/dist/index.d.ts CHANGED
@@ -2760,9 +2760,11 @@ declare class Events {
2760
2760
  * overrides; platform-wide fee programs are administered by Delopay and
2761
2761
  * not exposed here.
2762
2762
  *
2763
- * `fees.rules` manages the merchant-owned Euclid fee-rule program (a single
2764
- * active program per merchant), which takes precedence over the flat schedules
2765
- * above. Build the program with the `feeProgram()` helper.
2763
+ * `fees.rules` manages the merchant-owned Euclid fee-rule program, which takes
2764
+ * precedence over the flat schedules above. A program is scoped either to one
2765
+ * shop (`profile_id`) or merchant-wide; a shop-scoped program wins for that
2766
+ * shop, otherwise the merchant-wide one applies. Build the program with the
2767
+ * `feeProgram()` helper.
2766
2768
  */
2767
2769
  declare class Fees {
2768
2770
  private readonly request;
@@ -2797,8 +2799,10 @@ declare class Fees {
2797
2799
  delete(feeId: string): Promise<FeeScheduleResponse>;
2798
2800
  }
2799
2801
  /**
2800
- * Manages a merchant's single active Euclid fee-rule program. Build the
2801
- * `algorithm` with `feeProgram()`. The SDK injects `fee_owner: 'merchant'`.
2802
+ * Manages a merchant's Euclid fee-rule programs (merchant-wide or per-shop, one
2803
+ * active program per scope). Build the `algorithm` with `feeProgram()`. The SDK
2804
+ * injects `fee_owner: 'merchant'`; set `profile_id` on the input to scope a
2805
+ * program to a shop.
2802
2806
  */
2803
2807
  declare class FeeRulesManager {
2804
2808
  private readonly request;
@@ -2812,18 +2816,23 @@ declare class FeeRulesManager {
2812
2816
  */
2813
2817
  upsert(params: PlatformFeeRuleInput, merchantId: string): Promise<PlatformFeeRuleRecord>;
2814
2818
  /**
2815
- * Retrieve the merchant's active fee-rule program, or `null` if none.
2819
+ * Retrieve the active fee-rule program for a scope, or `null` if none.
2816
2820
  *
2817
2821
  * @param merchantId - The merchant account ID.
2822
+ * @param profileId - Optional shop (`profile_id`) scope. Omit for the
2823
+ * merchant-wide program; pass a shop id to get that shop's program.
2818
2824
  */
2819
- retrieve(merchantId: string): Promise<PlatformFeeRuleRecord | null>;
2825
+ retrieve(merchantId: string, profileId?: string): Promise<PlatformFeeRuleRecord | null>;
2820
2826
  /**
2821
- * Deactivate the merchant's active fee-rule program (falls back to the flat
2822
- * fee schedules / volume tier). Idempotent.
2827
+ * Deactivate a fee-rule program (falls back to the flat fee schedules /
2828
+ * volume tier). Idempotent.
2823
2829
  *
2824
2830
  * @param merchantId - The merchant account ID.
2831
+ * @param profileId - Optional shop (`profile_id`) scope. Omit to target the
2832
+ * merchant-wide program; pass a shop id to delete only that shop's program
2833
+ * (other shops' programs are left intact).
2825
2834
  */
2826
- delete(merchantId: string): Promise<void>;
2835
+ delete(merchantId: string, profileId?: string): Promise<void>;
2827
2836
  }
2828
2837
 
2829
2838
  /** View and revoke recurring payment mandates. */
package/dist/index.js CHANGED
@@ -43,7 +43,7 @@ import {
43
43
  shadowFor,
44
44
  surfacePadValue,
45
45
  verticalGapValue
46
- } from "./chunk-IQKFNKHU.js";
46
+ } from "./chunk-JAO3KHIM.js";
47
47
  export {
48
48
  Analytics,
49
49
  AnalyticsDashboard,
package/dist/internal.cjs CHANGED
@@ -32,6 +32,7 @@ __export(internal_exports, {
32
32
  CardIssuers: () => CardIssuers,
33
33
  Cards: () => Cards,
34
34
  Configs: () => Configs,
35
+ ConnectorRestrictionRules: () => ConnectorRestrictionRules,
35
36
  ConnectorRestrictions: () => ConnectorRestrictions,
36
37
  DEFAULT_BADGES: () => DEFAULT_BADGES,
37
38
  DEFAULT_BADGES_DARK: () => DEFAULT_BADGES_DARK,
@@ -766,24 +767,29 @@ var FeeRulesManager = class {
766
767
  });
767
768
  }
768
769
  /**
769
- * Retrieve the merchant's active fee-rule program, or `null` if none.
770
+ * Retrieve the active fee-rule program for a scope, or `null` if none.
770
771
  *
771
772
  * @param merchantId - The merchant account ID.
773
+ * @param profileId - Optional shop (`profile_id`) scope. Omit for the
774
+ * merchant-wide program; pass a shop id to get that shop's program.
772
775
  */
773
- async retrieve(merchantId) {
776
+ async retrieve(merchantId, profileId) {
774
777
  return this.request("GET", "/merchant-fees/rules", {
775
- query: { merchant_id: merchantId }
778
+ query: { merchant_id: merchantId, profile_id: profileId }
776
779
  });
777
780
  }
778
781
  /**
779
- * Deactivate the merchant's active fee-rule program (falls back to the flat
780
- * fee schedules / volume tier). Idempotent.
782
+ * Deactivate a fee-rule program (falls back to the flat fee schedules /
783
+ * volume tier). Idempotent.
781
784
  *
782
785
  * @param merchantId - The merchant account ID.
786
+ * @param profileId - Optional shop (`profile_id`) scope. Omit to target the
787
+ * merchant-wide program; pass a shop id to delete only that shop's program
788
+ * (other shops' programs are left intact).
783
789
  */
784
- async delete(merchantId) {
790
+ async delete(merchantId, profileId) {
785
791
  await this.request("DELETE", "/merchant-fees/rules", {
786
- query: { merchant_id: merchantId }
792
+ query: { merchant_id: merchantId, profile_id: profileId }
787
793
  });
788
794
  }
789
795
  };
@@ -4036,6 +4042,41 @@ var Configs = class {
4036
4042
  }
4037
4043
  };
4038
4044
 
4045
+ // src/internal/resources/connectorRestrictionRules.ts
4046
+ var BASE = "/admin/connector-restriction-rules";
4047
+ var ConnectorRestrictionRules = class {
4048
+ constructor(request) {
4049
+ this.request = request;
4050
+ }
4051
+ /**
4052
+ * Create one allow/deny rule. A duplicate
4053
+ * `(merchant_id, scope, scope_id, connector)` is rejected — update or delete
4054
+ * the existing rule instead.
4055
+ */
4056
+ async create(body) {
4057
+ return this.request("POST", BASE, { body });
4058
+ }
4059
+ /**
4060
+ * List rules for one scope (`scope` + `scope_id`) or a whole merchant
4061
+ * (`merchant_id`). Pass exactly one selector.
4062
+ */
4063
+ async list(query) {
4064
+ return this.request("GET", BASE, { query: { ...query } });
4065
+ }
4066
+ /** Retrieve a single rule by ID. */
4067
+ async retrieve(id) {
4068
+ return this.request("GET", `${BASE}/${encodeURIComponent(id)}`);
4069
+ }
4070
+ /** Update a rule's action and/or reason. */
4071
+ async update(id, body) {
4072
+ return this.request("PATCH", `${BASE}/${encodeURIComponent(id)}`, { body });
4073
+ }
4074
+ /** Delete a rule by ID. */
4075
+ async delete(id) {
4076
+ return this.request("DELETE", `${BASE}/${encodeURIComponent(id)}`);
4077
+ }
4078
+ };
4079
+
4039
4080
  // src/internal/resources/connectorRestrictions.ts
4040
4081
  var ConnectorRestrictions = class {
4041
4082
  constructor(request) {
@@ -4202,16 +4243,22 @@ var PlatformFeeRulesManager = class {
4202
4243
  query: { merchant_id: merchantId }
4203
4244
  });
4204
4245
  }
4205
- /** Retrieve the active platform fee-rule program for a merchant, or `null`. */
4206
- async retrieve(merchantId) {
4246
+ /**
4247
+ * Retrieve the active platform fee-rule program for a scope, or `null`.
4248
+ * `profileId` omitted = merchant-wide program; set = that shop's program.
4249
+ */
4250
+ async retrieve(merchantId, profileId) {
4207
4251
  return this.request("GET", "/admin/fees/rules", {
4208
- query: { merchant_id: merchantId }
4252
+ query: { merchant_id: merchantId, profile_id: profileId }
4209
4253
  });
4210
4254
  }
4211
- /** Deactivate the platform fee-rule program for a merchant. Idempotent. */
4212
- async delete(merchantId) {
4255
+ /**
4256
+ * Deactivate a platform fee-rule program. Idempotent. `profileId` omitted
4257
+ * targets the merchant-wide program; set targets only that shop's program.
4258
+ */
4259
+ async delete(merchantId, profileId) {
4213
4260
  await this.request("DELETE", "/admin/fees/rules", {
4214
- query: { merchant_id: merchantId }
4261
+ query: { merchant_id: merchantId, profile_id: profileId }
4215
4262
  });
4216
4263
  }
4217
4264
  };
@@ -4228,6 +4275,7 @@ var DelopayInternal = class extends Delopay {
4228
4275
  this.cardIssuers = new CardIssuers(request);
4229
4276
  this.configs = new Configs(request);
4230
4277
  this.connectorRestrictions = new ConnectorRestrictions(request);
4278
+ this.connectorRestrictionRules = new ConnectorRestrictionRules(request);
4231
4279
  this.gsm = new Gsm(request);
4232
4280
  this.platformBilling = new PlatformBilling(request);
4233
4281
  this.platformFees = new PlatformFees(request);
@@ -4247,6 +4295,7 @@ var DelopayInternal = class extends Delopay {
4247
4295
  CardIssuers,
4248
4296
  Cards,
4249
4297
  Configs,
4298
+ ConnectorRestrictionRules,
4250
4299
  ConnectorRestrictions,
4251
4300
  DEFAULT_BADGES,
4252
4301
  DEFAULT_BADGES_DARK,