@naturalpay/sdk 0.4.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 (118) hide show
  1. package/CHANGELOG.md +9 -0
  2. package/client.d.mts +7 -16
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +7 -16
  5. package/client.d.ts.map +1 -1
  6. package/client.js +3 -12
  7. package/client.js.map +1 -1
  8. package/client.mjs +3 -12
  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/customers.d.mts +243 -114
  29. package/resources/customers.d.mts.map +1 -1
  30. package/resources/customers.d.ts +243 -114
  31. package/resources/customers.d.ts.map +1 -1
  32. package/resources/customers.js +6 -7
  33. package/resources/customers.js.map +1 -1
  34. package/resources/customers.mjs +6 -7
  35. package/resources/customers.mjs.map +1 -1
  36. package/resources/index.d.mts +2 -4
  37. package/resources/index.d.mts.map +1 -1
  38. package/resources/index.d.ts +2 -4
  39. package/resources/index.d.ts.map +1 -1
  40. package/resources/index.js +1 -5
  41. package/resources/index.js.map +1 -1
  42. package/resources/index.mjs +0 -2
  43. package/resources/index.mjs.map +1 -1
  44. package/src/client.ts +23 -60
  45. package/src/internal/utils/query.ts +18 -2
  46. package/src/resources/agents.ts +676 -300
  47. package/src/resources/customers.ts +273 -132
  48. package/src/resources/index.ts +10 -24
  49. package/src/version.ts +1 -1
  50. package/version.d.mts +1 -1
  51. package/version.d.ts +1 -1
  52. package/version.js +1 -1
  53. package/version.mjs +1 -1
  54. package/internal/qs/formats.d.mts +0 -7
  55. package/internal/qs/formats.d.mts.map +0 -1
  56. package/internal/qs/formats.d.ts +0 -7
  57. package/internal/qs/formats.d.ts.map +0 -1
  58. package/internal/qs/formats.js +0 -13
  59. package/internal/qs/formats.js.map +0 -1
  60. package/internal/qs/formats.mjs +0 -9
  61. package/internal/qs/formats.mjs.map +0 -1
  62. package/internal/qs/index.d.mts +0 -10
  63. package/internal/qs/index.d.mts.map +0 -1
  64. package/internal/qs/index.d.ts +0 -10
  65. package/internal/qs/index.d.ts.map +0 -1
  66. package/internal/qs/index.js +0 -14
  67. package/internal/qs/index.js.map +0 -1
  68. package/internal/qs/index.mjs +0 -10
  69. package/internal/qs/index.mjs.map +0 -1
  70. package/internal/qs/stringify.d.mts +0 -3
  71. package/internal/qs/stringify.d.mts.map +0 -1
  72. package/internal/qs/stringify.d.ts +0 -3
  73. package/internal/qs/stringify.d.ts.map +0 -1
  74. package/internal/qs/stringify.js +0 -277
  75. package/internal/qs/stringify.js.map +0 -1
  76. package/internal/qs/stringify.mjs +0 -274
  77. package/internal/qs/stringify.mjs.map +0 -1
  78. package/internal/qs/types.d.mts +0 -57
  79. package/internal/qs/types.d.mts.map +0 -1
  80. package/internal/qs/types.d.ts +0 -57
  81. package/internal/qs/types.d.ts.map +0 -1
  82. package/internal/qs/types.js +0 -3
  83. package/internal/qs/types.js.map +0 -1
  84. package/internal/qs/types.mjs +0 -2
  85. package/internal/qs/types.mjs.map +0 -1
  86. package/internal/qs/utils.d.mts +0 -15
  87. package/internal/qs/utils.d.mts.map +0 -1
  88. package/internal/qs/utils.d.ts +0 -15
  89. package/internal/qs/utils.d.ts.map +0 -1
  90. package/internal/qs/utils.js +0 -230
  91. package/internal/qs/utils.js.map +0 -1
  92. package/internal/qs/utils.mjs +0 -217
  93. package/internal/qs/utils.mjs.map +0 -1
  94. package/resources/delegations.d.mts +0 -458
  95. package/resources/delegations.d.mts.map +0 -1
  96. package/resources/delegations.d.ts +0 -458
  97. package/resources/delegations.d.ts.map +0 -1
  98. package/resources/delegations.js +0 -47
  99. package/resources/delegations.js.map +0 -1
  100. package/resources/delegations.mjs +0 -43
  101. package/resources/delegations.mjs.map +0 -1
  102. package/resources/escalations.d.mts +0 -1124
  103. package/resources/escalations.d.mts.map +0 -1
  104. package/resources/escalations.d.ts +0 -1124
  105. package/resources/escalations.d.ts.map +0 -1
  106. package/resources/escalations.js +0 -110
  107. package/resources/escalations.js.map +0 -1
  108. package/resources/escalations.mjs +0 -106
  109. package/resources/escalations.mjs.map +0 -1
  110. package/src/internal/qs/LICENSE.md +0 -13
  111. package/src/internal/qs/README.md +0 -3
  112. package/src/internal/qs/formats.ts +0 -10
  113. package/src/internal/qs/index.ts +0 -13
  114. package/src/internal/qs/stringify.ts +0 -385
  115. package/src/internal/qs/types.ts +0 -71
  116. package/src/internal/qs/utils.ts +0 -265
  117. package/src/resources/delegations.ts +0 -580
  118. package/src/resources/escalations.ts +0 -1422
@@ -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
- }