@naturalpay/sdk 0.14.0 → 0.15.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/CHANGELOG.md +8 -0
- package/package.json +1 -1
- package/resources/payment-requests.d.mts +49 -60
- package/resources/payment-requests.d.mts.map +1 -1
- package/resources/payment-requests.d.ts +49 -60
- package/resources/payment-requests.d.ts.map +1 -1
- package/resources/payment-requests.js +46 -33
- package/resources/payment-requests.js.map +1 -1
- package/resources/payment-requests.mjs +46 -33
- package/resources/payment-requests.mjs.map +1 -1
- package/resources/payments.d.mts +34 -43
- package/resources/payments.d.mts.map +1 -1
- package/resources/payments.d.ts +34 -43
- package/resources/payments.d.ts.map +1 -1
- package/resources/payments.js +30 -23
- package/resources/payments.js.map +1 -1
- package/resources/payments.mjs +30 -23
- package/resources/payments.mjs.map +1 -1
- package/resources/transactions.d.mts +18 -16
- package/resources/transactions.d.mts.map +1 -1
- package/resources/transactions.d.ts +18 -16
- package/resources/transactions.d.ts.map +1 -1
- package/resources/transactions.js +18 -6
- package/resources/transactions.js.map +1 -1
- package/resources/transactions.mjs +18 -6
- package/resources/transactions.mjs.map +1 -1
- package/resources/transfers.d.mts +37 -44
- package/resources/transfers.d.mts.map +1 -1
- package/resources/transfers.d.ts +37 -44
- package/resources/transfers.d.ts.map +1 -1
- package/resources/transfers.js +29 -20
- package/resources/transfers.js.map +1 -1
- package/resources/transfers.mjs +29 -20
- package/resources/transfers.mjs.map +1 -1
- package/src/resources/payment-requests.ts +93 -71
- package/src/resources/payments.ts +71 -53
- package/src/resources/transactions.ts +39 -22
- package/src/resources/transfers.ts +68 -52
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.ts +1 -1
- package/version.js +1 -1
- package/version.mjs +1 -1
|
@@ -13,12 +13,21 @@ export class Transactions extends APIResource {
|
|
|
13
13
|
/**
|
|
14
14
|
* List transactions visible to your party.
|
|
15
15
|
*/
|
|
16
|
-
list(
|
|
17
|
-
|
|
16
|
+
list(
|
|
17
|
+
params: TransactionListParams | null | undefined = {},
|
|
18
|
+
options?: RequestOptions,
|
|
19
|
+
): APIPromise<TransactionListResponse> {
|
|
20
|
+
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
|
|
18
21
|
return this._client.get('/transactions', {
|
|
19
22
|
query,
|
|
20
23
|
...options,
|
|
21
|
-
headers: buildHeaders([
|
|
24
|
+
headers: buildHeaders([
|
|
25
|
+
{
|
|
26
|
+
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
27
|
+
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
28
|
+
},
|
|
29
|
+
options?.headers,
|
|
30
|
+
]),
|
|
22
31
|
});
|
|
23
32
|
}
|
|
24
33
|
|
|
@@ -27,14 +36,20 @@ export class Transactions extends APIResource {
|
|
|
27
36
|
*/
|
|
28
37
|
get(
|
|
29
38
|
transactionID: string,
|
|
30
|
-
params: TransactionGetParams,
|
|
39
|
+
params: TransactionGetParams | null | undefined = {},
|
|
31
40
|
options?: RequestOptions,
|
|
32
41
|
): APIPromise<TransactionGetResponse> {
|
|
33
|
-
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params;
|
|
42
|
+
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
|
|
34
43
|
return this._client.get(path`/transactions/${transactionID}`, {
|
|
35
44
|
query,
|
|
36
45
|
...options,
|
|
37
|
-
headers: buildHeaders([
|
|
46
|
+
headers: buildHeaders([
|
|
47
|
+
{
|
|
48
|
+
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
49
|
+
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
50
|
+
},
|
|
51
|
+
options?.headers,
|
|
52
|
+
]),
|
|
38
53
|
});
|
|
39
54
|
}
|
|
40
55
|
}
|
|
@@ -464,16 +479,6 @@ export namespace TransactionGetResponse {
|
|
|
464
479
|
}
|
|
465
480
|
|
|
466
481
|
export interface TransactionListParams {
|
|
467
|
-
/**
|
|
468
|
-
* Header param: Agent ID (agt_xxx) used for attribution and audit.
|
|
469
|
-
*/
|
|
470
|
-
'X-Agent-ID': string;
|
|
471
|
-
|
|
472
|
-
/**
|
|
473
|
-
* Header param: Stable run, session, or conversation ID for agent observability.
|
|
474
|
-
*/
|
|
475
|
-
'X-Instance-ID': string;
|
|
476
|
-
|
|
477
482
|
/**
|
|
478
483
|
* Query param: Pagination cursor from previous response
|
|
479
484
|
*/
|
|
@@ -488,23 +493,35 @@ export interface TransactionListParams {
|
|
|
488
493
|
* Query param
|
|
489
494
|
*/
|
|
490
495
|
type?: 'payment' | 'transfer' | 'all';
|
|
491
|
-
}
|
|
492
496
|
|
|
493
|
-
export interface TransactionGetParams {
|
|
494
497
|
/**
|
|
495
|
-
* Header param: Agent ID (agt_xxx)
|
|
498
|
+
* Header param: Agent ID (agt_xxx) identifying which agent is making the request.
|
|
496
499
|
*/
|
|
497
|
-
'X-Agent-ID'
|
|
500
|
+
'X-Agent-ID'?: string;
|
|
498
501
|
|
|
499
502
|
/**
|
|
500
|
-
* Header param:
|
|
503
|
+
* Header param: Required when X-Agent-ID is present. Session or conversation ID
|
|
504
|
+
* for agent observability.
|
|
501
505
|
*/
|
|
502
|
-
'X-Instance-ID'
|
|
506
|
+
'X-Instance-ID'?: string;
|
|
507
|
+
}
|
|
503
508
|
|
|
509
|
+
export interface TransactionGetParams {
|
|
504
510
|
/**
|
|
505
511
|
* Query param: Party ID for delegated transaction lookup
|
|
506
512
|
*/
|
|
507
513
|
partyId?: string;
|
|
514
|
+
|
|
515
|
+
/**
|
|
516
|
+
* Header param: Agent ID (agt_xxx) identifying which agent is making the request.
|
|
517
|
+
*/
|
|
518
|
+
'X-Agent-ID'?: string;
|
|
519
|
+
|
|
520
|
+
/**
|
|
521
|
+
* Header param: Required when X-Agent-ID is present. Session or conversation ID
|
|
522
|
+
* for agent observability.
|
|
523
|
+
*/
|
|
524
|
+
'X-Instance-ID'?: string;
|
|
508
525
|
}
|
|
509
526
|
|
|
510
527
|
export declare namespace Transactions {
|
|
@@ -15,18 +15,24 @@ export class Transfers extends APIResource {
|
|
|
15
15
|
*
|
|
16
16
|
* @example
|
|
17
17
|
* ```ts
|
|
18
|
-
* const transfers = await client.transfers.list(
|
|
19
|
-
* 'X-Agent-ID': 'X-Agent-ID',
|
|
20
|
-
* 'X-Instance-ID': 'X-Instance-ID',
|
|
21
|
-
* });
|
|
18
|
+
* const transfers = await client.transfers.list();
|
|
22
19
|
* ```
|
|
23
20
|
*/
|
|
24
|
-
list(
|
|
25
|
-
|
|
21
|
+
list(
|
|
22
|
+
params: TransferListParams | null | undefined = {},
|
|
23
|
+
options?: RequestOptions,
|
|
24
|
+
): APIPromise<TransferListResponse> {
|
|
25
|
+
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
|
|
26
26
|
return this._client.get('/transfers', {
|
|
27
27
|
query,
|
|
28
28
|
...options,
|
|
29
|
-
headers: buildHeaders([
|
|
29
|
+
headers: buildHeaders([
|
|
30
|
+
{
|
|
31
|
+
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
32
|
+
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
33
|
+
},
|
|
34
|
+
options?.headers,
|
|
35
|
+
]),
|
|
30
36
|
});
|
|
31
37
|
}
|
|
32
38
|
|
|
@@ -37,23 +43,25 @@ export class Transfers extends APIResource {
|
|
|
37
43
|
* ```ts
|
|
38
44
|
* const transfer = await client.transfers.get(
|
|
39
45
|
* 'trf_ecc2efdd09bd231a9ad9bd2aada37aa7',
|
|
40
|
-
* {
|
|
41
|
-
* 'X-Agent-ID': 'X-Agent-ID',
|
|
42
|
-
* 'X-Instance-ID': 'X-Instance-ID',
|
|
43
|
-
* },
|
|
44
46
|
* );
|
|
45
47
|
* ```
|
|
46
48
|
*/
|
|
47
49
|
get(
|
|
48
50
|
transferID: string,
|
|
49
|
-
params: TransferGetParams,
|
|
51
|
+
params: TransferGetParams | null | undefined = {},
|
|
50
52
|
options?: RequestOptions,
|
|
51
53
|
): APIPromise<TransferGetResponse> {
|
|
52
|
-
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params;
|
|
54
|
+
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
|
|
53
55
|
return this._client.get(path`/transfers/${transferID}`, {
|
|
54
56
|
query,
|
|
55
57
|
...options,
|
|
56
|
-
headers: buildHeaders([
|
|
58
|
+
headers: buildHeaders([
|
|
59
|
+
{
|
|
60
|
+
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
61
|
+
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
62
|
+
},
|
|
63
|
+
options?.headers,
|
|
64
|
+
]),
|
|
57
65
|
});
|
|
58
66
|
}
|
|
59
67
|
|
|
@@ -66,8 +74,6 @@ export class Transfers extends APIResource {
|
|
|
66
74
|
* amount: 100,
|
|
67
75
|
* externalAccountId: 'eac_ecc2efdd09bd231a9ad9bd2aada37aa7',
|
|
68
76
|
* 'Idempotency-Key': 'Idempotency-Key',
|
|
69
|
-
* 'X-Agent-ID': 'X-Agent-ID',
|
|
70
|
-
* 'X-Instance-ID': 'X-Instance-ID',
|
|
71
77
|
* });
|
|
72
78
|
* ```
|
|
73
79
|
*/
|
|
@@ -85,7 +91,11 @@ export class Transfers extends APIResource {
|
|
|
85
91
|
body,
|
|
86
92
|
...options,
|
|
87
93
|
headers: buildHeaders([
|
|
88
|
-
{
|
|
94
|
+
{
|
|
95
|
+
'Idempotency-Key': idempotencyKey,
|
|
96
|
+
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
97
|
+
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
98
|
+
},
|
|
89
99
|
options?.headers,
|
|
90
100
|
]),
|
|
91
101
|
});
|
|
@@ -100,8 +110,6 @@ export class Transfers extends APIResource {
|
|
|
100
110
|
* amount: 1,
|
|
101
111
|
* externalAccountId: 'eac_ecc2efdd09bd231a9ad9bd2aada37aa7',
|
|
102
112
|
* 'Idempotency-Key': 'Idempotency-Key',
|
|
103
|
-
* 'X-Agent-ID': 'X-Agent-ID',
|
|
104
|
-
* 'X-Instance-ID': 'X-Instance-ID',
|
|
105
113
|
* });
|
|
106
114
|
* ```
|
|
107
115
|
*/
|
|
@@ -119,7 +127,11 @@ export class Transfers extends APIResource {
|
|
|
119
127
|
body,
|
|
120
128
|
...options,
|
|
121
129
|
headers: buildHeaders([
|
|
122
|
-
{
|
|
130
|
+
{
|
|
131
|
+
'Idempotency-Key': idempotencyKey,
|
|
132
|
+
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
133
|
+
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
134
|
+
},
|
|
123
135
|
options?.headers,
|
|
124
136
|
]),
|
|
125
137
|
});
|
|
@@ -1189,16 +1201,6 @@ export namespace TransferInitiateWithdrawalResponse {
|
|
|
1189
1201
|
}
|
|
1190
1202
|
|
|
1191
1203
|
export interface TransferListParams {
|
|
1192
|
-
/**
|
|
1193
|
-
* Header param: Agent ID (agt_xxx) used for attribution and audit.
|
|
1194
|
-
*/
|
|
1195
|
-
'X-Agent-ID': string;
|
|
1196
|
-
|
|
1197
|
-
/**
|
|
1198
|
-
* Header param: Stable run, session, or conversation ID for agent observability.
|
|
1199
|
-
*/
|
|
1200
|
-
'X-Instance-ID': string;
|
|
1201
|
-
|
|
1202
1204
|
/**
|
|
1203
1205
|
* Query param: Pagination cursor from previous response
|
|
1204
1206
|
*/
|
|
@@ -1213,23 +1215,35 @@ export interface TransferListParams {
|
|
|
1213
1215
|
* Query param: Party ID for delegated transfer lookup
|
|
1214
1216
|
*/
|
|
1215
1217
|
partyId?: string;
|
|
1216
|
-
}
|
|
1217
1218
|
|
|
1218
|
-
export interface TransferGetParams {
|
|
1219
1219
|
/**
|
|
1220
|
-
* Header param: Agent ID (agt_xxx)
|
|
1220
|
+
* Header param: Agent ID (agt_xxx) identifying which agent is making the request.
|
|
1221
1221
|
*/
|
|
1222
|
-
'X-Agent-ID'
|
|
1222
|
+
'X-Agent-ID'?: string;
|
|
1223
1223
|
|
|
1224
1224
|
/**
|
|
1225
|
-
* Header param:
|
|
1225
|
+
* Header param: Required when X-Agent-ID is present. Session or conversation ID
|
|
1226
|
+
* for agent observability.
|
|
1226
1227
|
*/
|
|
1227
|
-
'X-Instance-ID'
|
|
1228
|
+
'X-Instance-ID'?: string;
|
|
1229
|
+
}
|
|
1228
1230
|
|
|
1231
|
+
export interface TransferGetParams {
|
|
1229
1232
|
/**
|
|
1230
1233
|
* Query param: Party ID for delegated transfer lookup
|
|
1231
1234
|
*/
|
|
1232
1235
|
partyId?: string;
|
|
1236
|
+
|
|
1237
|
+
/**
|
|
1238
|
+
* Header param: Agent ID (agt_xxx) identifying which agent is making the request.
|
|
1239
|
+
*/
|
|
1240
|
+
'X-Agent-ID'?: string;
|
|
1241
|
+
|
|
1242
|
+
/**
|
|
1243
|
+
* Header param: Required when X-Agent-ID is present. Session or conversation ID
|
|
1244
|
+
* for agent observability.
|
|
1245
|
+
*/
|
|
1246
|
+
'X-Instance-ID'?: string;
|
|
1233
1247
|
}
|
|
1234
1248
|
|
|
1235
1249
|
export interface TransferInitiateDepositParams {
|
|
@@ -1250,24 +1264,25 @@ export interface TransferInitiateDepositParams {
|
|
|
1250
1264
|
'Idempotency-Key': string;
|
|
1251
1265
|
|
|
1252
1266
|
/**
|
|
1253
|
-
*
|
|
1267
|
+
* Body param: Currency code
|
|
1254
1268
|
*/
|
|
1255
|
-
|
|
1269
|
+
currency?: string;
|
|
1256
1270
|
|
|
1257
1271
|
/**
|
|
1258
|
-
*
|
|
1272
|
+
* Body param: Deposit description
|
|
1259
1273
|
*/
|
|
1260
|
-
|
|
1274
|
+
description?: string;
|
|
1261
1275
|
|
|
1262
1276
|
/**
|
|
1263
|
-
*
|
|
1277
|
+
* Header param: Agent ID (agt_xxx) identifying which agent is making the request.
|
|
1264
1278
|
*/
|
|
1265
|
-
|
|
1279
|
+
'X-Agent-ID'?: string;
|
|
1266
1280
|
|
|
1267
1281
|
/**
|
|
1268
|
-
*
|
|
1282
|
+
* Header param: Required when X-Agent-ID is present. Session or conversation ID
|
|
1283
|
+
* for agent observability.
|
|
1269
1284
|
*/
|
|
1270
|
-
|
|
1285
|
+
'X-Instance-ID'?: string;
|
|
1271
1286
|
}
|
|
1272
1287
|
|
|
1273
1288
|
export interface TransferInitiateWithdrawalParams {
|
|
@@ -1288,24 +1303,25 @@ export interface TransferInitiateWithdrawalParams {
|
|
|
1288
1303
|
'Idempotency-Key': string;
|
|
1289
1304
|
|
|
1290
1305
|
/**
|
|
1291
|
-
*
|
|
1306
|
+
* Body param: Currency code
|
|
1292
1307
|
*/
|
|
1293
|
-
|
|
1308
|
+
currency?: string;
|
|
1294
1309
|
|
|
1295
1310
|
/**
|
|
1296
|
-
*
|
|
1311
|
+
* Body param: Withdrawal description
|
|
1297
1312
|
*/
|
|
1298
|
-
|
|
1313
|
+
description?: string;
|
|
1299
1314
|
|
|
1300
1315
|
/**
|
|
1301
|
-
*
|
|
1316
|
+
* Header param: Agent ID (agt_xxx) identifying which agent is making the request.
|
|
1302
1317
|
*/
|
|
1303
|
-
|
|
1318
|
+
'X-Agent-ID'?: string;
|
|
1304
1319
|
|
|
1305
1320
|
/**
|
|
1306
|
-
*
|
|
1321
|
+
* Header param: Required when X-Agent-ID is present. Session or conversation ID
|
|
1322
|
+
* for agent observability.
|
|
1307
1323
|
*/
|
|
1308
|
-
|
|
1324
|
+
'X-Instance-ID'?: string;
|
|
1309
1325
|
}
|
|
1310
1326
|
|
|
1311
1327
|
export declare namespace Transfers {
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.15.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.15.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.15.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.js
CHANGED
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.15.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|