@delopay/sdk 0.39.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
@@ -767,24 +767,29 @@ var FeeRulesManager = class {
767
767
  });
768
768
  }
769
769
  /**
770
- * 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.
771
771
  *
772
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.
773
775
  */
774
- async retrieve(merchantId) {
776
+ async retrieve(merchantId, profileId) {
775
777
  return this.request("GET", "/merchant-fees/rules", {
776
- query: { merchant_id: merchantId }
778
+ query: { merchant_id: merchantId, profile_id: profileId }
777
779
  });
778
780
  }
779
781
  /**
780
- * Deactivate the merchant's active fee-rule program (falls back to the flat
781
- * fee schedules / volume tier). Idempotent.
782
+ * Deactivate a fee-rule program (falls back to the flat fee schedules /
783
+ * volume tier). Idempotent.
782
784
  *
783
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).
784
789
  */
785
- async delete(merchantId) {
790
+ async delete(merchantId, profileId) {
786
791
  await this.request("DELETE", "/merchant-fees/rules", {
787
- query: { merchant_id: merchantId }
792
+ query: { merchant_id: merchantId, profile_id: profileId }
788
793
  });
789
794
  }
790
795
  };
@@ -4238,16 +4243,22 @@ var PlatformFeeRulesManager = class {
4238
4243
  query: { merchant_id: merchantId }
4239
4244
  });
4240
4245
  }
4241
- /** Retrieve the active platform fee-rule program for a merchant, or `null`. */
4242
- 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) {
4243
4251
  return this.request("GET", "/admin/fees/rules", {
4244
- query: { merchant_id: merchantId }
4252
+ query: { merchant_id: merchantId, profile_id: profileId }
4245
4253
  });
4246
4254
  }
4247
- /** Deactivate the platform fee-rule program for a merchant. Idempotent. */
4248
- 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) {
4249
4260
  await this.request("DELETE", "/admin/fees/rules", {
4250
- query: { merchant_id: merchantId }
4261
+ query: { merchant_id: merchantId, profile_id: profileId }
4251
4262
  });
4252
4263
  }
4253
4264
  };