@naturalpay/sdk 1.5.0 → 1.6.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.
Files changed (49) hide show
  1. package/dist/cjs/BaseClient.js +2 -2
  2. package/dist/cjs/api/resources/ach/client/Client.js +11 -3
  3. package/dist/cjs/api/resources/ach/client/requests/CancelAchParams.d.ts +2 -0
  4. package/dist/cjs/api/resources/ach/client/requests/GetAchRequest.d.ts +1 -0
  5. package/dist/cjs/api/resources/ach/client/requests/ListAchRequest.d.ts +1 -0
  6. package/dist/cjs/api/resources/ach/client/requests/NewAchParams.d.ts +2 -0
  7. package/dist/cjs/api/resources/externalParties/client/Client.js +11 -3
  8. package/dist/cjs/api/resources/externalParties/client/requests/GetExternalPartiesRequest.d.ts +1 -0
  9. package/dist/cjs/api/resources/externalParties/client/requests/ListExternalPartiesRequest.d.ts +1 -0
  10. package/dist/cjs/api/resources/externalParties/client/requests/NewExtPartyParams.d.ts +2 -0
  11. package/dist/cjs/api/resources/externalPartyAccounts/client/Client.js +11 -3
  12. package/dist/cjs/api/resources/externalPartyAccounts/client/requests/GetExternalPartyAccountsRequest.d.ts +1 -0
  13. package/dist/cjs/api/resources/externalPartyAccounts/client/requests/ListExternalPartyAccountsRequest.d.ts +1 -0
  14. package/dist/cjs/api/resources/externalPartyAccounts/client/requests/NewExtPartyAcctParams.d.ts +2 -0
  15. package/dist/cjs/serialization/resources/ach/client/requests/CancelAchParams.d.ts +1 -0
  16. package/dist/cjs/serialization/resources/ach/client/requests/CancelAchParams.js +1 -0
  17. package/dist/cjs/serialization/resources/ach/client/requests/NewAchParams.d.ts +1 -0
  18. package/dist/cjs/serialization/resources/ach/client/requests/NewAchParams.js +1 -0
  19. package/dist/cjs/serialization/resources/externalParties/client/requests/NewExtPartyParams.d.ts +1 -0
  20. package/dist/cjs/serialization/resources/externalParties/client/requests/NewExtPartyParams.js +1 -0
  21. package/dist/cjs/serialization/resources/externalPartyAccounts/client/requests/NewExtPartyAcctParams.d.ts +1 -0
  22. package/dist/cjs/serialization/resources/externalPartyAccounts/client/requests/NewExtPartyAcctParams.js +1 -0
  23. package/dist/cjs/version.d.ts +1 -1
  24. package/dist/cjs/version.js +1 -1
  25. package/dist/esm/BaseClient.mjs +2 -2
  26. package/dist/esm/api/resources/ach/client/Client.mjs +11 -3
  27. package/dist/esm/api/resources/ach/client/requests/CancelAchParams.d.mts +2 -0
  28. package/dist/esm/api/resources/ach/client/requests/GetAchRequest.d.mts +1 -0
  29. package/dist/esm/api/resources/ach/client/requests/ListAchRequest.d.mts +1 -0
  30. package/dist/esm/api/resources/ach/client/requests/NewAchParams.d.mts +2 -0
  31. package/dist/esm/api/resources/externalParties/client/Client.mjs +11 -3
  32. package/dist/esm/api/resources/externalParties/client/requests/GetExternalPartiesRequest.d.mts +1 -0
  33. package/dist/esm/api/resources/externalParties/client/requests/ListExternalPartiesRequest.d.mts +1 -0
  34. package/dist/esm/api/resources/externalParties/client/requests/NewExtPartyParams.d.mts +2 -0
  35. package/dist/esm/api/resources/externalPartyAccounts/client/Client.mjs +11 -3
  36. package/dist/esm/api/resources/externalPartyAccounts/client/requests/GetExternalPartyAccountsRequest.d.mts +1 -0
  37. package/dist/esm/api/resources/externalPartyAccounts/client/requests/ListExternalPartyAccountsRequest.d.mts +1 -0
  38. package/dist/esm/api/resources/externalPartyAccounts/client/requests/NewExtPartyAcctParams.d.mts +2 -0
  39. package/dist/esm/serialization/resources/ach/client/requests/CancelAchParams.d.mts +1 -0
  40. package/dist/esm/serialization/resources/ach/client/requests/CancelAchParams.mjs +1 -0
  41. package/dist/esm/serialization/resources/ach/client/requests/NewAchParams.d.mts +1 -0
  42. package/dist/esm/serialization/resources/ach/client/requests/NewAchParams.mjs +1 -0
  43. package/dist/esm/serialization/resources/externalParties/client/requests/NewExtPartyParams.d.mts +1 -0
  44. package/dist/esm/serialization/resources/externalParties/client/requests/NewExtPartyParams.mjs +1 -0
  45. package/dist/esm/serialization/resources/externalPartyAccounts/client/requests/NewExtPartyAcctParams.d.mts +1 -0
  46. package/dist/esm/serialization/resources/externalPartyAccounts/client/requests/NewExtPartyAcctParams.mjs +1 -0
  47. package/dist/esm/version.d.mts +1 -1
  48. package/dist/esm/version.mjs +1 -1
  49. package/package.json +1 -1
