@naturalpay/sdk 1.5.0 → 1.6.1
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/cjs/BaseClient.js +2 -2
- package/dist/cjs/api/resources/ach/client/Client.js +11 -3
- package/dist/cjs/api/resources/ach/client/requests/CancelAchParams.d.ts +2 -0
- package/dist/cjs/api/resources/ach/client/requests/GetAchRequest.d.ts +1 -0
- package/dist/cjs/api/resources/ach/client/requests/ListAchRequest.d.ts +1 -0
- package/dist/cjs/api/resources/ach/client/requests/NewAchParams.d.ts +2 -0
- package/dist/cjs/api/resources/customers/client/Client.d.ts +1 -50
- package/dist/cjs/api/resources/customers/client/Client.js +1 -50
- package/dist/cjs/api/resources/customers/client/requests/CreateInvitationsCustomersRequest.d.ts +2 -51
- package/dist/cjs/api/resources/externalAccounts/client/Client.d.ts +5 -3
- package/dist/cjs/api/resources/externalAccounts/client/Client.js +5 -3
- package/dist/cjs/api/resources/externalAccounts/client/requests/CreateFromProcessorTokenExternalAccountsRequest.d.ts +3 -3
- package/dist/cjs/api/resources/externalParties/client/Client.js +11 -3
- package/dist/cjs/api/resources/externalParties/client/requests/GetExternalPartiesRequest.d.ts +1 -0
- package/dist/cjs/api/resources/externalParties/client/requests/ListExternalPartiesRequest.d.ts +1 -0
- package/dist/cjs/api/resources/externalParties/client/requests/NewExtPartyParams.d.ts +2 -0
- package/dist/cjs/api/resources/externalPartyAccounts/client/Client.js +11 -3
- package/dist/cjs/api/resources/externalPartyAccounts/client/requests/GetExternalPartyAccountsRequest.d.ts +1 -0
- package/dist/cjs/api/resources/externalPartyAccounts/client/requests/ListExternalPartyAccountsRequest.d.ts +1 -0
- package/dist/cjs/api/resources/externalPartyAccounts/client/requests/NewExtPartyAcctParams.d.ts +2 -0
- package/dist/cjs/api/resources/paymentRequests/client/requests/NewPayReqParams.d.ts +1 -1
- package/dist/cjs/api/resources/payments/client/requests/NewPaymentParams.d.ts +1 -1
- package/dist/cjs/serialization/resources/ach/client/requests/CancelAchParams.d.ts +1 -0
- package/dist/cjs/serialization/resources/ach/client/requests/CancelAchParams.js +1 -0
- package/dist/cjs/serialization/resources/ach/client/requests/NewAchParams.d.ts +1 -0
- package/dist/cjs/serialization/resources/ach/client/requests/NewAchParams.js +1 -0
- package/dist/cjs/serialization/resources/externalParties/client/requests/NewExtPartyParams.d.ts +1 -0
- package/dist/cjs/serialization/resources/externalParties/client/requests/NewExtPartyParams.js +1 -0
- package/dist/cjs/serialization/resources/externalPartyAccounts/client/requests/NewExtPartyAcctParams.d.ts +1 -0
- package/dist/cjs/serialization/resources/externalPartyAccounts/client/requests/NewExtPartyAcctParams.js +1 -0
- package/dist/cjs/version.d.ts +1 -1
- package/dist/cjs/version.js +1 -1
- package/dist/esm/BaseClient.mjs +2 -2
- package/dist/esm/api/resources/ach/client/Client.mjs +11 -3
- package/dist/esm/api/resources/ach/client/requests/CancelAchParams.d.mts +2 -0
- package/dist/esm/api/resources/ach/client/requests/GetAchRequest.d.mts +1 -0
- package/dist/esm/api/resources/ach/client/requests/ListAchRequest.d.mts +1 -0
- package/dist/esm/api/resources/ach/client/requests/NewAchParams.d.mts +2 -0
- package/dist/esm/api/resources/customers/client/Client.d.mts +1 -50
- package/dist/esm/api/resources/customers/client/Client.mjs +1 -50
- package/dist/esm/api/resources/customers/client/requests/CreateInvitationsCustomersRequest.d.mts +2 -51
- package/dist/esm/api/resources/externalAccounts/client/Client.d.mts +5 -3
- package/dist/esm/api/resources/externalAccounts/client/Client.mjs +5 -3
- package/dist/esm/api/resources/externalAccounts/client/requests/CreateFromProcessorTokenExternalAccountsRequest.d.mts +3 -3
- package/dist/esm/api/resources/externalParties/client/Client.mjs +11 -3
- package/dist/esm/api/resources/externalParties/client/requests/GetExternalPartiesRequest.d.mts +1 -0
- package/dist/esm/api/resources/externalParties/client/requests/ListExternalPartiesRequest.d.mts +1 -0
- package/dist/esm/api/resources/externalParties/client/requests/NewExtPartyParams.d.mts +2 -0
- package/dist/esm/api/resources/externalPartyAccounts/client/Client.mjs +11 -3
- package/dist/esm/api/resources/externalPartyAccounts/client/requests/GetExternalPartyAccountsRequest.d.mts +1 -0
- package/dist/esm/api/resources/externalPartyAccounts/client/requests/ListExternalPartyAccountsRequest.d.mts +1 -0
- package/dist/esm/api/resources/externalPartyAccounts/client/requests/NewExtPartyAcctParams.d.mts +2 -0
- package/dist/esm/api/resources/paymentRequests/client/requests/NewPayReqParams.d.mts +1 -1
- package/dist/esm/api/resources/payments/client/requests/NewPaymentParams.d.mts +1 -1
- package/dist/esm/serialization/resources/ach/client/requests/CancelAchParams.d.mts +1 -0
- package/dist/esm/serialization/resources/ach/client/requests/CancelAchParams.mjs +1 -0
- package/dist/esm/serialization/resources/ach/client/requests/NewAchParams.d.mts +1 -0
- package/dist/esm/serialization/resources/ach/client/requests/NewAchParams.mjs +1 -0
- package/dist/esm/serialization/resources/externalParties/client/requests/NewExtPartyParams.d.mts +1 -0
- package/dist/esm/serialization/resources/externalParties/client/requests/NewExtPartyParams.mjs +1 -0
- package/dist/esm/serialization/resources/externalPartyAccounts/client/requests/NewExtPartyAcctParams.d.mts +1 -0
- package/dist/esm/serialization/resources/externalPartyAccounts/client/requests/NewExtPartyAcctParams.mjs +1 -0
- package/dist/esm/version.d.mts +1 -1
- package/dist/esm/version.mjs +1 -1
- package/package.json +1 -1
- package/reference.md +4 -53
package/dist/cjs/BaseClient.js
CHANGED
|
@@ -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.
|
|
47
|
-
"User-Agent": "@naturalpay/sdk/1.
|
|
46
|
+
"X-Fern-SDK-Version": "1.6.1",
|
|
47
|
+
"User-Agent": "@naturalpay/sdk/1.6.1",
|
|
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
|
|
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
|
}
|
|
@@ -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;
|
|
@@ -117,56 +117,7 @@ export declare class CustomersClient {
|
|
|
117
117
|
* await client.customers.createInvitations({
|
|
118
118
|
* recipients: [{
|
|
119
119
|
* type: "email",
|
|
120
|
-
* value: "ops@acme.com"
|
|
121
|
-
* accountType: "business",
|
|
122
|
-
* firstName: "Morgan",
|
|
123
|
-
* lastName: "Lee",
|
|
124
|
-
* phone: "+14155550176",
|
|
125
|
-
* business: {
|
|
126
|
-
* legalName: "Acme Logistics LLC",
|
|
127
|
-
* displayName: "Acme Logistics",
|
|
128
|
-
* website: "https://acmelogistics.com",
|
|
129
|
-
* hasTradeName: true,
|
|
130
|
-
* tradeName: "Acme Freight",
|
|
131
|
-
* businessType: "llc",
|
|
132
|
-
* industry: "513210",
|
|
133
|
-
* stateOfIncorporation: "DE",
|
|
134
|
-
* incorporationDate: "2018-03-12",
|
|
135
|
-
* registeredAddress: {
|
|
136
|
-
* streetLine1: "251 Little Falls Dr",
|
|
137
|
-
* city: "Wilmington",
|
|
138
|
-
* subdivision: "DE",
|
|
139
|
-
* postalCode: "19808",
|
|
140
|
-
* country: "US"
|
|
141
|
-
* },
|
|
142
|
-
* physicalAddress: {
|
|
143
|
-
* streetLine1: "900 Harrison St",
|
|
144
|
-
* city: "San Francisco",
|
|
145
|
-
* subdivision: "CA",
|
|
146
|
-
* postalCode: "94107",
|
|
147
|
-
* country: "US"
|
|
148
|
-
* },
|
|
149
|
-
* sourceOfFunds: ["business_revenue"],
|
|
150
|
-
* countriesOfOperations: ["US", "CA"],
|
|
151
|
-
* beneficialOwners: [{
|
|
152
|
-
* firstName: "Morgan",
|
|
153
|
-
* lastName: "Lee",
|
|
154
|
-
* email: "morgan.lee@acme.com",
|
|
155
|
-
* phone: "+14155550176",
|
|
156
|
-
* dateOfBirth: "1985-09-02",
|
|
157
|
-
* address: {
|
|
158
|
-
* streetLine1: "128 Alamo Square",
|
|
159
|
-
* city: "San Francisco",
|
|
160
|
-
* subdivision: "CA",
|
|
161
|
-
* postalCode: "94117",
|
|
162
|
-
* country: "US"
|
|
163
|
-
* },
|
|
164
|
-
* ownershipPercentage: 60,
|
|
165
|
-
* title: "ceo",
|
|
166
|
-
* countryOfCitizenship: "US",
|
|
167
|
-
* employmentStatus: "employed"
|
|
168
|
-
* }]
|
|
169
|
-
* }
|
|
120
|
+
* value: "ops@acme.com"
|
|
170
121
|
* }],
|
|
171
122
|
* agents: [{
|
|
172
123
|
* agentId: "agt_3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f",
|
|
@@ -408,56 +408,7 @@ class CustomersClient {
|
|
|
408
408
|
* await client.customers.createInvitations({
|
|
409
409
|
* recipients: [{
|
|
410
410
|
* type: "email",
|
|
411
|
-
* value: "ops@acme.com"
|
|
412
|
-
* accountType: "business",
|
|
413
|
-
* firstName: "Morgan",
|
|
414
|
-
* lastName: "Lee",
|
|
415
|
-
* phone: "+14155550176",
|
|
416
|
-
* business: {
|
|
417
|
-
* legalName: "Acme Logistics LLC",
|
|
418
|
-
* displayName: "Acme Logistics",
|
|
419
|
-
* website: "https://acmelogistics.com",
|
|
420
|
-
* hasTradeName: true,
|
|
421
|
-
* tradeName: "Acme Freight",
|
|
422
|
-
* businessType: "llc",
|
|
423
|
-
* industry: "513210",
|
|
424
|
-
* stateOfIncorporation: "DE",
|
|
425
|
-
* incorporationDate: "2018-03-12",
|
|
426
|
-
* registeredAddress: {
|
|
427
|
-
* streetLine1: "251 Little Falls Dr",
|
|
428
|
-
* city: "Wilmington",
|
|
429
|
-
* subdivision: "DE",
|
|
430
|
-
* postalCode: "19808",
|
|
431
|
-
* country: "US"
|
|
432
|
-
* },
|
|
433
|
-
* physicalAddress: {
|
|
434
|
-
* streetLine1: "900 Harrison St",
|
|
435
|
-
* city: "San Francisco",
|
|
436
|
-
* subdivision: "CA",
|
|
437
|
-
* postalCode: "94107",
|
|
438
|
-
* country: "US"
|
|
439
|
-
* },
|
|
440
|
-
* sourceOfFunds: ["business_revenue"],
|
|
441
|
-
* countriesOfOperations: ["US", "CA"],
|
|
442
|
-
* beneficialOwners: [{
|
|
443
|
-
* firstName: "Morgan",
|
|
444
|
-
* lastName: "Lee",
|
|
445
|
-
* email: "morgan.lee@acme.com",
|
|
446
|
-
* phone: "+14155550176",
|
|
447
|
-
* dateOfBirth: "1985-09-02",
|
|
448
|
-
* address: {
|
|
449
|
-
* streetLine1: "128 Alamo Square",
|
|
450
|
-
* city: "San Francisco",
|
|
451
|
-
* subdivision: "CA",
|
|
452
|
-
* postalCode: "94117",
|
|
453
|
-
* country: "US"
|
|
454
|
-
* },
|
|
455
|
-
* ownershipPercentage: 60,
|
|
456
|
-
* title: "ceo",
|
|
457
|
-
* countryOfCitizenship: "US",
|
|
458
|
-
* employmentStatus: "employed"
|
|
459
|
-
* }]
|
|
460
|
-
* }
|
|
411
|
+
* value: "ops@acme.com"
|
|
461
412
|
* }],
|
|
462
413
|
* agents: [{
|
|
463
414
|
* agentId: "agt_3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f",
|
package/dist/cjs/api/resources/customers/client/requests/CreateInvitationsCustomersRequest.d.ts
CHANGED
|
@@ -4,56 +4,7 @@ import type * as Natural from "../../../../index.js";
|
|
|
4
4
|
* {
|
|
5
5
|
* recipients: [{
|
|
6
6
|
* type: "email",
|
|
7
|
-
* value: "ops@acme.com"
|
|
8
|
-
* accountType: "business",
|
|
9
|
-
* firstName: "Morgan",
|
|
10
|
-
* lastName: "Lee",
|
|
11
|
-
* phone: "+14155550176",
|
|
12
|
-
* business: {
|
|
13
|
-
* legalName: "Acme Logistics LLC",
|
|
14
|
-
* displayName: "Acme Logistics",
|
|
15
|
-
* website: "https://acmelogistics.com",
|
|
16
|
-
* hasTradeName: true,
|
|
17
|
-
* tradeName: "Acme Freight",
|
|
18
|
-
* businessType: "llc",
|
|
19
|
-
* industry: "513210",
|
|
20
|
-
* stateOfIncorporation: "DE",
|
|
21
|
-
* incorporationDate: "2018-03-12",
|
|
22
|
-
* registeredAddress: {
|
|
23
|
-
* streetLine1: "251 Little Falls Dr",
|
|
24
|
-
* city: "Wilmington",
|
|
25
|
-
* subdivision: "DE",
|
|
26
|
-
* postalCode: "19808",
|
|
27
|
-
* country: "US"
|
|
28
|
-
* },
|
|
29
|
-
* physicalAddress: {
|
|
30
|
-
* streetLine1: "900 Harrison St",
|
|
31
|
-
* city: "San Francisco",
|
|
32
|
-
* subdivision: "CA",
|
|
33
|
-
* postalCode: "94107",
|
|
34
|
-
* country: "US"
|
|
35
|
-
* },
|
|
36
|
-
* sourceOfFunds: ["business_revenue"],
|
|
37
|
-
* countriesOfOperations: ["US", "CA"],
|
|
38
|
-
* beneficialOwners: [{
|
|
39
|
-
* firstName: "Morgan",
|
|
40
|
-
* lastName: "Lee",
|
|
41
|
-
* email: "morgan.lee@acme.com",
|
|
42
|
-
* phone: "+14155550176",
|
|
43
|
-
* dateOfBirth: "1985-09-02",
|
|
44
|
-
* address: {
|
|
45
|
-
* streetLine1: "128 Alamo Square",
|
|
46
|
-
* city: "San Francisco",
|
|
47
|
-
* subdivision: "CA",
|
|
48
|
-
* postalCode: "94117",
|
|
49
|
-
* country: "US"
|
|
50
|
-
* },
|
|
51
|
-
* ownershipPercentage: 60,
|
|
52
|
-
* title: "ceo",
|
|
53
|
-
* countryOfCitizenship: "US",
|
|
54
|
-
* employmentStatus: "employed"
|
|
55
|
-
* }]
|
|
56
|
-
* }
|
|
7
|
+
* value: "ops@acme.com"
|
|
57
8
|
* }],
|
|
58
9
|
* agents: [{
|
|
59
10
|
* agentId: "agt_3c4d5e6f7a8b9c0d1e2f3a4b5c6d7e8f",
|
|
@@ -80,6 +31,6 @@ export interface CreateInvitationsCustomersRequest {
|
|
|
80
31
|
message?: string;
|
|
81
32
|
/** Tags applied to each invitation. */
|
|
82
33
|
tags?: Record<string, string>;
|
|
83
|
-
/**
|
|
34
|
+
/** Deprecated. Previously skipped our notification to the counterparty; Natural now always sends its own notifications and this field is accepted but ignored. The returned link is unaffected. */
|
|
84
35
|
disableNotifications?: Natural.CreateInvitationsCustomersRequestDisableNotificationsItem[];
|
|
85
36
|
}
|
|
@@ -14,6 +14,8 @@ export declare class ExternalAccountsClient {
|
|
|
14
14
|
protected readonly _options: NormalizedClientOptionsWithAuth<ExternalAccountsClient.Options>;
|
|
15
15
|
constructor(options?: ExternalAccountsClient.Options);
|
|
16
16
|
/**
|
|
17
|
+
* @deprecated
|
|
18
|
+
*
|
|
17
19
|
* Link or refresh a bank account using a Plaid processor token
|
|
18
20
|
*
|
|
19
21
|
* @param {Natural.CreateFromProcessorTokenExternalAccountsRequest} request
|
|
@@ -37,11 +39,11 @@ export declare class ExternalAccountsClient {
|
|
|
37
39
|
* @example
|
|
38
40
|
* await client.externalAccounts.createFromProcessorToken({
|
|
39
41
|
* idempotencyKey: "Idempotency-Key",
|
|
40
|
-
* partyId: "
|
|
42
|
+
* partyId: "pty_550e8400e29b41d4a716446655440000",
|
|
41
43
|
* processorToken: "processor-sandbox-abc123",
|
|
42
|
-
* institutionName: "
|
|
44
|
+
* institutionName: "Plaid Sandbox",
|
|
43
45
|
* tags: {
|
|
44
|
-
* "environment": "
|
|
46
|
+
* "environment": "sandbox"
|
|
45
47
|
* }
|
|
46
48
|
* })
|
|
47
49
|
*/
|
|
@@ -72,6 +72,8 @@ class ExternalAccountsClient {
|
|
|
72
72
|
this._options = (0, BaseClient_js_1.normalizeClientOptionsWithAuth)(options);
|
|
73
73
|
}
|
|
74
74
|
/**
|
|
75
|
+
* @deprecated
|
|
76
|
+
*
|
|
75
77
|
* Link or refresh a bank account using a Plaid processor token
|
|
76
78
|
*
|
|
77
79
|
* @param {Natural.CreateFromProcessorTokenExternalAccountsRequest} request
|
|
@@ -95,11 +97,11 @@ class ExternalAccountsClient {
|
|
|
95
97
|
* @example
|
|
96
98
|
* await client.externalAccounts.createFromProcessorToken({
|
|
97
99
|
* idempotencyKey: "Idempotency-Key",
|
|
98
|
-
* partyId: "
|
|
100
|
+
* partyId: "pty_550e8400e29b41d4a716446655440000",
|
|
99
101
|
* processorToken: "processor-sandbox-abc123",
|
|
100
|
-
* institutionName: "
|
|
102
|
+
* institutionName: "Plaid Sandbox",
|
|
101
103
|
* tags: {
|
|
102
|
-
* "environment": "
|
|
104
|
+
* "environment": "sandbox"
|
|
103
105
|
* }
|
|
104
106
|
* })
|
|
105
107
|
*/
|
|
@@ -2,11 +2,11 @@
|
|
|
2
2
|
* @example
|
|
3
3
|
* {
|
|
4
4
|
* idempotencyKey: "Idempotency-Key",
|
|
5
|
-
* partyId: "
|
|
5
|
+
* partyId: "pty_550e8400e29b41d4a716446655440000",
|
|
6
6
|
* processorToken: "processor-sandbox-abc123",
|
|
7
|
-
* institutionName: "
|
|
7
|
+
* institutionName: "Plaid Sandbox",
|
|
8
8
|
* tags: {
|
|
9
|
-
* "environment": "
|
|
9
|
+
* "environment": "sandbox"
|
|
10
10
|
* }
|
|
11
11
|
* }
|
|
12
12
|
*/
|
|
@@ -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
|
|
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,
|
|
@@ -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
|
|
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,
|
package/dist/cjs/api/resources/externalPartyAccounts/client/requests/NewExtPartyAcctParams.d.ts
CHANGED
|
@@ -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;
|
|
@@ -34,6 +34,6 @@ export interface NewPayReqParams {
|
|
|
34
34
|
payerName?: string;
|
|
35
35
|
/** Who pays: exactly one typed email, phone, party ID, agent ID, or handle value. */
|
|
36
36
|
payer: Natural.CreatePaymentRequestsRequestPayer;
|
|
37
|
-
/**
|
|
37
|
+
/** Deprecated. Previously skipped our notification to the counterparty; Natural now always sends its own notifications and this field is accepted but ignored. The returned link is unaffected. */
|
|
38
38
|
disableNotifications?: Natural.CreatePaymentRequestsRequestDisableNotificationsItem[];
|
|
39
39
|
}
|
|
@@ -32,6 +32,6 @@ export interface NewPaymentParams {
|
|
|
32
32
|
tags?: Record<string, string>;
|
|
33
33
|
/** Source wallet ID (wal_*). Omit to pay from the sender party's default wallet. */
|
|
34
34
|
walletId?: string;
|
|
35
|
-
/**
|
|
35
|
+
/** Deprecated. Previously skipped our notification to the counterparty; Natural now always sends its own notifications and this field is accepted but ignored. The returned link is unaffected. */
|
|
36
36
|
disableNotifications?: Natural.CreatePaymentsRequestDisableNotificationsItem[];
|
|
37
37
|
}
|
|
@@ -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(),
|
package/dist/cjs/serialization/resources/externalParties/client/requests/NewExtPartyParams.d.ts
CHANGED
|
@@ -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;
|
package/dist/cjs/serialization/resources/externalParties/client/requests/NewExtPartyParams.js
CHANGED
|
@@ -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(),
|
package/dist/cjs/version.d.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export declare const SDK_VERSION = "1.
|
|
1
|
+
export declare const SDK_VERSION = "1.6.1";
|
package/dist/cjs/version.js
CHANGED
package/dist/esm/BaseClient.mjs
CHANGED
|
@@ -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.
|
|
10
|
-
"User-Agent": "@naturalpay/sdk/1.
|
|
9
|
+
"X-Fern-SDK-Version": "1.6.1",
|
|
10
|
+
"User-Agent": "@naturalpay/sdk/1.6.1",
|
|
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
|
|
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
|
}
|