@delopay/sdk 0.6.0 → 0.7.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/internal.cjs CHANGED
@@ -26,6 +26,7 @@ __export(internal_exports, {
26
26
  AnalyticsDashboard: () => AnalyticsDashboard,
27
27
  AuditLogs: () => AuditLogs,
28
28
  Cache: () => Cache,
29
+ CardIssuers: () => CardIssuers,
29
30
  Cards: () => Cards,
30
31
  Configs: () => Configs,
31
32
  Delopay: () => Delopay,
@@ -36,6 +37,8 @@ __export(internal_exports, {
36
37
  FeatureMatrix: () => FeatureMatrix,
37
38
  Files: () => Files,
38
39
  Forex: () => Forex,
40
+ Gsm: () => Gsm,
41
+ PlatformFees: () => PlatformFees,
39
42
  Regions: () => Regions,
40
43
  Subscriptions: () => Subscriptions,
41
44
  Webhooks: () => Webhooks
@@ -374,22 +377,6 @@ var Blocklist = class {
374
377
  }
375
378
  };
376
379
 
377
- // src/resources/cardIssuers.ts
378
- var CardIssuers = class {
379
- constructor(request) {
380
- this.request = request;
381
- }
382
- async create(params) {
383
- return this.request("POST", "/card_issuers", { body: params });
384
- }
385
- async update(issuerId, params) {
386
- return this.request("PUT", `/card_issuers/${encodeURIComponent(issuerId)}`, { body: params });
387
- }
388
- async list() {
389
- return this.request("GET", "/card_issuers");
390
- }
391
- };
392
-
393
380
  // src/resources/connectors.ts
394
381
  var Connectors = class {
395
382
  constructor(request) {
@@ -693,73 +680,15 @@ var Events = class {
693
680
  };
694
681
 
695
682
  // src/resources/fees.ts
696
- var PlatformFees = class {
697
- constructor(request) {
698
- this.request = request;
699
- }
700
- /**
701
- * Create a new platform fee schedule for a merchant (admin only).
702
- *
703
- * @param params - Fee schedule parameters (percentage, flat fee, min/max).
704
- * @param merchantId - The merchant account to attach the schedule to.
705
- * @returns The created fee schedule.
706
- */
707
- async create(params, merchantId) {
708
- return this.request("POST", "/admin/fees", {
709
- body: params,
710
- query: { merchant_id: merchantId }
711
- });
712
- }
713
- /**
714
- * List all platform fee schedules for a merchant (admin only).
715
- *
716
- * @param merchantId - The merchant account ID.
717
- * @returns Array of fee schedules.
718
- */
719
- async list(merchantId) {
720
- return this.request("GET", "/admin/fees/list", {
721
- query: { merchant_id: merchantId }
722
- });
723
- }
724
- /**
725
- * Retrieve a single fee schedule by ID (admin only).
726
- *
727
- * @param feeId - The fee schedule ID.
728
- * @returns The fee schedule.
729
- */
730
- async retrieve(feeId) {
731
- return this.request("GET", `/admin/fees/${encodeURIComponent(feeId)}`);
732
- }
733
- /**
734
- * Update a fee schedule (admin only).
735
- *
736
- * @param feeId - The fee schedule ID to update.
737
- * @param params - Fields to update.
738
- * @returns The updated fee schedule.
739
- */
740
- async update(feeId, params) {
741
- return this.request("PUT", `/admin/fees/${encodeURIComponent(feeId)}`, { body: params });
742
- }
743
- /**
744
- * Delete a fee schedule (admin only).
745
- *
746
- * @param feeId - The fee schedule ID to delete.
747
- * @returns The deleted fee schedule.
748
- */
749
- async delete(feeId) {
750
- return this.request("DELETE", `/admin/fees/${encodeURIComponent(feeId)}`);
751
- }
752
- };
753
- var MerchantFees = class {
683
+ var Fees = class {
754
684
  constructor(request) {
755
685
  this.request = request;
756
686
  }
757
687
  /**
758
- * Create a merchant-scoped fee schedule override for a specific shop.
688
+ * Create a merchant-scoped fee schedule (optionally per-shop).
759
689
  *
760
690
  * @param params - Fee schedule parameters.
761
691
  * @param merchantId - The merchant account ID.
762
- * @returns The created fee schedule.
763
692
  */
764
693
  async create(params, merchantId) {
765
694
  return this.request("POST", "/merchant_fees", {
@@ -768,10 +697,9 @@ var MerchantFees = class {
768
697
  });
769
698
  }
770
699
  /**
771
- * List merchant-scoped fee schedules.
700
+ * List the merchant's own fee schedules.
772
701
  *
773
702
  * @param merchantId - The merchant account ID.
774
- * @returns Array of fee schedules.
775
703
  */
776
704
  async list(merchantId) {
777
705
  return this.request("GET", "/merchant_fees/list", {
@@ -781,9 +709,8 @@ var MerchantFees = class {
781
709
  /**
782
710
  * Update a merchant-scoped fee schedule.
783
711
  *
784
- * @param feeId - The fee schedule ID to update.
712
+ * @param feeId - The fee schedule ID.
785
713
  * @param params - Fields to update.
786
- * @returns The updated fee schedule.
787
714
  */
788
715
  async update(feeId, params) {
789
716
  return this.request("PUT", `/merchant_fees/${encodeURIComponent(feeId)}`, { body: params });
@@ -791,38 +718,12 @@ var MerchantFees = class {
791
718
  /**
792
719
  * Delete a merchant-scoped fee schedule.
793
720
  *
794
- * @param feeId - The fee schedule ID to delete.
795
- * @returns The deleted fee schedule.
721
+ * @param feeId - The fee schedule ID.
796
722
  */
797
723
  async delete(feeId) {
798
724
  return this.request("DELETE", `/merchant_fees/${encodeURIComponent(feeId)}`);
799
725
  }
800
726
  };
801
- var Fees = class {
802
- constructor(request) {
803
- this.platform = new PlatformFees(request);
804
- this.merchant = new MerchantFees(request);
805
- }
806
- };
807
-
808
- // src/resources/gsm.ts
809
- var Gsm = class {
810
- constructor(request) {
811
- this.request = request;
812
- }
813
- async create(params) {
814
- return this.request("POST", "/gsm", { body: params });
815
- }
816
- async retrieve(params) {
817
- return this.request("POST", "/gsm/get", { body: params });
818
- }
819
- async update(params) {
820
- return this.request("POST", "/gsm/update", { body: params });
821
- }
822
- async delete(params) {
823
- return this.request("POST", "/gsm/delete", { body: params });
824
- }
825
- };
826
727
 
827
728
  // src/resources/mandates.ts
828
729
  var Mandates = class {
@@ -2424,17 +2325,6 @@ var AnalyticsDashboard = class {
2424
2325
  }
2425
2326
  };
2426
2327
 
2427
- // src/resources/cache.ts
2428
- var Cache = class {
2429
- constructor(request) {
2430
- this.request = request;
2431
- }
2432
- /** Invalidate a cache entry by key. `POST /cache/invalidate/{key}` */
2433
- async invalidate(key) {
2434
- return this.request("POST", `/cache/invalidate/${encodeURIComponent(key)}`);
2435
- }
2436
- };
2437
-
2438
2328
  // src/resources/cards.ts
2439
2329
  var Cards = class {
2440
2330
  constructor(request) {
@@ -2454,29 +2344,6 @@ var Cards = class {
2454
2344
  }
2455
2345
  };
2456
2346
 
2457
- // src/resources/configs.ts
2458
- var Configs = class {
2459
- constructor(request) {
2460
- this.request = request;
2461
- }
2462
- /** Create a config. `POST /configs` */
2463
- async create(params) {
2464
- return this.request("POST", "/configs", { body: params });
2465
- }
2466
- /** Retrieve a config by key. `GET /configs/{key}` */
2467
- async retrieve(key) {
2468
- return this.request("GET", `/configs/${encodeURIComponent(key)}`);
2469
- }
2470
- /** Update a config. `PUT /configs/{key}` */
2471
- async update(key, params) {
2472
- return this.request("PUT", `/configs/${encodeURIComponent(key)}`, { body: params });
2473
- }
2474
- /** Delete a config. `DELETE /configs/{key}` */
2475
- async delete(key) {
2476
- return this.request("DELETE", `/configs/${encodeURIComponent(key)}`);
2477
- }
2478
- };
2479
-
2480
2347
  // src/resources/export.ts
2481
2348
  var Export = class {
2482
2349
  constructor(request) {
@@ -2738,9 +2605,7 @@ var Delopay = class {
2738
2605
  this.apiKeys = new ApiKeys(request);
2739
2606
  this.billing = new Billing(request);
2740
2607
  this.blocklist = new Blocklist(request);
2741
- this.cardIssuers = new CardIssuers(request);
2742
2608
  this.fees = new Fees(request);
2743
- this.gsm = new Gsm(request);
2744
2609
  this.merchantAccounts = new MerchantAccounts(request);
2745
2610
  this.projects = new Projects(request);
2746
2611
  this.relay = new Relay(request);
@@ -2755,8 +2620,6 @@ var Delopay = class {
2755
2620
  this.analyticsDashboard = new AnalyticsDashboard(request);
2756
2621
  this.featureMatrix = new FeatureMatrix(request);
2757
2622
  this.cards = new Cards(request);
2758
- this.configs = new Configs(request);
2759
- this.cache = new Cache(request);
2760
2623
  }
2761
2624
  /**
2762
2625
  * Set a JWT token for subsequent requests.
@@ -2983,7 +2846,7 @@ var Delopay = class {
2983
2846
  /** Utility for verifying incoming webhook signatures (static, no instance needed). */
2984
2847
  Delopay.webhooks = Webhooks;
2985
2848
 
2986
- // src/resources/admin.ts
2849
+ // src/internal/resources/admin.ts
2987
2850
  var Admin = class {
2988
2851
  constructor(request) {
2989
2852
  this.request = request;
@@ -3023,7 +2886,7 @@ var Admin = class {
3023
2886
  }
3024
2887
  };
3025
2888
 
3026
- // src/resources/adminPortal.ts
2889
+ // src/internal/resources/adminPortal.ts
3027
2890
  var AdminPortal = class {
3028
2891
  constructor(request) {
3029
2892
  this.request = request;
@@ -3080,7 +2943,7 @@ var AdminPortal = class {
3080
2943
  }
3081
2944
  };
3082
2945
 
3083
- // src/resources/auditLogs.ts
2946
+ // src/internal/resources/auditLogs.ts
3084
2947
  var AuditLogs = class {
3085
2948
  constructor(request) {
3086
2949
  this.request = request;
@@ -3095,6 +2958,107 @@ var AuditLogs = class {
3095
2958
  }
3096
2959
  };
3097
2960
 
2961
+ // src/internal/resources/cache.ts
2962
+ var Cache = class {
2963
+ constructor(request) {
2964
+ this.request = request;
2965
+ }
2966
+ /** Invalidate a cache entry by key. `POST /cache/invalidate/{key}` */
2967
+ async invalidate(key) {
2968
+ return this.request("POST", `/cache/invalidate/${encodeURIComponent(key)}`);
2969
+ }
2970
+ };
2971
+
2972
+ // src/internal/resources/cardIssuers.ts
2973
+ var CardIssuers = class {
2974
+ constructor(request) {
2975
+ this.request = request;
2976
+ }
2977
+ async create(params) {
2978
+ return this.request("POST", "/card_issuers", { body: params });
2979
+ }
2980
+ async update(issuerId, params) {
2981
+ return this.request("PUT", `/card_issuers/${encodeURIComponent(issuerId)}`, { body: params });
2982
+ }
2983
+ async list() {
2984
+ return this.request("GET", "/card_issuers");
2985
+ }
2986
+ };
2987
+
2988
+ // src/internal/resources/configs.ts
2989
+ var Configs = class {
2990
+ constructor(request) {
2991
+ this.request = request;
2992
+ }
2993
+ /** Create a config. `POST /configs` */
2994
+ async create(params) {
2995
+ return this.request("POST", "/configs", { body: params });
2996
+ }
2997
+ /** Retrieve a config by key. `GET /configs/{key}` */
2998
+ async retrieve(key) {
2999
+ return this.request("GET", `/configs/${encodeURIComponent(key)}`);
3000
+ }
3001
+ /** Update a config. `PUT /configs/{key}` */
3002
+ async update(key, params) {
3003
+ return this.request("PUT", `/configs/${encodeURIComponent(key)}`, { body: params });
3004
+ }
3005
+ /** Delete a config. `DELETE /configs/{key}` */
3006
+ async delete(key) {
3007
+ return this.request("DELETE", `/configs/${encodeURIComponent(key)}`);
3008
+ }
3009
+ };
3010
+
3011
+ // src/internal/resources/gsm.ts
3012
+ var Gsm = class {
3013
+ constructor(request) {
3014
+ this.request = request;
3015
+ }
3016
+ async create(params) {
3017
+ return this.request("POST", "/gsm", { body: params });
3018
+ }
3019
+ async retrieve(params) {
3020
+ return this.request("POST", "/gsm/get", { body: params });
3021
+ }
3022
+ async update(params) {
3023
+ return this.request("POST", "/gsm/update", { body: params });
3024
+ }
3025
+ async delete(params) {
3026
+ return this.request("POST", "/gsm/delete", { body: params });
3027
+ }
3028
+ };
3029
+
3030
+ // src/internal/resources/platformFees.ts
3031
+ var PlatformFees = class {
3032
+ constructor(request) {
3033
+ this.request = request;
3034
+ }
3035
+ /** Create a platform fee schedule for a specific merchant. */
3036
+ async create(params, merchantId) {
3037
+ return this.request("POST", "/admin/fees", {
3038
+ body: params,
3039
+ query: { merchant_id: merchantId }
3040
+ });
3041
+ }
3042
+ /** List every platform fee schedule assigned to a merchant. */
3043
+ async list(merchantId) {
3044
+ return this.request("GET", "/admin/fees/list", {
3045
+ query: { merchant_id: merchantId }
3046
+ });
3047
+ }
3048
+ /** Retrieve a single platform fee schedule by ID. */
3049
+ async retrieve(feeId) {
3050
+ return this.request("GET", `/admin/fees/${encodeURIComponent(feeId)}`);
3051
+ }
3052
+ /** Update a platform fee schedule. */
3053
+ async update(feeId, params) {
3054
+ return this.request("PUT", `/admin/fees/${encodeURIComponent(feeId)}`, { body: params });
3055
+ }
3056
+ /** Delete a platform fee schedule. */
3057
+ async delete(feeId) {
3058
+ return this.request("DELETE", `/admin/fees/${encodeURIComponent(feeId)}`);
3059
+ }
3060
+ };
3061
+
3098
3062
  // src/internal/client.ts
3099
3063
  var DelopayInternal = class extends Delopay {
3100
3064
  constructor(...args) {
@@ -3103,6 +3067,11 @@ var DelopayInternal = class extends Delopay {
3103
3067
  this.admin = new Admin(request);
3104
3068
  this.adminPortal = new AdminPortal(request);
3105
3069
  this.auditLogs = new AuditLogs(request);
3070
+ this.cache = new Cache(request);
3071
+ this.cardIssuers = new CardIssuers(request);
3072
+ this.configs = new Configs(request);
3073
+ this.gsm = new Gsm(request);
3074
+ this.platformFees = new PlatformFees(request);
3106
3075
  }
3107
3076
  };
3108
3077
  // Annotate the CommonJS export names for ESM import in node:
@@ -3113,6 +3082,7 @@ var DelopayInternal = class extends Delopay {
3113
3082
  AnalyticsDashboard,
3114
3083
  AuditLogs,
3115
3084
  Cache,
3085
+ CardIssuers,
3116
3086
  Cards,
3117
3087
  Configs,
3118
3088
  Delopay,
@@ -3123,6 +3093,8 @@ var DelopayInternal = class extends Delopay {
3123
3093
  FeatureMatrix,
3124
3094
  Files,
3125
3095
  Forex,
3096
+ Gsm,
3097
+ PlatformFees,
3126
3098
  Regions,
3127
3099
  Subscriptions,
3128
3100
  Webhooks