@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/dist/internal.cjs CHANGED
@@ -1892,6 +1892,48 @@ var Routing = class {
1892
1892
  * algorithm: { type: 'priority', data: [{ connector: 'stripe' }] },
1893
1893
  * });
1894
1894
  * ```
1895
+ *
1896
+ * @example Conditional volume split (advanced): cards → 90% epayouts / 10% stripe.
1897
+ * Rules run top-down (first match wins); `defaultSelection` is the fallback.
1898
+ * Splits must sum to 100; `amount` conditions are in minor units.
1899
+ * ```typescript
1900
+ * const config = await delopay.routing.create({
1901
+ * name: 'Card split 90/10',
1902
+ * profile_id: 'pro_...',
1903
+ * algorithm: {
1904
+ * type: 'advanced',
1905
+ * data: {
1906
+ * defaultSelection: { type: 'priority', data: [{ connector: 'stripe' }] },
1907
+ * rules: [
1908
+ * {
1909
+ * name: 'cards',
1910
+ * connectorSelection: {
1911
+ * type: 'volume_split',
1912
+ * data: [
1913
+ * { connector: { connector: 'epayouts' }, split: 90 },
1914
+ * { connector: { connector: 'stripe' }, split: 10 },
1915
+ * ],
1916
+ * },
1917
+ * statements: [
1918
+ * {
1919
+ * condition: [
1920
+ * {
1921
+ * lhs: 'payment_method',
1922
+ * comparison: 'equal',
1923
+ * value: { type: 'enum_variant', value: 'card' },
1924
+ * metadata: {},
1925
+ * },
1926
+ * ],
1927
+ * },
1928
+ * ],
1929
+ * },
1930
+ * ],
1931
+ * metadata: {},
1932
+ * },
1933
+ * },
1934
+ * });
1935
+ * await delopay.routing.activate(config.id);
1936
+ * ```
1895
1937
  */
1896
1938
  async create(params) {
1897
1939
  return this.request("POST", "/routing", { body: params });
@@ -2427,6 +2469,23 @@ var Users = class {
2427
2469
  async addUser(params) {
2428
2470
  return this.request("POST", "/user/employees/add", { body: params });
2429
2471
  }
2472
+ /**
2473
+ * Impersonate one of your own team members — `POST /user/employees/impersonate`.
2474
+ *
2475
+ * Mints a session token **as** the given member, so the dashboard renders
2476
+ * exactly what they see (useful for support and role verification). The
2477
+ * caller needs the *Impersonation* permission, and the member's role must
2478
+ * rank **strictly below** the caller's (`Profile < Merchant < Organization`);
2479
+ * the server rejects self-impersonation, cross-merchant targets, and
2480
+ * equal/higher roles.
2481
+ *
2482
+ * The returned token is tab-scoped by design: open it in a fresh tab (e.g.
2483
+ * `/auth/impersonate?token=…`) rather than replacing the caller's own
2484
+ * session. No auth cookie is set on the response.
2485
+ */
2486
+ async impersonateEmployee(params) {
2487
+ return this.request("POST", "/user/employees/impersonate", { body: params });
2488
+ }
2430
2489
  async acceptInvitation(params) {
2431
2490
  return this.request("POST", "/user/employees/invite/accept", { body: params });
2432
2491
  }