@naturalpay/sdk 0.4.0 → 0.7.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 +17 -0
- package/client.d.mts +7 -16
- package/client.d.mts.map +1 -1
- package/client.d.ts +7 -16
- package/client.d.ts.map +1 -1
- package/client.js +3 -12
- package/client.js.map +1 -1
- package/client.mjs +3 -12
- package/client.mjs.map +1 -1
- package/internal/tslib.js +17 -17
- package/internal/utils/query.d.mts +3 -0
- package/internal/utils/query.d.mts.map +1 -1
- package/internal/utils/query.d.ts +3 -0
- package/internal/utils/query.d.ts.map +1 -1
- package/internal/utils/query.js +16 -3
- package/internal/utils/query.js.map +1 -1
- package/internal/utils/query.mjs +16 -2
- package/internal/utils/query.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/agents.d.mts +435 -260
- package/resources/agents.d.mts.map +1 -1
- package/resources/agents.d.ts +435 -260
- package/resources/agents.d.ts.map +1 -1
- package/resources/agents.js +72 -20
- package/resources/agents.js.map +1 -1
- package/resources/agents.mjs +72 -20
- package/resources/agents.mjs.map +1 -1
- package/resources/customers.d.mts +243 -114
- package/resources/customers.d.mts.map +1 -1
- package/resources/customers.d.ts +243 -114
- package/resources/customers.d.ts.map +1 -1
- package/resources/customers.js +6 -7
- package/resources/customers.js.map +1 -1
- package/resources/customers.mjs +6 -7
- package/resources/customers.mjs.map +1 -1
- package/resources/index.d.mts +2 -4
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -4
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +1 -5
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +0 -2
- package/resources/index.mjs.map +1 -1
- package/src/client.ts +23 -60
- package/src/internal/utils/query.ts +18 -2
- package/src/resources/agents.ts +541 -294
- package/src/resources/customers.ts +273 -132
- package/src/resources/index.ts +10 -24
- 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
- package/internal/qs/formats.d.mts +0 -7
- package/internal/qs/formats.d.mts.map +0 -1
- package/internal/qs/formats.d.ts +0 -7
- package/internal/qs/formats.d.ts.map +0 -1
- package/internal/qs/formats.js +0 -13
- package/internal/qs/formats.js.map +0 -1
- package/internal/qs/formats.mjs +0 -9
- package/internal/qs/formats.mjs.map +0 -1
- package/internal/qs/index.d.mts +0 -10
- package/internal/qs/index.d.mts.map +0 -1
- package/internal/qs/index.d.ts +0 -10
- package/internal/qs/index.d.ts.map +0 -1
- package/internal/qs/index.js +0 -14
- package/internal/qs/index.js.map +0 -1
- package/internal/qs/index.mjs +0 -10
- package/internal/qs/index.mjs.map +0 -1
- package/internal/qs/stringify.d.mts +0 -3
- package/internal/qs/stringify.d.mts.map +0 -1
- package/internal/qs/stringify.d.ts +0 -3
- package/internal/qs/stringify.d.ts.map +0 -1
- package/internal/qs/stringify.js +0 -277
- package/internal/qs/stringify.js.map +0 -1
- package/internal/qs/stringify.mjs +0 -274
- package/internal/qs/stringify.mjs.map +0 -1
- package/internal/qs/types.d.mts +0 -57
- package/internal/qs/types.d.mts.map +0 -1
- package/internal/qs/types.d.ts +0 -57
- package/internal/qs/types.d.ts.map +0 -1
- package/internal/qs/types.js +0 -3
- package/internal/qs/types.js.map +0 -1
- package/internal/qs/types.mjs +0 -2
- package/internal/qs/types.mjs.map +0 -1
- package/internal/qs/utils.d.mts +0 -15
- package/internal/qs/utils.d.mts.map +0 -1
- package/internal/qs/utils.d.ts +0 -15
- package/internal/qs/utils.d.ts.map +0 -1
- package/internal/qs/utils.js +0 -230
- package/internal/qs/utils.js.map +0 -1
- package/internal/qs/utils.mjs +0 -217
- package/internal/qs/utils.mjs.map +0 -1
- package/resources/delegations.d.mts +0 -458
- package/resources/delegations.d.mts.map +0 -1
- package/resources/delegations.d.ts +0 -458
- package/resources/delegations.d.ts.map +0 -1
- package/resources/delegations.js +0 -47
- package/resources/delegations.js.map +0 -1
- package/resources/delegations.mjs +0 -43
- package/resources/delegations.mjs.map +0 -1
- package/resources/escalations.d.mts +0 -1124
- package/resources/escalations.d.mts.map +0 -1
- package/resources/escalations.d.ts +0 -1124
- package/resources/escalations.d.ts.map +0 -1
- package/resources/escalations.js +0 -110
- package/resources/escalations.js.map +0 -1
- package/resources/escalations.mjs +0 -106
- package/resources/escalations.mjs.map +0 -1
- package/src/internal/qs/LICENSE.md +0 -13
- package/src/internal/qs/README.md +0 -3
- package/src/internal/qs/formats.ts +0 -10
- package/src/internal/qs/index.ts +0 -13
- package/src/internal/qs/stringify.ts +0 -385
- package/src/internal/qs/types.ts +0 -71
- package/src/internal/qs/utils.ts +0 -265
- package/src/resources/delegations.ts +0 -580
- package/src/resources/escalations.ts +0 -1422
|
@@ -1,1422 +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
|
-
* Payment approval escalation operations
|
|
11
|
-
*/
|
|
12
|
-
export class Escalations extends APIResource {
|
|
13
|
-
/**
|
|
14
|
-
* List escalations awaiting or recording approval decisions for your party.
|
|
15
|
-
*
|
|
16
|
-
* @example
|
|
17
|
-
* ```ts
|
|
18
|
-
* const escalations = await client.escalations.list();
|
|
19
|
-
* ```
|
|
20
|
-
*/
|
|
21
|
-
list(
|
|
22
|
-
params: EscalationListParams | null | undefined = {},
|
|
23
|
-
options?: RequestOptions,
|
|
24
|
-
): APIPromise<EscalationListResponse> {
|
|
25
|
-
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID, ...query } = params ?? {};
|
|
26
|
-
return this._client.get('/escalations', {
|
|
27
|
-
query,
|
|
28
|
-
...options,
|
|
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
|
-
]),
|
|
36
|
-
});
|
|
37
|
-
}
|
|
38
|
-
|
|
39
|
-
/**
|
|
40
|
-
* Approve the payment that exceeded approval limits.
|
|
41
|
-
*
|
|
42
|
-
* @example
|
|
43
|
-
* ```ts
|
|
44
|
-
* const response = await client.escalations.approve(
|
|
45
|
-
* 'apr_ecc2efdd09bd231a9ad9bd2aada37aa7',
|
|
46
|
-
* { 'Idempotency-Key': 'Idempotency-Key' },
|
|
47
|
-
* );
|
|
48
|
-
* ```
|
|
49
|
-
*/
|
|
50
|
-
approve(
|
|
51
|
-
escalationID: string,
|
|
52
|
-
params: EscalationApproveParams,
|
|
53
|
-
options?: RequestOptions,
|
|
54
|
-
): APIPromise<EscalationApproveResponse> {
|
|
55
|
-
const {
|
|
56
|
-
'Idempotency-Key': idempotencyKey,
|
|
57
|
-
'X-Agent-ID': xAgentID,
|
|
58
|
-
'X-Instance-ID': xInstanceID,
|
|
59
|
-
} = params;
|
|
60
|
-
return this._client.post(path`/escalations/${escalationID}/approve`, {
|
|
61
|
-
...options,
|
|
62
|
-
headers: buildHeaders([
|
|
63
|
-
{
|
|
64
|
-
'Idempotency-Key': idempotencyKey,
|
|
65
|
-
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
66
|
-
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
67
|
-
},
|
|
68
|
-
options?.headers,
|
|
69
|
-
]),
|
|
70
|
-
});
|
|
71
|
-
}
|
|
72
|
-
|
|
73
|
-
/**
|
|
74
|
-
* Deny the payment that exceeded approval limits.
|
|
75
|
-
*
|
|
76
|
-
* @example
|
|
77
|
-
* ```ts
|
|
78
|
-
* const response = await client.escalations.deny(
|
|
79
|
-
* 'apr_ecc2efdd09bd231a9ad9bd2aada37aa7',
|
|
80
|
-
* { 'Idempotency-Key': 'Idempotency-Key' },
|
|
81
|
-
* );
|
|
82
|
-
* ```
|
|
83
|
-
*/
|
|
84
|
-
deny(
|
|
85
|
-
escalationID: string,
|
|
86
|
-
params: EscalationDenyParams,
|
|
87
|
-
options?: RequestOptions,
|
|
88
|
-
): APIPromise<EscalationDenyResponse> {
|
|
89
|
-
const {
|
|
90
|
-
'Idempotency-Key': idempotencyKey,
|
|
91
|
-
'X-Agent-ID': xAgentID,
|
|
92
|
-
'X-Instance-ID': xInstanceID,
|
|
93
|
-
...body
|
|
94
|
-
} = params;
|
|
95
|
-
return this._client.post(path`/escalations/${escalationID}/deny`, {
|
|
96
|
-
body,
|
|
97
|
-
...options,
|
|
98
|
-
headers: buildHeaders([
|
|
99
|
-
{
|
|
100
|
-
'Idempotency-Key': idempotencyKey,
|
|
101
|
-
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
102
|
-
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
103
|
-
},
|
|
104
|
-
options?.headers,
|
|
105
|
-
]),
|
|
106
|
-
});
|
|
107
|
-
}
|
|
108
|
-
|
|
109
|
-
/**
|
|
110
|
-
* Get details of a specific escalation by approval request ID.
|
|
111
|
-
*
|
|
112
|
-
* @example
|
|
113
|
-
* ```ts
|
|
114
|
-
* const escalation = await client.escalations.get(
|
|
115
|
-
* 'apr_ecc2efdd09bd231a9ad9bd2aada37aa7',
|
|
116
|
-
* );
|
|
117
|
-
* ```
|
|
118
|
-
*/
|
|
119
|
-
get(
|
|
120
|
-
escalationID: string,
|
|
121
|
-
params: EscalationGetParams | null | undefined = {},
|
|
122
|
-
options?: RequestOptions,
|
|
123
|
-
): APIPromise<EscalationGetResponse> {
|
|
124
|
-
const { 'X-Agent-ID': xAgentID, 'X-Instance-ID': xInstanceID } = params ?? {};
|
|
125
|
-
return this._client.get(path`/escalations/${escalationID}`, {
|
|
126
|
-
...options,
|
|
127
|
-
headers: buildHeaders([
|
|
128
|
-
{
|
|
129
|
-
...(xAgentID != null ? { 'X-Agent-ID': xAgentID } : undefined),
|
|
130
|
-
...(xInstanceID != null ? { 'X-Instance-ID': xInstanceID } : undefined),
|
|
131
|
-
},
|
|
132
|
-
options?.headers,
|
|
133
|
-
]),
|
|
134
|
-
});
|
|
135
|
-
}
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
export interface EscalationListResponse {
|
|
139
|
-
data: Array<EscalationListResponse.Data>;
|
|
140
|
-
|
|
141
|
-
meta: EscalationListResponse.Meta;
|
|
142
|
-
}
|
|
143
|
-
|
|
144
|
-
export namespace EscalationListResponse {
|
|
145
|
-
export interface Data {
|
|
146
|
-
/**
|
|
147
|
-
* Resource ID
|
|
148
|
-
*/
|
|
149
|
-
id: string;
|
|
150
|
-
|
|
151
|
-
/**
|
|
152
|
-
* Resource attributes
|
|
153
|
-
*/
|
|
154
|
-
attributes: Data.Attributes;
|
|
155
|
-
|
|
156
|
-
/**
|
|
157
|
-
* Resource relationships
|
|
158
|
-
*/
|
|
159
|
-
relationships: Data.Relationships;
|
|
160
|
-
|
|
161
|
-
/**
|
|
162
|
-
* Resource type
|
|
163
|
-
*/
|
|
164
|
-
type: string;
|
|
165
|
-
}
|
|
166
|
-
|
|
167
|
-
export namespace Data {
|
|
168
|
-
/**
|
|
169
|
-
* Resource attributes
|
|
170
|
-
*/
|
|
171
|
-
export interface Attributes {
|
|
172
|
-
/**
|
|
173
|
-
* Agent ID that initiated the payment, if actor was an agent
|
|
174
|
-
*/
|
|
175
|
-
agentId: string | null;
|
|
176
|
-
|
|
177
|
-
/**
|
|
178
|
-
* Payment amount in minor units (cents)
|
|
179
|
-
*/
|
|
180
|
-
amountMinor: number;
|
|
181
|
-
|
|
182
|
-
/**
|
|
183
|
-
* Product-safe subject that caused the approval
|
|
184
|
-
*/
|
|
185
|
-
approvalScope: Attributes.ApprovalScope;
|
|
186
|
-
|
|
187
|
-
/**
|
|
188
|
-
* All breached limits covered by this approval
|
|
189
|
-
*/
|
|
190
|
-
breachedLimits: Array<Attributes.BreachedLimit>;
|
|
191
|
-
|
|
192
|
-
/**
|
|
193
|
-
* When approval was created
|
|
194
|
-
*/
|
|
195
|
-
createdAt: string;
|
|
196
|
-
|
|
197
|
-
/**
|
|
198
|
-
* Currency code (e.g., USD)
|
|
199
|
-
*/
|
|
200
|
-
currency: string;
|
|
201
|
-
|
|
202
|
-
/**
|
|
203
|
-
* Optional note supplied when denied
|
|
204
|
-
*/
|
|
205
|
-
denialReason: string | null;
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* PROGRAM or CUSTOMER
|
|
209
|
-
*/
|
|
210
|
-
evaluationTier: 'PROGRAM' | 'CUSTOMER';
|
|
211
|
-
|
|
212
|
-
/**
|
|
213
|
-
* Configured per-payment limit from the approval snapshot, in minor units
|
|
214
|
-
*/
|
|
215
|
-
exceededLimitAmountMinor: number | null;
|
|
216
|
-
|
|
217
|
-
/**
|
|
218
|
-
* Limit currency from the approval snapshot
|
|
219
|
-
*/
|
|
220
|
-
exceededLimitCurrency: string | null;
|
|
221
|
-
|
|
222
|
-
/**
|
|
223
|
-
* Money Movement Request ID
|
|
224
|
-
*/
|
|
225
|
-
moneyMovementRequestId: string | null;
|
|
226
|
-
|
|
227
|
-
/**
|
|
228
|
-
* Recipient label to display in approval UI
|
|
229
|
-
*/
|
|
230
|
-
recipientDisplayName: string | null;
|
|
231
|
-
|
|
232
|
-
/**
|
|
233
|
-
* Recipient email or other claim identifier when available
|
|
234
|
-
*/
|
|
235
|
-
recipientIdentifier: string | null;
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* Recipient party display name (enriched from identity)
|
|
239
|
-
*/
|
|
240
|
-
recipientPartyName: string | null;
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* When approval was resolved (approved/denied)
|
|
244
|
-
*/
|
|
245
|
-
resolvedAt: string | null;
|
|
246
|
-
|
|
247
|
-
/**
|
|
248
|
-
* Party that resolved the approval
|
|
249
|
-
*/
|
|
250
|
-
resolvedByPartyId: string | null;
|
|
251
|
-
|
|
252
|
-
/**
|
|
253
|
-
* Sender party display name (enriched from identity)
|
|
254
|
-
*/
|
|
255
|
-
senderPartyName: string | null;
|
|
256
|
-
|
|
257
|
-
/**
|
|
258
|
-
* Approval status
|
|
259
|
-
*/
|
|
260
|
-
status: 'PENDING' | 'APPROVED' | 'DENIED' | 'CANCELLED';
|
|
261
|
-
|
|
262
|
-
/**
|
|
263
|
-
* User-facing transaction ID (txn_xxx) derived from the money movement request
|
|
264
|
-
*/
|
|
265
|
-
transactionId: string | null;
|
|
266
|
-
}
|
|
267
|
-
|
|
268
|
-
export namespace Attributes {
|
|
269
|
-
/**
|
|
270
|
-
* Product-safe subject that caused the approval
|
|
271
|
-
*/
|
|
272
|
-
export interface ApprovalScope {
|
|
273
|
-
/**
|
|
274
|
-
* Scope subject ID, when available
|
|
275
|
-
*/
|
|
276
|
-
id: string | null;
|
|
277
|
-
|
|
278
|
-
/**
|
|
279
|
-
* Product-safe approval scope type
|
|
280
|
-
*/
|
|
281
|
-
type: 'PROGRAM' | 'PARTY' | 'AGENT_DELEGATION' | 'AGENT' | 'UNKNOWN';
|
|
282
|
-
}
|
|
283
|
-
|
|
284
|
-
export interface BreachedLimit {
|
|
285
|
-
/**
|
|
286
|
-
* Actual payment amount in minor units
|
|
287
|
-
*/
|
|
288
|
-
actualAmountMinor: number;
|
|
289
|
-
|
|
290
|
-
/**
|
|
291
|
-
* Configured limit threshold in minor units
|
|
292
|
-
*/
|
|
293
|
-
amountMinor: number;
|
|
294
|
-
|
|
295
|
-
/**
|
|
296
|
-
* Limit currency
|
|
297
|
-
*/
|
|
298
|
-
currency: string;
|
|
299
|
-
|
|
300
|
-
/**
|
|
301
|
-
* Approval gate order evaluated for this policy
|
|
302
|
-
*/
|
|
303
|
-
gateOrder: number;
|
|
304
|
-
|
|
305
|
-
/**
|
|
306
|
-
* Policy version evaluated for this approval
|
|
307
|
-
*/
|
|
308
|
-
policyDbVersion: number | null;
|
|
309
|
-
|
|
310
|
-
/**
|
|
311
|
-
* Approval policy that was breached
|
|
312
|
-
*/
|
|
313
|
-
policyId: string;
|
|
314
|
-
|
|
315
|
-
/**
|
|
316
|
-
* Scope of the breached policy
|
|
317
|
-
*/
|
|
318
|
-
scope: BreachedLimit.Scope;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
export namespace BreachedLimit {
|
|
322
|
-
/**
|
|
323
|
-
* Scope of the breached policy
|
|
324
|
-
*/
|
|
325
|
-
export interface Scope {
|
|
326
|
-
/**
|
|
327
|
-
* Scope subject ID, when available
|
|
328
|
-
*/
|
|
329
|
-
id: string | null;
|
|
330
|
-
|
|
331
|
-
/**
|
|
332
|
-
* Product-safe approval scope type
|
|
333
|
-
*/
|
|
334
|
-
type: 'PROGRAM' | 'PARTY' | 'AGENT_DELEGATION' | 'AGENT' | 'UNKNOWN';
|
|
335
|
-
}
|
|
336
|
-
}
|
|
337
|
-
}
|
|
338
|
-
|
|
339
|
-
/**
|
|
340
|
-
* Resource relationships
|
|
341
|
-
*/
|
|
342
|
-
export interface Relationships {
|
|
343
|
-
/**
|
|
344
|
-
* Party who can approve/deny
|
|
345
|
-
*/
|
|
346
|
-
approverParty: Relationships.ApproverParty;
|
|
347
|
-
|
|
348
|
-
/**
|
|
349
|
-
* Recipient party
|
|
350
|
-
*/
|
|
351
|
-
recipientParty: Relationships.RecipientParty;
|
|
352
|
-
|
|
353
|
-
/**
|
|
354
|
-
* Sender party
|
|
355
|
-
*/
|
|
356
|
-
senderParty: Relationships.SenderParty;
|
|
357
|
-
}
|
|
358
|
-
|
|
359
|
-
export namespace Relationships {
|
|
360
|
-
/**
|
|
361
|
-
* Party who can approve/deny
|
|
362
|
-
*/
|
|
363
|
-
export interface ApproverParty {
|
|
364
|
-
/**
|
|
365
|
-
* Related resource identifier
|
|
366
|
-
*/
|
|
367
|
-
data: ApproverParty.Data | null;
|
|
368
|
-
}
|
|
369
|
-
|
|
370
|
-
export namespace ApproverParty {
|
|
371
|
-
/**
|
|
372
|
-
* Related resource identifier
|
|
373
|
-
*/
|
|
374
|
-
export interface Data {
|
|
375
|
-
id: string;
|
|
376
|
-
|
|
377
|
-
/**
|
|
378
|
-
* Resource type
|
|
379
|
-
*/
|
|
380
|
-
type: string;
|
|
381
|
-
}
|
|
382
|
-
}
|
|
383
|
-
|
|
384
|
-
/**
|
|
385
|
-
* Recipient party
|
|
386
|
-
*/
|
|
387
|
-
export interface RecipientParty {
|
|
388
|
-
/**
|
|
389
|
-
* Related resource identifier
|
|
390
|
-
*/
|
|
391
|
-
data: RecipientParty.Data | null;
|
|
392
|
-
}
|
|
393
|
-
|
|
394
|
-
export namespace RecipientParty {
|
|
395
|
-
/**
|
|
396
|
-
* Related resource identifier
|
|
397
|
-
*/
|
|
398
|
-
export interface Data {
|
|
399
|
-
id: string;
|
|
400
|
-
|
|
401
|
-
/**
|
|
402
|
-
* Resource type
|
|
403
|
-
*/
|
|
404
|
-
type: string;
|
|
405
|
-
}
|
|
406
|
-
}
|
|
407
|
-
|
|
408
|
-
/**
|
|
409
|
-
* Sender party
|
|
410
|
-
*/
|
|
411
|
-
export interface SenderParty {
|
|
412
|
-
/**
|
|
413
|
-
* Related resource identifier
|
|
414
|
-
*/
|
|
415
|
-
data: SenderParty.Data | null;
|
|
416
|
-
}
|
|
417
|
-
|
|
418
|
-
export namespace SenderParty {
|
|
419
|
-
/**
|
|
420
|
-
* Related resource identifier
|
|
421
|
-
*/
|
|
422
|
-
export interface Data {
|
|
423
|
-
id: string;
|
|
424
|
-
|
|
425
|
-
/**
|
|
426
|
-
* Resource type
|
|
427
|
-
*/
|
|
428
|
-
type: string;
|
|
429
|
-
}
|
|
430
|
-
}
|
|
431
|
-
}
|
|
432
|
-
}
|
|
433
|
-
|
|
434
|
-
export interface Meta {
|
|
435
|
-
pagination: Meta.Pagination;
|
|
436
|
-
}
|
|
437
|
-
|
|
438
|
-
export namespace Meta {
|
|
439
|
-
export interface Pagination {
|
|
440
|
-
hasMore: boolean;
|
|
441
|
-
|
|
442
|
-
nextCursor: string | null;
|
|
443
|
-
}
|
|
444
|
-
}
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
export interface EscalationApproveResponse {
|
|
448
|
-
data: EscalationApproveResponse.Data;
|
|
449
|
-
}
|
|
450
|
-
|
|
451
|
-
export namespace EscalationApproveResponse {
|
|
452
|
-
export interface Data {
|
|
453
|
-
/**
|
|
454
|
-
* Resource ID
|
|
455
|
-
*/
|
|
456
|
-
id: string;
|
|
457
|
-
|
|
458
|
-
/**
|
|
459
|
-
* Resource attributes
|
|
460
|
-
*/
|
|
461
|
-
attributes: Data.Attributes;
|
|
462
|
-
|
|
463
|
-
/**
|
|
464
|
-
* Resource relationships
|
|
465
|
-
*/
|
|
466
|
-
relationships: Data.Relationships;
|
|
467
|
-
|
|
468
|
-
/**
|
|
469
|
-
* Resource type
|
|
470
|
-
*/
|
|
471
|
-
type: string;
|
|
472
|
-
}
|
|
473
|
-
|
|
474
|
-
export namespace Data {
|
|
475
|
-
/**
|
|
476
|
-
* Resource attributes
|
|
477
|
-
*/
|
|
478
|
-
export interface Attributes {
|
|
479
|
-
/**
|
|
480
|
-
* Agent ID that initiated the payment, if actor was an agent
|
|
481
|
-
*/
|
|
482
|
-
agentId: string | null;
|
|
483
|
-
|
|
484
|
-
/**
|
|
485
|
-
* Payment amount in minor units (cents)
|
|
486
|
-
*/
|
|
487
|
-
amountMinor: number;
|
|
488
|
-
|
|
489
|
-
/**
|
|
490
|
-
* Product-safe subject that caused the approval
|
|
491
|
-
*/
|
|
492
|
-
approvalScope: Attributes.ApprovalScope;
|
|
493
|
-
|
|
494
|
-
/**
|
|
495
|
-
* All breached limits covered by this approval
|
|
496
|
-
*/
|
|
497
|
-
breachedLimits: Array<Attributes.BreachedLimit>;
|
|
498
|
-
|
|
499
|
-
/**
|
|
500
|
-
* When approval was created
|
|
501
|
-
*/
|
|
502
|
-
createdAt: string;
|
|
503
|
-
|
|
504
|
-
/**
|
|
505
|
-
* Currency code (e.g., USD)
|
|
506
|
-
*/
|
|
507
|
-
currency: string;
|
|
508
|
-
|
|
509
|
-
/**
|
|
510
|
-
* Optional note supplied when denied
|
|
511
|
-
*/
|
|
512
|
-
denialReason: string | null;
|
|
513
|
-
|
|
514
|
-
/**
|
|
515
|
-
* PROGRAM or CUSTOMER
|
|
516
|
-
*/
|
|
517
|
-
evaluationTier: 'PROGRAM' | 'CUSTOMER';
|
|
518
|
-
|
|
519
|
-
/**
|
|
520
|
-
* Configured per-payment limit from the approval snapshot, in minor units
|
|
521
|
-
*/
|
|
522
|
-
exceededLimitAmountMinor: number | null;
|
|
523
|
-
|
|
524
|
-
/**
|
|
525
|
-
* Limit currency from the approval snapshot
|
|
526
|
-
*/
|
|
527
|
-
exceededLimitCurrency: string | null;
|
|
528
|
-
|
|
529
|
-
/**
|
|
530
|
-
* Money Movement Request ID
|
|
531
|
-
*/
|
|
532
|
-
moneyMovementRequestId: string | null;
|
|
533
|
-
|
|
534
|
-
/**
|
|
535
|
-
* Recipient label to display in approval UI
|
|
536
|
-
*/
|
|
537
|
-
recipientDisplayName: string | null;
|
|
538
|
-
|
|
539
|
-
/**
|
|
540
|
-
* Recipient email or other claim identifier when available
|
|
541
|
-
*/
|
|
542
|
-
recipientIdentifier: string | null;
|
|
543
|
-
|
|
544
|
-
/**
|
|
545
|
-
* Recipient party display name (enriched from identity)
|
|
546
|
-
*/
|
|
547
|
-
recipientPartyName: string | null;
|
|
548
|
-
|
|
549
|
-
/**
|
|
550
|
-
* When approval was resolved (approved/denied)
|
|
551
|
-
*/
|
|
552
|
-
resolvedAt: string | null;
|
|
553
|
-
|
|
554
|
-
/**
|
|
555
|
-
* Party that resolved the approval
|
|
556
|
-
*/
|
|
557
|
-
resolvedByPartyId: string | null;
|
|
558
|
-
|
|
559
|
-
/**
|
|
560
|
-
* Sender party display name (enriched from identity)
|
|
561
|
-
*/
|
|
562
|
-
senderPartyName: string | null;
|
|
563
|
-
|
|
564
|
-
/**
|
|
565
|
-
* Approval status
|
|
566
|
-
*/
|
|
567
|
-
status: 'PENDING' | 'APPROVED' | 'DENIED' | 'CANCELLED';
|
|
568
|
-
|
|
569
|
-
/**
|
|
570
|
-
* User-facing transaction ID (txn_xxx) derived from the money movement request
|
|
571
|
-
*/
|
|
572
|
-
transactionId: string | null;
|
|
573
|
-
}
|
|
574
|
-
|
|
575
|
-
export namespace Attributes {
|
|
576
|
-
/**
|
|
577
|
-
* Product-safe subject that caused the approval
|
|
578
|
-
*/
|
|
579
|
-
export interface ApprovalScope {
|
|
580
|
-
/**
|
|
581
|
-
* Scope subject ID, when available
|
|
582
|
-
*/
|
|
583
|
-
id: string | null;
|
|
584
|
-
|
|
585
|
-
/**
|
|
586
|
-
* Product-safe approval scope type
|
|
587
|
-
*/
|
|
588
|
-
type: 'PROGRAM' | 'PARTY' | 'AGENT_DELEGATION' | 'AGENT' | 'UNKNOWN';
|
|
589
|
-
}
|
|
590
|
-
|
|
591
|
-
export interface BreachedLimit {
|
|
592
|
-
/**
|
|
593
|
-
* Actual payment amount in minor units
|
|
594
|
-
*/
|
|
595
|
-
actualAmountMinor: number;
|
|
596
|
-
|
|
597
|
-
/**
|
|
598
|
-
* Configured limit threshold in minor units
|
|
599
|
-
*/
|
|
600
|
-
amountMinor: number;
|
|
601
|
-
|
|
602
|
-
/**
|
|
603
|
-
* Limit currency
|
|
604
|
-
*/
|
|
605
|
-
currency: string;
|
|
606
|
-
|
|
607
|
-
/**
|
|
608
|
-
* Approval gate order evaluated for this policy
|
|
609
|
-
*/
|
|
610
|
-
gateOrder: number;
|
|
611
|
-
|
|
612
|
-
/**
|
|
613
|
-
* Policy version evaluated for this approval
|
|
614
|
-
*/
|
|
615
|
-
policyDbVersion: number | null;
|
|
616
|
-
|
|
617
|
-
/**
|
|
618
|
-
* Approval policy that was breached
|
|
619
|
-
*/
|
|
620
|
-
policyId: string;
|
|
621
|
-
|
|
622
|
-
/**
|
|
623
|
-
* Scope of the breached policy
|
|
624
|
-
*/
|
|
625
|
-
scope: BreachedLimit.Scope;
|
|
626
|
-
}
|
|
627
|
-
|
|
628
|
-
export namespace BreachedLimit {
|
|
629
|
-
/**
|
|
630
|
-
* Scope of the breached policy
|
|
631
|
-
*/
|
|
632
|
-
export interface Scope {
|
|
633
|
-
/**
|
|
634
|
-
* Scope subject ID, when available
|
|
635
|
-
*/
|
|
636
|
-
id: string | null;
|
|
637
|
-
|
|
638
|
-
/**
|
|
639
|
-
* Product-safe approval scope type
|
|
640
|
-
*/
|
|
641
|
-
type: 'PROGRAM' | 'PARTY' | 'AGENT_DELEGATION' | 'AGENT' | 'UNKNOWN';
|
|
642
|
-
}
|
|
643
|
-
}
|
|
644
|
-
}
|
|
645
|
-
|
|
646
|
-
/**
|
|
647
|
-
* Resource relationships
|
|
648
|
-
*/
|
|
649
|
-
export interface Relationships {
|
|
650
|
-
/**
|
|
651
|
-
* Party who can approve/deny
|
|
652
|
-
*/
|
|
653
|
-
approverParty: Relationships.ApproverParty;
|
|
654
|
-
|
|
655
|
-
/**
|
|
656
|
-
* Recipient party
|
|
657
|
-
*/
|
|
658
|
-
recipientParty: Relationships.RecipientParty;
|
|
659
|
-
|
|
660
|
-
/**
|
|
661
|
-
* Sender party
|
|
662
|
-
*/
|
|
663
|
-
senderParty: Relationships.SenderParty;
|
|
664
|
-
}
|
|
665
|
-
|
|
666
|
-
export namespace Relationships {
|
|
667
|
-
/**
|
|
668
|
-
* Party who can approve/deny
|
|
669
|
-
*/
|
|
670
|
-
export interface ApproverParty {
|
|
671
|
-
/**
|
|
672
|
-
* Related resource identifier
|
|
673
|
-
*/
|
|
674
|
-
data: ApproverParty.Data | null;
|
|
675
|
-
}
|
|
676
|
-
|
|
677
|
-
export namespace ApproverParty {
|
|
678
|
-
/**
|
|
679
|
-
* Related resource identifier
|
|
680
|
-
*/
|
|
681
|
-
export interface Data {
|
|
682
|
-
id: string;
|
|
683
|
-
|
|
684
|
-
/**
|
|
685
|
-
* Resource type
|
|
686
|
-
*/
|
|
687
|
-
type: string;
|
|
688
|
-
}
|
|
689
|
-
}
|
|
690
|
-
|
|
691
|
-
/**
|
|
692
|
-
* Recipient party
|
|
693
|
-
*/
|
|
694
|
-
export interface RecipientParty {
|
|
695
|
-
/**
|
|
696
|
-
* Related resource identifier
|
|
697
|
-
*/
|
|
698
|
-
data: RecipientParty.Data | null;
|
|
699
|
-
}
|
|
700
|
-
|
|
701
|
-
export namespace RecipientParty {
|
|
702
|
-
/**
|
|
703
|
-
* Related resource identifier
|
|
704
|
-
*/
|
|
705
|
-
export interface Data {
|
|
706
|
-
id: string;
|
|
707
|
-
|
|
708
|
-
/**
|
|
709
|
-
* Resource type
|
|
710
|
-
*/
|
|
711
|
-
type: string;
|
|
712
|
-
}
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
/**
|
|
716
|
-
* Sender party
|
|
717
|
-
*/
|
|
718
|
-
export interface SenderParty {
|
|
719
|
-
/**
|
|
720
|
-
* Related resource identifier
|
|
721
|
-
*/
|
|
722
|
-
data: SenderParty.Data | null;
|
|
723
|
-
}
|
|
724
|
-
|
|
725
|
-
export namespace SenderParty {
|
|
726
|
-
/**
|
|
727
|
-
* Related resource identifier
|
|
728
|
-
*/
|
|
729
|
-
export interface Data {
|
|
730
|
-
id: string;
|
|
731
|
-
|
|
732
|
-
/**
|
|
733
|
-
* Resource type
|
|
734
|
-
*/
|
|
735
|
-
type: string;
|
|
736
|
-
}
|
|
737
|
-
}
|
|
738
|
-
}
|
|
739
|
-
}
|
|
740
|
-
}
|
|
741
|
-
|
|
742
|
-
export interface EscalationDenyResponse {
|
|
743
|
-
data: EscalationDenyResponse.Data;
|
|
744
|
-
}
|
|
745
|
-
|
|
746
|
-
export namespace EscalationDenyResponse {
|
|
747
|
-
export interface Data {
|
|
748
|
-
/**
|
|
749
|
-
* Resource ID
|
|
750
|
-
*/
|
|
751
|
-
id: string;
|
|
752
|
-
|
|
753
|
-
/**
|
|
754
|
-
* Resource attributes
|
|
755
|
-
*/
|
|
756
|
-
attributes: Data.Attributes;
|
|
757
|
-
|
|
758
|
-
/**
|
|
759
|
-
* Resource relationships
|
|
760
|
-
*/
|
|
761
|
-
relationships: Data.Relationships;
|
|
762
|
-
|
|
763
|
-
/**
|
|
764
|
-
* Resource type
|
|
765
|
-
*/
|
|
766
|
-
type: string;
|
|
767
|
-
}
|
|
768
|
-
|
|
769
|
-
export namespace Data {
|
|
770
|
-
/**
|
|
771
|
-
* Resource attributes
|
|
772
|
-
*/
|
|
773
|
-
export interface Attributes {
|
|
774
|
-
/**
|
|
775
|
-
* Agent ID that initiated the payment, if actor was an agent
|
|
776
|
-
*/
|
|
777
|
-
agentId: string | null;
|
|
778
|
-
|
|
779
|
-
/**
|
|
780
|
-
* Payment amount in minor units (cents)
|
|
781
|
-
*/
|
|
782
|
-
amountMinor: number;
|
|
783
|
-
|
|
784
|
-
/**
|
|
785
|
-
* Product-safe subject that caused the approval
|
|
786
|
-
*/
|
|
787
|
-
approvalScope: Attributes.ApprovalScope;
|
|
788
|
-
|
|
789
|
-
/**
|
|
790
|
-
* All breached limits covered by this approval
|
|
791
|
-
*/
|
|
792
|
-
breachedLimits: Array<Attributes.BreachedLimit>;
|
|
793
|
-
|
|
794
|
-
/**
|
|
795
|
-
* When approval was created
|
|
796
|
-
*/
|
|
797
|
-
createdAt: string;
|
|
798
|
-
|
|
799
|
-
/**
|
|
800
|
-
* Currency code (e.g., USD)
|
|
801
|
-
*/
|
|
802
|
-
currency: string;
|
|
803
|
-
|
|
804
|
-
/**
|
|
805
|
-
* Optional note supplied when denied
|
|
806
|
-
*/
|
|
807
|
-
denialReason: string | null;
|
|
808
|
-
|
|
809
|
-
/**
|
|
810
|
-
* PROGRAM or CUSTOMER
|
|
811
|
-
*/
|
|
812
|
-
evaluationTier: 'PROGRAM' | 'CUSTOMER';
|
|
813
|
-
|
|
814
|
-
/**
|
|
815
|
-
* Configured per-payment limit from the approval snapshot, in minor units
|
|
816
|
-
*/
|
|
817
|
-
exceededLimitAmountMinor: number | null;
|
|
818
|
-
|
|
819
|
-
/**
|
|
820
|
-
* Limit currency from the approval snapshot
|
|
821
|
-
*/
|
|
822
|
-
exceededLimitCurrency: string | null;
|
|
823
|
-
|
|
824
|
-
/**
|
|
825
|
-
* Money Movement Request ID
|
|
826
|
-
*/
|
|
827
|
-
moneyMovementRequestId: string | null;
|
|
828
|
-
|
|
829
|
-
/**
|
|
830
|
-
* Recipient label to display in approval UI
|
|
831
|
-
*/
|
|
832
|
-
recipientDisplayName: string | null;
|
|
833
|
-
|
|
834
|
-
/**
|
|
835
|
-
* Recipient email or other claim identifier when available
|
|
836
|
-
*/
|
|
837
|
-
recipientIdentifier: string | null;
|
|
838
|
-
|
|
839
|
-
/**
|
|
840
|
-
* Recipient party display name (enriched from identity)
|
|
841
|
-
*/
|
|
842
|
-
recipientPartyName: string | null;
|
|
843
|
-
|
|
844
|
-
/**
|
|
845
|
-
* When approval was resolved (approved/denied)
|
|
846
|
-
*/
|
|
847
|
-
resolvedAt: string | null;
|
|
848
|
-
|
|
849
|
-
/**
|
|
850
|
-
* Party that resolved the approval
|
|
851
|
-
*/
|
|
852
|
-
resolvedByPartyId: string | null;
|
|
853
|
-
|
|
854
|
-
/**
|
|
855
|
-
* Sender party display name (enriched from identity)
|
|
856
|
-
*/
|
|
857
|
-
senderPartyName: string | null;
|
|
858
|
-
|
|
859
|
-
/**
|
|
860
|
-
* Approval status
|
|
861
|
-
*/
|
|
862
|
-
status: 'PENDING' | 'APPROVED' | 'DENIED' | 'CANCELLED';
|
|
863
|
-
|
|
864
|
-
/**
|
|
865
|
-
* User-facing transaction ID (txn_xxx) derived from the money movement request
|
|
866
|
-
*/
|
|
867
|
-
transactionId: string | null;
|
|
868
|
-
}
|
|
869
|
-
|
|
870
|
-
export namespace Attributes {
|
|
871
|
-
/**
|
|
872
|
-
* Product-safe subject that caused the approval
|
|
873
|
-
*/
|
|
874
|
-
export interface ApprovalScope {
|
|
875
|
-
/**
|
|
876
|
-
* Scope subject ID, when available
|
|
877
|
-
*/
|
|
878
|
-
id: string | null;
|
|
879
|
-
|
|
880
|
-
/**
|
|
881
|
-
* Product-safe approval scope type
|
|
882
|
-
*/
|
|
883
|
-
type: 'PROGRAM' | 'PARTY' | 'AGENT_DELEGATION' | 'AGENT' | 'UNKNOWN';
|
|
884
|
-
}
|
|
885
|
-
|
|
886
|
-
export interface BreachedLimit {
|
|
887
|
-
/**
|
|
888
|
-
* Actual payment amount in minor units
|
|
889
|
-
*/
|
|
890
|
-
actualAmountMinor: number;
|
|
891
|
-
|
|
892
|
-
/**
|
|
893
|
-
* Configured limit threshold in minor units
|
|
894
|
-
*/
|
|
895
|
-
amountMinor: number;
|
|
896
|
-
|
|
897
|
-
/**
|
|
898
|
-
* Limit currency
|
|
899
|
-
*/
|
|
900
|
-
currency: string;
|
|
901
|
-
|
|
902
|
-
/**
|
|
903
|
-
* Approval gate order evaluated for this policy
|
|
904
|
-
*/
|
|
905
|
-
gateOrder: number;
|
|
906
|
-
|
|
907
|
-
/**
|
|
908
|
-
* Policy version evaluated for this approval
|
|
909
|
-
*/
|
|
910
|
-
policyDbVersion: number | null;
|
|
911
|
-
|
|
912
|
-
/**
|
|
913
|
-
* Approval policy that was breached
|
|
914
|
-
*/
|
|
915
|
-
policyId: string;
|
|
916
|
-
|
|
917
|
-
/**
|
|
918
|
-
* Scope of the breached policy
|
|
919
|
-
*/
|
|
920
|
-
scope: BreachedLimit.Scope;
|
|
921
|
-
}
|
|
922
|
-
|
|
923
|
-
export namespace BreachedLimit {
|
|
924
|
-
/**
|
|
925
|
-
* Scope of the breached policy
|
|
926
|
-
*/
|
|
927
|
-
export interface Scope {
|
|
928
|
-
/**
|
|
929
|
-
* Scope subject ID, when available
|
|
930
|
-
*/
|
|
931
|
-
id: string | null;
|
|
932
|
-
|
|
933
|
-
/**
|
|
934
|
-
* Product-safe approval scope type
|
|
935
|
-
*/
|
|
936
|
-
type: 'PROGRAM' | 'PARTY' | 'AGENT_DELEGATION' | 'AGENT' | 'UNKNOWN';
|
|
937
|
-
}
|
|
938
|
-
}
|
|
939
|
-
}
|
|
940
|
-
|
|
941
|
-
/**
|
|
942
|
-
* Resource relationships
|
|
943
|
-
*/
|
|
944
|
-
export interface Relationships {
|
|
945
|
-
/**
|
|
946
|
-
* Party who can approve/deny
|
|
947
|
-
*/
|
|
948
|
-
approverParty: Relationships.ApproverParty;
|
|
949
|
-
|
|
950
|
-
/**
|
|
951
|
-
* Recipient party
|
|
952
|
-
*/
|
|
953
|
-
recipientParty: Relationships.RecipientParty;
|
|
954
|
-
|
|
955
|
-
/**
|
|
956
|
-
* Sender party
|
|
957
|
-
*/
|
|
958
|
-
senderParty: Relationships.SenderParty;
|
|
959
|
-
}
|
|
960
|
-
|
|
961
|
-
export namespace Relationships {
|
|
962
|
-
/**
|
|
963
|
-
* Party who can approve/deny
|
|
964
|
-
*/
|
|
965
|
-
export interface ApproverParty {
|
|
966
|
-
/**
|
|
967
|
-
* Related resource identifier
|
|
968
|
-
*/
|
|
969
|
-
data: ApproverParty.Data | null;
|
|
970
|
-
}
|
|
971
|
-
|
|
972
|
-
export namespace ApproverParty {
|
|
973
|
-
/**
|
|
974
|
-
* Related resource identifier
|
|
975
|
-
*/
|
|
976
|
-
export interface Data {
|
|
977
|
-
id: string;
|
|
978
|
-
|
|
979
|
-
/**
|
|
980
|
-
* Resource type
|
|
981
|
-
*/
|
|
982
|
-
type: string;
|
|
983
|
-
}
|
|
984
|
-
}
|
|
985
|
-
|
|
986
|
-
/**
|
|
987
|
-
* Recipient party
|
|
988
|
-
*/
|
|
989
|
-
export interface RecipientParty {
|
|
990
|
-
/**
|
|
991
|
-
* Related resource identifier
|
|
992
|
-
*/
|
|
993
|
-
data: RecipientParty.Data | null;
|
|
994
|
-
}
|
|
995
|
-
|
|
996
|
-
export namespace RecipientParty {
|
|
997
|
-
/**
|
|
998
|
-
* Related resource identifier
|
|
999
|
-
*/
|
|
1000
|
-
export interface Data {
|
|
1001
|
-
id: string;
|
|
1002
|
-
|
|
1003
|
-
/**
|
|
1004
|
-
* Resource type
|
|
1005
|
-
*/
|
|
1006
|
-
type: string;
|
|
1007
|
-
}
|
|
1008
|
-
}
|
|
1009
|
-
|
|
1010
|
-
/**
|
|
1011
|
-
* Sender party
|
|
1012
|
-
*/
|
|
1013
|
-
export interface SenderParty {
|
|
1014
|
-
/**
|
|
1015
|
-
* Related resource identifier
|
|
1016
|
-
*/
|
|
1017
|
-
data: SenderParty.Data | null;
|
|
1018
|
-
}
|
|
1019
|
-
|
|
1020
|
-
export namespace SenderParty {
|
|
1021
|
-
/**
|
|
1022
|
-
* Related resource identifier
|
|
1023
|
-
*/
|
|
1024
|
-
export interface Data {
|
|
1025
|
-
id: string;
|
|
1026
|
-
|
|
1027
|
-
/**
|
|
1028
|
-
* Resource type
|
|
1029
|
-
*/
|
|
1030
|
-
type: string;
|
|
1031
|
-
}
|
|
1032
|
-
}
|
|
1033
|
-
}
|
|
1034
|
-
}
|
|
1035
|
-
}
|
|
1036
|
-
|
|
1037
|
-
export interface EscalationGetResponse {
|
|
1038
|
-
data: EscalationGetResponse.Data;
|
|
1039
|
-
}
|
|
1040
|
-
|
|
1041
|
-
export namespace EscalationGetResponse {
|
|
1042
|
-
export interface Data {
|
|
1043
|
-
/**
|
|
1044
|
-
* Resource ID
|
|
1045
|
-
*/
|
|
1046
|
-
id: string;
|
|
1047
|
-
|
|
1048
|
-
/**
|
|
1049
|
-
* Resource attributes
|
|
1050
|
-
*/
|
|
1051
|
-
attributes: Data.Attributes;
|
|
1052
|
-
|
|
1053
|
-
/**
|
|
1054
|
-
* Resource relationships
|
|
1055
|
-
*/
|
|
1056
|
-
relationships: Data.Relationships;
|
|
1057
|
-
|
|
1058
|
-
/**
|
|
1059
|
-
* Resource type
|
|
1060
|
-
*/
|
|
1061
|
-
type: string;
|
|
1062
|
-
}
|
|
1063
|
-
|
|
1064
|
-
export namespace Data {
|
|
1065
|
-
/**
|
|
1066
|
-
* Resource attributes
|
|
1067
|
-
*/
|
|
1068
|
-
export interface Attributes {
|
|
1069
|
-
/**
|
|
1070
|
-
* Agent ID that initiated the payment, if actor was an agent
|
|
1071
|
-
*/
|
|
1072
|
-
agentId: string | null;
|
|
1073
|
-
|
|
1074
|
-
/**
|
|
1075
|
-
* Payment amount in minor units (cents)
|
|
1076
|
-
*/
|
|
1077
|
-
amountMinor: number;
|
|
1078
|
-
|
|
1079
|
-
/**
|
|
1080
|
-
* Product-safe subject that caused the approval
|
|
1081
|
-
*/
|
|
1082
|
-
approvalScope: Attributes.ApprovalScope;
|
|
1083
|
-
|
|
1084
|
-
/**
|
|
1085
|
-
* All breached limits covered by this approval
|
|
1086
|
-
*/
|
|
1087
|
-
breachedLimits: Array<Attributes.BreachedLimit>;
|
|
1088
|
-
|
|
1089
|
-
/**
|
|
1090
|
-
* When approval was created
|
|
1091
|
-
*/
|
|
1092
|
-
createdAt: string;
|
|
1093
|
-
|
|
1094
|
-
/**
|
|
1095
|
-
* Currency code (e.g., USD)
|
|
1096
|
-
*/
|
|
1097
|
-
currency: string;
|
|
1098
|
-
|
|
1099
|
-
/**
|
|
1100
|
-
* Optional note supplied when denied
|
|
1101
|
-
*/
|
|
1102
|
-
denialReason: string | null;
|
|
1103
|
-
|
|
1104
|
-
/**
|
|
1105
|
-
* PROGRAM or CUSTOMER
|
|
1106
|
-
*/
|
|
1107
|
-
evaluationTier: 'PROGRAM' | 'CUSTOMER';
|
|
1108
|
-
|
|
1109
|
-
/**
|
|
1110
|
-
* Configured per-payment limit from the approval snapshot, in minor units
|
|
1111
|
-
*/
|
|
1112
|
-
exceededLimitAmountMinor: number | null;
|
|
1113
|
-
|
|
1114
|
-
/**
|
|
1115
|
-
* Limit currency from the approval snapshot
|
|
1116
|
-
*/
|
|
1117
|
-
exceededLimitCurrency: string | null;
|
|
1118
|
-
|
|
1119
|
-
/**
|
|
1120
|
-
* Money Movement Request ID
|
|
1121
|
-
*/
|
|
1122
|
-
moneyMovementRequestId: string | null;
|
|
1123
|
-
|
|
1124
|
-
/**
|
|
1125
|
-
* Recipient label to display in approval UI
|
|
1126
|
-
*/
|
|
1127
|
-
recipientDisplayName: string | null;
|
|
1128
|
-
|
|
1129
|
-
/**
|
|
1130
|
-
* Recipient email or other claim identifier when available
|
|
1131
|
-
*/
|
|
1132
|
-
recipientIdentifier: string | null;
|
|
1133
|
-
|
|
1134
|
-
/**
|
|
1135
|
-
* Recipient party display name (enriched from identity)
|
|
1136
|
-
*/
|
|
1137
|
-
recipientPartyName: string | null;
|
|
1138
|
-
|
|
1139
|
-
/**
|
|
1140
|
-
* When approval was resolved (approved/denied)
|
|
1141
|
-
*/
|
|
1142
|
-
resolvedAt: string | null;
|
|
1143
|
-
|
|
1144
|
-
/**
|
|
1145
|
-
* Party that resolved the approval
|
|
1146
|
-
*/
|
|
1147
|
-
resolvedByPartyId: string | null;
|
|
1148
|
-
|
|
1149
|
-
/**
|
|
1150
|
-
* Sender party display name (enriched from identity)
|
|
1151
|
-
*/
|
|
1152
|
-
senderPartyName: string | null;
|
|
1153
|
-
|
|
1154
|
-
/**
|
|
1155
|
-
* Approval status
|
|
1156
|
-
*/
|
|
1157
|
-
status: 'PENDING' | 'APPROVED' | 'DENIED' | 'CANCELLED';
|
|
1158
|
-
|
|
1159
|
-
/**
|
|
1160
|
-
* User-facing transaction ID (txn_xxx) derived from the money movement request
|
|
1161
|
-
*/
|
|
1162
|
-
transactionId: string | null;
|
|
1163
|
-
}
|
|
1164
|
-
|
|
1165
|
-
export namespace Attributes {
|
|
1166
|
-
/**
|
|
1167
|
-
* Product-safe subject that caused the approval
|
|
1168
|
-
*/
|
|
1169
|
-
export interface ApprovalScope {
|
|
1170
|
-
/**
|
|
1171
|
-
* Scope subject ID, when available
|
|
1172
|
-
*/
|
|
1173
|
-
id: string | null;
|
|
1174
|
-
|
|
1175
|
-
/**
|
|
1176
|
-
* Product-safe approval scope type
|
|
1177
|
-
*/
|
|
1178
|
-
type: 'PROGRAM' | 'PARTY' | 'AGENT_DELEGATION' | 'AGENT' | 'UNKNOWN';
|
|
1179
|
-
}
|
|
1180
|
-
|
|
1181
|
-
export interface BreachedLimit {
|
|
1182
|
-
/**
|
|
1183
|
-
* Actual payment amount in minor units
|
|
1184
|
-
*/
|
|
1185
|
-
actualAmountMinor: number;
|
|
1186
|
-
|
|
1187
|
-
/**
|
|
1188
|
-
* Configured limit threshold in minor units
|
|
1189
|
-
*/
|
|
1190
|
-
amountMinor: number;
|
|
1191
|
-
|
|
1192
|
-
/**
|
|
1193
|
-
* Limit currency
|
|
1194
|
-
*/
|
|
1195
|
-
currency: string;
|
|
1196
|
-
|
|
1197
|
-
/**
|
|
1198
|
-
* Approval gate order evaluated for this policy
|
|
1199
|
-
*/
|
|
1200
|
-
gateOrder: number;
|
|
1201
|
-
|
|
1202
|
-
/**
|
|
1203
|
-
* Policy version evaluated for this approval
|
|
1204
|
-
*/
|
|
1205
|
-
policyDbVersion: number | null;
|
|
1206
|
-
|
|
1207
|
-
/**
|
|
1208
|
-
* Approval policy that was breached
|
|
1209
|
-
*/
|
|
1210
|
-
policyId: string;
|
|
1211
|
-
|
|
1212
|
-
/**
|
|
1213
|
-
* Scope of the breached policy
|
|
1214
|
-
*/
|
|
1215
|
-
scope: BreachedLimit.Scope;
|
|
1216
|
-
}
|
|
1217
|
-
|
|
1218
|
-
export namespace BreachedLimit {
|
|
1219
|
-
/**
|
|
1220
|
-
* Scope of the breached policy
|
|
1221
|
-
*/
|
|
1222
|
-
export interface Scope {
|
|
1223
|
-
/**
|
|
1224
|
-
* Scope subject ID, when available
|
|
1225
|
-
*/
|
|
1226
|
-
id: string | null;
|
|
1227
|
-
|
|
1228
|
-
/**
|
|
1229
|
-
* Product-safe approval scope type
|
|
1230
|
-
*/
|
|
1231
|
-
type: 'PROGRAM' | 'PARTY' | 'AGENT_DELEGATION' | 'AGENT' | 'UNKNOWN';
|
|
1232
|
-
}
|
|
1233
|
-
}
|
|
1234
|
-
}
|
|
1235
|
-
|
|
1236
|
-
/**
|
|
1237
|
-
* Resource relationships
|
|
1238
|
-
*/
|
|
1239
|
-
export interface Relationships {
|
|
1240
|
-
/**
|
|
1241
|
-
* Party who can approve/deny
|
|
1242
|
-
*/
|
|
1243
|
-
approverParty: Relationships.ApproverParty;
|
|
1244
|
-
|
|
1245
|
-
/**
|
|
1246
|
-
* Recipient party
|
|
1247
|
-
*/
|
|
1248
|
-
recipientParty: Relationships.RecipientParty;
|
|
1249
|
-
|
|
1250
|
-
/**
|
|
1251
|
-
* Sender party
|
|
1252
|
-
*/
|
|
1253
|
-
senderParty: Relationships.SenderParty;
|
|
1254
|
-
}
|
|
1255
|
-
|
|
1256
|
-
export namespace Relationships {
|
|
1257
|
-
/**
|
|
1258
|
-
* Party who can approve/deny
|
|
1259
|
-
*/
|
|
1260
|
-
export interface ApproverParty {
|
|
1261
|
-
/**
|
|
1262
|
-
* Related resource identifier
|
|
1263
|
-
*/
|
|
1264
|
-
data: ApproverParty.Data | null;
|
|
1265
|
-
}
|
|
1266
|
-
|
|
1267
|
-
export namespace ApproverParty {
|
|
1268
|
-
/**
|
|
1269
|
-
* Related resource identifier
|
|
1270
|
-
*/
|
|
1271
|
-
export interface Data {
|
|
1272
|
-
id: string;
|
|
1273
|
-
|
|
1274
|
-
/**
|
|
1275
|
-
* Resource type
|
|
1276
|
-
*/
|
|
1277
|
-
type: string;
|
|
1278
|
-
}
|
|
1279
|
-
}
|
|
1280
|
-
|
|
1281
|
-
/**
|
|
1282
|
-
* Recipient party
|
|
1283
|
-
*/
|
|
1284
|
-
export interface RecipientParty {
|
|
1285
|
-
/**
|
|
1286
|
-
* Related resource identifier
|
|
1287
|
-
*/
|
|
1288
|
-
data: RecipientParty.Data | null;
|
|
1289
|
-
}
|
|
1290
|
-
|
|
1291
|
-
export namespace RecipientParty {
|
|
1292
|
-
/**
|
|
1293
|
-
* Related resource identifier
|
|
1294
|
-
*/
|
|
1295
|
-
export interface Data {
|
|
1296
|
-
id: string;
|
|
1297
|
-
|
|
1298
|
-
/**
|
|
1299
|
-
* Resource type
|
|
1300
|
-
*/
|
|
1301
|
-
type: string;
|
|
1302
|
-
}
|
|
1303
|
-
}
|
|
1304
|
-
|
|
1305
|
-
/**
|
|
1306
|
-
* Sender party
|
|
1307
|
-
*/
|
|
1308
|
-
export interface SenderParty {
|
|
1309
|
-
/**
|
|
1310
|
-
* Related resource identifier
|
|
1311
|
-
*/
|
|
1312
|
-
data: SenderParty.Data | null;
|
|
1313
|
-
}
|
|
1314
|
-
|
|
1315
|
-
export namespace SenderParty {
|
|
1316
|
-
/**
|
|
1317
|
-
* Related resource identifier
|
|
1318
|
-
*/
|
|
1319
|
-
export interface Data {
|
|
1320
|
-
id: string;
|
|
1321
|
-
|
|
1322
|
-
/**
|
|
1323
|
-
* Resource type
|
|
1324
|
-
*/
|
|
1325
|
-
type: string;
|
|
1326
|
-
}
|
|
1327
|
-
}
|
|
1328
|
-
}
|
|
1329
|
-
}
|
|
1330
|
-
}
|
|
1331
|
-
|
|
1332
|
-
export interface EscalationListParams {
|
|
1333
|
-
/**
|
|
1334
|
-
* Query param: Maximum number to return
|
|
1335
|
-
*/
|
|
1336
|
-
limit?: number;
|
|
1337
|
-
|
|
1338
|
-
/**
|
|
1339
|
-
* Query param: Approval status to list. Defaults to pending approvals.
|
|
1340
|
-
*/
|
|
1341
|
-
status?: 'PENDING' | 'APPROVED' | 'DENIED' | 'CANCELLED';
|
|
1342
|
-
|
|
1343
|
-
/**
|
|
1344
|
-
* Header param: Agent ID (agt_xxx) identifying which agent is making the request.
|
|
1345
|
-
*/
|
|
1346
|
-
'X-Agent-ID'?: string;
|
|
1347
|
-
|
|
1348
|
-
/**
|
|
1349
|
-
* Header param: Required when X-Agent-ID is present. Session or conversation ID
|
|
1350
|
-
* for agent observability.
|
|
1351
|
-
*/
|
|
1352
|
-
'X-Instance-ID'?: string;
|
|
1353
|
-
}
|
|
1354
|
-
|
|
1355
|
-
export interface EscalationApproveParams {
|
|
1356
|
-
/**
|
|
1357
|
-
* Unique key for idempotent request handling. If a request with the same key was
|
|
1358
|
-
* already processed, the original response is returned.
|
|
1359
|
-
*/
|
|
1360
|
-
'Idempotency-Key': string;
|
|
1361
|
-
|
|
1362
|
-
/**
|
|
1363
|
-
* Agent ID (agt_xxx) identifying which agent is making the request.
|
|
1364
|
-
*/
|
|
1365
|
-
'X-Agent-ID'?: string;
|
|
1366
|
-
|
|
1367
|
-
/**
|
|
1368
|
-
* Required when X-Agent-ID is present. Session or conversation ID for agent
|
|
1369
|
-
* observability.
|
|
1370
|
-
*/
|
|
1371
|
-
'X-Instance-ID'?: string;
|
|
1372
|
-
}
|
|
1373
|
-
|
|
1374
|
-
export interface EscalationDenyParams {
|
|
1375
|
-
/**
|
|
1376
|
-
* Header param: Unique key for idempotent request handling. If a request with the
|
|
1377
|
-
* same key was already processed, the original response is returned.
|
|
1378
|
-
*/
|
|
1379
|
-
'Idempotency-Key': string;
|
|
1380
|
-
|
|
1381
|
-
/**
|
|
1382
|
-
* Body param: Reason for denial (optional)
|
|
1383
|
-
*/
|
|
1384
|
-
reason?: string;
|
|
1385
|
-
|
|
1386
|
-
/**
|
|
1387
|
-
* Header param: Agent ID (agt_xxx) identifying which agent is making the request.
|
|
1388
|
-
*/
|
|
1389
|
-
'X-Agent-ID'?: string;
|
|
1390
|
-
|
|
1391
|
-
/**
|
|
1392
|
-
* Header param: Required when X-Agent-ID is present. Session or conversation ID
|
|
1393
|
-
* for agent observability.
|
|
1394
|
-
*/
|
|
1395
|
-
'X-Instance-ID'?: string;
|
|
1396
|
-
}
|
|
1397
|
-
|
|
1398
|
-
export interface EscalationGetParams {
|
|
1399
|
-
/**
|
|
1400
|
-
* Agent ID (agt_xxx) identifying which agent is making the request.
|
|
1401
|
-
*/
|
|
1402
|
-
'X-Agent-ID'?: string;
|
|
1403
|
-
|
|
1404
|
-
/**
|
|
1405
|
-
* Required when X-Agent-ID is present. Session or conversation ID for agent
|
|
1406
|
-
* observability.
|
|
1407
|
-
*/
|
|
1408
|
-
'X-Instance-ID'?: string;
|
|
1409
|
-
}
|
|
1410
|
-
|
|
1411
|
-
export declare namespace Escalations {
|
|
1412
|
-
export {
|
|
1413
|
-
type EscalationListResponse as EscalationListResponse,
|
|
1414
|
-
type EscalationApproveResponse as EscalationApproveResponse,
|
|
1415
|
-
type EscalationDenyResponse as EscalationDenyResponse,
|
|
1416
|
-
type EscalationGetResponse as EscalationGetResponse,
|
|
1417
|
-
type EscalationListParams as EscalationListParams,
|
|
1418
|
-
type EscalationApproveParams as EscalationApproveParams,
|
|
1419
|
-
type EscalationDenyParams as EscalationDenyParams,
|
|
1420
|
-
type EscalationGetParams as EscalationGetParams,
|
|
1421
|
-
};
|
|
1422
|
-
}
|