@@ -43,8 +43,8 @@ function normalizeClientOptions(options) {
43
43
  const headers = (0, headers_js_1.mergeHeaders)({
44
44
  "X-Fern-Language": "JavaScript",
45
45
  "X-Fern-SDK-Name": "@naturalpay/sdk",
46
- "X-Fern-SDK-Version": "1.5.0",
47
- "User-Agent": "@naturalpay/sdk/1.5.0",
46
+ "X-Fern-SDK-Version": "1.6.0",
47
+ "User-Agent": "@naturalpay/sdk/1.6.0",
48
48
  "X-Fern-Runtime": core.RUNTIME.type,
49
49
  "X-Fern-Runtime-Version": core.RUNTIME.version,
50
50
  "X-Agent-ID": options === null || options === void 0 ? void 0 : options.agentId,
@@ -99,8 +99,9 @@ class AchClient {
99
99
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
100
100
  const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
101
101
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
102
- const { status, direction, externalPartyId, externalPartyAccountId, limit, cursor } = request;
102
+ const { customerPartyId, status, direction, externalPartyId, externalPartyAccountId, limit, cursor } = request;
103
103
  const _queryParams = {
104
+ customerPartyId,
104
105
  status: status != null
105
106
  ? serializers.ListAchRequestStatus.jsonOrThrow(status, {
106
107
  unrecognizedObjectKeys: "strip",
@@ -339,7 +340,10 @@ class AchClient {
339
340
  __get(request, requestOptions) {
340
341
  return __awaiter(this, void 0, void 0, function* () {
341
342
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
342
- const { achId } = request;
343
+ const { achId, customerPartyId } = request;
344
+ const _queryParams = {
345
+ customerPartyId,
346
+ };
343
347
  const _authRequest = yield this._options.authProvider.getAuthRequest();
344
348
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
345
349
  "X-Agent-ID": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.agentId,
@@ -349,7 +353,11 @@ class AchClient {
349
353
  url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.NaturalEnvironment.Production, `ach/${core.url.encodePathParam(achId)}`),
350
354
  method: "GET",
351
355
  headers: _headers,
352
- queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
356
+ queryString: core.url
357
+ .queryBuilder()
358
+ .addMany(_queryParams)
359
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
360
+ .build(),
353
361
  timeoutMs: ((_l = (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.timeoutInSeconds) !== null && _l !== void 0 ? _l : 60) * 1000,
354
362
  maxRetries: (_m = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _m !== void 0 ? _m : (_o = this._options) === null || _o === void 0 ? void 0 : _o.maxRetries,
355
363
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -10,5 +10,7 @@ export interface CancelAchParams {
10
10
  achId: string;
11
11
  /** Unique key for safely retrying a request without creating duplicates. */
12
12
  idempotencyKey: string;
13
+ /** Defaults to your party. To act for another party, pass the ID of a party that has authorized you to act on its behalf. */
14
+ customerPartyId?: string;
13
15
  reason: string;
14
16
  }
@@ -6,4 +6,5 @@
6
6
  */
7
7
  export interface GetAchRequest {
8
8
  achId: string;
9
+ customerPartyId?: string;
9
10
  }
@@ -4,6 +4,7 @@ import type * as Natural from "../../../../index.js";
4
4
  * {}
5
5
  */
6
6
  export interface ListAchRequest {
7
+ customerPartyId?: string;
7
8
  status?: Natural.ListAchRequestStatus;
8
9
  direction?: Natural.ListAchRequestDirection;
9
10
  externalPartyId?: string;
@@ -13,6 +13,8 @@ import type * as Natural from "../../../../index.js";
13
13
  export interface NewAchParams {
14
14
  /** Unique key for safely retrying a request without creating duplicates. */
15
15
  idempotencyKey: string;
16
+ /** Customer party ID (pty_*). Omit to create for your own party; provide for delegated creation. */
17
+ customerPartyId?: string;
16
18
  direction: Natural.NewAchParamsDirection;
17
19
  /** Integer amount in the minor units of currency. */
18
20
  amount: number;
@@ -99,8 +99,9 @@ class ExternalPartiesClient {
99
99
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
100
100
  const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
101
101
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
102
- const { limit, cursor } = request;
102
+ const { customerPartyId, limit, cursor } = request;
103
103
  const _queryParams = {
104
+ customerPartyId,
104
105
  limit,
105
106
  cursor,
106
107
  };
@@ -334,7 +335,10 @@ class ExternalPartiesClient {
334
335
  __get(request, requestOptions) {
335
336
  return __awaiter(this, void 0, void 0, function* () {
336
337
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
337
- const { externalPartyId } = request;
338
+ const { externalPartyId, customerPartyId } = request;
339
+ const _queryParams = {
340
+ customerPartyId,
341
+ };
338
342
  const _authRequest = yield this._options.authProvider.getAuthRequest();
339
343
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
340
344
  "X-Agent-ID": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.agentId,
@@ -344,7 +348,11 @@ class ExternalPartiesClient {
344
348
  url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.NaturalEnvironment.Production, `external-parties/${core.url.encodePathParam(externalPartyId)}`),
345
349
  method: "GET",
346
350
  headers: _headers,
347
- queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
351
+ queryString: core.url
352
+ .queryBuilder()
353
+ .addMany(_queryParams)
354
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
355
+ .build(),
348
356
  timeoutMs: ((_l = (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.timeoutInSeconds) !== null && _l !== void 0 ? _l : 60) * 1000,
349
357
  maxRetries: (_m = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _m !== void 0 ? _m : (_o = this._options) === null || _o === void 0 ? void 0 : _o.maxRetries,
350
358
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -6,4 +6,5 @@
6
6
  */
7
7
  export interface GetExternalPartiesRequest {
8
8
  externalPartyId: string;
9
+ customerPartyId?: string;
9
10
  }
@@ -3,6 +3,7 @@
3
3
  * {}
4
4
  */
5
5
  export interface ListExternalPartiesRequest {
6
+ customerPartyId?: string;
6
7
  limit?: number;
7
8
  cursor?: string;
8
9
  }
@@ -19,6 +19,8 @@ import type * as Natural from "../../../../index.js";
19
19
  export interface NewExtPartyParams {
20
20
  /** Unique key for safely retrying a request without creating duplicates. */
21
21
  idempotencyKey: string;
22
+ /** Customer party ID (pty_*). Omit to create for your own party; provide for delegated creation. */
23
+ customerPartyId?: string;
22
24
  /** External party type. */
23
25
  kind: Natural.NewExtPartyParamsKind;
24
26
  /** External party name. */
@@ -101,9 +101,10 @@ class ExternalPartyAccountsClient {
101
101
  return __awaiter(this, void 0, void 0, function* () {
102
102
  const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
103
103
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
104
- const { externalPartyId, limit, cursor } = request;
104
+ const { externalPartyId, customerPartyId, limit, cursor } = request;
105
105
  const _queryParams = {
106
106
  externalPartyId,
107
+ customerPartyId,
107
108
  limit,
108
109
  cursor,
109
110
  };
@@ -334,7 +335,10 @@ class ExternalPartyAccountsClient {
334
335
  __get(request, requestOptions) {
335
336
  return __awaiter(this, void 0, void 0, function* () {
336
337
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
337
- const { externalPartyAccountId } = request;
338
+ const { externalPartyAccountId, customerPartyId } = request;
339
+ const _queryParams = {
340
+ customerPartyId,
341
+ };
338
342
  const _authRequest = yield this._options.authProvider.getAuthRequest();
339
343
  const _headers = (0, headers_js_1.mergeHeaders)(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, (0, headers_js_1.mergeOnlyDefinedHeaders)({
340
344
  "X-Agent-ID": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.agentId,
@@ -344,7 +348,11 @@ class ExternalPartyAccountsClient {
344
348
  url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.NaturalEnvironment.Production, `external-party-accounts/${core.url.encodePathParam(externalPartyAccountId)}`),
345
349
  method: "GET",
346
350
  headers: _headers,
347
- queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
351
+ queryString: core.url
352
+ .queryBuilder()
353
+ .addMany(_queryParams)
354
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
355
+ .build(),
348
356
  timeoutMs: ((_l = (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.timeoutInSeconds) !== null && _l !== void 0 ? _l : 60) * 1000,
349
357
  maxRetries: (_m = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _m !== void 0 ? _m : (_o = this._options) === null || _o === void 0 ? void 0 : _o.maxRetries,
350
358
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -6,4 +6,5 @@
6
6
  */
7
7
  export interface GetExternalPartyAccountsRequest {
8
8
  externalPartyAccountId: string;
9
+ customerPartyId?: string;
9
10
  }
@@ -6,6 +6,7 @@
6
6
  */
7
7
  export interface ListExternalPartyAccountsRequest {
8
8
  externalPartyId: string;
9
+ customerPartyId?: string;
9
10
  limit?: number;
10
11
  cursor?: string;
11
12
  }
@@ -16,6 +16,8 @@ import type * as Natural from "../../../../index.js";
16
16
  export interface NewExtPartyAcctParams {
17
17
  /** Unique key for safely retrying a request without creating duplicates. */
18
18
  idempotencyKey: string;
19
+ /** Customer party ID (pty_*). Omit to create for your own party; provide for delegated creation. */
20
+ customerPartyId?: string;
19
21
  /** External party ID (epty_*). */
20
22
  externalPartyId: string;
21
23
  accountDetails: Natural.NewUsBankAccountDetails;
@@ -4,6 +4,7 @@ import type * as serializers from "../../../../index.js";
4
4
  export declare const CancelAchParams: core.serialization.Schema<serializers.CancelAchParams.Raw, Omit<Natural.CancelAchParams, "achId" | "idempotencyKey">>;
5
5
  export declare namespace CancelAchParams {
6
6
  interface Raw {
7
+ customerPartyId?: string | null;
7
8
  reason: string;
8
9
  }
9
10
  }
@@ -37,5 +37,6 @@ Object.defineProperty(exports, "__esModule", { value: true });
37
37
  exports.CancelAchParams = void 0;
38
38
  const core = __importStar(require("../../../../../core/index.js"));
39
39
  exports.CancelAchParams = core.serialization.object({
40
+ customerPartyId: core.serialization.string().optional(),
40
41
  reason: core.serialization.string(),
41
42
  });
@@ -6,6 +6,7 @@ import { NewAchParamsDirection } from "../../types/NewAchParamsDirection.js";
6
6
  export declare const NewAchParams: core.serialization.Schema<serializers.NewAchParams.Raw, Omit<Natural.NewAchParams, "idempotencyKey">>;
7
7
  export declare namespace NewAchParams {
8
8
  interface Raw {
9
+ customerPartyId?: string | null;
9
10
  direction: NewAchParamsDirection.Raw;
10
11
  amount: number;
11
12
  currency?: NewAchParamsCurrency.Raw | null;
@@ -39,6 +39,7 @@ const core = __importStar(require("../../../../../core/index.js"));
39
39
  const NewAchParamsCurrency_js_1 = require("../../types/NewAchParamsCurrency.js");
40
40
  const NewAchParamsDirection_js_1 = require("../../types/NewAchParamsDirection.js");
41
41
  exports.NewAchParams = core.serialization.object({
42
+ customerPartyId: core.serialization.string().optional(),
42
43
  direction: NewAchParamsDirection_js_1.NewAchParamsDirection,
43
44
  amount: core.serialization.number(),
44
45
  currency: NewAchParamsCurrency_js_1.NewAchParamsCurrency.optional(),
@@ -6,6 +6,7 @@ import { NewExtPartyParamsKind } from "../../types/NewExtPartyParamsKind.js";
6
6
  export declare const NewExtPartyParams: core.serialization.Schema<serializers.NewExtPartyParams.Raw, Omit<Natural.NewExtPartyParams, "idempotencyKey">>;
7
7
  export declare namespace NewExtPartyParams {
8
8
  interface Raw {
9
+ customerPartyId?: string | null;
9
10
  kind: NewExtPartyParamsKind.Raw;
10
11
  name: string;
11
12
  email?: string | null;
@@ -39,6 +39,7 @@ const core = __importStar(require("../../../../../core/index.js"));
39
39
  const NewExtPartyParamsAddress_js_1 = require("../../types/NewExtPartyParamsAddress.js");
40
40
  const NewExtPartyParamsKind_js_1 = require("../../types/NewExtPartyParamsKind.js");
41
41
  exports.NewExtPartyParams = core.serialization.object({
42
+ customerPartyId: core.serialization.string().optional(),
42
43
  kind: NewExtPartyParamsKind_js_1.NewExtPartyParamsKind,
43
44
  name: core.serialization.string(),
44
45
  email: core.serialization.string().optional(),
@@ -5,6 +5,7 @@ import { NewUsBankAccountDetails } from "../../types/NewUsBankAccountDetails.js"
5
5
  export declare const NewExtPartyAcctParams: core.serialization.Schema<serializers.NewExtPartyAcctParams.Raw, Omit<Natural.NewExtPartyAcctParams, "idempotencyKey">>;
6
6
  export declare namespace NewExtPartyAcctParams {
7
7
  interface Raw {
8
+ customerPartyId?: string | null;
8
9
  externalPartyId: string;
9
10
  accountDetails: NewUsBankAccountDetails.Raw;
10
11
  institutionName?: (string | null | undefined) | null;
@@ -38,6 +38,7 @@ exports.NewExtPartyAcctParams = void 0;
38
38
  const core = __importStar(require("../../../../../core/index.js"));
39
39
  const NewUsBankAccountDetails_js_1 = require("../../types/NewUsBankAccountDetails.js");
40
40
  exports.NewExtPartyAcctParams = core.serialization.object({
41
+ customerPartyId: core.serialization.string().optional(),
41
42
  externalPartyId: core.serialization.string(),
42
43
  accountDetails: NewUsBankAccountDetails_js_1.NewUsBankAccountDetails,
43
44
  institutionName: core.serialization.string().optionalNullable(),
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.5.0";
1
+ export declare const SDK_VERSION = "1.6.0";
@@ -1,4 +1,4 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.SDK_VERSION = void 0;
4
- exports.SDK_VERSION = "1.5.0";
4
+ exports.SDK_VERSION = "1.6.0";
@@ -6,8 +6,8 @@ export function normalizeClientOptions(options) {
6
6
  const headers = mergeHeaders({
7
7
  "X-Fern-Language": "JavaScript",
8
8
  "X-Fern-SDK-Name": "@naturalpay/sdk",
9
- "X-Fern-SDK-Version": "1.5.0",
10
- "User-Agent": "@naturalpay/sdk/1.5.0",
9
+ "X-Fern-SDK-Version": "1.6.0",
10
+ "User-Agent": "@naturalpay/sdk/1.6.0",
11
11
  "X-Fern-Runtime": core.RUNTIME.type,
12
12
  "X-Fern-Runtime-Version": core.RUNTIME.version,
13
13
  "X-Agent-ID": options === null || options === void 0 ? void 0 : options.agentId,
@@ -63,8 +63,9 @@ export class AchClient {
63
63
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
64
64
  const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
65
65
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
66
- const { status, direction, externalPartyId, externalPartyAccountId, limit, cursor } = request;
66
+ const { customerPartyId, status, direction, externalPartyId, externalPartyAccountId, limit, cursor } = request;
67
67
  const _queryParams = {
68
+ customerPartyId,
68
69
  status: status != null
69
70
  ? serializers.ListAchRequestStatus.jsonOrThrow(status, {
70
71
  unrecognizedObjectKeys: "strip",
@@ -303,7 +304,10 @@ export class AchClient {
303
304
  __get(request, requestOptions) {
304
305
  return __awaiter(this, void 0, void 0, function* () {
305
306
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
306
- const { achId } = request;
307
+ const { achId, customerPartyId } = request;
308
+ const _queryParams = {
309
+ customerPartyId,
310
+ };
307
311
  const _authRequest = yield this._options.authProvider.getAuthRequest();
308
312
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
309
313
  "X-Agent-ID": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.agentId,
@@ -313,7 +317,11 @@ export class AchClient {
313
317
  url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.NaturalEnvironment.Production, `ach/${core.url.encodePathParam(achId)}`),
314
318
  method: "GET",
315
319
  headers: _headers,
316
- queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
320
+ queryString: core.url
321
+ .queryBuilder()
322
+ .addMany(_queryParams)
323
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
324
+ .build(),
317
325
  timeoutMs: ((_l = (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.timeoutInSeconds) !== null && _l !== void 0 ? _l : 60) * 1000,
318
326
  maxRetries: (_m = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _m !== void 0 ? _m : (_o = this._options) === null || _o === void 0 ? void 0 : _o.maxRetries,
319
327
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -10,5 +10,7 @@ export interface CancelAchParams {
10
10
  achId: string;
11
11
  /** Unique key for safely retrying a request without creating duplicates. */
12
12
  idempotencyKey: string;
13
+ /** Defaults to your party. To act for another party, pass the ID of a party that has authorized you to act on its behalf. */
14
+ customerPartyId?: string;
13
15
  reason: string;
14
16
  }
@@ -6,4 +6,5 @@
6
6
  */
7
7
  export interface GetAchRequest {
8
8
  achId: string;
9
+ customerPartyId?: string;
9
10
  }
@@ -4,6 +4,7 @@ import type * as Natural from "../../../../index.mjs";
4
4
  * {}
5
5
  */
6
6
  export interface ListAchRequest {
7
+ customerPartyId?: string;
7
8
  status?: Natural.ListAchRequestStatus;
8
9
  direction?: Natural.ListAchRequestDirection;
9
10
  externalPartyId?: string;
@@ -13,6 +13,8 @@ import type * as Natural from "../../../../index.mjs";
13
13
  export interface NewAchParams {
14
14
  /** Unique key for safely retrying a request without creating duplicates. */
15
15
  idempotencyKey: string;
16
+ /** Customer party ID (pty_*). Omit to create for your own party; provide for delegated creation. */
17
+ customerPartyId?: string;
16
18
  direction: Natural.NewAchParamsDirection;
17
19
  /** Integer amount in the minor units of currency. */
18
20
  amount: number;
@@ -63,8 +63,9 @@ export class ExternalPartiesClient {
63
63
  return __awaiter(this, arguments, void 0, function* (request = {}, requestOptions) {
64
64
  const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
65
65
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
66
- const { limit, cursor } = request;
66
+ const { customerPartyId, limit, cursor } = request;
67
67
  const _queryParams = {
68
+ customerPartyId,
68
69
  limit,
69
70
  cursor,
70
71
  };
@@ -298,7 +299,10 @@ export class ExternalPartiesClient {
298
299
  __get(request, requestOptions) {
299
300
  return __awaiter(this, void 0, void 0, function* () {
300
301
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
301
- const { externalPartyId } = request;
302
+ const { externalPartyId, customerPartyId } = request;
303
+ const _queryParams = {
304
+ customerPartyId,
305
+ };
302
306
  const _authRequest = yield this._options.authProvider.getAuthRequest();
303
307
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
304
308
  "X-Agent-ID": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.agentId,
@@ -308,7 +312,11 @@ export class ExternalPartiesClient {
308
312
  url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.NaturalEnvironment.Production, `external-parties/${core.url.encodePathParam(externalPartyId)}`),
309
313
  method: "GET",
310
314
  headers: _headers,
311
- queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
315
+ queryString: core.url
316
+ .queryBuilder()
317
+ .addMany(_queryParams)
318
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
319
+ .build(),
312
320
  timeoutMs: ((_l = (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.timeoutInSeconds) !== null && _l !== void 0 ? _l : 60) * 1000,
313
321
  maxRetries: (_m = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _m !== void 0 ? _m : (_o = this._options) === null || _o === void 0 ? void 0 : _o.maxRetries,
314
322
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -6,4 +6,5 @@
6
6
  */
7
7
  export interface GetExternalPartiesRequest {
8
8
  externalPartyId: string;
9
+ customerPartyId?: string;
9
10
  }
@@ -3,6 +3,7 @@
3
3
  * {}
4
4
  */
5
5
  export interface ListExternalPartiesRequest {
6
+ customerPartyId?: string;
6
7
  limit?: number;
7
8
  cursor?: string;
8
9
  }
@@ -19,6 +19,8 @@ import type * as Natural from "../../../../index.mjs";
19
19
  export interface NewExtPartyParams {
20
20
  /** Unique key for safely retrying a request without creating duplicates. */
21
21
  idempotencyKey: string;
22
+ /** Customer party ID (pty_*). Omit to create for your own party; provide for delegated creation. */
23
+ customerPartyId?: string;
22
24
  /** External party type. */
23
25
  kind: Natural.NewExtPartyParamsKind;
24
26
  /** External party name. */
@@ -65,9 +65,10 @@ export class ExternalPartyAccountsClient {
65
65
  return __awaiter(this, void 0, void 0, function* () {
66
66
  const list = core.HttpResponsePromise.interceptFunction((request) => __awaiter(this, void 0, void 0, function* () {
67
67
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
68
- const { externalPartyId, limit, cursor } = request;
68
+ const { externalPartyId, customerPartyId, limit, cursor } = request;
69
69
  const _queryParams = {
70
70
  externalPartyId,
71
+ customerPartyId,
71
72
  limit,
72
73
  cursor,
73
74
  };
@@ -298,7 +299,10 @@ export class ExternalPartyAccountsClient {
298
299
  __get(request, requestOptions) {
299
300
  return __awaiter(this, void 0, void 0, function* () {
300
301
  var _a, _b, _c, _d, _e, _f, _g, _h, _j, _k, _l, _m, _o, _p;
301
- const { externalPartyAccountId } = request;
302
+ const { externalPartyAccountId, customerPartyId } = request;
303
+ const _queryParams = {
304
+ customerPartyId,
305
+ };
302
306
  const _authRequest = yield this._options.authProvider.getAuthRequest();
303
307
  const _headers = mergeHeaders(_authRequest.headers, (_a = this._options) === null || _a === void 0 ? void 0 : _a.headers, mergeOnlyDefinedHeaders({
304
308
  "X-Agent-ID": (_b = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.agentId) !== null && _b !== void 0 ? _b : (_c = this._options) === null || _c === void 0 ? void 0 : _c.agentId,
@@ -308,7 +312,11 @@ export class ExternalPartyAccountsClient {
308
312
  url: core.url.join((_h = (_g = (yield core.Supplier.get(this._options.baseUrl))) !== null && _g !== void 0 ? _g : (yield core.Supplier.get(this._options.environment))) !== null && _h !== void 0 ? _h : environments.NaturalEnvironment.Production, `external-party-accounts/${core.url.encodePathParam(externalPartyAccountId)}`),
309
313
  method: "GET",
310
314
  headers: _headers,
311
- queryString: core.url.queryBuilder().mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams).build(),
315
+ queryString: core.url
316
+ .queryBuilder()
317
+ .addMany(_queryParams)
318
+ .mergeAdditional(requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.queryParams)
319
+ .build(),
312
320
  timeoutMs: ((_l = (_j = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.timeoutInSeconds) !== null && _j !== void 0 ? _j : (_k = this._options) === null || _k === void 0 ? void 0 : _k.timeoutInSeconds) !== null && _l !== void 0 ? _l : 60) * 1000,
313
321
  maxRetries: (_m = requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.maxRetries) !== null && _m !== void 0 ? _m : (_o = this._options) === null || _o === void 0 ? void 0 : _o.maxRetries,
314
322
  abortSignal: requestOptions === null || requestOptions === void 0 ? void 0 : requestOptions.abortSignal,
@@ -6,4 +6,5 @@
6
6
  */
7
7
  export interface GetExternalPartyAccountsRequest {
8
8
  externalPartyAccountId: string;
9
+ customerPartyId?: string;
9
10
  }
@@ -6,6 +6,7 @@
6
6
  */
7
7
  export interface ListExternalPartyAccountsRequest {
8
8
  externalPartyId: string;
9
+ customerPartyId?: string;
9
10
  limit?: number;
10
11
  cursor?: string;
11
12
  }
@@ -16,6 +16,8 @@ import type * as Natural from "../../../../index.mjs";
16
16
  export interface NewExtPartyAcctParams {
17
17
  /** Unique key for safely retrying a request without creating duplicates. */
18
18
  idempotencyKey: string;
19
+ /** Customer party ID (pty_*). Omit to create for your own party; provide for delegated creation. */
20
+ customerPartyId?: string;
19
21
  /** External party ID (epty_*). */
20
22
  externalPartyId: string;
21
23
  accountDetails: Natural.NewUsBankAccountDetails;
@@ -4,6 +4,7 @@ import type * as serializers from "../../../../index.mjs";
4
4
  export declare const CancelAchParams: core.serialization.Schema<serializers.CancelAchParams.Raw, Omit<Natural.CancelAchParams, "achId" | "idempotencyKey">>;
5
5
  export declare namespace CancelAchParams {
6
6
  interface Raw {
7
+ customerPartyId?: string | null;
7
8
  reason: string;
8
9
  }
9
10
  }
@@ -1,5 +1,6 @@
1
1
  // This file was auto-generated by Fern from our API Definition.
2
2
  import * as core from "../../../../../core/index.mjs";
3
3
  export const CancelAchParams = core.serialization.object({
4
+ customerPartyId: core.serialization.string().optional(),
4
5
  reason: core.serialization.string(),
5
6
  });
@@ -6,6 +6,7 @@ import { NewAchParamsDirection } from "../../types/NewAchParamsDirection.mjs";
6
6
  export declare const NewAchParams: core.serialization.Schema<serializers.NewAchParams.Raw, Omit<Natural.NewAchParams, "idempotencyKey">>;
7
7
  export declare namespace NewAchParams {
8
8
  interface Raw {
9
+ customerPartyId?: string | null;
9
10
  direction: NewAchParamsDirection.Raw;
10
11
  amount: number;
11
12
  currency?: NewAchParamsCurrency.Raw | null;
@@ -3,6 +3,7 @@ import * as core from "../../../../../core/index.mjs";
3
3
  import { NewAchParamsCurrency } from "../../types/NewAchParamsCurrency.mjs";
4
4
  import { NewAchParamsDirection } from "../../types/NewAchParamsDirection.mjs";
5
5
  export const NewAchParams = core.serialization.object({
6
+ customerPartyId: core.serialization.string().optional(),
6
7
  direction: NewAchParamsDirection,
7
8
  amount: core.serialization.number(),
8
9
  currency: NewAchParamsCurrency.optional(),
@@ -6,6 +6,7 @@ import { NewExtPartyParamsKind } from "../../types/NewExtPartyParamsKind.mjs";
6
6
  export declare const NewExtPartyParams: core.serialization.Schema<serializers.NewExtPartyParams.Raw, Omit<Natural.NewExtPartyParams, "idempotencyKey">>;
7
7
  export declare namespace NewExtPartyParams {
8
8
  interface Raw {
9
+ customerPartyId?: string | null;
9
10
  kind: NewExtPartyParamsKind.Raw;
10
11
  name: string;
11
12
  email?: string | null;
@@ -3,6 +3,7 @@ import * as core from "../../../../../core/index.mjs";
3
3
  import { NewExtPartyParamsAddress } from "../../types/NewExtPartyParamsAddress.mjs";
4
4
  import { NewExtPartyParamsKind } from "../../types/NewExtPartyParamsKind.mjs";
5
5
  export const NewExtPartyParams = core.serialization.object({
6
+ customerPartyId: core.serialization.string().optional(),
6
7
  kind: NewExtPartyParamsKind,
7
8
  name: core.serialization.string(),
8
9
  email: core.serialization.string().optional(),
@@ -5,6 +5,7 @@ import { NewUsBankAccountDetails } from "../../types/NewUsBankAccountDetails.mjs
5
5
  export declare const NewExtPartyAcctParams: core.serialization.Schema<serializers.NewExtPartyAcctParams.Raw, Omit<Natural.NewExtPartyAcctParams, "idempotencyKey">>;
6
6
  export declare namespace NewExtPartyAcctParams {
7
7
  interface Raw {
8
+ customerPartyId?: string | null;
8
9
  externalPartyId: string;
9
10
  accountDetails: NewUsBankAccountDetails.Raw;
10
11
  institutionName?: (string | null | undefined) | null;
@@ -2,6 +2,7 @@
2
2
  import * as core from "../../../../../core/index.mjs";
3
3
  import { NewUsBankAccountDetails } from "../../types/NewUsBankAccountDetails.mjs";
4
4
  export const NewExtPartyAcctParams = core.serialization.object({
5
+ customerPartyId: core.serialization.string().optional(),
5
6
  externalPartyId: core.serialization.string(),
6
7
  accountDetails: NewUsBankAccountDetails,
7
8
  institutionName: core.serialization.string().optionalNullable(),
@@ -1 +1 @@
1
- export declare const SDK_VERSION = "1.5.0";
1
+ export declare const SDK_VERSION = "1.6.0";
@@ -1 +1 @@
1
- export const SDK_VERSION = "1.5.0";
1
+ export const SDK_VERSION = "1.6.0";
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@naturalpay/sdk",
3
- "version": "1.5.0",
3
+ "version": "1.6.0",
4
4
  "private": false,
5
5
  "repository": {
6
6
  "type": "git",