@naturalpay/sdk 0.3.0 → 0.5.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 (184) hide show
  1. package/CHANGELOG.md +22 -0
  2. package/client.d.mts +23 -20
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +23 -20
  5. package/client.d.ts.map +1 -1
  6. package/client.js +11 -8
  7. package/client.js.map +1 -1
  8. package/client.mjs +12 -9
  9. package/client.mjs.map +1 -1
  10. package/internal/tslib.js +17 -17
  11. package/internal/utils/query.d.mts +3 -0
  12. package/internal/utils/query.d.mts.map +1 -1
  13. package/internal/utils/query.d.ts +3 -0
  14. package/internal/utils/query.d.ts.map +1 -1
  15. package/internal/utils/query.js +16 -3
  16. package/internal/utils/query.js.map +1 -1
  17. package/internal/utils/query.mjs +16 -2
  18. package/internal/utils/query.mjs.map +1 -1
  19. package/package.json +1 -1
  20. package/resources/agents.d.mts +554 -268
  21. package/resources/agents.d.mts.map +1 -1
  22. package/resources/agents.d.ts +554 -268
  23. package/resources/agents.d.ts.map +1 -1
  24. package/resources/agents.js +72 -20
  25. package/resources/agents.js.map +1 -1
  26. package/resources/agents.mjs +72 -20
  27. package/resources/agents.mjs.map +1 -1
  28. package/resources/api-keys.d.mts +16 -2
  29. package/resources/api-keys.d.mts.map +1 -1
  30. package/resources/api-keys.d.ts +16 -2
  31. package/resources/api-keys.d.ts.map +1 -1
  32. package/resources/api-keys.js +7 -4
  33. package/resources/api-keys.js.map +1 -1
  34. package/resources/api-keys.mjs +7 -4
  35. package/resources/api-keys.mjs.map +1 -1
  36. package/resources/customers.d.mts +243 -114
  37. package/resources/customers.d.mts.map +1 -1
  38. package/resources/customers.d.ts +243 -114
  39. package/resources/customers.d.ts.map +1 -1
  40. package/resources/customers.js +6 -7
  41. package/resources/customers.js.map +1 -1
  42. package/resources/customers.mjs +6 -7
  43. package/resources/customers.mjs.map +1 -1
  44. package/resources/index.d.mts +7 -7
  45. package/resources/index.d.mts.map +1 -1
  46. package/resources/index.d.ts +7 -7
  47. package/resources/index.d.ts.map +1 -1
  48. package/resources/index.js +3 -3
  49. package/resources/index.js.map +1 -1
  50. package/resources/index.mjs +2 -2
  51. package/resources/index.mjs.map +1 -1
  52. package/resources/invitations.d.mts +16 -7
  53. package/resources/invitations.d.mts.map +1 -1
  54. package/resources/invitations.d.ts +16 -7
  55. package/resources/invitations.d.ts.map +1 -1
  56. package/resources/invitations.js +6 -4
  57. package/resources/invitations.js.map +1 -1
  58. package/resources/invitations.mjs +6 -4
  59. package/resources/invitations.mjs.map +1 -1
  60. package/resources/parties.d.mts +53 -26
  61. package/resources/parties.d.mts.map +1 -1
  62. package/resources/parties.d.ts +53 -26
  63. package/resources/parties.d.ts.map +1 -1
  64. package/resources/parties.js +27 -1
  65. package/resources/parties.js.map +1 -1
  66. package/resources/parties.mjs +27 -1
  67. package/resources/parties.mjs.map +1 -1
  68. package/resources/payment-requests.d.mts +738 -33
  69. package/resources/payment-requests.d.mts.map +1 -1
  70. package/resources/payment-requests.d.ts +738 -33
  71. package/resources/payment-requests.d.ts.map +1 -1
  72. package/resources/payment-requests.js +82 -1
  73. package/resources/payment-requests.js.map +1 -1
  74. package/resources/payment-requests.mjs +82 -1
  75. package/resources/payment-requests.mjs.map +1 -1
  76. package/resources/payments.d.mts +390 -24
  77. package/resources/payments.d.mts.map +1 -1
  78. package/resources/payments.d.ts +390 -24
  79. package/resources/payments.d.ts.map +1 -1
  80. package/resources/payments.js +53 -3
  81. package/resources/payments.js.map +1 -1
  82. package/resources/payments.mjs +53 -3
  83. package/resources/payments.mjs.map +1 -1
  84. package/resources/transactions.d.mts +50 -118
  85. package/resources/transactions.d.mts.map +1 -1
  86. package/resources/transactions.d.ts +50 -118
  87. package/resources/transactions.d.ts.map +1 -1
  88. package/resources/transactions.js +2 -2
  89. package/resources/transactions.mjs +2 -2
  90. package/resources/transfers.d.mts +1030 -0
  91. package/resources/transfers.d.mts.map +1 -0
  92. package/resources/transfers.d.ts +1030 -0
  93. package/resources/transfers.d.ts.map +1 -0
  94. package/resources/transfers.js +114 -0
  95. package/resources/transfers.js.map +1 -0
  96. package/resources/transfers.mjs +110 -0
  97. package/resources/transfers.mjs.map +1 -0
  98. package/resources/wallet.d.mts +1 -189
  99. package/resources/wallet.d.mts.map +1 -1
  100. package/resources/wallet.d.ts +1 -189
  101. package/resources/wallet.d.ts.map +1 -1
  102. package/resources/wallet.js +0 -66
  103. package/resources/wallet.js.map +1 -1
  104. package/resources/wallet.mjs +0 -66
  105. package/resources/wallet.mjs.map +1 -1
  106. package/resources/webhooks.d.mts +7 -7
  107. package/resources/webhooks.d.mts.map +1 -1
  108. package/resources/webhooks.d.ts +7 -7
  109. package/resources/webhooks.d.ts.map +1 -1
  110. package/src/client.ts +82 -43
  111. package/src/internal/utils/query.ts +18 -2
  112. package/src/resources/agents.ts +676 -300
  113. package/src/resources/api-keys.ts +26 -4
  114. package/src/resources/customers.ts +273 -132
  115. package/src/resources/index.ts +38 -18
  116. package/src/resources/invitations.ts +26 -10
  117. package/src/resources/parties.ts +85 -30
  118. package/src/resources/payment-requests.ts +949 -58
  119. package/src/resources/payments.ts +518 -23
  120. package/src/resources/transactions.ts +50 -136
  121. package/src/resources/transfers.ts +1338 -0
  122. package/src/resources/wallet.ts +0 -268
  123. package/src/resources/webhooks.ts +7 -0
  124. package/src/version.ts +1 -1
  125. package/version.d.mts +1 -1
  126. package/version.d.ts +1 -1
  127. package/version.js +1 -1
  128. package/version.mjs +1 -1
  129. package/internal/qs/formats.d.mts +0 -7
  130. package/internal/qs/formats.d.mts.map +0 -1
  131. package/internal/qs/formats.d.ts +0 -7
  132. package/internal/qs/formats.d.ts.map +0 -1
  133. package/internal/qs/formats.js +0 -13
  134. package/internal/qs/formats.js.map +0 -1
  135. package/internal/qs/formats.mjs +0 -9
  136. package/internal/qs/formats.mjs.map +0 -1
  137. package/internal/qs/index.d.mts +0 -10
  138. package/internal/qs/index.d.mts.map +0 -1
  139. package/internal/qs/index.d.ts +0 -10
  140. package/internal/qs/index.d.ts.map +0 -1
  141. package/internal/qs/index.js +0 -14
  142. package/internal/qs/index.js.map +0 -1
  143. package/internal/qs/index.mjs +0 -10
  144. package/internal/qs/index.mjs.map +0 -1
  145. package/internal/qs/stringify.d.mts +0 -3
  146. package/internal/qs/stringify.d.mts.map +0 -1
  147. package/internal/qs/stringify.d.ts +0 -3
  148. package/internal/qs/stringify.d.ts.map +0 -1
  149. package/internal/qs/stringify.js +0 -277
  150. package/internal/qs/stringify.js.map +0 -1
  151. package/internal/qs/stringify.mjs +0 -274
  152. package/internal/qs/stringify.mjs.map +0 -1
  153. package/internal/qs/types.d.mts +0 -57
  154. package/internal/qs/types.d.mts.map +0 -1
  155. package/internal/qs/types.d.ts +0 -57
  156. package/internal/qs/types.d.ts.map +0 -1
  157. package/internal/qs/types.js +0 -3
  158. package/internal/qs/types.js.map +0 -1
  159. package/internal/qs/types.mjs +0 -2
  160. package/internal/qs/types.mjs.map +0 -1
  161. package/internal/qs/utils.d.mts +0 -15
  162. package/internal/qs/utils.d.mts.map +0 -1
  163. package/internal/qs/utils.d.ts +0 -15
  164. package/internal/qs/utils.d.ts.map +0 -1
  165. package/internal/qs/utils.js +0 -230
  166. package/internal/qs/utils.js.map +0 -1
  167. package/internal/qs/utils.mjs +0 -217
  168. package/internal/qs/utils.mjs.map +0 -1
  169. package/resources/delegations.d.mts +0 -458
  170. package/resources/delegations.d.mts.map +0 -1
  171. package/resources/delegations.d.ts +0 -458
  172. package/resources/delegations.d.ts.map +0 -1
  173. package/resources/delegations.js +0 -47
  174. package/resources/delegations.js.map +0 -1
  175. package/resources/delegations.mjs +0 -43
  176. package/resources/delegations.mjs.map +0 -1
  177. package/src/internal/qs/LICENSE.md +0 -13
  178. package/src/internal/qs/README.md +0 -3
  179. package/src/internal/qs/formats.ts +0 -10
  180. package/src/internal/qs/index.ts +0 -13
  181. package/src/internal/qs/stringify.ts +0 -385
  182. package/src/internal/qs/types.ts +0 -71
  183. package/src/internal/qs/utils.ts +0 -265
  184. package/src/resources/delegations.ts +0 -580
