@onkernel/sdk 0.98.0 → 0.100.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 +15 -0
- package/client.d.mts +5 -2
- package/client.d.mts.map +1 -1
- package/client.d.ts +5 -2
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/browser-pools.d.mts +9 -0
- package/resources/browser-pools.d.mts.map +1 -1
- package/resources/browser-pools.d.ts +9 -0
- package/resources/browser-pools.d.ts.map +1 -1
- package/resources/browsers/browsers.d.mts +49 -1
- package/resources/browsers/browsers.d.mts.map +1 -1
- package/resources/browsers/browsers.d.ts +49 -1
- package/resources/browsers/browsers.d.ts.map +1 -1
- package/resources/browsers/browsers.js.map +1 -1
- package/resources/browsers/browsers.mjs.map +1 -1
- package/resources/browsers/index.d.mts +1 -1
- package/resources/browsers/index.d.mts.map +1 -1
- package/resources/browsers/index.d.ts +1 -1
- package/resources/browsers/index.d.ts.map +1 -1
- package/resources/browsers/index.js.map +1 -1
- package/resources/browsers/index.mjs.map +1 -1
- package/resources/config-registry/config-registry.d.mts +14 -11
- package/resources/config-registry/config-registry.d.mts.map +1 -1
- package/resources/config-registry/config-registry.d.ts +14 -11
- package/resources/config-registry/config-registry.d.ts.map +1 -1
- package/resources/config-registry/config-registry.js +2 -2
- package/resources/config-registry/config-registry.js.map +1 -1
- package/resources/config-registry/config-registry.mjs +2 -2
- package/resources/config-registry/config-registry.mjs.map +1 -1
- package/resources/index.d.mts +2 -1
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +2 -1
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/invocations.d.mts +9 -0
- package/resources/invocations.d.mts.map +1 -1
- package/resources/invocations.d.ts +9 -0
- package/resources/invocations.d.ts.map +1 -1
- package/resources/telemetry/destinations.d.mts +23 -0
- package/resources/telemetry/destinations.d.mts.map +1 -1
- package/resources/telemetry/destinations.d.ts +23 -0
- package/resources/telemetry/destinations.d.ts.map +1 -1
- package/resources/vaults/index.d.mts +3 -0
- package/resources/vaults/index.d.mts.map +1 -0
- package/resources/vaults/index.d.ts +3 -0
- package/resources/vaults/index.d.ts.map +1 -0
- package/resources/vaults/index.js +9 -0
- package/resources/vaults/index.js.map +1 -0
- package/resources/vaults/index.mjs +4 -0
- package/resources/vaults/index.mjs.map +1 -0
- package/resources/vaults/items.d.mts +529 -0
- package/resources/vaults/items.d.mts.map +1 -0
- package/resources/vaults/items.d.ts +529 -0
- package/resources/vaults/items.d.ts.map +1 -0
- package/resources/vaults/items.js +70 -0
- package/resources/vaults/items.js.map +1 -0
- package/resources/vaults/items.mjs +66 -0
- package/resources/vaults/items.mjs.map +1 -0
- package/resources/vaults/vaults.d.mts +48 -0
- package/resources/vaults/vaults.d.mts.map +1 -0
- package/resources/vaults/vaults.d.ts +48 -0
- package/resources/vaults/vaults.d.ts.map +1 -0
- package/resources/vaults/vaults.js +47 -0
- package/resources/vaults/vaults.js.map +1 -0
- package/resources/vaults/vaults.mjs +42 -0
- package/resources/vaults/vaults.mjs.map +1 -0
- package/resources/vaults.d.mts +2 -0
- package/resources/vaults.d.mts.map +1 -0
- package/resources/vaults.d.ts +2 -0
- package/resources/vaults.d.ts.map +1 -0
- package/resources/vaults.js +6 -0
- package/resources/vaults.js.map +1 -0
- package/resources/vaults.mjs +3 -0
- package/resources/vaults.mjs.map +1 -0
- package/src/client.ts +19 -0
- package/src/resources/browser-pools.ts +11 -0
- package/src/resources/browsers/browsers.ts +60 -0
- package/src/resources/browsers/index.ts +1 -0
- package/src/resources/config-registry/config-registry.ts +14 -11
- package/src/resources/index.ts +8 -0
- package/src/resources/invocations.ts +11 -0
- package/src/resources/telemetry/destinations.ts +27 -0
- package/src/resources/vaults/index.ts +30 -0
- package/src/resources/vaults/items.ts +774 -0
- package/src/resources/vaults/vaults.ts +125 -0
- package/src/resources/vaults.ts +3 -0
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
|
@@ -0,0 +1,774 @@
|
|
|
1
|
+
// File generated from our OpenAPI spec by Stainless. See CONTRIBUTING.md for details.
|
|
2
|
+
|
|
3
|
+
import { APIResource } from '../../core/resource';
|
|
4
|
+
import * as ItemsAPI from './items';
|
|
5
|
+
import { APIPromise } from '../../core/api-promise';
|
|
6
|
+
import { buildHeaders } from '../../internal/headers';
|
|
7
|
+
import { RequestOptions } from '../../internal/request-options';
|
|
8
|
+
import { path } from '../../internal/utils/path';
|
|
9
|
+
|
|
10
|
+
export class Items extends APIResource {
|
|
11
|
+
/**
|
|
12
|
+
* The response advertises operations that are valid in the item's current state
|
|
13
|
+
* and live data that can be requested through `expand`. Read each operation's
|
|
14
|
+
* description before using it. Expanded data is fetched from the provider and is
|
|
15
|
+
* not persisted in the vault item. Requesting an unavailable expansion returns 409
|
|
16
|
+
* instead of a partial item.
|
|
17
|
+
*/
|
|
18
|
+
retrieve(key: string, params: ItemRetrieveParams, options?: RequestOptions): APIPromise<VaultItem> {
|
|
19
|
+
const { id_or_name, ...query } = params;
|
|
20
|
+
return this._client.get(path`/vaults/${id_or_name}/items/${key}`, { query, ...options });
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* Update a card specification before or between authorizations
|
|
25
|
+
*/
|
|
26
|
+
update(key: string, params: ItemUpdateParams, options?: RequestOptions): APIPromise<VaultItem> {
|
|
27
|
+
const { id_or_name, ...body } = params;
|
|
28
|
+
return this._client.patch(path`/vaults/${id_or_name}/items/${key}`, { body, ...options });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
/**
|
|
32
|
+
* List vault items without secret values
|
|
33
|
+
*/
|
|
34
|
+
list(idOrName: string, options?: RequestOptions): APIPromise<ItemListResponse> {
|
|
35
|
+
return this._client.get(path`/vaults/${idOrName}/items`, options);
|
|
36
|
+
}
|
|
37
|
+
|
|
38
|
+
/**
|
|
39
|
+
* Delete a vault item and invalidate its secret value
|
|
40
|
+
*/
|
|
41
|
+
delete(key: string, params: ItemDeleteParams, options?: RequestOptions): APIPromise<void> {
|
|
42
|
+
const { id_or_name } = params;
|
|
43
|
+
return this._client.delete(path`/vaults/${id_or_name}/items/${key}`, {
|
|
44
|
+
...options,
|
|
45
|
+
headers: buildHeaders([{ Accept: '*/*' }, options?.headers]),
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
/**
|
|
50
|
+
* List immutable audit events for a vault item
|
|
51
|
+
*/
|
|
52
|
+
events(key: string, params: ItemEventsParams, options?: RequestOptions): APIPromise<ItemEventsResponse> {
|
|
53
|
+
const { id_or_name, ...query } = params;
|
|
54
|
+
return this._client.get(path`/vaults/${id_or_name}/items/${key}/events`, { query, ...options });
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/**
|
|
58
|
+
* Retrieve the item first and invoke only an operation listed in
|
|
59
|
+
* `available_operations`, following its natural-language description. Operations
|
|
60
|
+
* may call an external provider and can return the item's updated state. If the
|
|
61
|
+
* provider rate limits spend-request creation, returns HTTP 429 with code
|
|
62
|
+
* `spend_request_rate_limited`; stop and back off before retrying.
|
|
63
|
+
*/
|
|
64
|
+
performOperation(
|
|
65
|
+
key: string,
|
|
66
|
+
params: ItemPerformOperationParams,
|
|
67
|
+
options?: RequestOptions,
|
|
68
|
+
): APIPromise<VaultItem> {
|
|
69
|
+
const { id_or_name, ...body } = params;
|
|
70
|
+
return this._client.post(path`/vaults/${id_or_name}/items/${key}/operations`, { body, ...options });
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Create or retrieve an identical vault item by immutable key
|
|
75
|
+
*/
|
|
76
|
+
upsert(key: string, params: ItemUpsertParams, options?: RequestOptions): APIPromise<VaultItem> {
|
|
77
|
+
const { id_or_name, ...body } = params;
|
|
78
|
+
return this._client.put(path`/vaults/${id_or_name}/items/${key}`, { body, ...options });
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/**
|
|
83
|
+
* The in-flight or most recent checkout authorization. Present while a checkout is
|
|
84
|
+
* pending approval and after it settles.
|
|
85
|
+
*/
|
|
86
|
+
export interface AgentcardCheckoutAuthorization {
|
|
87
|
+
id: string;
|
|
88
|
+
|
|
89
|
+
amount_cents: number;
|
|
90
|
+
|
|
91
|
+
created_at: string;
|
|
92
|
+
|
|
93
|
+
currency: string;
|
|
94
|
+
|
|
95
|
+
merchant: string;
|
|
96
|
+
|
|
97
|
+
psp: string;
|
|
98
|
+
|
|
99
|
+
status: 'awaiting_approval' | 'approved' | 'declined' | 'expired';
|
|
100
|
+
|
|
101
|
+
actual_cents?: number;
|
|
102
|
+
|
|
103
|
+
/**
|
|
104
|
+
* Display amount shown on the approval screen.
|
|
105
|
+
*/
|
|
106
|
+
amount?: string;
|
|
107
|
+
|
|
108
|
+
amount_authority?: 'display_only' | 'stripe_payment_intent';
|
|
109
|
+
|
|
110
|
+
amount_verified?: boolean;
|
|
111
|
+
|
|
112
|
+
approval_url?: string;
|
|
113
|
+
|
|
114
|
+
/**
|
|
115
|
+
* Browser session that submitted the checkout.
|
|
116
|
+
*/
|
|
117
|
+
browser_id?: string;
|
|
118
|
+
|
|
119
|
+
charged_amount_cents?: number;
|
|
120
|
+
|
|
121
|
+
charged_currency?: string;
|
|
122
|
+
|
|
123
|
+
charged_kind?: 'captured' | 'authorized' | 'none';
|
|
124
|
+
|
|
125
|
+
expected_cents?: number;
|
|
126
|
+
|
|
127
|
+
expires_at?: string;
|
|
128
|
+
|
|
129
|
+
psp_error_code?: string;
|
|
130
|
+
|
|
131
|
+
reason?: string;
|
|
132
|
+
|
|
133
|
+
replay_attempted?: boolean;
|
|
134
|
+
|
|
135
|
+
/**
|
|
136
|
+
* Whether the processor response was delivered to the browser.
|
|
137
|
+
*/
|
|
138
|
+
replay_delivered?: boolean;
|
|
139
|
+
|
|
140
|
+
/**
|
|
141
|
+
* HTTP status of the replayed processor response.
|
|
142
|
+
*/
|
|
143
|
+
replay_status?: number;
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Live payment card. Test-mode card creation is not supported.
|
|
148
|
+
*/
|
|
149
|
+
export type CardVaultItemSpec =
|
|
150
|
+
| CardVaultItemSpec.LinkCardVaultItemSpec
|
|
151
|
+
| CardVaultItemSpec.AgentCardCardVaultItemSpec;
|
|
152
|
+
|
|
153
|
+
export namespace CardVaultItemSpec {
|
|
154
|
+
/**
|
|
155
|
+
* Live payment card. Test-mode card creation is not supported.
|
|
156
|
+
*/
|
|
157
|
+
export interface LinkCardVaultItemSpec {
|
|
158
|
+
/**
|
|
159
|
+
* Integer amount in minor currency units.
|
|
160
|
+
*/
|
|
161
|
+
amount: number;
|
|
162
|
+
|
|
163
|
+
context: string;
|
|
164
|
+
|
|
165
|
+
currency: string;
|
|
166
|
+
|
|
167
|
+
merchant_name: string;
|
|
168
|
+
|
|
169
|
+
merchant_url: string;
|
|
170
|
+
|
|
171
|
+
/**
|
|
172
|
+
* Payment-method ID returned by the referenced wallet's payment-method listing.
|
|
173
|
+
* The provider decides whether the selected funding method can satisfy the card
|
|
174
|
+
* request.
|
|
175
|
+
*/
|
|
176
|
+
payment_method_id: string;
|
|
177
|
+
|
|
178
|
+
provider: 'link';
|
|
179
|
+
|
|
180
|
+
/**
|
|
181
|
+
* Wallet item key used to mint this card.
|
|
182
|
+
*/
|
|
183
|
+
wallet: string;
|
|
184
|
+
|
|
185
|
+
expires_at?: number;
|
|
186
|
+
|
|
187
|
+
line_items?: Array<LinkCardVaultItemSpec.LineItem>;
|
|
188
|
+
|
|
189
|
+
metadata?: { [key: string]: string };
|
|
190
|
+
|
|
191
|
+
totals?: Array<LinkCardVaultItemSpec.Total>;
|
|
192
|
+
}
|
|
193
|
+
|
|
194
|
+
export namespace LinkCardVaultItemSpec {
|
|
195
|
+
export interface LineItem {
|
|
196
|
+
name: string;
|
|
197
|
+
|
|
198
|
+
description?: string;
|
|
199
|
+
|
|
200
|
+
image_url?: string;
|
|
201
|
+
|
|
202
|
+
product_url?: string;
|
|
203
|
+
|
|
204
|
+
quantity?: number;
|
|
205
|
+
|
|
206
|
+
sku?: string;
|
|
207
|
+
|
|
208
|
+
totals?: Array<LineItem.Total>;
|
|
209
|
+
|
|
210
|
+
/**
|
|
211
|
+
* Unit amount in minor currency units.
|
|
212
|
+
*/
|
|
213
|
+
unit_amount?: number;
|
|
214
|
+
|
|
215
|
+
url?: string;
|
|
216
|
+
}
|
|
217
|
+
|
|
218
|
+
export namespace LineItem {
|
|
219
|
+
export interface Total {
|
|
220
|
+
/**
|
|
221
|
+
* Total amount in minor currency units.
|
|
222
|
+
*/
|
|
223
|
+
amount: number;
|
|
224
|
+
|
|
225
|
+
display_text: string;
|
|
226
|
+
|
|
227
|
+
type: string;
|
|
228
|
+
}
|
|
229
|
+
}
|
|
230
|
+
|
|
231
|
+
export interface Total {
|
|
232
|
+
/**
|
|
233
|
+
* Total amount in minor currency units.
|
|
234
|
+
*/
|
|
235
|
+
amount: number;
|
|
236
|
+
|
|
237
|
+
display_text: string;
|
|
238
|
+
|
|
239
|
+
type: string;
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
/**
|
|
244
|
+
* AgentCard reusable live payment card. Test-mode card creation is not supported.
|
|
245
|
+
* Each checkout creates an approval-gated authorization for spec.merchant /
|
|
246
|
+
* spec.amount. The card stays ready after each authorization.
|
|
247
|
+
*/
|
|
248
|
+
export interface AgentCardCardVaultItemSpec {
|
|
249
|
+
/**
|
|
250
|
+
* Integer amount in minor currency units.
|
|
251
|
+
*/
|
|
252
|
+
amount: number;
|
|
253
|
+
|
|
254
|
+
currency: string;
|
|
255
|
+
|
|
256
|
+
/**
|
|
257
|
+
* Merchant name shown on the cardholder's approval screen.
|
|
258
|
+
*/
|
|
259
|
+
merchant: string;
|
|
260
|
+
|
|
261
|
+
provider: 'agentcard';
|
|
262
|
+
|
|
263
|
+
/**
|
|
264
|
+
* Wallet item key used to authorize checkouts.
|
|
265
|
+
*/
|
|
266
|
+
wallet: string;
|
|
267
|
+
|
|
268
|
+
/**
|
|
269
|
+
* AgentCard vaulted card to pay with. Omitted, the cardholder picks on the
|
|
270
|
+
* approval screen.
|
|
271
|
+
*/
|
|
272
|
+
card_id?: string;
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
|
|
276
|
+
export type CardVaultItemState = CardVaultItemState.LinkCardState | CardVaultItemState.AgentCardCardState;
|
|
277
|
+
|
|
278
|
+
export namespace CardVaultItemState {
|
|
279
|
+
export interface LinkCardState {
|
|
280
|
+
provider: 'link';
|
|
281
|
+
|
|
282
|
+
status: 'requested' | 'pending_authorization' | 'ready' | 'consumed' | 'expired' | 'declined';
|
|
283
|
+
|
|
284
|
+
aliases?: ItemsAPI.VaultCardAliases;
|
|
285
|
+
|
|
286
|
+
domains?: Array<string>;
|
|
287
|
+
|
|
288
|
+
masks?: LinkCardState.Masks;
|
|
289
|
+
|
|
290
|
+
status_reason?: string;
|
|
291
|
+
}
|
|
292
|
+
|
|
293
|
+
export namespace LinkCardState {
|
|
294
|
+
export interface Masks {
|
|
295
|
+
brand?: string;
|
|
296
|
+
|
|
297
|
+
last4?: string;
|
|
298
|
+
|
|
299
|
+
[k: string]: string | undefined;
|
|
300
|
+
}
|
|
301
|
+
}
|
|
302
|
+
|
|
303
|
+
export interface AgentCardCardState {
|
|
304
|
+
provider: 'agentcard';
|
|
305
|
+
|
|
306
|
+
status: 'requested' | 'ready' | 'pending_approval' | 'degraded';
|
|
307
|
+
|
|
308
|
+
aliases?: ItemsAPI.VaultCardAliases;
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* The in-flight or most recent checkout authorization. Present while a checkout is
|
|
312
|
+
* pending approval and after it settles.
|
|
313
|
+
*/
|
|
314
|
+
authorization?: ItemsAPI.AgentcardCheckoutAuthorization;
|
|
315
|
+
|
|
316
|
+
masks?: AgentCardCardState.Masks;
|
|
317
|
+
|
|
318
|
+
status_reason?: string;
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
export namespace AgentCardCardState {
|
|
322
|
+
export interface Masks {
|
|
323
|
+
brand?: string;
|
|
324
|
+
|
|
325
|
+
last4?: string;
|
|
326
|
+
|
|
327
|
+
[k: string]: string | undefined;
|
|
328
|
+
}
|
|
329
|
+
}
|
|
330
|
+
}
|
|
331
|
+
|
|
332
|
+
export interface VaultCardAliases {
|
|
333
|
+
cvc: string;
|
|
334
|
+
|
|
335
|
+
exp_month: string;
|
|
336
|
+
|
|
337
|
+
exp_year: string;
|
|
338
|
+
|
|
339
|
+
number: string;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
export type VaultItem = VaultItem.WalletVaultItem | VaultItem.CardVaultItem;
|
|
343
|
+
|
|
344
|
+
export namespace VaultItem {
|
|
345
|
+
export interface WalletVaultItem {
|
|
346
|
+
id: string;
|
|
347
|
+
|
|
348
|
+
available_expansions: Array<WalletVaultItem.AvailableExpansion>;
|
|
349
|
+
|
|
350
|
+
available_operations: Array<WalletVaultItem.AvailableOperation>;
|
|
351
|
+
|
|
352
|
+
created_at: string;
|
|
353
|
+
|
|
354
|
+
/**
|
|
355
|
+
* Immutable item key assigned when the item is created.
|
|
356
|
+
*/
|
|
357
|
+
key: string;
|
|
358
|
+
|
|
359
|
+
/**
|
|
360
|
+
* AgentCard wallet. Mode (sandbox vs live) is fixed by the deployment's AgentCard
|
|
361
|
+
* credential; there is no per-item test flag. user_id may only reference a user
|
|
362
|
+
* already enrolled by a wallet in this organization.
|
|
363
|
+
*/
|
|
364
|
+
spec: ItemsAPI.WalletVaultItemSpec;
|
|
365
|
+
|
|
366
|
+
state: ItemsAPI.WalletVaultItemState;
|
|
367
|
+
|
|
368
|
+
type: 'wallet';
|
|
369
|
+
|
|
370
|
+
updated_at: string;
|
|
371
|
+
|
|
372
|
+
action?: ItemsAPI.VaultItemAction;
|
|
373
|
+
|
|
374
|
+
/**
|
|
375
|
+
* Live, non-persisted data requested through the item GET expand parameter.
|
|
376
|
+
*/
|
|
377
|
+
expanded?: WalletVaultItem.Expanded;
|
|
378
|
+
|
|
379
|
+
expires_at?: string;
|
|
380
|
+
}
|
|
381
|
+
|
|
382
|
+
export namespace WalletVaultItem {
|
|
383
|
+
/**
|
|
384
|
+
* Live data that can currently be requested by passing its type to the item GET
|
|
385
|
+
* expand parameter.
|
|
386
|
+
*/
|
|
387
|
+
export interface AvailableExpansion {
|
|
388
|
+
description: string;
|
|
389
|
+
|
|
390
|
+
type: 'payment_methods';
|
|
391
|
+
}
|
|
392
|
+
|
|
393
|
+
/**
|
|
394
|
+
* An operation that is currently valid for this item. Read the description before
|
|
395
|
+
* invoking it through the item operations endpoint.
|
|
396
|
+
*/
|
|
397
|
+
export interface AvailableOperation {
|
|
398
|
+
description: string;
|
|
399
|
+
|
|
400
|
+
type: 'authorize';
|
|
401
|
+
}
|
|
402
|
+
|
|
403
|
+
/**
|
|
404
|
+
* Live, non-persisted data requested through the item GET expand parameter.
|
|
405
|
+
*/
|
|
406
|
+
export interface Expanded {
|
|
407
|
+
payment_methods?: Array<ItemsAPI.VaultPaymentMethod>;
|
|
408
|
+
}
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
export interface CardVaultItem {
|
|
412
|
+
id: string;
|
|
413
|
+
|
|
414
|
+
available_expansions: Array<CardVaultItem.AvailableExpansion>;
|
|
415
|
+
|
|
416
|
+
available_operations: Array<CardVaultItem.AvailableOperation>;
|
|
417
|
+
|
|
418
|
+
created_at: string;
|
|
419
|
+
|
|
420
|
+
/**
|
|
421
|
+
* Immutable item key assigned when the item is created.
|
|
422
|
+
*/
|
|
423
|
+
key: string;
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Live payment card. Test-mode card creation is not supported.
|
|
427
|
+
*/
|
|
428
|
+
spec: ItemsAPI.CardVaultItemSpec;
|
|
429
|
+
|
|
430
|
+
state: ItemsAPI.CardVaultItemState;
|
|
431
|
+
|
|
432
|
+
type: 'card';
|
|
433
|
+
|
|
434
|
+
updated_at: string;
|
|
435
|
+
|
|
436
|
+
action?: ItemsAPI.VaultItemAction;
|
|
437
|
+
|
|
438
|
+
expires_at?: string;
|
|
439
|
+
}
|
|
440
|
+
|
|
441
|
+
export namespace CardVaultItem {
|
|
442
|
+
/**
|
|
443
|
+
* Live data that can currently be requested by passing its type to the item GET
|
|
444
|
+
* expand parameter.
|
|
445
|
+
*/
|
|
446
|
+
export interface AvailableExpansion {
|
|
447
|
+
description: string;
|
|
448
|
+
|
|
449
|
+
type: 'payment_methods';
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/**
|
|
453
|
+
* An operation that is currently valid for this item. Read the description before
|
|
454
|
+
* invoking it through the item operations endpoint.
|
|
455
|
+
*/
|
|
456
|
+
export interface AvailableOperation {
|
|
457
|
+
description: string;
|
|
458
|
+
|
|
459
|
+
type: 'authorize';
|
|
460
|
+
}
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
export type VaultItemAction =
|
|
465
|
+
| VaultItemAction.LinkOAuthAction
|
|
466
|
+
| VaultItemAction.SpendApprovalAction
|
|
467
|
+
| VaultItemAction.PushApprovalAction
|
|
468
|
+
| VaultItemAction.CollectAction
|
|
469
|
+
| VaultItemAction.MfaAction
|
|
470
|
+
| VaultItemAction.EmbeddedCeremonyAction
|
|
471
|
+
| VaultItemAction.CardEnrollmentAction;
|
|
472
|
+
|
|
473
|
+
export namespace VaultItemAction {
|
|
474
|
+
export interface LinkOAuthAction {
|
|
475
|
+
name: 'link_oauth';
|
|
476
|
+
|
|
477
|
+
url: string;
|
|
478
|
+
}
|
|
479
|
+
|
|
480
|
+
export interface SpendApprovalAction {
|
|
481
|
+
name: 'spend_approval';
|
|
482
|
+
|
|
483
|
+
url: string;
|
|
484
|
+
}
|
|
485
|
+
|
|
486
|
+
export interface PushApprovalAction {
|
|
487
|
+
name: 'push_approval';
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
export interface CollectAction {
|
|
491
|
+
name: 'collect';
|
|
492
|
+
}
|
|
493
|
+
|
|
494
|
+
export interface MfaAction {
|
|
495
|
+
name: 'mfa';
|
|
496
|
+
}
|
|
497
|
+
|
|
498
|
+
export interface EmbeddedCeremonyAction {
|
|
499
|
+
name: 'embedded_ceremony';
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
export interface CardEnrollmentAction {
|
|
503
|
+
name: 'card_enrollment';
|
|
504
|
+
|
|
505
|
+
url: string;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
export interface VaultItemEvent {
|
|
510
|
+
id: string;
|
|
511
|
+
|
|
512
|
+
created_at: string;
|
|
513
|
+
|
|
514
|
+
name: string;
|
|
515
|
+
|
|
516
|
+
/**
|
|
517
|
+
* Browser session associated with the event, when applicable.
|
|
518
|
+
*/
|
|
519
|
+
browser_id?: string;
|
|
520
|
+
|
|
521
|
+
data?: { [key: string]: unknown };
|
|
522
|
+
}
|
|
523
|
+
|
|
524
|
+
export interface VaultPaymentMethod {
|
|
525
|
+
id: string;
|
|
526
|
+
|
|
527
|
+
/**
|
|
528
|
+
* Provider-reported advisory capabilities. A missing capability is unknown, not
|
|
529
|
+
* ineligible; only eligible=false is an explicit negative signal.
|
|
530
|
+
*/
|
|
531
|
+
capabilities: VaultPaymentMethod.Capabilities;
|
|
532
|
+
|
|
533
|
+
display: VaultPaymentMethod.Display;
|
|
534
|
+
|
|
535
|
+
is_default: boolean;
|
|
536
|
+
|
|
537
|
+
/**
|
|
538
|
+
* Provider that issued this payment-method ID.
|
|
539
|
+
*/
|
|
540
|
+
provider: string;
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* Provider-neutral payment-method type normalized to lowercase.
|
|
544
|
+
*/
|
|
545
|
+
type: string;
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
export namespace VaultPaymentMethod {
|
|
549
|
+
/**
|
|
550
|
+
* Provider-reported advisory capabilities. A missing capability is unknown, not
|
|
551
|
+
* ineligible; only eligible=false is an explicit negative signal.
|
|
552
|
+
*/
|
|
553
|
+
export interface Capabilities {
|
|
554
|
+
single_use_card?: Capabilities.SingleUseCard;
|
|
555
|
+
}
|
|
556
|
+
|
|
557
|
+
export namespace Capabilities {
|
|
558
|
+
export interface SingleUseCard {
|
|
559
|
+
eligible: boolean;
|
|
560
|
+
|
|
561
|
+
reasons: Array<string>;
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
export interface Display {
|
|
566
|
+
brand?: string;
|
|
567
|
+
|
|
568
|
+
label?: string;
|
|
569
|
+
|
|
570
|
+
last4?: string;
|
|
571
|
+
}
|
|
572
|
+
}
|
|
573
|
+
|
|
574
|
+
/**
|
|
575
|
+
* AgentCard wallet. Mode (sandbox vs live) is fixed by the deployment's AgentCard
|
|
576
|
+
* credential; there is no per-item test flag. user_id may only reference a user
|
|
577
|
+
* already enrolled by a wallet in this organization.
|
|
578
|
+
*/
|
|
579
|
+
export type WalletVaultItemSpec =
|
|
580
|
+
| WalletVaultItemSpec.LinkWalletVaultItemSpec
|
|
581
|
+
| WalletVaultItemSpec.AgentCardWalletVaultItemSpec;
|
|
582
|
+
|
|
583
|
+
export namespace WalletVaultItemSpec {
|
|
584
|
+
export interface LinkWalletVaultItemSpec {
|
|
585
|
+
authorization: LinkWalletVaultItemSpec.Authorization;
|
|
586
|
+
|
|
587
|
+
provider: 'link';
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
export namespace LinkWalletVaultItemSpec {
|
|
591
|
+
export interface Authorization {
|
|
592
|
+
client: Authorization.Client;
|
|
593
|
+
|
|
594
|
+
method: 'oauth';
|
|
595
|
+
}
|
|
596
|
+
|
|
597
|
+
export namespace Authorization {
|
|
598
|
+
export interface Client {
|
|
599
|
+
type: 'kernel_managed';
|
|
600
|
+
}
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
|
|
604
|
+
/**
|
|
605
|
+
* AgentCard wallet. Mode (sandbox vs live) is fixed by the deployment's AgentCard
|
|
606
|
+
* credential; there is no per-item test flag. user_id may only reference a user
|
|
607
|
+
* already enrolled by a wallet in this organization.
|
|
608
|
+
*/
|
|
609
|
+
export interface AgentCardWalletVaultItemSpec {
|
|
610
|
+
provider: 'agentcard';
|
|
611
|
+
|
|
612
|
+
user_id?: string;
|
|
613
|
+
}
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
export type WalletVaultItemState =
|
|
617
|
+
| WalletVaultItemState.LinkWalletState
|
|
618
|
+
| WalletVaultItemState.AgentCardWalletState;
|
|
619
|
+
|
|
620
|
+
export namespace WalletVaultItemState {
|
|
621
|
+
export interface LinkWalletState {
|
|
622
|
+
provider: 'link';
|
|
623
|
+
|
|
624
|
+
status: 'pending_authorization' | 'connected' | 'declined' | 'reconnect_required' | 'degraded';
|
|
625
|
+
|
|
626
|
+
status_reason?: string;
|
|
627
|
+
}
|
|
628
|
+
|
|
629
|
+
export interface AgentCardWalletState {
|
|
630
|
+
provider: 'agentcard';
|
|
631
|
+
|
|
632
|
+
status: 'pending_authorization' | 'connected' | 'degraded';
|
|
633
|
+
|
|
634
|
+
status_reason?: string;
|
|
635
|
+
|
|
636
|
+
/**
|
|
637
|
+
* AgentCard user id linked to this wallet. Present once connected.
|
|
638
|
+
*/
|
|
639
|
+
user_id?: string;
|
|
640
|
+
}
|
|
641
|
+
}
|
|
642
|
+
|
|
643
|
+
export type ItemListResponse = Array<VaultItem>;
|
|
644
|
+
|
|
645
|
+
export type ItemEventsResponse = Array<VaultItemEvent>;
|
|
646
|
+
|
|
647
|
+
export interface ItemRetrieveParams {
|
|
648
|
+
/**
|
|
649
|
+
* Path param
|
|
650
|
+
*/
|
|
651
|
+
id_or_name: string;
|
|
652
|
+
|
|
653
|
+
/**
|
|
654
|
+
* Query param: Live fields advertised by `available_expansions` to include in
|
|
655
|
+
* `expanded`.
|
|
656
|
+
*/
|
|
657
|
+
expand?: Array<'payment_methods'>;
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* Query param: Hold for up to this many seconds while the item is pending
|
|
661
|
+
* authorization or approval.
|
|
662
|
+
*/
|
|
663
|
+
wait?: number;
|
|
664
|
+
}
|
|
665
|
+
|
|
666
|
+
export interface ItemUpdateParams {
|
|
667
|
+
/**
|
|
668
|
+
* Path param
|
|
669
|
+
*/
|
|
670
|
+
id_or_name: string;
|
|
671
|
+
|
|
672
|
+
/**
|
|
673
|
+
* Body param: Live payment card. Test-mode card creation is not supported.
|
|
674
|
+
*/
|
|
675
|
+
spec: CardVaultItemSpec;
|
|
676
|
+
}
|
|
677
|
+
|
|
678
|
+
export interface ItemDeleteParams {
|
|
679
|
+
id_or_name: string;
|
|
680
|
+
}
|
|
681
|
+
|
|
682
|
+
export interface ItemEventsParams {
|
|
683
|
+
/**
|
|
684
|
+
* Path param
|
|
685
|
+
*/
|
|
686
|
+
id_or_name: string;
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* Query param: Return events after this event ID.
|
|
690
|
+
*/
|
|
691
|
+
after?: string;
|
|
692
|
+
|
|
693
|
+
/**
|
|
694
|
+
* Query param: Long-poll for new events for up to this many seconds.
|
|
695
|
+
*/
|
|
696
|
+
wait?: number;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
export interface ItemPerformOperationParams {
|
|
700
|
+
/**
|
|
701
|
+
* Path param
|
|
702
|
+
*/
|
|
703
|
+
id_or_name: string;
|
|
704
|
+
|
|
705
|
+
/**
|
|
706
|
+
* Body param
|
|
707
|
+
*/
|
|
708
|
+
type: 'authorize';
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
export type ItemUpsertParams =
|
|
712
|
+
| ItemUpsertParams.WalletVaultItemRequest
|
|
713
|
+
| ItemUpsertParams.CardVaultItemRequest;
|
|
714
|
+
|
|
715
|
+
export declare namespace ItemUpsertParams {
|
|
716
|
+
export interface WalletVaultItemRequest {
|
|
717
|
+
/**
|
|
718
|
+
* Path param
|
|
719
|
+
*/
|
|
720
|
+
id_or_name: string;
|
|
721
|
+
|
|
722
|
+
/**
|
|
723
|
+
* Body param: AgentCard wallet. Mode (sandbox vs live) is fixed by the
|
|
724
|
+
* deployment's AgentCard credential; there is no per-item test flag. user_id may
|
|
725
|
+
* only reference a user already enrolled by a wallet in this organization.
|
|
726
|
+
*/
|
|
727
|
+
spec: WalletVaultItemSpec;
|
|
728
|
+
|
|
729
|
+
/**
|
|
730
|
+
* Body param
|
|
731
|
+
*/
|
|
732
|
+
type: 'wallet';
|
|
733
|
+
}
|
|
734
|
+
|
|
735
|
+
export interface CardVaultItemRequest {
|
|
736
|
+
/**
|
|
737
|
+
* Path param
|
|
738
|
+
*/
|
|
739
|
+
id_or_name: string;
|
|
740
|
+
|
|
741
|
+
/**
|
|
742
|
+
* Body param: Live payment card. Test-mode card creation is not supported.
|
|
743
|
+
*/
|
|
744
|
+
spec: CardVaultItemSpec;
|
|
745
|
+
|
|
746
|
+
/**
|
|
747
|
+
* Body param
|
|
748
|
+
*/
|
|
749
|
+
type: 'card';
|
|
750
|
+
}
|
|
751
|
+
}
|
|
752
|
+
|
|
753
|
+
export declare namespace Items {
|
|
754
|
+
export {
|
|
755
|
+
type AgentcardCheckoutAuthorization as AgentcardCheckoutAuthorization,
|
|
756
|
+
type CardVaultItemSpec as CardVaultItemSpec,
|
|
757
|
+
type CardVaultItemState as CardVaultItemState,
|
|
758
|
+
type VaultCardAliases as VaultCardAliases,
|
|
759
|
+
type VaultItem as VaultItem,
|
|
760
|
+
type VaultItemAction as VaultItemAction,
|
|
761
|
+
type VaultItemEvent as VaultItemEvent,
|
|
762
|
+
type VaultPaymentMethod as VaultPaymentMethod,
|
|
763
|
+
type WalletVaultItemSpec as WalletVaultItemSpec,
|
|
764
|
+
type WalletVaultItemState as WalletVaultItemState,
|
|
765
|
+
type ItemListResponse as ItemListResponse,
|
|
766
|
+
type ItemEventsResponse as ItemEventsResponse,
|
|
767
|
+
type ItemRetrieveParams as ItemRetrieveParams,
|
|
768
|
+
type ItemUpdateParams as ItemUpdateParams,
|
|
769
|
+
type ItemDeleteParams as ItemDeleteParams,
|
|
770
|
+
type ItemEventsParams as ItemEventsParams,
|
|
771
|
+
type ItemPerformOperationParams as ItemPerformOperationParams,
|
|
772
|
+
type ItemUpsertParams as ItemUpsertParams,
|
|
773
|
+
};
|
|
774
|
+
}
|