@delopay/sdk 0.61.0 → 0.63.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/README.md +430 -421
- package/dist/{chunk-ADPSXHH7.js → chunk-JCO4CHY7.js} +60 -1
- package/dist/chunk-JCO4CHY7.js.map +1 -0
- package/dist/index.cjs +59 -0
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.cts +167 -8
- package/dist/index.d.ts +167 -8
- package/dist/index.js +1 -1
- package/dist/internal.cjs +59 -0
- package/dist/internal.cjs.map +1 -1
- package/dist/internal.d.cts +1 -1
- package/dist/internal.d.ts +1 -1
- package/dist/internal.js +1 -1
- package/dist/internal.js.map +1 -1
- package/package.json +63 -64
- package/dist/chunk-ADPSXHH7.js.map +0 -1
package/dist/index.cjs
CHANGED
|
@@ -1880,6 +1880,48 @@ var Routing = class {
|
|
|
1880
1880
|
* algorithm: { type: 'priority', data: [{ connector: 'stripe' }] },
|
|
1881
1881
|
* });
|
|
1882
1882
|
* ```
|
|
1883
|
+
*
|
|
1884
|
+
* @example Conditional volume split (advanced): cards → 90% epayouts / 10% stripe.
|
|
1885
|
+
* Rules run top-down (first match wins); `defaultSelection` is the fallback.
|
|
1886
|
+
* Splits must sum to 100; `amount` conditions are in minor units.
|
|
1887
|
+
* ```typescript
|
|
1888
|
+
* const config = await delopay.routing.create({
|
|
1889
|
+
* name: 'Card split 90/10',
|
|
1890
|
+
* profile_id: 'pro_...',
|
|
1891
|
+
* algorithm: {
|
|
1892
|
+
* type: 'advanced',
|
|
1893
|
+
* data: {
|
|
1894
|
+
* defaultSelection: { type: 'priority', data: [{ connector: 'stripe' }] },
|
|
1895
|
+
* rules: [
|
|
1896
|
+
* {
|
|
1897
|
+
* name: 'cards',
|
|
1898
|
+
* connectorSelection: {
|
|
1899
|
+
* type: 'volume_split',
|
|
1900
|
+
* data: [
|
|
1901
|
+
* { connector: { connector: 'epayouts' }, split: 90 },
|
|
1902
|
+
* { connector: { connector: 'stripe' }, split: 10 },
|
|
1903
|
+
* ],
|
|
1904
|
+
* },
|
|
1905
|
+
* statements: [
|
|
1906
|
+
* {
|
|
1907
|
+
* condition: [
|
|
1908
|
+
* {
|
|
1909
|
+
* lhs: 'payment_method',
|
|
1910
|
+
* comparison: 'equal',
|
|
1911
|
+
* value: { type: 'enum_variant', value: 'card' },
|
|
1912
|
+
* metadata: {},
|
|
1913
|
+
* },
|
|
1914
|
+
* ],
|
|
1915
|
+
* },
|
|
1916
|
+
* ],
|
|
1917
|
+
* },
|
|
1918
|
+
* ],
|
|
1919
|
+
* metadata: {},
|
|
1920
|
+
* },
|
|
1921
|
+
* },
|
|
1922
|
+
* });
|
|
1923
|
+
* await delopay.routing.activate(config.id);
|
|
1924
|
+
* ```
|
|
1883
1925
|
*/
|
|
1884
1926
|
async create(params) {
|
|
1885
1927
|
return this.request("POST", "/routing", { body: params });
|
|
@@ -2415,6 +2457,23 @@ var Users = class {
|
|
|
2415
2457
|
async addUser(params) {
|
|
2416
2458
|
return this.request("POST", "/user/employees/add", { body: params });
|
|
2417
2459
|
}
|
|
2460
|
+
/**
|
|
2461
|
+
* Impersonate one of your own team members — `POST /user/employees/impersonate`.
|
|
2462
|
+
*
|
|
2463
|
+
* Mints a session token **as** the given member, so the dashboard renders
|
|
2464
|
+
* exactly what they see (useful for support and role verification). The
|
|
2465
|
+
* caller needs the *Impersonation* permission, and the member's role must
|
|
2466
|
+
* rank **strictly below** the caller's (`Profile < Merchant < Organization`);
|
|
2467
|
+
* the server rejects self-impersonation, cross-merchant targets, and
|
|
2468
|
+
* equal/higher roles.
|
|
2469
|
+
*
|
|
2470
|
+
* The returned token is tab-scoped by design: open it in a fresh tab (e.g.
|
|
2471
|
+
* `/auth/impersonate?token=…`) rather than replacing the caller's own
|
|
2472
|
+
* session. No auth cookie is set on the response.
|
|
2473
|
+
*/
|
|
2474
|
+
async impersonateEmployee(params) {
|
|
2475
|
+
return this.request("POST", "/user/employees/impersonate", { body: params });
|
|
2476
|
+
}
|
|
2418
2477
|
async acceptInvitation(params) {
|
|
2419
2478
|
return this.request("POST", "/user/employees/invite/accept", { body: params });
|
|
2420
2479
|
}
|