@delopay/sdk 0.113.0 → 0.115.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-NY5O6S5X.js → chunk-VH5NCMH6.js} +14 -1
- package/dist/chunk-VH5NCMH6.js.map +1 -0
- package/dist/index.cjs +13 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +23 -0
- package/dist/index.d.ts +23 -0
- package/dist/index.js +1 -1
- package/dist/internal.cjs +69 -0
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +109 -2
- package/dist/internal.d.ts +109 -2
- package/dist/internal.js +57 -1
- package/dist/internal.js.map +1 -1
- package/package.json +1 -1
- package/dist/chunk-NY5O6S5X.js.map +0 -1
package/dist/index.d.cts
CHANGED
|
@@ -1603,6 +1603,18 @@ interface BillingProfileResponse {
|
|
|
1603
1603
|
suspension_source?: string | null;
|
|
1604
1604
|
/** Admin-provided reason for a manual suspension. Absent otherwise. */
|
|
1605
1605
|
suspension_reason?: string | null;
|
|
1606
|
+
/**
|
|
1607
|
+
* Free (not billed) merchant. While set, no platform fee is deducted on
|
|
1608
|
+
* any payment, the payment gate never blocks on `billing_status`, top-ups
|
|
1609
|
+
* are refused and auto-recharge is inert. Orthogonal to `is_trusted`, which
|
|
1610
|
+
* only shields against suspension. Absent on a router that predates the
|
|
1611
|
+
* flag (delopay-backend#378); read absent as `false`.
|
|
1612
|
+
*/
|
|
1613
|
+
is_free?: boolean;
|
|
1614
|
+
/** Admin-provided reason the merchant is free. Absent when not free. */
|
|
1615
|
+
free_reason?: string | null;
|
|
1616
|
+
/** When the free flag was set (ISO 8601). Absent when not free. */
|
|
1617
|
+
free_set_at?: string | null;
|
|
1606
1618
|
created_at: string;
|
|
1607
1619
|
modified_at: string;
|
|
1608
1620
|
/**
|
|
@@ -8557,6 +8569,17 @@ declare class Routing {
|
|
|
8557
8569
|
updateDefault(params: Record<string, unknown>): Promise<RoutableConnectorChoice[]>;
|
|
8558
8570
|
/** Retrieve default config for profiles. `GET /routing/default/profile` */
|
|
8559
8571
|
getDefaultProfile(): Promise<RoutableConnectorChoice[] | ProfileDefaultRoutingConfig[]>;
|
|
8572
|
+
/**
|
|
8573
|
+
* Retrieve one profile's default config. `GET /routing/default/profile/{profileId}`
|
|
8574
|
+
*
|
|
8575
|
+
* The narrow counterpart of `getDefaultProfile()`: that one returns every
|
|
8576
|
+
* profile of the merchant and needs merchant-level routing read, so a
|
|
8577
|
+
* profile-scoped (shop) role could write its own default through
|
|
8578
|
+
* `updateDefaultProfile()` but never read it back. This read is gated on
|
|
8579
|
+
* profile-level routing read and pinned to the caller's own profile — a shop
|
|
8580
|
+
* role asking for a sibling profile is refused.
|
|
8581
|
+
*/
|
|
8582
|
+
getDefaultForProfile(profileId: string): Promise<ProfileDefaultRoutingConfig>;
|
|
8560
8583
|
/** Update default config for a profile. `POST /routing/default/profile/{profileId}` */
|
|
8561
8584
|
updateDefaultProfile(profileId: string, params: Record<string, unknown>): Promise<ProfileDefaultRoutingConfig>;
|
|
8562
8585
|
/** List routing configs for profile. `GET /routing/list/profile` */
|
package/dist/index.d.ts
CHANGED
|
@@ -1603,6 +1603,18 @@ interface BillingProfileResponse {
|
|
|
1603
1603
|
suspension_source?: string | null;
|
|
1604
1604
|
/** Admin-provided reason for a manual suspension. Absent otherwise. */
|
|
1605
1605
|
suspension_reason?: string | null;
|
|
1606
|
+
/**
|
|
1607
|
+
* Free (not billed) merchant. While set, no platform fee is deducted on
|
|
1608
|
+
* any payment, the payment gate never blocks on `billing_status`, top-ups
|
|
1609
|
+
* are refused and auto-recharge is inert. Orthogonal to `is_trusted`, which
|
|
1610
|
+
* only shields against suspension. Absent on a router that predates the
|
|
1611
|
+
* flag (delopay-backend#378); read absent as `false`.
|
|
1612
|
+
*/
|
|
1613
|
+
is_free?: boolean;
|
|
1614
|
+
/** Admin-provided reason the merchant is free. Absent when not free. */
|
|
1615
|
+
free_reason?: string | null;
|
|
1616
|
+
/** When the free flag was set (ISO 8601). Absent when not free. */
|
|
1617
|
+
free_set_at?: string | null;
|
|
1606
1618
|
created_at: string;
|
|
1607
1619
|
modified_at: string;
|
|
1608
1620
|
/**
|
|
@@ -8557,6 +8569,17 @@ declare class Routing {
|
|
|
8557
8569
|
updateDefault(params: Record<string, unknown>): Promise<RoutableConnectorChoice[]>;
|
|
8558
8570
|
/** Retrieve default config for profiles. `GET /routing/default/profile` */
|
|
8559
8571
|
getDefaultProfile(): Promise<RoutableConnectorChoice[] | ProfileDefaultRoutingConfig[]>;
|
|
8572
|
+
/**
|
|
8573
|
+
* Retrieve one profile's default config. `GET /routing/default/profile/{profileId}`
|
|
8574
|
+
*
|
|
8575
|
+
* The narrow counterpart of `getDefaultProfile()`: that one returns every
|
|
8576
|
+
* profile of the merchant and needs merchant-level routing read, so a
|
|
8577
|
+
* profile-scoped (shop) role could write its own default through
|
|
8578
|
+
* `updateDefaultProfile()` but never read it back. This read is gated on
|
|
8579
|
+
* profile-level routing read and pinned to the caller's own profile — a shop
|
|
8580
|
+
* role asking for a sibling profile is refused.
|
|
8581
|
+
*/
|
|
8582
|
+
getDefaultForProfile(profileId: string): Promise<ProfileDefaultRoutingConfig>;
|
|
8560
8583
|
/** Update default config for a profile. `POST /routing/default/profile/{profileId}` */
|
|
8561
8584
|
updateDefaultProfile(profileId: string, params: Record<string, unknown>): Promise<ProfileDefaultRoutingConfig>;
|
|
8562
8585
|
/** List routing configs for profile. `GET /routing/list/profile` */
|
package/dist/index.js
CHANGED
package/dist/internal.cjs
CHANGED
|
@@ -2536,6 +2536,19 @@ var Routing = class {
|
|
|
2536
2536
|
async getDefaultProfile() {
|
|
2537
2537
|
return this.request("GET", "/routing/default/profile");
|
|
2538
2538
|
}
|
|
2539
|
+
/**
|
|
2540
|
+
* Retrieve one profile's default config. `GET /routing/default/profile/{profileId}`
|
|
2541
|
+
*
|
|
2542
|
+
* The narrow counterpart of `getDefaultProfile()`: that one returns every
|
|
2543
|
+
* profile of the merchant and needs merchant-level routing read, so a
|
|
2544
|
+
* profile-scoped (shop) role could write its own default through
|
|
2545
|
+
* `updateDefaultProfile()` but never read it back. This read is gated on
|
|
2546
|
+
* profile-level routing read and pinned to the caller's own profile — a shop
|
|
2547
|
+
* role asking for a sibling profile is refused.
|
|
2548
|
+
*/
|
|
2549
|
+
async getDefaultForProfile(profileId) {
|
|
2550
|
+
return this.request("GET", `/routing/default/profile/${encodeURIComponent(profileId)}`);
|
|
2551
|
+
}
|
|
2539
2552
|
/** Update default config for a profile. `POST /routing/default/profile/{profileId}` */
|
|
2540
2553
|
async updateDefaultProfile(profileId, params) {
|
|
2541
2554
|
return this.request("POST", `/routing/default/profile/${encodeURIComponent(profileId)}`, {
|
|
@@ -7660,6 +7673,62 @@ var PlatformBilling = class {
|
|
|
7660
7673
|
body: params
|
|
7661
7674
|
});
|
|
7662
7675
|
}
|
|
7676
|
+
/**
|
|
7677
|
+
* Mark a merchant free (not billed), or put it back on the prepaid model
|
|
7678
|
+
* (delopay-backend#378). While free, no platform fee is deducted, the
|
|
7679
|
+
* payment gate never blocks on billing status, top-ups are refused and
|
|
7680
|
+
* auto-recharge is inert. Marking free needs a `reason` and is refused
|
|
7681
|
+
* (412) while an admin suspension is in force — lift that first.
|
|
7682
|
+
*
|
|
7683
|
+
* Requires a router with delopay-backend#378; older routers answer `404`.
|
|
7684
|
+
*
|
|
7685
|
+
* @param merchantId - The merchant account ID.
|
|
7686
|
+
* @param params - The desired free state and, when marking free, the reason.
|
|
7687
|
+
* @returns The updated billing profile.
|
|
7688
|
+
*/
|
|
7689
|
+
async setFree(merchantId, params) {
|
|
7690
|
+
return this.request("PATCH", `/billing/${encodeURIComponent(merchantId)}/admin/free`, {
|
|
7691
|
+
body: params
|
|
7692
|
+
});
|
|
7693
|
+
}
|
|
7694
|
+
/**
|
|
7695
|
+
* Delete a merchant's **entire** ledger (delopay-backend#378). Every live
|
|
7696
|
+
* entry is soft-deleted — kept, so a replayed fee deduction or top-up
|
|
7697
|
+
* webhook still no-ops — the balance is set to zero and the status
|
|
7698
|
+
* re-derived (`active` for a free merchant; an active paying merchant
|
|
7699
|
+
* lands in `delinquent`). Refused (412) while the merchant has shop
|
|
7700
|
+
* allocations. Audited.
|
|
7701
|
+
*
|
|
7702
|
+
* Requires a router with delopay-backend#378; older routers answer `404`.
|
|
7703
|
+
*
|
|
7704
|
+
* @param merchantId - The merchant account ID.
|
|
7705
|
+
* @param params - The reason, required for audit.
|
|
7706
|
+
* @returns What was removed and the post-reset profile.
|
|
7707
|
+
*/
|
|
7708
|
+
async resetLedger(merchantId, params) {
|
|
7709
|
+
return this.request("DELETE", `/billing/${encodeURIComponent(merchantId)}/admin/ledger`, {
|
|
7710
|
+
body: params
|
|
7711
|
+
});
|
|
7712
|
+
}
|
|
7713
|
+
/**
|
|
7714
|
+
* (Re)create a merchant's ledger, optionally seeded with an opening balance
|
|
7715
|
+
* (delopay-backend#378). Ensures the billing profile exists (created
|
|
7716
|
+
* without the welcome promo credit) and, when `opening_balance` is set,
|
|
7717
|
+
* writes one `opening_balance` entry through the same atomic helper an
|
|
7718
|
+
* admin credit uses. Refused (412) while live entries or a non-zero balance
|
|
7719
|
+
* remain — reset first. Does not clear the free flag. Audited.
|
|
7720
|
+
*
|
|
7721
|
+
* Requires a router with delopay-backend#378; older routers answer `404`.
|
|
7722
|
+
*
|
|
7723
|
+
* @param merchantId - The merchant account ID.
|
|
7724
|
+
* @param params - Opening balance (minor units), currency for a new profile, and the reason.
|
|
7725
|
+
* @returns The opening entry id (if one was written) and the profile.
|
|
7726
|
+
*/
|
|
7727
|
+
async createLedger(merchantId, params) {
|
|
7728
|
+
return this.request("POST", `/billing/${encodeURIComponent(merchantId)}/admin/ledger`, {
|
|
7729
|
+
body: params
|
|
7730
|
+
});
|
|
7731
|
+
}
|
|
7663
7732
|
};
|
|
7664
7733
|
|
|
7665
7734
|
// src/internal/resources/platformFees.ts
|