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