@delopay/sdk 0.6.0 → 0.8.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/{chunk-LCF7ILAH.js → chunk-SPWI4Z6T.js} +6 -172
- package/dist/chunk-SPWI4Z6T.js.map +1 -0
- package/dist/index.cjs +5 -173
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +10 -367
- package/dist/index.d.ts +10 -367
- package/dist/index.js +1 -5
- package/dist/internal.cjs +153 -172
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +358 -10
- package/dist/internal.d.ts +358 -10
- package/dist/internal.js +145 -6
- package/dist/internal.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-LCF7ILAH.js.map +0 -1
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,
|
|
@@ -323,30 +321,6 @@ var Billing = class {
|
|
|
323
321
|
body: params
|
|
324
322
|
});
|
|
325
323
|
}
|
|
326
|
-
/**
|
|
327
|
-
* Admin: manually credit a merchant's balance (e.g. promotional credit).
|
|
328
|
-
*
|
|
329
|
-
* @param merchantId - The merchant account ID.
|
|
330
|
-
* @param params - Credit amount and reason.
|
|
331
|
-
* @returns The adjustment result.
|
|
332
|
-
*/
|
|
333
|
-
async adminCredit(merchantId, params) {
|
|
334
|
-
return this.request("POST", `/billing/${encodeURIComponent(merchantId)}/admin/credit`, {
|
|
335
|
-
body: params
|
|
336
|
-
});
|
|
337
|
-
}
|
|
338
|
-
/**
|
|
339
|
-
* Admin: manually debit a merchant's balance.
|
|
340
|
-
*
|
|
341
|
-
* @param merchantId - The merchant account ID.
|
|
342
|
-
* @param params - Debit amount and reason.
|
|
343
|
-
* @returns The adjustment result.
|
|
344
|
-
*/
|
|
345
|
-
async adminDebit(merchantId, params) {
|
|
346
|
-
return this.request("POST", `/billing/${encodeURIComponent(merchantId)}/admin/debit`, {
|
|
347
|
-
body: params
|
|
348
|
-
});
|
|
349
|
-
}
|
|
350
324
|
};
|
|
351
325
|
|
|
352
326
|
// src/resources/blocklist.ts
|
|
@@ -370,22 +344,6 @@ var Blocklist = class {
|
|
|
370
344
|
}
|
|
371
345
|
};
|
|
372
346
|
|
|
373
|
-
// src/resources/cardIssuers.ts
|
|
374
|
-
var CardIssuers = class {
|
|
375
|
-
constructor(request) {
|
|
376
|
-
this.request = request;
|
|
377
|
-
}
|
|
378
|
-
async create(params) {
|
|
379
|
-
return this.request("POST", "/card_issuers", { body: params });
|
|
380
|
-
}
|
|
381
|
-
async update(issuerId, params) {
|
|
382
|
-
return this.request("PUT", `/card_issuers/${encodeURIComponent(issuerId)}`, { body: params });
|
|
383
|
-
}
|
|
384
|
-
async list() {
|
|
385
|
-
return this.request("GET", "/card_issuers");
|
|
386
|
-
}
|
|
387
|
-
};
|
|
388
|
-
|
|
389
347
|
// src/resources/connectors.ts
|
|
390
348
|
var Connectors = class {
|
|
391
349
|
constructor(request) {
|
|
@@ -689,73 +647,15 @@ var Events = class {
|
|
|
689
647
|
};
|
|
690
648
|
|
|
691
649
|
// src/resources/fees.ts
|
|
692
|
-
var
|
|
693
|
-
constructor(request) {
|
|
694
|
-
this.request = request;
|
|
695
|
-
}
|
|
696
|
-
/**
|
|
697
|
-
* Create a new platform fee schedule for a merchant (admin only).
|
|
698
|
-
*
|
|
699
|
-
* @param params - Fee schedule parameters (percentage, flat fee, min/max).
|
|
700
|
-
* @param merchantId - The merchant account to attach the schedule to.
|
|
701
|
-
* @returns The created fee schedule.
|
|
702
|
-
*/
|
|
703
|
-
async create(params, merchantId) {
|
|
704
|
-
return this.request("POST", "/admin/fees", {
|
|
705
|
-
body: params,
|
|
706
|
-
query: { merchant_id: merchantId }
|
|
707
|
-
});
|
|
708
|
-
}
|
|
709
|
-
/**
|
|
710
|
-
* List all platform fee schedules for a merchant (admin only).
|
|
711
|
-
*
|
|
712
|
-
* @param merchantId - The merchant account ID.
|
|
713
|
-
* @returns Array of fee schedules.
|
|
714
|
-
*/
|
|
715
|
-
async list(merchantId) {
|
|
716
|
-
return this.request("GET", "/admin/fees/list", {
|
|
717
|
-
query: { merchant_id: merchantId }
|
|
718
|
-
});
|
|
719
|
-
}
|
|
720
|
-
/**
|
|
721
|
-
* Retrieve a single fee schedule by ID (admin only).
|
|
722
|
-
*
|
|
723
|
-
* @param feeId - The fee schedule ID.
|
|
724
|
-
* @returns The fee schedule.
|
|
725
|
-
*/
|
|
726
|
-
async retrieve(feeId) {
|
|
727
|
-
return this.request("GET", `/admin/fees/${encodeURIComponent(feeId)}`);
|
|
728
|
-
}
|
|
729
|
-
/**
|
|
730
|
-
* Update a fee schedule (admin only).
|
|
731
|
-
*
|
|
732
|
-
* @param feeId - The fee schedule ID to update.
|
|
733
|
-
* @param params - Fields to update.
|
|
734
|
-
* @returns The updated fee schedule.
|
|
735
|
-
*/
|
|
736
|
-
async update(feeId, params) {
|
|
737
|
-
return this.request("PUT", `/admin/fees/${encodeURIComponent(feeId)}`, { body: params });
|
|
738
|
-
}
|
|
739
|
-
/**
|
|
740
|
-
* Delete a fee schedule (admin only).
|
|
741
|
-
*
|
|
742
|
-
* @param feeId - The fee schedule ID to delete.
|
|
743
|
-
* @returns The deleted fee schedule.
|
|
744
|
-
*/
|
|
745
|
-
async delete(feeId) {
|
|
746
|
-
return this.request("DELETE", `/admin/fees/${encodeURIComponent(feeId)}`);
|
|
747
|
-
}
|
|
748
|
-
};
|
|
749
|
-
var MerchantFees = class {
|
|
650
|
+
var Fees = class {
|
|
750
651
|
constructor(request) {
|
|
751
652
|
this.request = request;
|
|
752
653
|
}
|
|
753
654
|
/**
|
|
754
|
-
* Create a merchant-scoped fee schedule
|
|
655
|
+
* Create a merchant-scoped fee schedule (optionally per-shop).
|
|
755
656
|
*
|
|
756
657
|
* @param params - Fee schedule parameters.
|
|
757
658
|
* @param merchantId - The merchant account ID.
|
|
758
|
-
* @returns The created fee schedule.
|
|
759
659
|
*/
|
|
760
660
|
async create(params, merchantId) {
|
|
761
661
|
return this.request("POST", "/merchant_fees", {
|
|
@@ -764,10 +664,9 @@ var MerchantFees = class {
|
|
|
764
664
|
});
|
|
765
665
|
}
|
|
766
666
|
/**
|
|
767
|
-
* List merchant
|
|
667
|
+
* List the merchant's own fee schedules.
|
|
768
668
|
*
|
|
769
669
|
* @param merchantId - The merchant account ID.
|
|
770
|
-
* @returns Array of fee schedules.
|
|
771
670
|
*/
|
|
772
671
|
async list(merchantId) {
|
|
773
672
|
return this.request("GET", "/merchant_fees/list", {
|
|
@@ -777,9 +676,8 @@ var MerchantFees = class {
|
|
|
777
676
|
/**
|
|
778
677
|
* Update a merchant-scoped fee schedule.
|
|
779
678
|
*
|
|
780
|
-
* @param feeId - The fee schedule ID
|
|
679
|
+
* @param feeId - The fee schedule ID.
|
|
781
680
|
* @param params - Fields to update.
|
|
782
|
-
* @returns The updated fee schedule.
|
|
783
681
|
*/
|
|
784
682
|
async update(feeId, params) {
|
|
785
683
|
return this.request("PUT", `/merchant_fees/${encodeURIComponent(feeId)}`, { body: params });
|
|
@@ -787,38 +685,12 @@ var MerchantFees = class {
|
|
|
787
685
|
/**
|
|
788
686
|
* Delete a merchant-scoped fee schedule.
|
|
789
687
|
*
|
|
790
|
-
* @param feeId - The fee schedule ID
|
|
791
|
-
* @returns The deleted fee schedule.
|
|
688
|
+
* @param feeId - The fee schedule ID.
|
|
792
689
|
*/
|
|
793
690
|
async delete(feeId) {
|
|
794
691
|
return this.request("DELETE", `/merchant_fees/${encodeURIComponent(feeId)}`);
|
|
795
692
|
}
|
|
796
693
|
};
|
|
797
|
-
var Fees = class {
|
|
798
|
-
constructor(request) {
|
|
799
|
-
this.platform = new PlatformFees(request);
|
|
800
|
-
this.merchant = new MerchantFees(request);
|
|
801
|
-
}
|
|
802
|
-
};
|
|
803
|
-
|
|
804
|
-
// src/resources/gsm.ts
|
|
805
|
-
var Gsm = class {
|
|
806
|
-
constructor(request) {
|
|
807
|
-
this.request = request;
|
|
808
|
-
}
|
|
809
|
-
async create(params) {
|
|
810
|
-
return this.request("POST", "/gsm", { body: params });
|
|
811
|
-
}
|
|
812
|
-
async retrieve(params) {
|
|
813
|
-
return this.request("POST", "/gsm/get", { body: params });
|
|
814
|
-
}
|
|
815
|
-
async update(params) {
|
|
816
|
-
return this.request("POST", "/gsm/update", { body: params });
|
|
817
|
-
}
|
|
818
|
-
async delete(params) {
|
|
819
|
-
return this.request("POST", "/gsm/delete", { body: params });
|
|
820
|
-
}
|
|
821
|
-
};
|
|
822
694
|
|
|
823
695
|
// src/resources/mandates.ts
|
|
824
696
|
var Mandates = class {
|
|
@@ -2420,17 +2292,6 @@ var AnalyticsDashboard = class {
|
|
|
2420
2292
|
}
|
|
2421
2293
|
};
|
|
2422
2294
|
|
|
2423
|
-
// src/resources/cache.ts
|
|
2424
|
-
var Cache = class {
|
|
2425
|
-
constructor(request) {
|
|
2426
|
-
this.request = request;
|
|
2427
|
-
}
|
|
2428
|
-
/** Invalidate a cache entry by key. `POST /cache/invalidate/{key}` */
|
|
2429
|
-
async invalidate(key) {
|
|
2430
|
-
return this.request("POST", `/cache/invalidate/${encodeURIComponent(key)}`);
|
|
2431
|
-
}
|
|
2432
|
-
};
|
|
2433
|
-
|
|
2434
2295
|
// src/resources/cards.ts
|
|
2435
2296
|
var Cards = class {
|
|
2436
2297
|
constructor(request) {
|
|
@@ -2450,29 +2311,6 @@ var Cards = class {
|
|
|
2450
2311
|
}
|
|
2451
2312
|
};
|
|
2452
2313
|
|
|
2453
|
-
// src/resources/configs.ts
|
|
2454
|
-
var Configs = class {
|
|
2455
|
-
constructor(request) {
|
|
2456
|
-
this.request = request;
|
|
2457
|
-
}
|
|
2458
|
-
/** Create a config. `POST /configs` */
|
|
2459
|
-
async create(params) {
|
|
2460
|
-
return this.request("POST", "/configs", { body: params });
|
|
2461
|
-
}
|
|
2462
|
-
/** Retrieve a config by key. `GET /configs/{key}` */
|
|
2463
|
-
async retrieve(key) {
|
|
2464
|
-
return this.request("GET", `/configs/${encodeURIComponent(key)}`);
|
|
2465
|
-
}
|
|
2466
|
-
/** Update a config. `PUT /configs/{key}` */
|
|
2467
|
-
async update(key, params) {
|
|
2468
|
-
return this.request("PUT", `/configs/${encodeURIComponent(key)}`, { body: params });
|
|
2469
|
-
}
|
|
2470
|
-
/** Delete a config. `DELETE /configs/{key}` */
|
|
2471
|
-
async delete(key) {
|
|
2472
|
-
return this.request("DELETE", `/configs/${encodeURIComponent(key)}`);
|
|
2473
|
-
}
|
|
2474
|
-
};
|
|
2475
|
-
|
|
2476
2314
|
// src/resources/export.ts
|
|
2477
2315
|
var Export = class {
|
|
2478
2316
|
constructor(request) {
|
|
@@ -2734,9 +2572,7 @@ var Delopay = class {
|
|
|
2734
2572
|
this.apiKeys = new ApiKeys(request);
|
|
2735
2573
|
this.billing = new Billing(request);
|
|
2736
2574
|
this.blocklist = new Blocklist(request);
|
|
2737
|
-
this.cardIssuers = new CardIssuers(request);
|
|
2738
2575
|
this.fees = new Fees(request);
|
|
2739
|
-
this.gsm = new Gsm(request);
|
|
2740
2576
|
this.merchantAccounts = new MerchantAccounts(request);
|
|
2741
2577
|
this.projects = new Projects(request);
|
|
2742
2578
|
this.relay = new Relay(request);
|
|
@@ -2751,8 +2587,6 @@ var Delopay = class {
|
|
|
2751
2587
|
this.analyticsDashboard = new AnalyticsDashboard(request);
|
|
2752
2588
|
this.featureMatrix = new FeatureMatrix(request);
|
|
2753
2589
|
this.cards = new Cards(request);
|
|
2754
|
-
this.configs = new Configs(request);
|
|
2755
|
-
this.cache = new Cache(request);
|
|
2756
2590
|
}
|
|
2757
2591
|
/**
|
|
2758
2592
|
* Set a JWT token for subsequent requests.
|
|
@@ -2982,9 +2816,7 @@ Delopay.webhooks = Webhooks;
|
|
|
2982
2816
|
0 && (module.exports = {
|
|
2983
2817
|
Analytics,
|
|
2984
2818
|
AnalyticsDashboard,
|
|
2985
|
-
Cache,
|
|
2986
2819
|
Cards,
|
|
2987
|
-
Configs,
|
|
2988
2820
|
Delopay,
|
|
2989
2821
|
DelopayAuthenticationError,
|
|
2990
2822
|
DelopayError,
|