@@ -1,580 +0,0 @@
1
- // File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
2
-
3
- import { APIResource } from '../core/resource';
4
- import { APIPromise } from '../core/api-promise';
5
- import { buildHeaders } from '../internal/headers';
6
- import { RequestOptions } from '../internal/request-options';
7
- import { path } from '../internal/utils/path';
8
-
9
- /**
10
- * Agent delegation management
11
- */
12
- export class Delegations extends APIResource {
13
- /**
14
- * Get agent delegation
15
- */
16
- getAgentDelegation(
17
- agentDelegationID: string,
18
- params: DelegationGetAgentDelegationParams | null | undefined = {},
19
- options?: RequestOptions,
20
- ): APIPromise<DelegationGetAgentDelegationResponse> {
21
- const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID } = params ?? {};
22
- return this._client.get(path`/agent-delegations/${agentDelegationID}`, {
23
- ...options,
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
- ]),
31
- });
32
- }
33
-
34
- /**
35
- * List agent delegations
36
- */
37
- listAgentDelegations(
38
- params: DelegationListAgentDelegationsParams | null | undefined = {},
39
- options?: RequestOptions,
40
- ): APIPromise<DelegationListAgentDelegationsResponse> {
41
- const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
42
- return this._client.get('/agent-delegations', {
43
- query,
44
- ...options,
45
- headers: buildHeaders([
46
- {
47
- ...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
48
- ...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
49
- },
50
- options?.headers,
51
- ]),
52
- });
53
- }
54
- }
55
-
56
- export interface DelegationGetAgentDelegationResponse {
57
- data: DelegationGetAgentDelegationResponse.Data;
58
- }
59
-
60
- export namespace DelegationGetAgentDelegationResponse {
61
- export interface Data {
62
- /**
63
- * Resource ID
64
- */
65
- id: string;
66
-
67
- /**
68
- * Resource attributes
69
- */
70
- attributes: Data.Attributes;
71
-
72
- /**
73
- * Resource relationships
74
- */
75
- relationships: Data.Relationships;
76
-
77
- /**
78
- * Resource type
79
- */
80
- type: string;
81
- }
82
-
83
- export namespace Data {
84
- /**
85
- * Resource attributes
86
- */
87
- export interface Attributes {
88
- /**
89
- * Agent display name
90
- */
91
- agentName: string | null;
92
-
93
- /**
94
- * When this delegation was created
95
- */
96
- createdAt: string;
97
-
98
- /**
99
- * User who created this delegation (usr\_\*)
100
- */
101
- createdBy: string | null;
102
-
103
- /**
104
- * Developer party name
105
- */
106
- delegateePartyName: string | null;
107
-
108
- /**
109
- * Customer party name
110
- */
111
- delegatorPartyName: string | null;
112
-
113
- /**
114
- * Expiration timestamp
115
- */
116
- expiresAt: string | null;
117
-
118
- /**
119
- * Transaction limits in cents
120
- */
121
- limits: Attributes.Limits | null;
122
-
123
- /**
124
- * Granted permissions. Use `status` to derive Active vs Revoked.
125
- */
126
- permissions: Array<string>;
127
-
128
- /**
129
- * Authoritative active/revoked flag (revoke keeps permissions for audit)
130
- */
131
- status: 'ACTIVE' | 'REVOKED';
132
-
133
- /**
134
- * When this delegation was last updated
135
- */
136
- updatedAt: string;
137
- }
138
-
139
- export namespace Attributes {
140
- /**
141
- * Transaction limits in cents
142
- */
143
- export interface Limits {
144
- /**
145
- * Positive per-transaction limit in cents. null means no per-payment limit.
146
- */
147
- perTransaction?: number | null;
148
- }
149
- }
150
-
151
- /**
152
- * Resource relationships
153
- */
154
- export interface Relationships {
155
- /**
156
- * Agent granted access
157
- */
158
- agent: Relationships.Agent;
159
-
160
- /**
161
- * Parent party delegation
162
- */
163
- delegation: Relationships.Delegation;
164
-
165
- /**
166
- * Developer party receiving access
167
- */
168
- delegateeParty?: Relationships.DelegateeParty;
169
-
170
- /**
171
- * Customer party granting access
172
- */
173
- delegatorParty?: Relationships.DelegatorParty;
174
- }
175
-
176
- export namespace Relationships {
177
- /**
178
- * Agent granted access
179
- */
180
- export interface Agent {
181
- /**
182
- * Related resource identifier
183
- */
184
- data: Agent.Data;
185
- }
186
-
187
- export namespace Agent {
188
- /**
189
- * Related resource identifier
190
- */
191
- export interface Data {
192
- id: string;
193
-
194
- /**
195
- * Resource type
196
- */
197
- type: string;
198
- }
199
- }
200
-
201
- /**
202
- * Parent party delegation
203
- */
204
- export interface Delegation {
205
- /**
206
- * Related resource identifier
207
- */
208
- data: Delegation.Data;
209
- }
210
-
211
- export namespace Delegation {
212
- /**
213
- * Related resource identifier
214
- */
215
- export interface Data {
216
- id: string;
217
-
218
- /**
219
- * Resource type
220
- */
221
- type: string;
222
- }
223
- }
224
-
225
- /**
226
- * Developer party receiving access
227
- */
228
- export interface DelegateeParty {
229
- /**
230
- * Related resource identifier
231
- */
232
- data: DelegateeParty.Data | null;
233
- }
234
-
235
- export namespace DelegateeParty {
236
- /**
237
- * Related resource identifier
238
- */
239
- export interface Data {
240
- id: string;
241
-
242
- /**
243
- * Resource type
244
- */
245
- type: string;
246
- }
247
- }
248
-
249
- /**
250
- * Customer party granting access
251
- */
252
- export interface DelegatorParty {
253
- /**
254
- * Related resource identifier
255
- */
256
- data: DelegatorParty.Data | null;
257
- }
258
-
259
- export namespace DelegatorParty {
260
- /**
261
- * Related resource identifier
262
- */
263
- export interface Data {
264
- id: string;
265
-
266
- /**
267
- * Resource type
268
- */
269
- type: string;
270
- }
271
- }
272
- }
273
- }
274
- }
275
-
276
- export interface DelegationListAgentDelegationsResponse {
277
- data: Array<DelegationListAgentDelegationsResponse.Data>;
278
-
279
- meta: DelegationListAgentDelegationsResponse.Meta;
280
- }
281
-
282
- export namespace DelegationListAgentDelegationsResponse {
283
- export interface Data {
284
- /**
285
- * Resource ID
286
- */
287
- id: string;
288
-
289
- /**
290
- * Resource attributes
291
- */
292
- attributes: Data.Attributes;
293
-
294
- /**
295
- * Resource relationships
296
- */
297
- relationships: Data.Relationships;
298
-
299
- /**
300
- * Resource type
301
- */
302
- type: string;
303
- }
304
-
305
- export namespace Data {
306
- /**
307
- * Resource attributes
308
- */
309
- export interface Attributes {
310
- /**
311
- * Agent display name
312
- */
313
- agentName: string | null;
314
-
315
- /**
316
- * When this delegation was created
317
- */
318
- createdAt: string;
319
-
320
- /**
321
- * User who created this delegation (usr\_\*)
322
- */
323
- createdBy: string | null;
324
-
325
- /**
326
- * Developer party name
327
- */
328
- delegateePartyName: string | null;
329
-
330
- /**
331
- * Customer party name
332
- */
333
- delegatorPartyName: string | null;
334
-
335
- /**
336
- * Expiration timestamp
337
- */
338
- expiresAt: string | null;
339
-
340
- /**
341
- * Transaction limits in cents
342
- */
343
- limits: Attributes.Limits | null;
344
-
345
- /**
346
- * Granted permissions. Use `status` to derive Active vs Revoked.
347
- */
348
- permissions: Array<string>;
349
-
350
- /**
351
- * Authoritative active/revoked flag (revoke keeps permissions for audit)
352
- */
353
- status: 'ACTIVE' | 'REVOKED';
354
-
355
- /**
356
- * When this delegation was last updated
357
- */
358
- updatedAt: string;
359
- }
360
-
361
- export namespace Attributes {
362
- /**
363
- * Transaction limits in cents
364
- */
365
- export interface Limits {
366
- /**
367
- * Positive per-transaction limit in cents. null means no per-payment limit.
368
- */
369
- perTransaction?: number | null;
370
- }
371
- }
372
-
373
- /**
374
- * Resource relationships
375
- */
376
- export interface Relationships {
377
- /**
378
- * Agent granted access
379
- */
380
- agent: Relationships.Agent;
381
-
382
- /**
383
- * Parent party delegation
384
- */
385
- delegation: Relationships.Delegation;
386
-
387
- /**
388
- * Developer party receiving access
389
- */
390
- delegateeParty?: Relationships.DelegateeParty;
391
-
392
- /**
393
- * Customer party granting access
394
- */
395
- delegatorParty?: Relationships.DelegatorParty;
396
- }
397
-
398
- export namespace Relationships {
399
- /**
400
- * Agent granted access
401
- */
402
- export interface Agent {
403
- /**
404
- * Related resource identifier
405
- */
406
- data: Agent.Data;
407
- }
408
-
409
- export namespace Agent {
410
- /**
411
- * Related resource identifier
412
- */
413
- export interface Data {
414
- id: string;
415
-
416
- /**
417
- * Resource type
418
- */
419
- type: string;
420
- }
421
- }
422
-
423
- /**
424
- * Parent party delegation
425
- */
426
- export interface Delegation {
427
- /**
428
- * Related resource identifier
429
- */
430
- data: Delegation.Data;
431
- }
432
-
433
- export namespace Delegation {
434
- /**
435
- * Related resource identifier
436
- */
437
- export interface Data {
438
- id: string;
439
-
440
- /**
441
- * Resource type
442
- */
443
- type: string;
444
- }
445
- }
446
-
447
- /**
448
- * Developer party receiving access
449
- */
450
- export interface DelegateeParty {
451
- /**
452
- * Related resource identifier
453
- */
454
- data: DelegateeParty.Data | null;
455
- }
456
-
457
- export namespace DelegateeParty {
458
- /**
459
- * Related resource identifier
460
- */
461
- export interface Data {
462
- id: string;
463
-
464
- /**
465
- * Resource type
466
- */
467
- type: string;
468
- }
469
- }
470
-
471
- /**
472
- * Customer party granting access
473
- */
474
- export interface DelegatorParty {
475
- /**
476
- * Related resource identifier
477
- */
478
- data: DelegatorParty.Data | null;
479
- }
480
-
481
- export namespace DelegatorParty {
482
- /**
483
- * Related resource identifier
484
- */
485
- export interface Data {
486
- id: string;
487
-
488
- /**
489
- * Resource type
490
- */
491
- type: string;
492
- }
493
- }
494
- }
495
- }
496
-
497
- export interface Meta {
498
- pagination: Meta.Pagination;
499
- }
500
-
501
- export namespace Meta {
502
- export interface Pagination {
503
- hasMore: boolean;
504
-
505
- nextCursor: string | null;
506
- }
507
- }
508
- }
509
-
510
- export interface DelegationGetAgentDelegationParams {
511
- /**
512
- * Agent ID (agt_xxx) identifying which agent is making the request.
513
- */
514
- 'X-Agent-ID'?: string;
515
-
516
- /**
517
- * Required when X-Agent-ID is present. Session or conversation ID for agent
518
- * observability.
519
- */
520
- 'X-Instance-ID'?: string;
521
- }
522
-
523
- export interface DelegationListAgentDelegationsParams {
524
- /**
525
- * Query param: Filter by agent (agt_xxx)
526
- */
527
- agentId?: string;
528
-
529
- /**
530
- * Query param: Cursor for pagination
531
- */
532
- cursor?: string;
533
-
534
- /**
535
- * Query param: Filter to delegations where caller is the delegated party
536
- * (developer)
537
- */
538
- delegateePartyId?: string;
539
-
540
- /**
541
- * Query param: Filter by parent delegation (dlg_xxx)
542
- */
543
- delegationId?: string;
544
-
545
- /**
546
- * Query param: Filter to delegations where caller is the delegating party
547
- * (customer)
548
- */
549
- delegatorPartyId?: string;
550
-
551
- /**
552
- * Query param: Include revoked delegations
553
- */
554
- includeRevoked?: boolean | string;
555
-
556
- /**
557
- * Query param: Max items per page
558
- */
559
- limit?: number;
560
-
561
- /**
562
- * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
563
- */
564
- 'X-Agent-ID'?: string;
565
-
566
- /**
567
- * Header param: Required when X-Agent-ID is present. Session or conversation ID
568
- * for agent observability.
569
- */
570
- 'X-Instance-ID'?: string;
571
- }
572
-
573
- export declare namespace Delegations {
574
- export {
575
- type DelegationGetAgentDelegationResponse as DelegationGetAgentDelegationResponse,
576
- type DelegationListAgentDelegationsResponse as DelegationListAgentDelegationsResponse,
577
- type DelegationGetAgentDelegationParams as DelegationGetAgentDelegationParams,
578
- type DelegationListAgentDelegationsParams as DelegationListAgentDelegationsParams,
579
- };
580
- }