@delopay/sdk 0.5.1 → 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/index.cjs CHANGED
@@ -22,9 +22,7 @@ var index_exports = {};
22
22
  __export(index_exports, {
23
23
  Analytics: () => Analytics,
24
24
  AnalyticsDashboard: () => AnalyticsDashboard,
25
- Cache: () => Cache,
26
25
  Cards: () => Cards,
27
- Configs: () => Configs,
28
26
  Delopay: () => Delopay,
29
27
  DelopayAuthenticationError: () => DelopayAuthenticationError,
30
28
  DelopayError: () => DelopayError,
@@ -68,103 +66,6 @@ var DelopayAuthenticationError = class extends DelopayError {
68
66
  }
69
67
  };
70
68
 
71
- // src/resources/admin.ts
72
- var Admin = class {
73
- constructor(request) {
74
- this.request = request;
75
- }
76
- async signIn(params) {
77
- return this.request("POST", "/admin/signin", { body: params });
78
- }
79
- async createInternalUser(params) {
80
- return this.request("POST", "/admin/internal_signup", { body: params });
81
- }
82
- async createTenant(params) {
83
- return this.request("POST", "/admin/tenant_signup", { body: params });
84
- }
85
- /**
86
- * Create a new merchant admin user and merchant account atomically.
87
- *
88
- * This is the correct endpoint for bootstrapping the first admin user in a
89
- * fresh deployment — `internal_signup`/`tenant_signup` both require
90
- * pre-existing merchant records that don't exist on a clean database.
91
- *
92
- * `POST /admin/signup_with_merchant_id`
93
- */
94
- async signupWithMerchantId(params) {
95
- return this.request("POST", "/admin/signup_with_merchant_id", { body: params });
96
- }
97
- /** Toggle public signup on/off. `POST /admin/settings/signup` */
98
- async setSignupSettings(params) {
99
- return this.request("POST", "/admin/settings/signup", { body: params });
100
- }
101
- /** Read current public-signup status. `GET /admin/settings/signup` */
102
- async getSignupSettings() {
103
- return this.request("GET", "/admin/settings/signup");
104
- }
105
- /** Full merchant bootstrap — user + merchant + project + profile + keys. `POST /admin/onboard_merchant` */
106
- async onboardMerchant(params) {
107
- return this.request("POST", "/admin/onboard_merchant", { body: params });
108
- }
109
- };
110
-
111
- // src/resources/adminPortal.ts
112
- var AdminPortal = class {
113
- constructor(request) {
114
- this.request = request;
115
- }
116
- async listCustomers(params) {
117
- return this.request("GET", "/admin-portal/customers", {
118
- query: params
119
- });
120
- }
121
- async getCustomer(customerId) {
122
- return this.request("GET", `/admin-portal/customers/${encodeURIComponent(customerId)}`);
123
- }
124
- async listTransactions(params) {
125
- return this.request("GET", "/admin-portal/transactions", {
126
- query: params
127
- });
128
- }
129
- async analytics(params) {
130
- return this.request("GET", "/admin-portal/analytics", {
131
- query: params
132
- });
133
- }
134
- async overviewStats() {
135
- return this.request("GET", "/admin-portal/overview-stats");
136
- }
137
- async paymentAnalytics(params) {
138
- return this.request("GET", "/admin-portal/payment-analytics", {
139
- query: params
140
- });
141
- }
142
- /**
143
- * Retrieve a merchant account via the admin portal. Unlike
144
- * `merchantAccounts.retrieve`, this route accepts an admin JWT (or admin API
145
- * key) and does not require the JWT to be scoped to the target merchant.
146
- */
147
- async retrieveAccount(merchantId) {
148
- return this.request("GET", `/admin-portal/accounts/${encodeURIComponent(merchantId)}`);
149
- }
150
- /**
151
- * Update a merchant account via the admin portal. Authenticated via admin JWT
152
- * or admin API key.
153
- */
154
- async updateAccount(merchantId, params) {
155
- return this.request("POST", `/admin-portal/accounts/${encodeURIComponent(merchantId)}`, {
156
- body: params
157
- });
158
- }
159
- /**
160
- * Delete a merchant account via the admin portal. Authenticated via admin JWT
161
- * or admin API key.
162
- */
163
- async deleteAccount(merchantId) {
164
- return this.request("DELETE", `/admin-portal/accounts/${encodeURIComponent(merchantId)}`);
165
- }
166
- };
167
-
168
69
  // src/resources/apiKeys.ts
169
70
  var ApiKeys = class {
170
71
  constructor(request) {
@@ -237,21 +138,6 @@ var ApiKeys = class {
237
138
  }
238
139
  };
239
140
 
240
- // src/resources/auditLogs.ts
241
- var AuditLogs = class {
242
- constructor(request) {
243
- this.request = request;
244
- }
245
- async list(params) {
246
- return this.request("GET", "/admin-portal/audit", {
247
- query: params
248
- });
249
- }
250
- async retrieve(logId) {
251
- return this.request("GET", `/admin-portal/audit/${encodeURIComponent(logId)}`);
252
- }
253
- };
254
-
255
141
  // src/resources/authentication.ts
256
142
  var Authentication = class {
257
143
  constructor(request) {
@@ -482,22 +368,6 @@ var Blocklist = class {
482
368
  }
483
369
  };
484
370
 
485
- // src/resources/cardIssuers.ts
486
- var CardIssuers = class {
487
- constructor(request) {
488
- this.request = request;
489
- }
490
- async create(params) {
491
- return this.request("POST", "/card_issuers", { body: params });
492
- }
493
- async update(issuerId, params) {
494
- return this.request("PUT", `/card_issuers/${encodeURIComponent(issuerId)}`, { body: params });
495
- }
496
- async list() {
497
- return this.request("GET", "/card_issuers");
498
- }
499
- };
500
-
501
371
  // src/resources/connectors.ts
502
372
  var Connectors = class {
503
373
  constructor(request) {
@@ -801,73 +671,15 @@ var Events = class {
801
671
  };
802
672
 
803
673
  // src/resources/fees.ts
804
- var PlatformFees = class {
805
- constructor(request) {
806
- this.request = request;
807
- }
808
- /**
809
- * Create a new platform fee schedule for a merchant (admin only).
810
- *
811
- * @param params - Fee schedule parameters (percentage, flat fee, min/max).
812
- * @param merchantId - The merchant account to attach the schedule to.
813
- * @returns The created fee schedule.
814
- */
815
- async create(params, merchantId) {
816
- return this.request("POST", "/admin/fees", {
817
- body: params,
818
- query: { merchant_id: merchantId }
819
- });
820
- }
821
- /**
822
- * List all platform fee schedules for a merchant (admin only).
823
- *
824
- * @param merchantId - The merchant account ID.
825
- * @returns Array of fee schedules.
826
- */
827
- async list(merchantId) {
828
- return this.request("GET", "/admin/fees/list", {
829
- query: { merchant_id: merchantId }
830
- });
831
- }
832
- /**
833
- * Retrieve a single fee schedule by ID (admin only).
834
- *
835
- * @param feeId - The fee schedule ID.
836
- * @returns The fee schedule.
837
- */
838
- async retrieve(feeId) {
839
- return this.request("GET", `/admin/fees/${encodeURIComponent(feeId)}`);
840
- }
841
- /**
842
- * Update a fee schedule (admin only).
843
- *
844
- * @param feeId - The fee schedule ID to update.
845
- * @param params - Fields to update.
846
- * @returns The updated fee schedule.
847
- */
848
- async update(feeId, params) {
849
- return this.request("PUT", `/admin/fees/${encodeURIComponent(feeId)}`, { body: params });
850
- }
851
- /**
852
- * Delete a fee schedule (admin only).
853
- *
854
- * @param feeId - The fee schedule ID to delete.
855
- * @returns The deleted fee schedule.
856
- */
857
- async delete(feeId) {
858
- return this.request("DELETE", `/admin/fees/${encodeURIComponent(feeId)}`);
859
- }
860
- };
861
- var MerchantFees = class {
674
+ var Fees = class {
862
675
  constructor(request) {
863
676
  this.request = request;
864
677
  }
865
678
  /**
866
- * Create a merchant-scoped fee schedule override for a specific shop.
679
+ * Create a merchant-scoped fee schedule (optionally per-shop).
867
680
  *
868
681
  * @param params - Fee schedule parameters.
869
682
  * @param merchantId - The merchant account ID.
870
- * @returns The created fee schedule.
871
683
  */
872
684
  async create(params, merchantId) {
873
685
  return this.request("POST", "/merchant_fees", {
@@ -876,10 +688,9 @@ var MerchantFees = class {
876
688
  });
877
689
  }
878
690
  /**
879
- * List merchant-scoped fee schedules.
691
+ * List the merchant's own fee schedules.
880
692
  *
881
693
  * @param merchantId - The merchant account ID.
882
- * @returns Array of fee schedules.
883
694
  */
884
695
  async list(merchantId) {
885
696
  return this.request("GET", "/merchant_fees/list", {
@@ -889,9 +700,8 @@ var MerchantFees = class {
889
700
  /**
890
701
  * Update a merchant-scoped fee schedule.
891
702
  *
892
- * @param feeId - The fee schedule ID to update.
703
+ * @param feeId - The fee schedule ID.
893
704
  * @param params - Fields to update.
894
- * @returns The updated fee schedule.
895
705
  */
896
706
  async update(feeId, params) {
897
707
  return this.request("PUT", `/merchant_fees/${encodeURIComponent(feeId)}`, { body: params });
@@ -899,38 +709,12 @@ var MerchantFees = class {
899
709
  /**
900
710
  * Delete a merchant-scoped fee schedule.
901
711
  *
902
- * @param feeId - The fee schedule ID to delete.
903
- * @returns The deleted fee schedule.
712
+ * @param feeId - The fee schedule ID.
904
713
  */
905
714
  async delete(feeId) {
906
715
  return this.request("DELETE", `/merchant_fees/${encodeURIComponent(feeId)}`);
907
716
  }
908
717
  };
909
- var Fees = class {
910
- constructor(request) {
911
- this.platform = new PlatformFees(request);
912
- this.merchant = new MerchantFees(request);
913
- }
914
- };
915
-
916
- // src/resources/gsm.ts
917
- var Gsm = class {
918
- constructor(request) {
919
- this.request = request;
920
- }
921
- async create(params) {
922
- return this.request("POST", "/gsm", { body: params });
923
- }
924
- async retrieve(params) {
925
- return this.request("POST", "/gsm/get", { body: params });
926
- }
927
- async update(params) {
928
- return this.request("POST", "/gsm/update", { body: params });
929
- }
930
- async delete(params) {
931
- return this.request("POST", "/gsm/delete", { body: params });
932
- }
933
- };
934
718
 
935
719
  // src/resources/mandates.ts
936
720
  var Mandates = class {
@@ -2105,8 +1889,7 @@ var Users = class {
2105
1889
  * `generateRecoveryCodes`, `terminate2fa`) and setting it on the client
2106
1890
  * via `setJwtToken` before calling this method. `body.token` must still
2107
1891
  * be the original `EmailToken` from the reset-link URL — the handler
2108
- * decodes it a second time to find the user
2109
- * (`delopay-backend/crates/router/src/core/user.rs:687`).
1892
+ * decodes it a second time to find the user.
2110
1893
  */
2111
1894
  async resetPassword(params) {
2112
1895
  return this.request("POST", "/user/reset_password", { body: params });
@@ -2199,14 +1982,6 @@ var Users = class {
2199
1982
  async deleteUserRole(params) {
2200
1983
  return this.request("DELETE", "/user/user/delete", { body: params });
2201
1984
  }
2202
- async getDashboardMetadata(params) {
2203
- return this.request("GET", "/user/data", {
2204
- query: params
2205
- });
2206
- }
2207
- async setDashboardMetadata(params) {
2208
- return this.request("POST", "/user/data", { body: params });
2209
- }
2210
1985
  // --- Advanced methods (Task 4.7) ---
2211
1986
  /** Sign in (v2). `POST /user/v2/signin` */
2212
1987
  async signInV2(params) {
@@ -2296,10 +2071,6 @@ var Users = class {
2296
2071
  async resendInvite(params) {
2297
2072
  return this.request("POST", "/user/user/resend_invite", { body: params });
2298
2073
  }
2299
- /** Clone connector. `POST /user/clone_connector` */
2300
- async cloneConnector(params) {
2301
- return this.request("POST", "/user/clone_connector", { body: params });
2302
- }
2303
2074
  /** Get role (v2). `GET /user/role/v2` */
2304
2075
  async getRoleV2() {
2305
2076
  return this.request("GET", "/user/role/v2");
@@ -2545,17 +2316,6 @@ var AnalyticsDashboard = class {
2545
2316
  }
2546
2317
  };
2547
2318
 
2548
- // src/resources/cache.ts
2549
- var Cache = class {
2550
- constructor(request) {
2551
- this.request = request;
2552
- }
2553
- /** Invalidate a cache entry by key. `POST /cache/invalidate/{key}` */
2554
- async invalidate(key) {
2555
- return this.request("POST", `/cache/invalidate/${encodeURIComponent(key)}`);
2556
- }
2557
- };
2558
-
2559
2319
  // src/resources/cards.ts
2560
2320
  var Cards = class {
2561
2321
  constructor(request) {
@@ -2575,29 +2335,6 @@ var Cards = class {
2575
2335
  }
2576
2336
  };
2577
2337
 
2578
- // src/resources/configs.ts
2579
- var Configs = class {
2580
- constructor(request) {
2581
- this.request = request;
2582
- }
2583
- /** Create a config. `POST /configs` */
2584
- async create(params) {
2585
- return this.request("POST", "/configs", { body: params });
2586
- }
2587
- /** Retrieve a config by key. `GET /configs/{key}` */
2588
- async retrieve(key) {
2589
- return this.request("GET", `/configs/${encodeURIComponent(key)}`);
2590
- }
2591
- /** Update a config. `PUT /configs/{key}` */
2592
- async update(key, params) {
2593
- return this.request("PUT", `/configs/${encodeURIComponent(key)}`, { body: params });
2594
- }
2595
- /** Delete a config. `DELETE /configs/{key}` */
2596
- async delete(key) {
2597
- return this.request("DELETE", `/configs/${encodeURIComponent(key)}`);
2598
- }
2599
- };
2600
-
2601
2338
  // src/resources/export.ts
2602
2339
  var Export = class {
2603
2340
  constructor(request) {
@@ -2856,15 +2593,10 @@ var Delopay = class {
2856
2593
  this.authentication = new Authentication(request);
2857
2594
  this.verification = new Verification(request);
2858
2595
  this.users = new Users(request);
2859
- this.admin = new Admin(request);
2860
- this.adminPortal = new AdminPortal(request);
2861
2596
  this.apiKeys = new ApiKeys(request);
2862
- this.auditLogs = new AuditLogs(request);
2863
2597
  this.billing = new Billing(request);
2864
2598
  this.blocklist = new Blocklist(request);
2865
- this.cardIssuers = new CardIssuers(request);
2866
2599
  this.fees = new Fees(request);
2867
- this.gsm = new Gsm(request);
2868
2600
  this.merchantAccounts = new MerchantAccounts(request);
2869
2601
  this.projects = new Projects(request);
2870
2602
  this.relay = new Relay(request);
@@ -2879,8 +2611,6 @@ var Delopay = class {
2879
2611
  this.analyticsDashboard = new AnalyticsDashboard(request);
2880
2612
  this.featureMatrix = new FeatureMatrix(request);
2881
2613
  this.cards = new Cards(request);
2882
- this.configs = new Configs(request);
2883
- this.cache = new Cache(request);
2884
2614
  }
2885
2615
  /**
2886
2616
  * Set a JWT token for subsequent requests.
@@ -3110,9 +2840,7 @@ Delopay.webhooks = Webhooks;
3110
2840
  0 && (module.exports = {
3111
2841
  Analytics,
3112
2842
  AnalyticsDashboard,
3113
- Cache,
3114
2843
  Cards,
3115
- Configs,
3116
2844
  Delopay,
3117
2845
  DelopayAuthenticationError,
3118
2846
  DelopayError,