@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,1124 +0,0 @@
1
- import { APIResource } from "../core/resource.js";
2
- import { APIPromise } from "../core/api-promise.js";
3
- import { RequestOptions } from "../internal/request-options.js";
4
- /**
5
- * Payment approval escalation operations
6
- */
7
- export declare class Escalations extends APIResource {
8
- /**
9
- * List escalations awaiting or recording approval decisions for your party.
10
- *
11
- * @example
12
- * ```ts
13
- * const escalations = await client.escalations.list();
14
- * ```
15
- */
16
- list(params?: EscalationListParams | null | undefined, options?: RequestOptions): APIPromise<EscalationListResponse>;
17
- /**
18
- * Approve the payment that exceeded approval limits.
19
- *
20
- * @example
21
- * ```ts
22
- * const response = await client.escalations.approve(
23
- * 'apr_ecc2efdd09bd231a9ad9bd2aada37aa7',
24
- * { 'Idempotency-Key': 'Idempotency-Key' },
25
- * );
26
- * ```
27
- */
28
- approve(escalationID: string, params: EscalationApproveParams, options?: RequestOptions): APIPromise<EscalationApproveResponse>;
29
- /**
30
- * Deny the payment that exceeded approval limits.
31
- *
32
- * @example
33
- * ```ts
34
- * const response = await client.escalations.deny(
35
- * 'apr_ecc2efdd09bd231a9ad9bd2aada37aa7',
36
- * { 'Idempotency-Key': 'Idempotency-Key' },
37
- * );
38
- * ```
39
- */
40
- deny(escalationID: string, params: EscalationDenyParams, options?: RequestOptions): APIPromise<EscalationDenyResponse>;
41
- /**
42
- * Get details of a specific escalation by approval request ID.
43
- *
44
- * @example
45
- * ```ts
46
- * const escalation = await client.escalations.get(
47
- * 'apr_ecc2efdd09bd231a9ad9bd2aada37aa7',
48
- * );
49
- * ```
50
- */
51
- get(escalationID: string, params?: EscalationGetParams | null | undefined, options?: RequestOptions): APIPromise<EscalationGetResponse>;
52
- }
53
- export interface EscalationListResponse {
54
- data: Array<EscalationListResponse.Data>;
55
- meta: EscalationListResponse.Meta;
56
- }
57
- export declare namespace EscalationListResponse {
58
- interface Data {
59
- /**
60
- * Resource ID
61
- */
62
- id: string;
63
- /**
64
- * Resource attributes
65
- */
66
- attributes: Data.Attributes;
67
- /**
68
- * Resource relationships
69
- */
70
- relationships: Data.Relationships;
71
- /**
72
- * Resource type
73
- */
74
- type: string;
75
- }
76
- namespace Data {
77
- /**
78
- * Resource attributes
79
- */
80
- interface Attributes {
81
- /**
82
- * Agent ID that initiated the payment, if actor was an agent
83
- */
84
- agentId: string | null;
85
- /**
86
- * Payment amount in minor units (cents)
87
- */
88
- amountMinor: number;
89
- /**
90
- * Product-safe subject that caused the approval
91
- */
92
- approvalScope: Attributes.ApprovalScope;
93
- /**
94
- * All breached limits covered by this approval
95
- */
96
- breachedLimits: Array<Attributes.BreachedLimit>;
97
- /**
98
- * When approval was created
99
- */
100
- createdAt: string;
101
- /**
102
- * Currency code (e.g., USD)
103
- */
104
- currency: string;
105
- /**
106
- * Optional note supplied when denied
107
- */
108
- denialReason: string | null;
109
- /**
110
- * PROGRAM or CUSTOMER
111
- */
112
- evaluationTier: 'PROGRAM' | 'CUSTOMER';
113
- /**
114
- * Configured per-payment limit from the approval snapshot, in minor units
115
- */
116
- exceededLimitAmountMinor: number | null;
117
- /**
118
- * Limit currency from the approval snapshot
119
- */
120
- exceededLimitCurrency: string | null;
121
- /**
122
- * Money Movement Request ID
123
- */
124
- moneyMovementRequestId: string | null;
125
- /**
126
- * Recipient label to display in approval UI
127
- */
128
- recipientDisplayName: string | null;
129
- /**
130
- * Recipient email or other claim identifier when available
131
- */
132
- recipientIdentifier: string | null;
133
- /**
134
- * Recipient party display name (enriched from identity)
135
- */
136
- recipientPartyName: string | null;
137
- /**
138
- * When approval was resolved (approved/denied)
139
- */
140
- resolvedAt: string | null;
141
- /**
142
- * Party that resolved the approval
143
- */
144
- resolvedByPartyId: string | null;
145
- /**
146
- * Sender party display name (enriched from identity)
147
- */
148
- senderPartyName: string | null;
149
- /**
150
- * Approval status
151
- */
152
- status: 'PENDING' | 'APPROVED' | 'DENIED' | 'CANCELLED';
153
- /**
154
- * User-facing transaction ID (txn_xxx) derived from the money movement request
155
- */
156
- transactionId: string | null;
157
- }
158
- namespace Attributes {
159
- /**
160
- * Product-safe subject that caused the approval
161
- */
162
- interface ApprovalScope {
163
- /**
164
- * Scope subject ID, when available
165
- */
166
- id: string | null;
167
- /**
168
- * Product-safe approval scope type
169
- */
170
- type: 'PROGRAM' | 'PARTY' | 'AGENT_DELEGATION' | 'AGENT' | 'UNKNOWN';
171
- }
172
- interface BreachedLimit {
173
- /**
174
- * Actual payment amount in minor units
175
- */
176
- actualAmountMinor: number;
177
- /**
178
- * Configured limit threshold in minor units
179
- */
180
- amountMinor: number;
181
- /**
182
- * Limit currency
183
- */
184
- currency: string;
185
- /**
186
- * Approval gate order evaluated for this policy
187
- */
188
- gateOrder: number;
189
- /**
190
- * Policy version evaluated for this approval
191
- */
192
- policyDbVersion: number | null;
193
- /**
194
- * Approval policy that was breached
195
- */
196
- policyId: string;
197
- /**
198
- * Scope of the breached policy
199
- */
200
- scope: BreachedLimit.Scope;
201
- }
202
- namespace BreachedLimit {
203
- /**
204
- * Scope of the breached policy
205
- */
206
- interface Scope {
207
- /**
208
- * Scope subject ID, when available
209
- */
210
- id: string | null;
211
- /**
212
- * Product-safe approval scope type
213
- */
214
- type: 'PROGRAM' | 'PARTY' | 'AGENT_DELEGATION' | 'AGENT' | 'UNKNOWN';
215
- }
216
- }
217
- }
218
- /**
219
- * Resource relationships
220
- */
221
- interface Relationships {
222
- /**
223
- * Party who can approve/deny
224
- */
225
- approverParty: Relationships.ApproverParty;
226
- /**
227
- * Recipient party
228
- */
229
- recipientParty: Relationships.RecipientParty;
230
- /**
231
- * Sender party
232
- */
233
- senderParty: Relationships.SenderParty;
234
- }
235
- namespace Relationships {
236
- /**
237
- * Party who can approve/deny
238
- */
239
- interface ApproverParty {
240
- /**
241
- * Related resource identifier
242
- */
243
- data: ApproverParty.Data | null;
244
- }
245
- namespace ApproverParty {
246
- /**
247
- * Related resource identifier
248
- */
249
- interface Data {
250
- id: string;
251
- /**
252
- * Resource type
253
- */
254
- type: string;
255
- }
256
- }
257
- /**
258
- * Recipient party
259
- */
260
- interface RecipientParty {
261
- /**
262
- * Related resource identifier
263
- */
264
- data: RecipientParty.Data | null;
265
- }
266
- namespace RecipientParty {
267
- /**
268
- * Related resource identifier
269
- */
270
- interface Data {
271
- id: string;
272
- /**
273
- * Resource type
274
- */
275
- type: string;
276
- }
277
- }
278
- /**
279
- * Sender party
280
- */
281
- interface SenderParty {
282
- /**
283
- * Related resource identifier
284
- */
285
- data: SenderParty.Data | null;
286
- }
287
- namespace SenderParty {
288
- /**
289
- * Related resource identifier
290
- */
291
- interface Data {
292
- id: string;
293
- /**
294
- * Resource type
295
- */
296
- type: string;
297
- }
298
- }
299
- }
300
- }
301
- interface Meta {
302
- pagination: Meta.Pagination;
303
- }
304
- namespace Meta {
305
- interface Pagination {
306
- hasMore: boolean;
307
- nextCursor: string | null;
308
- }
309
- }
310
- }
311
- export interface EscalationApproveResponse {
312
- data: EscalationApproveResponse.Data;
313
- }
314
- export declare namespace EscalationApproveResponse {
315
- interface Data {
316
- /**
317
- * Resource ID
318
- */
319
- id: string;
320
- /**
321
- * Resource attributes
322
- */
323
- attributes: Data.Attributes;
324
- /**
325
- * Resource relationships
326
- */
327
- relationships: Data.Relationships;
328
- /**
329
- * Resource type
330
- */
331
- type: string;
332
- }
333
- namespace Data {
334
- /**
335
- * Resource attributes
336
- */
337
- interface Attributes {
338
- /**
339
- * Agent ID that initiated the payment, if actor was an agent
340
- */
341
- agentId: string | null;
342
- /**
343
- * Payment amount in minor units (cents)
344
- */
345
- amountMinor: number;
346
- /**
347
- * Product-safe subject that caused the approval
348
- */
349
- approvalScope: Attributes.ApprovalScope;
350
- /**
351
- * All breached limits covered by this approval
352
- */
353
- breachedLimits: Array<Attributes.BreachedLimit>;
354
- /**
355
- * When approval was created
356
- */
357
- createdAt: string;
358
- /**
359
- * Currency code (e.g., USD)
360
- */
361
- currency: string;
362
- /**
363
- * Optional note supplied when denied
364
- */
365
- denialReason: string | null;
366
- /**
367
- * PROGRAM or CUSTOMER
368
- */
369
- evaluationTier: 'PROGRAM' | 'CUSTOMER';
370
- /**
371
- * Configured per-payment limit from the approval snapshot, in minor units
372
- */
373
- exceededLimitAmountMinor: number | null;
374
- /**
375
- * Limit currency from the approval snapshot
376
- */
377
- exceededLimitCurrency: string | null;
378
- /**
379
- * Money Movement Request ID
380
- */
381
- moneyMovementRequestId: string | null;
382
- /**
383
- * Recipient label to display in approval UI
384
- */
385
- recipientDisplayName: string | null;
386
- /**
387
- * Recipient email or other claim identifier when available
388
- */
389
- recipientIdentifier: string | null;
390
- /**
391
- * Recipient party display name (enriched from identity)
392
- */
393
- recipientPartyName: string | null;
394
- /**
395
- * When approval was resolved (approved/denied)
396
- */
397
- resolvedAt: string | null;
398
- /**
399
- * Party that resolved the approval
400
- */
401
- resolvedByPartyId: string | null;
402
- /**
403
- * Sender party display name (enriched from identity)
404
- */
405
- senderPartyName: string | null;
406
- /**
407
- * Approval status
408
- */
409
- status: 'PENDING' | 'APPROVED' | 'DENIED' | 'CANCELLED';
410
- /**
411
- * User-facing transaction ID (txn_xxx) derived from the money movement request
412
- */
413
- transactionId: string | null;
414
- }
415
- namespace Attributes {
416
- /**
417
- * Product-safe subject that caused the approval
418
- */
419
- interface ApprovalScope {
420
- /**
421
- * Scope subject ID, when available
422
- */
423
- id: string | null;
424
- /**
425
- * Product-safe approval scope type
426
- */
427
- type: 'PROGRAM' | 'PARTY' | 'AGENT_DELEGATION' | 'AGENT' | 'UNKNOWN';
428
- }
429
- interface BreachedLimit {
430
- /**
431
- * Actual payment amount in minor units
432
- */
433
- actualAmountMinor: number;
434
- /**
435
- * Configured limit threshold in minor units
436
- */
437
- amountMinor: number;
438
- /**
439
- * Limit currency
440
- */
441
- currency: string;
442
- /**
443
- * Approval gate order evaluated for this policy
444
- */
445
- gateOrder: number;
446
- /**
447
- * Policy version evaluated for this approval
448
- */
449
- policyDbVersion: number | null;
450
- /**
451
- * Approval policy that was breached
452
- */
453
- policyId: string;
454
- /**
455
- * Scope of the breached policy
456
- */
457
- scope: BreachedLimit.Scope;
458
- }
459
- namespace BreachedLimit {
460
- /**
461
- * Scope of the breached policy
462
- */
463
- interface Scope {
464
- /**
465
- * Scope subject ID, when available
466
- */
467
- id: string | null;
468
- /**
469
- * Product-safe approval scope type
470
- */
471
- type: 'PROGRAM' | 'PARTY' | 'AGENT_DELEGATION' | 'AGENT' | 'UNKNOWN';
472
- }
473
- }
474
- }
475
- /**
476
- * Resource relationships
477
- */
478
- interface Relationships {
479
- /**
480
- * Party who can approve/deny
481
- */
482
- approverParty: Relationships.ApproverParty;
483
- /**
484
- * Recipient party
485
- */
486
- recipientParty: Relationships.RecipientParty;
487
- /**
488
- * Sender party
489
- */
490
- senderParty: Relationships.SenderParty;
491
- }
492
- namespace Relationships {
493
- /**
494
- * Party who can approve/deny
495
- */
496
- interface ApproverParty {
497
- /**
498
- * Related resource identifier
499
- */
500
- data: ApproverParty.Data | null;
501
- }
502
- namespace ApproverParty {
503
- /**
504
- * Related resource identifier
505
- */
506
- interface Data {
507
- id: string;
508
- /**
509
- * Resource type
510
- */
511
- type: string;
512
- }
513
- }
514
- /**
515
- * Recipient party
516
- */
517
- interface RecipientParty {
518
- /**
519
- * Related resource identifier
520
- */
521
- data: RecipientParty.Data | null;
522
- }
523
- namespace RecipientParty {
524
- /**
525
- * Related resource identifier
526
- */
527
- interface Data {
528
- id: string;
529
- /**
530
- * Resource type
531
- */
532
- type: string;
533
- }
534
- }
535
- /**
536
- * Sender party
537
- */
538
- interface SenderParty {
539
- /**
540
- * Related resource identifier
541
- */
542
- data: SenderParty.Data | null;
543
- }
544
- namespace SenderParty {
545
- /**
546
- * Related resource identifier
547
- */
548
- interface Data {
549
- id: string;
550
- /**
551
- * Resource type
552
- */
553
- type: string;
554
- }
555
- }
556
- }
557
- }
558
- }
559
- export interface EscalationDenyResponse {
560
- data: EscalationDenyResponse.Data;
561
- }
562
- export declare namespace EscalationDenyResponse {
563
- interface Data {
564
- /**
565
- * Resource ID
566
- */
567
- id: string;
568
- /**
569
- * Resource attributes
570
- */
571
- attributes: Data.Attributes;
572
- /**
573
- * Resource relationships
574
- */
575
- relationships: Data.Relationships;
576
- /**
577
- * Resource type
578
- */
579
- type: string;
580
- }
581
- namespace Data {
582
- /**
583
- * Resource attributes
584
- */
585
- interface Attributes {
586
- /**
587
- * Agent ID that initiated the payment, if actor was an agent
588
- */
589
- agentId: string | null;
590
- /**
591
- * Payment amount in minor units (cents)
592
- */
593
- amountMinor: number;
594
- /**
595
- * Product-safe subject that caused the approval
596
- */
597
- approvalScope: Attributes.ApprovalScope;
598
- /**
599
- * All breached limits covered by this approval
600
- */
601
- breachedLimits: Array<Attributes.BreachedLimit>;
602
- /**
603
- * When approval was created
604
- */
605
- createdAt: string;
606
- /**
607
- * Currency code (e.g., USD)
608
- */
609
- currency: string;
610
- /**
611
- * Optional note supplied when denied
612
- */
613
- denialReason: string | null;
614
- /**
615
- * PROGRAM or CUSTOMER
616
- */
617
- evaluationTier: 'PROGRAM' | 'CUSTOMER';
618
- /**
619
- * Configured per-payment limit from the approval snapshot, in minor units
620
- */
621
- exceededLimitAmountMinor: number | null;
622
- /**
623
- * Limit currency from the approval snapshot
624
- */
625
- exceededLimitCurrency: string | null;
626
- /**
627
- * Money Movement Request ID
628
- */
629
- moneyMovementRequestId: string | null;
630
- /**
631
- * Recipient label to display in approval UI
632
- */
633
- recipientDisplayName: string | null;
634
- /**
635
- * Recipient email or other claim identifier when available
636
- */
637
- recipientIdentifier: string | null;
638
- /**
639
- * Recipient party display name (enriched from identity)
640
- */
641
- recipientPartyName: string | null;
642
- /**
643
- * When approval was resolved (approved/denied)
644
- */
645
- resolvedAt: string | null;
646
- /**
647
- * Party that resolved the approval
648
- */
649
- resolvedByPartyId: string | null;
650
- /**
651
- * Sender party display name (enriched from identity)
652
- */
653
- senderPartyName: string | null;
654
- /**
655
- * Approval status
656
- */
657
- status: 'PENDING' | 'APPROVED' | 'DENIED' | 'CANCELLED';
658
- /**
659
- * User-facing transaction ID (txn_xxx) derived from the money movement request
660
- */
661
- transactionId: string | null;
662
- }
663
- namespace Attributes {
664
- /**
665
- * Product-safe subject that caused the approval
666
- */
667
- interface ApprovalScope {
668
- /**
669
- * Scope subject ID, when available
670
- */
671
- id: string | null;
672
- /**
673
- * Product-safe approval scope type
674
- */
675
- type: 'PROGRAM' | 'PARTY' | 'AGENT_DELEGATION' | 'AGENT' | 'UNKNOWN';
676
- }
677
- interface BreachedLimit {
678
- /**
679
- * Actual payment amount in minor units
680
- */
681
- actualAmountMinor: number;
682
- /**
683
- * Configured limit threshold in minor units
684
- */
685
- amountMinor: number;
686
- /**
687
- * Limit currency
688
- */
689
- currency: string;
690
- /**
691
- * Approval gate order evaluated for this policy
692
- */
693
- gateOrder: number;
694
- /**
695
- * Policy version evaluated for this approval
696
- */
697
- policyDbVersion: number | null;
698
- /**
699
- * Approval policy that was breached
700
- */
701
- policyId: string;
702
- /**
703
- * Scope of the breached policy
704
- */
705
- scope: BreachedLimit.Scope;
706
- }
707
- namespace BreachedLimit {
708
- /**
709
- * Scope of the breached policy
710
- */
711
- interface Scope {
712
- /**
713
- * Scope subject ID, when available
714
- */
715
- id: string | null;
716
- /**
717
- * Product-safe approval scope type
718
- */
719
- type: 'PROGRAM' | 'PARTY' | 'AGENT_DELEGATION' | 'AGENT' | 'UNKNOWN';
720
- }
721
- }
722
- }
723
- /**
724
- * Resource relationships
725
- */
726
- interface Relationships {
727
- /**
728
- * Party who can approve/deny
729
- */
730
- approverParty: Relationships.ApproverParty;
731
- /**
732
- * Recipient party
733
- */
734
- recipientParty: Relationships.RecipientParty;
735
- /**
736
- * Sender party
737
- */
738
- senderParty: Relationships.SenderParty;
739
- }
740
- namespace Relationships {
741
- /**
742
- * Party who can approve/deny
743
- */
744
- interface ApproverParty {
745
- /**
746
- * Related resource identifier
747
- */
748
- data: ApproverParty.Data | null;
749
- }
750
- namespace ApproverParty {
751
- /**
752
- * Related resource identifier
753
- */
754
- interface Data {
755
- id: string;
756
- /**
757
- * Resource type
758
- */
759
- type: string;
760
- }
761
- }
762
- /**
763
- * Recipient party
764
- */
765
- interface RecipientParty {
766
- /**
767
- * Related resource identifier
768
- */
769
- data: RecipientParty.Data | null;
770
- }
771
- namespace RecipientParty {
772
- /**
773
- * Related resource identifier
774
- */
775
- interface Data {
776
- id: string;
777
- /**
778
- * Resource type
779
- */
780
- type: string;
781
- }
782
- }
783
- /**
784
- * Sender party
785
- */
786
- interface SenderParty {
787
- /**
788
- * Related resource identifier
789
- */
790
- data: SenderParty.Data | null;
791
- }
792
- namespace SenderParty {
793
- /**
794
- * Related resource identifier
795
- */
796
- interface Data {
797
- id: string;
798
- /**
799
- * Resource type
800
- */
801
- type: string;
802
- }
803
- }
804
- }
805
- }
806
- }
807
- export interface EscalationGetResponse {
808
- data: EscalationGetResponse.Data;
809
- }
810
- export declare namespace EscalationGetResponse {
811
- interface Data {
812
- /**
813
- * Resource ID
814
- */
815
- id: string;
816
- /**
817
- * Resource attributes
818
- */
819
- attributes: Data.Attributes;
820
- /**
821
- * Resource relationships
822
- */
823
- relationships: Data.Relationships;
824
- /**
825
- * Resource type
826
- */
827
- type: string;
828
- }
829
- namespace Data {
830
- /**
831
- * Resource attributes
832
- */
833
- interface Attributes {
834
- /**
835
- * Agent ID that initiated the payment, if actor was an agent
836
- */
837
- agentId: string | null;
838
- /**
839
- * Payment amount in minor units (cents)
840
- */
841
- amountMinor: number;
842
- /**
843
- * Product-safe subject that caused the approval
844
- */
845
- approvalScope: Attributes.ApprovalScope;
846
- /**
847
- * All breached limits covered by this approval
848
- */
849
- breachedLimits: Array<Attributes.BreachedLimit>;
850
- /**
851
- * When approval was created
852
- */
853
- createdAt: string;
854
- /**
855
- * Currency code (e.g., USD)
856
- */
857
- currency: string;
858
- /**
859
- * Optional note supplied when denied
860
- */
861
- denialReason: string | null;
862
- /**
863
- * PROGRAM or CUSTOMER
864
- */
865
- evaluationTier: 'PROGRAM' | 'CUSTOMER';
866
- /**
867
- * Configured per-payment limit from the approval snapshot, in minor units
868
- */
869
- exceededLimitAmountMinor: number | null;
870
- /**
871
- * Limit currency from the approval snapshot
872
- */
873
- exceededLimitCurrency: string | null;
874
- /**
875
- * Money Movement Request ID
876
- */
877
- moneyMovementRequestId: string | null;
878
- /**
879
- * Recipient label to display in approval UI
880
- */
881
- recipientDisplayName: string | null;
882
- /**
883
- * Recipient email or other claim identifier when available
884
- */
885
- recipientIdentifier: string | null;
886
- /**
887
- * Recipient party display name (enriched from identity)
888
- */
889
- recipientPartyName: string | null;
890
- /**
891
- * When approval was resolved (approved/denied)
892
- */
893
- resolvedAt: string | null;
894
- /**
895
- * Party that resolved the approval
896
- */
897
- resolvedByPartyId: string | null;
898
- /**
899
- * Sender party display name (enriched from identity)
900
- */
901
- senderPartyName: string | null;
902
- /**
903
- * Approval status
904
- */
905
- status: 'PENDING' | 'APPROVED' | 'DENIED' | 'CANCELLED';
906
- /**
907
- * User-facing transaction ID (txn_xxx) derived from the money movement request
908
- */
909
- transactionId: string | null;
910
- }
911
- namespace Attributes {
912
- /**
913
- * Product-safe subject that caused the approval
914
- */
915
- interface ApprovalScope {
916
- /**
917
- * Scope subject ID, when available
918
- */
919
- id: string | null;
920
- /**
921
- * Product-safe approval scope type
922
- */
923
- type: 'PROGRAM' | 'PARTY' | 'AGENT_DELEGATION' | 'AGENT' | 'UNKNOWN';
924
- }
925
- interface BreachedLimit {
926
- /**
927
- * Actual payment amount in minor units
928
- */
929
- actualAmountMinor: number;
930
- /**
931
- * Configured limit threshold in minor units
932
- */
933
- amountMinor: number;
934
- /**
935
- * Limit currency
936
- */
937
- currency: string;
938
- /**
939
- * Approval gate order evaluated for this policy
940
- */
941
- gateOrder: number;
942
- /**
943
- * Policy version evaluated for this approval
944
- */
945
- policyDbVersion: number | null;
946
- /**
947
- * Approval policy that was breached
948
- */
949
- policyId: string;
950
- /**
951
- * Scope of the breached policy
952
- */
953
- scope: BreachedLimit.Scope;
954
- }
955
- namespace BreachedLimit {
956
- /**
957
- * Scope of the breached policy
958
- */
959
- interface Scope {
960
- /**
961
- * Scope subject ID, when available
962
- */
963
- id: string | null;
964
- /**
965
- * Product-safe approval scope type
966
- */
967
- type: 'PROGRAM' | 'PARTY' | 'AGENT_DELEGATION' | 'AGENT' | 'UNKNOWN';
968
- }
969
- }
970
- }
971
- /**
972
- * Resource relationships
973
- */
974
- interface Relationships {
975
- /**
976
- * Party who can approve/deny
977
- */
978
- approverParty: Relationships.ApproverParty;
979
- /**
980
- * Recipient party
981
- */
982
- recipientParty: Relationships.RecipientParty;
983
- /**
984
- * Sender party
985
- */
986
- senderParty: Relationships.SenderParty;
987
- }
988
- namespace Relationships {
989
- /**
990
- * Party who can approve/deny
991
- */
992
- interface ApproverParty {
993
- /**
994
- * Related resource identifier
995
- */
996
- data: ApproverParty.Data | null;
997
- }
998
- namespace ApproverParty {
999
- /**
1000
- * Related resource identifier
1001
- */
1002
- interface Data {
1003
- id: string;
1004
- /**
1005
- * Resource type
1006
- */
1007
- type: string;
1008
- }
1009
- }
1010
- /**
1011
- * Recipient party
1012
- */
1013
- interface RecipientParty {
1014
- /**
1015
- * Related resource identifier
1016
- */
1017
- data: RecipientParty.Data | null;
1018
- }
1019
- namespace RecipientParty {
1020
- /**
1021
- * Related resource identifier
1022
- */
1023
- interface Data {
1024
- id: string;
1025
- /**
1026
- * Resource type
1027
- */
1028
- type: string;
1029
- }
1030
- }
1031
- /**
1032
- * Sender party
1033
- */
1034
- interface SenderParty {
1035
- /**
1036
- * Related resource identifier
1037
- */
1038
- data: SenderParty.Data | null;
1039
- }
1040
- namespace SenderParty {
1041
- /**
1042
- * Related resource identifier
1043
- */
1044
- interface Data {
1045
- id: string;
1046
- /**
1047
- * Resource type
1048
- */
1049
- type: string;
1050
- }
1051
- }
1052
- }
1053
- }
1054
- }
1055
- export interface EscalationListParams {
1056
- /**
1057
- * Query param: Maximum number to return
1058
- */
1059
- limit?: number;
1060
- /**
1061
- * Query param: Approval status to list. Defaults to pending approvals.
1062
- */
1063
- status?: 'PENDING' | 'APPROVED' | 'DENIED' | 'CANCELLED';
1064
- /**
1065
- * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
1066
- */
1067
- 'X-Agent-ID'?: string;
1068
- /**
1069
- * Header param: Required when X-Agent-ID is present. Session or conversation ID
1070
- * for agent observability.
1071
- */
1072
- 'X-Instance-ID'?: string;
1073
- }
1074
- export interface EscalationApproveParams {
1075
- /**
1076
- * Unique key for idempotent request handling. If a request with the same key was
1077
- * already processed, the original response is returned.
1078
- */
1079
- 'Idempotency-Key': string;
1080
- /**
1081
- * Agent ID (agt_xxx) identifying which agent is making the request.
1082
- */
1083
- 'X-Agent-ID'?: string;
1084
- /**
1085
- * Required when X-Agent-ID is present. Session or conversation ID for agent
1086
- * observability.
1087
- */
1088
- 'X-Instance-ID'?: string;
1089
- }
1090
- export interface EscalationDenyParams {
1091
- /**
1092
- * Header param: Unique key for idempotent request handling. If a request with the
1093
- * same key was already processed, the original response is returned.
1094
- */
1095
- 'Idempotency-Key': string;
1096
- /**
1097
- * Body param: Reason for denial (optional)
1098
- */
1099
- reason?: string;
1100
- /**
1101
- * Header param: Agent ID (agt_xxx) identifying which agent is making the request.
1102
- */
1103
- 'X-Agent-ID'?: string;
1104
- /**
1105
- * Header param: Required when X-Agent-ID is present. Session or conversation ID
1106
- * for agent observability.
1107
- */
1108
- 'X-Instance-ID'?: string;
1109
- }
1110
- export interface EscalationGetParams {
1111
- /**
1112
- * Agent ID (agt_xxx) identifying which agent is making the request.
1113
- */
1114
- 'X-Agent-ID'?: string;
1115
- /**
1116
- * Required when X-Agent-ID is present. Session or conversation ID for agent
1117
- * observability.
1118
- */
1119
- 'X-Instance-ID'?: string;
1120
- }
1121
- export declare namespace Escalations {
1122
- export { type EscalationListResponse as EscalationListResponse, type EscalationApproveResponse as EscalationApproveResponse, type EscalationDenyResponse as EscalationDenyResponse, type EscalationGetResponse as EscalationGetResponse, type EscalationListParams as EscalationListParams, type EscalationApproveParams as EscalationApproveParams, type EscalationDenyParams as EscalationDenyParams, type EscalationGetParams as EscalationGetParams, };
1123
- }
1124
- //# sourceMappingURL=escalations.d.ts.map