@onkernel/sdk 0.101.0 → 0.103.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 +29 -0
- package/package.json +1 -1
- package/resources/auth/connections.d.mts +14 -0
- package/resources/auth/connections.d.mts.map +1 -1
- package/resources/auth/connections.d.ts +14 -0
- package/resources/auth/connections.d.ts.map +1 -1
- package/resources/browsers/computer.d.mts +6 -2
- package/resources/browsers/computer.d.mts.map +1 -1
- package/resources/browsers/computer.d.ts +6 -2
- package/resources/browsers/computer.d.ts.map +1 -1
- package/resources/config-registry/config-registry.d.mts +54 -1
- package/resources/config-registry/config-registry.d.mts.map +1 -1
- package/resources/config-registry/config-registry.d.ts +54 -1
- package/resources/config-registry/config-registry.d.ts.map +1 -1
- package/resources/config-registry/config-registry.js.map +1 -1
- package/resources/config-registry/config-registry.mjs.map +1 -1
- package/resources/vaults/index.d.mts +1 -1
- package/resources/vaults/index.d.mts.map +1 -1
- package/resources/vaults/index.d.ts +1 -1
- package/resources/vaults/index.d.ts.map +1 -1
- package/resources/vaults/index.js.map +1 -1
- package/resources/vaults/index.mjs.map +1 -1
- package/resources/vaults/items.d.mts +814 -49
- package/resources/vaults/items.d.mts.map +1 -1
- package/resources/vaults/items.d.ts +814 -49
- package/resources/vaults/items.d.ts.map +1 -1
- package/resources/vaults/items.js +52 -20
- package/resources/vaults/items.js.map +1 -1
- package/resources/vaults/items.mjs +52 -20
- package/resources/vaults/items.mjs.map +1 -1
- package/resources/vaults/vaults.d.mts +2 -2
- package/resources/vaults/vaults.d.mts.map +1 -1
- package/resources/vaults/vaults.d.ts +2 -2
- package/resources/vaults/vaults.d.ts.map +1 -1
- package/resources/vaults/vaults.js.map +1 -1
- package/resources/vaults/vaults.mjs.map +1 -1
- package/src/resources/auth/connections.ts +17 -0
- package/src/resources/browsers/computer.ts +6 -2
- package/src/resources/config-registry/config-registry.ts +68 -1
- package/src/resources/vaults/index.ts +24 -0
- package/src/resources/vaults/items.ts +1009 -49
- package/src/resources/vaults/vaults.ts +48 -0
- 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
|
@@ -8,7 +8,11 @@ export declare class Items extends APIResource {
|
|
|
8
8
|
* and live data that can be requested through `expand`. Read each operation's
|
|
9
9
|
* description before using it. Expanded data is fetched from the provider and is
|
|
10
10
|
* not persisted in the vault item. Requesting an unavailable expansion returns 409
|
|
11
|
-
* instead of a partial item.
|
|
11
|
+
* instead of a partial item. Pending credential items return a collection action.
|
|
12
|
+
* Kernel-hosted active collection links are renewed atomically on expiry for ready
|
|
13
|
+
* or pending items without changing the item version. Invoke collect to open a
|
|
14
|
+
* form for a ready item without clearing values. Sensitive credential values are
|
|
15
|
+
* never returned.
|
|
12
16
|
*
|
|
13
17
|
* @example
|
|
14
18
|
* ```ts
|
|
@@ -19,13 +23,18 @@ export declare class Items extends APIResource {
|
|
|
19
23
|
*/
|
|
20
24
|
retrieve(key: string, params: ItemRetrieveParams, options?: RequestOptions): APIPromise<VaultItem>;
|
|
21
25
|
/**
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
*
|
|
27
|
-
*
|
|
28
|
-
*
|
|
26
|
+
* Credential updates require type credential and the current version, and change
|
|
27
|
+
* only values or description; omitted values are preserved, nonempty strings
|
|
28
|
+
* replace, and null or empty strings clear supported fields. Clearing required
|
|
29
|
+
* text/email/password values returns pending_collection; browser forms still
|
|
30
|
+
* require nonempty required inputs. Card updates may omit type for compatibility
|
|
31
|
+
* with legacy requests. Requested cards accept a replacement specification.
|
|
32
|
+
* Pending issuance requests may update provider-supported fields on their existing
|
|
33
|
+
* request, subject to atomic provider approval checks; omitted optional fields
|
|
34
|
+
* remain unchanged and explicit empty lists clear them. Wallet/provider binding
|
|
35
|
+
* and unsupported fields cannot change after authorization starts. An uncertain
|
|
36
|
+
* update enters recovery_required and must not be retried. Checkout cards may be
|
|
37
|
+
* edited between authorizations.
|
|
29
38
|
*
|
|
30
39
|
* @example
|
|
31
40
|
* ```ts
|
|
@@ -42,12 +51,15 @@ export declare class Items extends APIResource {
|
|
|
42
51
|
* context:
|
|
43
52
|
* 'The order total changed to USD 30.00 including shipping and taxes for one notebook. Update this unapproved request rather than creating a second payment.',
|
|
44
53
|
* },
|
|
54
|
+
* type: 'card',
|
|
45
55
|
* });
|
|
46
56
|
* ```
|
|
47
57
|
*/
|
|
48
58
|
update(key: string, params: ItemUpdateParams, options?: RequestOptions): APIPromise<VaultItem>;
|
|
49
59
|
/**
|
|
50
|
-
*
|
|
60
|
+
* Credential entries include safe field metadata and non-sensitive values. Listing
|
|
61
|
+
* never creates or renews collection sessions; only an existing unexpired active
|
|
62
|
+
* session is included. Use single-item GET or collect to obtain a fresh link.
|
|
51
63
|
*
|
|
52
64
|
* @example
|
|
53
65
|
* ```ts
|
|
@@ -58,9 +70,11 @@ export declare class Items extends APIResource {
|
|
|
58
70
|
*/
|
|
59
71
|
list(idOrName: string, options?: RequestOptions): APIPromise<ItemListResponse>;
|
|
60
72
|
/**
|
|
61
|
-
* Unresolved payment operations block deletion, including operations on
|
|
62
|
-
* cards of a wallet.
|
|
63
|
-
*
|
|
73
|
+
* Unresolved payment operations normally block deletion, including operations on
|
|
74
|
+
* child cards of a wallet. An AgentCard card in recovery_required whose checkout
|
|
75
|
+
* create response returned no authorization ID may be explicitly abandoned by
|
|
76
|
+
* deleting that card directly; deleting its wallet or vault remains blocked.
|
|
77
|
+
* Deleting or recreating an item is not proof that a payment did not occur.
|
|
64
78
|
*
|
|
65
79
|
* @example
|
|
66
80
|
* ```ts
|
|
@@ -84,30 +98,44 @@ export declare class Items extends APIResource {
|
|
|
84
98
|
events(key: string, params: ItemEventsParams, options?: RequestOptions): APIPromise<ItemEventsResponse>;
|
|
85
99
|
/**
|
|
86
100
|
* Retrieve the item first and invoke only an operation listed in
|
|
87
|
-
* `available_operations`, following its natural-language description.
|
|
88
|
-
*
|
|
89
|
-
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
101
|
+
* `available_operations`, following its natural-language description. Availability
|
|
102
|
+
* is rechecked at execution time; unavailable operations return 409. Authorization
|
|
103
|
+
* and preparation may call an external provider and return updated state. Link
|
|
104
|
+
* cards advertise authorize without checkout context. Eligible unused AgentCard
|
|
105
|
+
* cards advertise prepare_checkout, which requires checkout context and obtains
|
|
106
|
+
* device approval before native Square Pay. Keep the returned approval page open,
|
|
107
|
+
* poll until ready_to_submit, then submit before preparation.expires_at. Unused
|
|
108
|
+
* preparations expire automatically and cannot be reused. If spend-request
|
|
109
|
+
* creation is rate limited, returns HTTP 429 with code
|
|
92
110
|
* `spend_request_rate_limited`; stop and back off before retrying.
|
|
93
111
|
*
|
|
112
|
+
* Fill returns a value-free execution result. Validation failures before writing
|
|
113
|
+
* return 400 (invalid request or targets), 403 (access or destination denied), 404
|
|
114
|
+
* (resource not found), or 409 (item or browser not ready). Once writing starts,
|
|
115
|
+
* known partial failures and indeterminate field outcomes return 200 with status
|
|
116
|
+
* `failed` or `unknown`, not an automatic-retry signal. A transport error may
|
|
117
|
+
* leave the outcome unknown; do not automatically retry.
|
|
118
|
+
*
|
|
94
119
|
* @example
|
|
95
120
|
* ```ts
|
|
96
|
-
* const
|
|
121
|
+
* const vaultItemOperationResponse =
|
|
97
122
|
* await client.vaults.items.performOperation('key', {
|
|
98
123
|
* id_or_name: 'id_or_name',
|
|
99
124
|
* type: 'authorize',
|
|
100
125
|
* });
|
|
101
126
|
* ```
|
|
102
127
|
*/
|
|
103
|
-
performOperation(key: string, params: ItemPerformOperationParams, options?: RequestOptions): APIPromise<
|
|
128
|
+
performOperation(key: string, params: ItemPerformOperationParams, options?: RequestOptions): APIPromise<VaultItemOperationResponse>;
|
|
104
129
|
/**
|
|
105
130
|
* Create an item under a key unique within its vault, or retrieve the existing
|
|
106
131
|
* item when its specification matches. An identical card PUT returns the existing
|
|
107
132
|
* card in any lifecycle state without polling the provider, reauthorizing,
|
|
108
133
|
* replacing aliases, or resetting recovery. Conflicting specifications return 409.
|
|
109
134
|
* Provider-specific authorization requirements and retry behavior are described in
|
|
110
|
-
* the item's request schema.
|
|
135
|
+
* the item's request schema. Do not use credential items to store, collect, or
|
|
136
|
+
* fill credit card data, including card numbers (PANs), security codes (CVV/CVC),
|
|
137
|
+
* or expiration dates. Use wallet and card item types for credit cards and payment
|
|
138
|
+
* checkout instead.
|
|
111
139
|
*
|
|
112
140
|
* @example
|
|
113
141
|
* ```ts
|
|
@@ -161,6 +189,41 @@ export interface AgentcardCheckoutAuthorization {
|
|
|
161
189
|
*/
|
|
162
190
|
replay_status?: number;
|
|
163
191
|
}
|
|
192
|
+
/**
|
|
193
|
+
* One-use Square checkout preparation. Keep the approval page open through token
|
|
194
|
+
* handoff. The amount is display-only and does not constrain the merchant's
|
|
195
|
+
* eventual charge.
|
|
196
|
+
*/
|
|
197
|
+
export interface AgentcardCheckoutPreparation {
|
|
198
|
+
browser_id: string;
|
|
199
|
+
created_at: string;
|
|
200
|
+
environment: 'production' | 'sandbox';
|
|
201
|
+
merchant_origin: string;
|
|
202
|
+
/**
|
|
203
|
+
* Preparation consumed means egress claimed the preparation and it cannot be
|
|
204
|
+
* reused. It does not mean the attempt settled. Use the enclosing item's status as
|
|
205
|
+
* the lifecycle indicator; item consumed means the attempt settled, not that an
|
|
206
|
+
* order or charge succeeded.
|
|
207
|
+
*/
|
|
208
|
+
status: 'creating' | 'awaiting_approval' | 'ready' | 'consumed' | 'cancelled' | 'expired' | 'unknown';
|
|
209
|
+
id?: string;
|
|
210
|
+
approval_url?: string;
|
|
211
|
+
/**
|
|
212
|
+
* When ready, the absolute deadline to submit the first native request; no later
|
|
213
|
+
* than provider readiness expiry or 30 seconds after Kernel first observes
|
|
214
|
+
* readiness. Polling never extends this deadline.
|
|
215
|
+
*/
|
|
216
|
+
expires_at?: string;
|
|
217
|
+
}
|
|
218
|
+
/**
|
|
219
|
+
* Authorize a Link card using its existing purchase specification. Use only after
|
|
220
|
+
* explicit user approval and when the item advertises authorize. Do not
|
|
221
|
+
* automatically retry provider failures or indeterminate outcomes. Checkout
|
|
222
|
+
* context is not accepted.
|
|
223
|
+
*/
|
|
224
|
+
export interface AuthorizeVaultItemOperationRequest {
|
|
225
|
+
type: 'authorize';
|
|
226
|
+
}
|
|
164
227
|
/**
|
|
165
228
|
* Live payment card. Test-mode card creation is not supported.
|
|
166
229
|
*/
|
|
@@ -284,12 +347,17 @@ export declare namespace CardVaultItemState {
|
|
|
284
347
|
interface AgentCardCardState {
|
|
285
348
|
provider: 'agentcard';
|
|
286
349
|
/**
|
|
287
|
-
*
|
|
288
|
-
*
|
|
289
|
-
*
|
|
290
|
-
*
|
|
350
|
+
* ready_to_submit is device readiness for at most 30 seconds. consumed means the
|
|
351
|
+
* prepared attempt has settled, not that an order succeeded. stopped cannot be
|
|
352
|
+
* reused. outcome_unknown requires merchant reconciliation and blocks new
|
|
353
|
+
* requests. recovery_required means the original checkout outcome is unresolved.
|
|
354
|
+
* Automatic reuse is blocked. Known authorization IDs must be reconciled through
|
|
355
|
+
* provider observations or support. When no authorization ID was returned, an
|
|
356
|
+
* explicitly confirmed item deletion may abandon the unresolved attempt so the
|
|
357
|
+
* caller can create a replacement; deletion does not prove that the original
|
|
358
|
+
* attempt failed. It does not mean declined or expired.
|
|
291
359
|
*/
|
|
292
|
-
status: 'requested' | 'ready' | 'pending_approval' | 'degraded' | 'recovery_required';
|
|
360
|
+
status: 'requested' | 'ready' | 'preparing' | 'ready_to_submit' | 'pending_approval' | 'consumed' | 'stopped' | 'outcome_unknown' | 'degraded' | 'recovery_required';
|
|
293
361
|
aliases?: ItemsAPI.VaultCardAliases;
|
|
294
362
|
/**
|
|
295
363
|
* The in-flight or most recent checkout authorization. Present while a checkout is
|
|
@@ -297,6 +365,12 @@ export declare namespace CardVaultItemState {
|
|
|
297
365
|
*/
|
|
298
366
|
authorization?: ItemsAPI.AgentcardCheckoutAuthorization;
|
|
299
367
|
masks?: AgentCardCardState.Masks;
|
|
368
|
+
/**
|
|
369
|
+
* One-use Square checkout preparation. Keep the approval page open through token
|
|
370
|
+
* handoff. The amount is display-only and does not constrain the merchant's
|
|
371
|
+
* eventual charge.
|
|
372
|
+
*/
|
|
373
|
+
preparation?: ItemsAPI.AgentcardCheckoutPreparation;
|
|
300
374
|
status_reason?: string;
|
|
301
375
|
}
|
|
302
376
|
namespace AgentCardCardState {
|
|
@@ -307,13 +381,494 @@ export declare namespace CardVaultItemState {
|
|
|
307
381
|
}
|
|
308
382
|
}
|
|
309
383
|
}
|
|
384
|
+
/**
|
|
385
|
+
* Return the credential item with its collection action. Supported for ready and
|
|
386
|
+
* pending_collection credential items. Always render the same form from every
|
|
387
|
+
* form-supported field; totp fields have no form input and are omitted. No
|
|
388
|
+
* caller-selected field subsets or form overrides are accepted. Reuse an active
|
|
389
|
+
* Kernel-hosted session or renew an expired session atomically. Customer-hosted
|
|
390
|
+
* forms use their own backend and ordinary item GET/PATCH. Opening the form does
|
|
391
|
+
* not clear values or change readiness or item version. To observe edits on a
|
|
392
|
+
* ready item, record its version and poll GET without wait until the version
|
|
393
|
+
* changes, then reconcile the returned state. Version changes may also come from
|
|
394
|
+
* PATCH; they do not identify a particular form submission. Customer-hosted apps
|
|
395
|
+
* use their own submission callback, including for unchanged forms. The wait
|
|
396
|
+
* parameter waits for readiness, not edits.
|
|
397
|
+
*/
|
|
398
|
+
export interface CollectVaultItemOperationRequest {
|
|
399
|
+
type: 'collect';
|
|
400
|
+
}
|
|
401
|
+
/**
|
|
402
|
+
* One schema-derived form for the item, available in ready or pending_collection
|
|
403
|
+
* state. Render every form-supported field as editable; omit totp fields and
|
|
404
|
+
* preserve their stored seeds. Prefill non-sensitive values, and allow existing
|
|
405
|
+
* sensitive values to be preserved or replaced without ever revealing them. No
|
|
406
|
+
* field subsets or per-request form configuration exist. Validate required fields
|
|
407
|
+
* against the resulting values, including preserved secrets. Submit changed values
|
|
408
|
+
* only, using the version used to render the form. Scoped hosted submission
|
|
409
|
+
* rejects totp edits; seed writes require the ordinary authenticated item API.
|
|
410
|
+
* Customer forms likewise omit totp from their payloads. Save edits atomically. A
|
|
411
|
+
* successful hosted submission increments the version, marks ready, and consumes
|
|
412
|
+
* the session; an empty edit may complete collection while preserving values. A
|
|
413
|
+
* customer form uses PATCH for changed values and does not send an empty PATCH
|
|
414
|
+
* when nothing changed. Kernel-hosted bearer sessions require no Kernel account
|
|
415
|
+
* and are bound to the item version. Expired, superseded, consumed, or
|
|
416
|
+
* deleted-item sessions cannot submit. Authenticated item GET renews expired
|
|
417
|
+
* active sessions for ready or pending items; pending items always receive an
|
|
418
|
+
* action. A ready item with no active session omits the action until collect is
|
|
419
|
+
* invoked. Concurrent renewals return the same link. Renewal changes neither
|
|
420
|
+
* values nor item version. An expired link cannot renew itself. The hosted form
|
|
421
|
+
* handles its collection protocol; callers only open the returned URL and do not
|
|
422
|
+
* extract or submit its token through the public API. For customer-hosted forms,
|
|
423
|
+
* use @onkernel/vault-react and an authenticated customer backend calling the
|
|
424
|
+
* ordinary item GET/PATCH API. Kernel does not store customer collection URLs or
|
|
425
|
+
* authenticate the customer's end users. Treat URLs and submitted values as
|
|
426
|
+
* secrets and exclude them from logs, traces, and errors.
|
|
427
|
+
*/
|
|
428
|
+
export interface CredentialCollectionAction {
|
|
429
|
+
/**
|
|
430
|
+
* Expiry of the Kernel-hosted collection link (30 minutes after issuance).
|
|
431
|
+
*/
|
|
432
|
+
expires_at: string;
|
|
433
|
+
name: 'collect';
|
|
434
|
+
/**
|
|
435
|
+
* Time-scoped hosted form URL (vault.kernel.sh in production). Open this URL as
|
|
436
|
+
* returned; treat it as a secret.
|
|
437
|
+
*/
|
|
438
|
+
url: string;
|
|
439
|
+
}
|
|
440
|
+
export interface CredentialVaultFieldDefinition {
|
|
441
|
+
/**
|
|
442
|
+
* Whether a nonempty value is required for readiness and form submission.
|
|
443
|
+
*/
|
|
444
|
+
required: boolean;
|
|
445
|
+
/**
|
|
446
|
+
* Whether the value is omitted from every item response. Reserve true for secrets
|
|
447
|
+
* such as passwords, API tokens, and TOTP seeds. Ordinary usernames and email
|
|
448
|
+
* addresses should be false so the form can display and prefill them.
|
|
449
|
+
*/
|
|
450
|
+
sensitive: boolean;
|
|
451
|
+
/**
|
|
452
|
+
* Text, email, and password have form inputs; totp does not and is omitted from
|
|
453
|
+
* both Kernel-hosted and customer React forms. Password and totp must be
|
|
454
|
+
* sensitive. A totp value is an RFC 4648 Base32 generator seed (case-insensitive,
|
|
455
|
+
* optional trailing padding), not an otpauth URI or current code. Reject invalid
|
|
456
|
+
* or empty decoded seeds. Browser fill generates an RFC 6238 code at execution
|
|
457
|
+
* time using HMAC-SHA1, 6 digits, and a 30-second period. Preserve leading zeros;
|
|
458
|
+
* never fill the seed. Custom algorithms, digits, periods, and form enrollment are
|
|
459
|
+
* unsupported.
|
|
460
|
+
*/
|
|
461
|
+
type: CredentialVaultFieldType;
|
|
462
|
+
}
|
|
463
|
+
export interface CredentialVaultFieldInput {
|
|
464
|
+
/**
|
|
465
|
+
* Text, email, and password have form inputs; totp does not and is omitted from
|
|
466
|
+
* both Kernel-hosted and customer React forms. Password and totp must be
|
|
467
|
+
* sensitive. A totp value is an RFC 4648 Base32 generator seed (case-insensitive,
|
|
468
|
+
* optional trailing padding), not an otpauth URI or current code. Reject invalid
|
|
469
|
+
* or empty decoded seeds. Browser fill generates an RFC 6238 code at execution
|
|
470
|
+
* time using HMAC-SHA1, 6 digits, and a 30-second period. Preserve leading zeros;
|
|
471
|
+
* never fill the seed. Custom algorithms, digits, periods, and form enrollment are
|
|
472
|
+
* unsupported.
|
|
473
|
+
*/
|
|
474
|
+
type: CredentialVaultFieldType;
|
|
475
|
+
required?: boolean;
|
|
476
|
+
/**
|
|
477
|
+
* Set false explicitly for ordinary usernames, email addresses, and other
|
|
478
|
+
* non-secret identifiers. Reserve true for secrets such as passwords, API tokens,
|
|
479
|
+
* and TOTP seeds. Password and totp fields must be true. Omission defaults to true
|
|
480
|
+
* for safety; do not rely on that default for every field. False permits API reads
|
|
481
|
+
* and form prefilling.
|
|
482
|
+
*/
|
|
483
|
+
sensitive?: boolean;
|
|
484
|
+
/**
|
|
485
|
+
* Optional initial value satisfying the declared type, at most 16 KiB in UTF-8
|
|
486
|
+
* bytes. Omit to leave unset; null and empty strings are rejected on creation.
|
|
487
|
+
* Sensitive values are encrypted and never copied into the returned spec.
|
|
488
|
+
*/
|
|
489
|
+
value?: string;
|
|
490
|
+
}
|
|
491
|
+
export interface CredentialVaultFieldState {
|
|
492
|
+
has_value: boolean;
|
|
493
|
+
/**
|
|
494
|
+
* Present exactly when has_value is true and the field is not sensitive. Reflects
|
|
495
|
+
* the latest developer or human edit. For totp, has_value indicates a stored seed;
|
|
496
|
+
* neither the seed nor a generated code is returned.
|
|
497
|
+
*/
|
|
498
|
+
value?: string;
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Text, email, and password have form inputs; totp does not and is omitted from
|
|
502
|
+
* both Kernel-hosted and customer React forms. Password and totp must be
|
|
503
|
+
* sensitive. A totp value is an RFC 4648 Base32 generator seed (case-insensitive,
|
|
504
|
+
* optional trailing padding), not an otpauth URI or current code. Reject invalid
|
|
505
|
+
* or empty decoded seeds. Browser fill generates an RFC 6238 code at execution
|
|
506
|
+
* time using HMAC-SHA1, 6 digits, and a 30-second period. Preserve leading zeros;
|
|
507
|
+
* never fill the seed. Custom algorithms, digits, periods, and form enrollment are
|
|
508
|
+
* unsupported.
|
|
509
|
+
*/
|
|
510
|
+
export type CredentialVaultFieldType = 'text' | 'email' | 'password' | 'totp';
|
|
511
|
+
export interface CredentialVaultFieldUpdate {
|
|
512
|
+
/**
|
|
513
|
+
* Replacement value (at most 16 KiB in UTF-8 bytes), or null or an empty string to
|
|
514
|
+
* immediately clear the stored value. Clearing a required form-supported field
|
|
515
|
+
* reopens collection; clearing an optional field does not prevent readiness.
|
|
516
|
+
* Values must satisfy the declared field type. For totp, value is the generator
|
|
517
|
+
* seed, never a current code. Clearing a required totp field returns 400 because
|
|
518
|
+
* it cannot be collected in a form.
|
|
519
|
+
*/
|
|
520
|
+
value: string | null;
|
|
521
|
+
}
|
|
522
|
+
export interface CredentialVaultItem {
|
|
523
|
+
id: string;
|
|
524
|
+
available_expansions: Array<CredentialVaultItem.AvailableExpansion>;
|
|
525
|
+
/**
|
|
526
|
+
* Advertises collect for ready and pending_collection items. Browser fill is
|
|
527
|
+
* advertised only when separately implemented and eligible.
|
|
528
|
+
*/
|
|
529
|
+
available_operations: Array<CredentialVaultItem.AvailableOperation>;
|
|
530
|
+
created_at: string;
|
|
531
|
+
/**
|
|
532
|
+
* Immutable item key assigned when the item is created.
|
|
533
|
+
*/
|
|
534
|
+
key: string;
|
|
535
|
+
spec: CredentialVaultItemSpec;
|
|
536
|
+
state: CredentialVaultItemState;
|
|
537
|
+
type: 'credential';
|
|
538
|
+
updated_at: string;
|
|
539
|
+
/**
|
|
540
|
+
* Starts at 1 and increments on PATCH and successful hosted submission, but not
|
|
541
|
+
* collection-link renewal.
|
|
542
|
+
*/
|
|
543
|
+
version: number;
|
|
544
|
+
/**
|
|
545
|
+
* One schema-derived form for the item, available in ready or pending_collection
|
|
546
|
+
* state. Render every form-supported field as editable; omit totp fields and
|
|
547
|
+
* preserve their stored seeds. Prefill non-sensitive values, and allow existing
|
|
548
|
+
* sensitive values to be preserved or replaced without ever revealing them. No
|
|
549
|
+
* field subsets or per-request form configuration exist. Validate required fields
|
|
550
|
+
* against the resulting values, including preserved secrets. Submit changed values
|
|
551
|
+
* only, using the version used to render the form. Scoped hosted submission
|
|
552
|
+
* rejects totp edits; seed writes require the ordinary authenticated item API.
|
|
553
|
+
* Customer forms likewise omit totp from their payloads. Save edits atomically. A
|
|
554
|
+
* successful hosted submission increments the version, marks ready, and consumes
|
|
555
|
+
* the session; an empty edit may complete collection while preserving values. A
|
|
556
|
+
* customer form uses PATCH for changed values and does not send an empty PATCH
|
|
557
|
+
* when nothing changed. Kernel-hosted bearer sessions require no Kernel account
|
|
558
|
+
* and are bound to the item version. Expired, superseded, consumed, or
|
|
559
|
+
* deleted-item sessions cannot submit. Authenticated item GET renews expired
|
|
560
|
+
* active sessions for ready or pending items; pending items always receive an
|
|
561
|
+
* action. A ready item with no active session omits the action until collect is
|
|
562
|
+
* invoked. Concurrent renewals return the same link. Renewal changes neither
|
|
563
|
+
* values nor item version. An expired link cannot renew itself. The hosted form
|
|
564
|
+
* handles its collection protocol; callers only open the returned URL and do not
|
|
565
|
+
* extract or submit its token through the public API. For customer-hosted forms,
|
|
566
|
+
* use @onkernel/vault-react and an authenticated customer backend calling the
|
|
567
|
+
* ordinary item GET/PATCH API. Kernel does not store customer collection URLs or
|
|
568
|
+
* authenticate the customer's end users. Treat URLs and submitted values as
|
|
569
|
+
* secrets and exclude them from logs, traces, and errors.
|
|
570
|
+
*/
|
|
571
|
+
action?: CredentialCollectionAction;
|
|
572
|
+
}
|
|
573
|
+
export declare namespace CredentialVaultItem {
|
|
574
|
+
/**
|
|
575
|
+
* Live data that can currently be requested by passing its type to the item GET
|
|
576
|
+
* expand parameter.
|
|
577
|
+
*/
|
|
578
|
+
interface AvailableExpansion {
|
|
579
|
+
description: string;
|
|
580
|
+
type: 'payment_methods';
|
|
581
|
+
}
|
|
582
|
+
/**
|
|
583
|
+
* An operation that is currently valid for this item. Read the description before
|
|
584
|
+
* invoking it through the item operations endpoint.
|
|
585
|
+
*/
|
|
586
|
+
interface AvailableOperation {
|
|
587
|
+
description: string;
|
|
588
|
+
type: 'authorize' | 'collect' | 'prepare_checkout' | 'fill';
|
|
589
|
+
}
|
|
590
|
+
}
|
|
591
|
+
/**
|
|
592
|
+
* Create a credential item without a wallet or external provider. Do not use
|
|
593
|
+
* credential items to store, collect, or fill credit card data, including card
|
|
594
|
+
* numbers (PANs), security codes (CVV/CVC), or expiration dates. Use wallet and
|
|
595
|
+
* card item types for credit cards and payment checkout instead. If all required
|
|
596
|
+
* fields have values, return ready without a collection action; collect can still
|
|
597
|
+
* open its form. Otherwise return pending_collection with a time-scoped
|
|
598
|
+
* Kernel-hosted collection action. Missing optional fields alone do not trigger
|
|
599
|
+
* collection. Repeating the original creation request returns the current item
|
|
600
|
+
* without overwriting later edits; a different request at the same key
|
|
601
|
+
* returns 409. Use PATCH for updates. Required totp fields must include a valid
|
|
602
|
+
* seed on creation; otherwise return 400 rather than opening a form that cannot
|
|
603
|
+
* collect it. Optional totp fields may be unset and populated later through PATCH.
|
|
604
|
+
*/
|
|
605
|
+
export interface CredentialVaultItemRequest {
|
|
606
|
+
/**
|
|
607
|
+
* Credential fields are for login and other non-payment credentials. Do not store,
|
|
608
|
+
* collect, or fill credit card data in credential items. Use wallet and card item
|
|
609
|
+
* types for credit cards and payment checkout instead.
|
|
610
|
+
*/
|
|
611
|
+
spec: CredentialVaultItemSpecInput;
|
|
612
|
+
type: 'credential';
|
|
613
|
+
}
|
|
614
|
+
export interface CredentialVaultItemSpec {
|
|
615
|
+
fields: {
|
|
616
|
+
[key: string]: CredentialVaultFieldDefinition;
|
|
617
|
+
};
|
|
618
|
+
/**
|
|
619
|
+
* Recognizable site or service name displayed verbatim as the form title, without
|
|
620
|
+
* suffixes such as sign-in credentials. Display text only, not an enforced
|
|
621
|
+
* destination policy.
|
|
622
|
+
*/
|
|
623
|
+
description?: string;
|
|
624
|
+
}
|
|
625
|
+
/**
|
|
626
|
+
* Credential fields are for login and other non-payment credentials. Do not store,
|
|
627
|
+
* collect, or fill credit card data in credential items. Use wallet and card item
|
|
628
|
+
* types for credit cards and payment checkout instead.
|
|
629
|
+
*/
|
|
630
|
+
export interface CredentialVaultItemSpecInput {
|
|
631
|
+
fields: {
|
|
632
|
+
[key: string]: CredentialVaultFieldInput;
|
|
633
|
+
};
|
|
634
|
+
/**
|
|
635
|
+
* The site's recognizable display name, used verbatim as the user-facing form
|
|
636
|
+
* title (for example, Hacker News). Use only the site or service name; do not
|
|
637
|
+
* append sign-in, login, credentials, or task instructions. This is display text,
|
|
638
|
+
* not an enforced destination policy. At most 16 KiB in UTF-8 bytes.
|
|
639
|
+
*/
|
|
640
|
+
description?: string;
|
|
641
|
+
}
|
|
642
|
+
export interface CredentialVaultItemSpecUpdate {
|
|
643
|
+
/**
|
|
644
|
+
* Recognizable site or service name used as the form title, without suffixes such
|
|
645
|
+
* as sign-in credentials. An empty string clears it. Display text only, not an
|
|
646
|
+
* enforced destination policy. The server also enforces a 16 KiB UTF-8 byte limit.
|
|
647
|
+
*/
|
|
648
|
+
description?: string;
|
|
649
|
+
fields?: {
|
|
650
|
+
[key: string]: CredentialVaultFieldUpdate;
|
|
651
|
+
};
|
|
652
|
+
}
|
|
653
|
+
export interface CredentialVaultItemState {
|
|
654
|
+
/**
|
|
655
|
+
* Exactly one entry for each declared field.
|
|
656
|
+
*/
|
|
657
|
+
fields: {
|
|
658
|
+
[key: string]: CredentialVaultFieldState;
|
|
659
|
+
};
|
|
660
|
+
/**
|
|
661
|
+
* Ready means all required fields have values, not that a login succeeded.
|
|
662
|
+
* Optional fields may remain unset.
|
|
663
|
+
*/
|
|
664
|
+
status: 'pending_collection' | 'ready';
|
|
665
|
+
}
|
|
666
|
+
/**
|
|
667
|
+
* Atomically update description and selected values. Omitted properties are
|
|
668
|
+
* preserved. Field names, types, required flags, and sensitivity cannot change.
|
|
669
|
+
* Unknown field names return 400; stale versions or mismatched item types return
|
|
670
|
+
* 409 without changing the item. A successful update increments version and
|
|
671
|
+
* invalidates outstanding Kernel-hosted collection sessions. If required values
|
|
672
|
+
* remain missing, return pending_collection and a fresh collection action.
|
|
673
|
+
* Otherwise return ready without an action; collect can open the form again
|
|
674
|
+
* without clearing values. Customer URLs have no Kernel-managed expiry.
|
|
675
|
+
*/
|
|
676
|
+
export interface CredentialVaultItemUpdateRequest {
|
|
677
|
+
spec: CredentialVaultItemSpecUpdate;
|
|
678
|
+
type: 'credential';
|
|
679
|
+
/**
|
|
680
|
+
* Expected current item version from the latest read.
|
|
681
|
+
*/
|
|
682
|
+
version: number;
|
|
683
|
+
/**
|
|
684
|
+
* Optional immutable item ID precondition. Returns 409 if the key now identifies a
|
|
685
|
+
* different item. Accepted writes target this immutable ID, preventing
|
|
686
|
+
* replacement-key races. Supply this when submitting a form bound to a previously
|
|
687
|
+
* read item.
|
|
688
|
+
*/
|
|
689
|
+
expected_item_id?: string;
|
|
690
|
+
}
|
|
691
|
+
/**
|
|
692
|
+
* Fill selected fields from one ready credential or ready, unexpired Link card
|
|
693
|
+
* into a browser linked to its vault. Only invoke when the item advertises `fill`.
|
|
694
|
+
* Browser and vault must belong to the same project. Kernel checks access and
|
|
695
|
+
* allowed destinations before filling; providing a page URL does not authorize a
|
|
696
|
+
* destination.
|
|
697
|
+
*
|
|
698
|
+
* Find exactly one open page matching `page_url`. Credential items may omit
|
|
699
|
+
* `page_url` to require exactly one open page; cards require an HTTPS page URL.
|
|
700
|
+
* Credentials have no destination allowlist. TOTP fields generate a current code
|
|
701
|
+
* immediately before writing; their seeds never enter the browser. For each
|
|
702
|
+
* selector, search the main frame and all descendant frames for editable inputs or
|
|
703
|
+
* selects matched directly or contained within matching elements. Each selector
|
|
704
|
+
* must resolve to one unique editable element across all frames; zero or multiple
|
|
705
|
+
* candidates fail. Count each element once, even if multiple matching containers
|
|
706
|
+
* contain it. Validate all bindings before filling. Select elements match an
|
|
707
|
+
* option by its value, not its label. If the page navigates or a target disappears
|
|
708
|
+
* during filling, stop rather than selecting a different page or element.
|
|
709
|
+
*
|
|
710
|
+
* Fill in request order and stop on the first failure. This operation is not
|
|
711
|
+
* atomic: previously filled fields are not rolled back. Never submit the form or
|
|
712
|
+
* click buttons, though input/change events may trigger site behavior. Fill is the
|
|
713
|
+
* preferred browser-checkout path. Aliases remain an alternative for explicitly
|
|
714
|
+
* chosen egress-substitution integrations. Do not automatically retry or fall back
|
|
715
|
+
* to aliases after a failed or indeterminate operation.
|
|
716
|
+
*
|
|
717
|
+
* Secret values are never returned or included in operation logs, traces, audit
|
|
718
|
+
* events, or error details. This does not prevent an agent with unrestricted
|
|
719
|
+
* browser access from reading values from the page or other browser observation
|
|
720
|
+
* surfaces.
|
|
721
|
+
*/
|
|
722
|
+
export interface FillVaultItemOperationRequest {
|
|
723
|
+
/**
|
|
724
|
+
* Browser session ID, not a reusable browser name.
|
|
725
|
+
*/
|
|
726
|
+
browser_id: string;
|
|
727
|
+
/**
|
|
728
|
+
* Field bindings for this step. No two bindings may resolve to the same element.
|
|
729
|
+
*/
|
|
730
|
+
fields: Array<VaultFillField>;
|
|
731
|
+
type: 'fill';
|
|
732
|
+
/**
|
|
733
|
+
* Exact current top-level page URL, including path, query, and fragment. Must
|
|
734
|
+
* match exactly one open page in the browser; zero or multiple matches fail. No
|
|
735
|
+
* prefix or glob matching. Required for cards, which must use HTTPS without
|
|
736
|
+
* embedded credentials. Optional for credentials, where omission requires exactly
|
|
737
|
+
* one open page.
|
|
738
|
+
*/
|
|
739
|
+
page_url?: string;
|
|
740
|
+
/**
|
|
741
|
+
* Total operation deadline in milliseconds, not a per-field timeout.
|
|
742
|
+
*/
|
|
743
|
+
timeout_ms?: number;
|
|
744
|
+
}
|
|
745
|
+
export interface FillVaultItemOperationResult {
|
|
746
|
+
/**
|
|
747
|
+
* Exactly one result per request binding, in request order. After the first failed
|
|
748
|
+
* or unknown field, all remaining fields are not_attempted.
|
|
749
|
+
*/
|
|
750
|
+
fields: Array<VaultFillFieldResult>;
|
|
751
|
+
/**
|
|
752
|
+
* Completed only when all fields were filled. Failed when execution stopped with
|
|
753
|
+
* known outcomes. Unknown when any field's outcome cannot be determined. None of
|
|
754
|
+
* these statuses confirms payment or merchant acceptance.
|
|
755
|
+
*/
|
|
756
|
+
status: 'completed' | 'failed' | 'unknown';
|
|
757
|
+
type: 'fill';
|
|
758
|
+
}
|
|
759
|
+
/**
|
|
760
|
+
* Prepare an unused AgentCard card for Square checkout. Deliver the returned
|
|
761
|
+
* approval URL and keep the approval page open. Poll the item until
|
|
762
|
+
* ready_to_submit, then submit native Pay before preparation.expires_at. Readiness
|
|
763
|
+
* lasts at most 30 seconds. Unused preparations expire automatically. Preparations
|
|
764
|
+
* are single-use even after failure or expiry; do not automatically retry and
|
|
765
|
+
* reconcile uncertain outcomes with the merchant.
|
|
766
|
+
*/
|
|
767
|
+
export interface PrepareCheckoutVaultItemOperationRequest {
|
|
768
|
+
/**
|
|
769
|
+
* Required when preparing an unused AgentCard card for Square. Consent is bound to
|
|
770
|
+
* this browser and declared merchant origin, not a tab. Wait for the item's
|
|
771
|
+
* ready_to_submit status before native Pay and submit within its readiness
|
|
772
|
+
* deadline. Unused preparations expire automatically; every preparation is
|
|
773
|
+
* single-use, including after failure or expiry.
|
|
774
|
+
*/
|
|
775
|
+
checkout: VaultCheckoutContext;
|
|
776
|
+
type: 'prepare_checkout';
|
|
777
|
+
}
|
|
310
778
|
export interface VaultCardAliases {
|
|
311
779
|
cvc: string;
|
|
312
780
|
exp_month: string;
|
|
313
781
|
exp_year: string;
|
|
314
782
|
number: string;
|
|
315
783
|
}
|
|
316
|
-
|
|
784
|
+
/**
|
|
785
|
+
* Combined expiration derived from the stored month and year; not a separate
|
|
786
|
+
* stored secret.
|
|
787
|
+
*/
|
|
788
|
+
export type VaultCardFillField = VaultCardFillField.VaultCardStoredFillField | VaultCardFillField.VaultCardExpirationFillField;
|
|
789
|
+
export declare namespace VaultCardFillField {
|
|
790
|
+
interface VaultCardStoredFillField {
|
|
791
|
+
/**
|
|
792
|
+
* Field in the decrypted card, not an alias. Number and CVC preserve leading
|
|
793
|
+
* zeros; month uses two digits and year uses four digits. Billing fields use the
|
|
794
|
+
* provider's stored billing address (name, line1, line2, city, state, postal_code,
|
|
795
|
+
* country) without reformatting. Request only needed billing fields. An absent or
|
|
796
|
+
* empty requested billing field returns 400 field_unavailable before any browser
|
|
797
|
+
* writes; it does not make other card fields unavailable.
|
|
798
|
+
*/
|
|
799
|
+
field: 'number' | 'exp_month' | 'exp_year' | 'cvc' | 'billing_name' | 'billing_line1' | 'billing_line2' | 'billing_city' | 'billing_state' | 'billing_postal_code' | 'billing_country';
|
|
800
|
+
/**
|
|
801
|
+
* CSS selector for an editable input or select, or a containing element. Must
|
|
802
|
+
* resolve to one unique editable element across all page frames.
|
|
803
|
+
*/
|
|
804
|
+
selector: string;
|
|
805
|
+
}
|
|
806
|
+
/**
|
|
807
|
+
* Combined expiration derived from the stored month and year; not a separate
|
|
808
|
+
* stored secret.
|
|
809
|
+
*/
|
|
810
|
+
interface VaultCardExpirationFillField {
|
|
811
|
+
field: 'expiration';
|
|
812
|
+
format: 'MM/YY' | 'MM/YYYY';
|
|
813
|
+
/**
|
|
814
|
+
* CSS selector for an editable input or select, or a containing element. Must
|
|
815
|
+
* resolve to one unique editable element across all page frames.
|
|
816
|
+
*/
|
|
817
|
+
selector: string;
|
|
818
|
+
}
|
|
819
|
+
}
|
|
820
|
+
/**
|
|
821
|
+
* Required when preparing an unused AgentCard card for Square. Consent is bound to
|
|
822
|
+
* this browser and declared merchant origin, not a tab. Wait for the item's
|
|
823
|
+
* ready_to_submit status before native Pay and submit within its readiness
|
|
824
|
+
* deadline. Unused preparations expire automatically; every preparation is
|
|
825
|
+
* single-use, including after failure or expiry.
|
|
826
|
+
*/
|
|
827
|
+
export interface VaultCheckoutContext {
|
|
828
|
+
/**
|
|
829
|
+
* Active browser session with this vault bound to it.
|
|
830
|
+
*/
|
|
831
|
+
browser_id: string;
|
|
832
|
+
/**
|
|
833
|
+
* Square environment, independent of the AgentCard credential mode.
|
|
834
|
+
*/
|
|
835
|
+
environment: 'production' | 'sandbox';
|
|
836
|
+
/**
|
|
837
|
+
* Canonical HTTPS origin of the top-level merchant document, not the Square
|
|
838
|
+
* iframe. HTTP localhost is accepted for tests.
|
|
839
|
+
*/
|
|
840
|
+
merchant_origin: string;
|
|
841
|
+
}
|
|
842
|
+
export interface VaultFillField {
|
|
843
|
+
/**
|
|
844
|
+
* A declared credential field name or a supported card field. Unset credential
|
|
845
|
+
* fields cannot be filled.
|
|
846
|
+
*/
|
|
847
|
+
field: string;
|
|
848
|
+
selector: string;
|
|
849
|
+
/**
|
|
850
|
+
* Required only for a card's combined expiration field. Forbidden for other card
|
|
851
|
+
* fields and all credential fields.
|
|
852
|
+
*/
|
|
853
|
+
format?: 'MM/YY' | 'MM/YYYY';
|
|
854
|
+
}
|
|
855
|
+
export interface VaultFillFieldResult {
|
|
856
|
+
/**
|
|
857
|
+
* Zero-based index into the request fields array.
|
|
858
|
+
*/
|
|
859
|
+
index: number;
|
|
860
|
+
/**
|
|
861
|
+
* Filled means the fill action completed, not that the website retained or
|
|
862
|
+
* accepted the value.
|
|
863
|
+
*/
|
|
864
|
+
status: 'filled' | 'failed' | 'not_attempted' | 'unknown';
|
|
865
|
+
/**
|
|
866
|
+
* Present only for failed or unknown fields. Never includes secret values, DOM
|
|
867
|
+
* content, or raw browser errors.
|
|
868
|
+
*/
|
|
869
|
+
error_code?: 'target_changed' | 'element_not_found' | 'ambiguous_selector' | 'element_not_editable' | 'option_not_found' | 'timeout' | 'execution_failed';
|
|
870
|
+
}
|
|
871
|
+
export type VaultItem = VaultItem.WalletVaultItem | VaultItem.CardVaultItem | CredentialVaultItem;
|
|
317
872
|
export declare namespace VaultItem {
|
|
318
873
|
interface WalletVaultItem {
|
|
319
874
|
id: string;
|
|
@@ -358,7 +913,7 @@ export declare namespace VaultItem {
|
|
|
358
913
|
*/
|
|
359
914
|
interface AvailableOperation {
|
|
360
915
|
description: string;
|
|
361
|
-
type: 'authorize';
|
|
916
|
+
type: 'authorize' | 'collect' | 'prepare_checkout' | 'fill';
|
|
362
917
|
}
|
|
363
918
|
/**
|
|
364
919
|
* Live, non-persisted data requested through the item GET expand parameter.
|
|
@@ -401,7 +956,7 @@ export declare namespace VaultItem {
|
|
|
401
956
|
*/
|
|
402
957
|
interface AvailableOperation {
|
|
403
958
|
description: string;
|
|
404
|
-
type: 'authorize';
|
|
959
|
+
type: 'authorize' | 'collect' | 'prepare_checkout' | 'fill';
|
|
405
960
|
}
|
|
406
961
|
}
|
|
407
962
|
}
|
|
@@ -444,6 +999,103 @@ export interface VaultItemEvent {
|
|
|
444
999
|
[key: string]: unknown;
|
|
445
1000
|
};
|
|
446
1001
|
}
|
|
1002
|
+
/**
|
|
1003
|
+
* Authorization and preparation return the existing item shape. Fill returns a
|
|
1004
|
+
* value-free execution result; it does not persist transient field outcomes on the
|
|
1005
|
+
* item.
|
|
1006
|
+
*/
|
|
1007
|
+
export type VaultItemOperationResponse = VaultItemOperationResponse.WalletVaultItem | VaultItemOperationResponse.CardVaultItem | CredentialVaultItem | FillVaultItemOperationResult;
|
|
1008
|
+
export declare namespace VaultItemOperationResponse {
|
|
1009
|
+
interface WalletVaultItem {
|
|
1010
|
+
id: string;
|
|
1011
|
+
available_expansions: Array<WalletVaultItem.AvailableExpansion>;
|
|
1012
|
+
available_operations: Array<WalletVaultItem.AvailableOperation>;
|
|
1013
|
+
created_at: string;
|
|
1014
|
+
/**
|
|
1015
|
+
* Immutable item key assigned when the item is created.
|
|
1016
|
+
*/
|
|
1017
|
+
key: string;
|
|
1018
|
+
/**
|
|
1019
|
+
* AgentCard wallet. Omit provider_config to use Kernel-managed credentials, or
|
|
1020
|
+
* select a customer-owned configuration. Mode (sandbox vs live) is determined by
|
|
1021
|
+
* the selected credential; there is no per-item test flag. Without user_id,
|
|
1022
|
+
* creation returns a hosted enrollment action and Kernel polls until the user
|
|
1023
|
+
* connects. user_id may only reference a user already enrolled by a wallet in this
|
|
1024
|
+
* organization under the same configuration.
|
|
1025
|
+
*/
|
|
1026
|
+
spec: ItemsAPI.WalletVaultItemSpec;
|
|
1027
|
+
state: ItemsAPI.WalletVaultItemState;
|
|
1028
|
+
type: 'wallet';
|
|
1029
|
+
updated_at: string;
|
|
1030
|
+
action?: ItemsAPI.VaultItemAction;
|
|
1031
|
+
/**
|
|
1032
|
+
* Live, non-persisted data requested through the item GET expand parameter.
|
|
1033
|
+
*/
|
|
1034
|
+
expanded?: WalletVaultItem.Expanded;
|
|
1035
|
+
expires_at?: string;
|
|
1036
|
+
}
|
|
1037
|
+
namespace WalletVaultItem {
|
|
1038
|
+
/**
|
|
1039
|
+
* Live data that can currently be requested by passing its type to the item GET
|
|
1040
|
+
* expand parameter.
|
|
1041
|
+
*/
|
|
1042
|
+
interface AvailableExpansion {
|
|
1043
|
+
description: string;
|
|
1044
|
+
type: 'payment_methods';
|
|
1045
|
+
}
|
|
1046
|
+
/**
|
|
1047
|
+
* An operation that is currently valid for this item. Read the description before
|
|
1048
|
+
* invoking it through the item operations endpoint.
|
|
1049
|
+
*/
|
|
1050
|
+
interface AvailableOperation {
|
|
1051
|
+
description: string;
|
|
1052
|
+
type: 'authorize' | 'collect' | 'prepare_checkout' | 'fill';
|
|
1053
|
+
}
|
|
1054
|
+
/**
|
|
1055
|
+
* Live, non-persisted data requested through the item GET expand parameter.
|
|
1056
|
+
*/
|
|
1057
|
+
interface Expanded {
|
|
1058
|
+
payment_methods?: Array<ItemsAPI.VaultPaymentMethod>;
|
|
1059
|
+
}
|
|
1060
|
+
}
|
|
1061
|
+
interface CardVaultItem {
|
|
1062
|
+
id: string;
|
|
1063
|
+
available_expansions: Array<CardVaultItem.AvailableExpansion>;
|
|
1064
|
+
available_operations: Array<CardVaultItem.AvailableOperation>;
|
|
1065
|
+
created_at: string;
|
|
1066
|
+
/**
|
|
1067
|
+
* Immutable item key assigned when the item is created.
|
|
1068
|
+
*/
|
|
1069
|
+
key: string;
|
|
1070
|
+
/**
|
|
1071
|
+
* Live payment card. Test-mode card creation is not supported.
|
|
1072
|
+
*/
|
|
1073
|
+
spec: ItemsAPI.CardVaultItemSpec;
|
|
1074
|
+
state: ItemsAPI.CardVaultItemState;
|
|
1075
|
+
type: 'card';
|
|
1076
|
+
updated_at: string;
|
|
1077
|
+
action?: ItemsAPI.VaultItemAction;
|
|
1078
|
+
expires_at?: string;
|
|
1079
|
+
}
|
|
1080
|
+
namespace CardVaultItem {
|
|
1081
|
+
/**
|
|
1082
|
+
* Live data that can currently be requested by passing its type to the item GET
|
|
1083
|
+
* expand parameter.
|
|
1084
|
+
*/
|
|
1085
|
+
interface AvailableExpansion {
|
|
1086
|
+
description: string;
|
|
1087
|
+
type: 'payment_methods';
|
|
1088
|
+
}
|
|
1089
|
+
/**
|
|
1090
|
+
* An operation that is currently valid for this item. Read the description before
|
|
1091
|
+
* invoking it through the item operations endpoint.
|
|
1092
|
+
*/
|
|
1093
|
+
interface AvailableOperation {
|
|
1094
|
+
description: string;
|
|
1095
|
+
type: 'authorize' | 'collect' | 'prepare_checkout' | 'fill';
|
|
1096
|
+
}
|
|
1097
|
+
}
|
|
1098
|
+
}
|
|
447
1099
|
export interface VaultPaymentMethod {
|
|
448
1100
|
id: string;
|
|
449
1101
|
/**
|
|
@@ -586,19 +1238,54 @@ export interface ItemRetrieveParams {
|
|
|
586
1238
|
expand?: Array<'payment_methods'>;
|
|
587
1239
|
/**
|
|
588
1240
|
* Query param: Hold for up to this many seconds while the item is pending
|
|
589
|
-
* authorization or
|
|
1241
|
+
* authorization, approval, or credential collection. Return the current item when
|
|
1242
|
+
* ready or when the wait elapses. This does not wait for edits to an already-ready
|
|
1243
|
+
* credential; poll GET without wait and compare version to observe changes after
|
|
1244
|
+
* collect.
|
|
590
1245
|
*/
|
|
591
1246
|
wait?: number;
|
|
592
1247
|
}
|
|
593
|
-
export
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
1248
|
+
export type ItemUpdateParams = ItemUpdateParams.CardVaultItemUpdateRequest | ItemUpdateParams.CredentialVaultItemUpdateRequest;
|
|
1249
|
+
export declare namespace ItemUpdateParams {
|
|
1250
|
+
interface CardVaultItemUpdateRequest {
|
|
1251
|
+
/**
|
|
1252
|
+
* Path param
|
|
1253
|
+
*/
|
|
1254
|
+
id_or_name: string;
|
|
1255
|
+
/**
|
|
1256
|
+
* Body param: Live payment card. Test-mode card creation is not supported.
|
|
1257
|
+
*/
|
|
1258
|
+
spec: CardVaultItemSpec;
|
|
1259
|
+
/**
|
|
1260
|
+
* Body param
|
|
1261
|
+
*/
|
|
1262
|
+
type?: 'card';
|
|
1263
|
+
}
|
|
1264
|
+
interface CredentialVaultItemUpdateRequest {
|
|
1265
|
+
/**
|
|
1266
|
+
* Path param
|
|
1267
|
+
*/
|
|
1268
|
+
id_or_name: string;
|
|
1269
|
+
/**
|
|
1270
|
+
* Body param
|
|
1271
|
+
*/
|
|
1272
|
+
spec: CredentialVaultItemSpecUpdate;
|
|
1273
|
+
/**
|
|
1274
|
+
* Body param
|
|
1275
|
+
*/
|
|
1276
|
+
type: 'credential';
|
|
1277
|
+
/**
|
|
1278
|
+
* Body param: Expected current item version from the latest read.
|
|
1279
|
+
*/
|
|
1280
|
+
version: number;
|
|
1281
|
+
/**
|
|
1282
|
+
* Body param: Optional immutable item ID precondition. Returns 409 if the key now
|
|
1283
|
+
* identifies a different item. Accepted writes target this immutable ID,
|
|
1284
|
+
* preventing replacement-key races. Supply this when submitting a form bound to a
|
|
1285
|
+
* previously read item.
|
|
1286
|
+
*/
|
|
1287
|
+
expected_item_id?: string;
|
|
1288
|
+
}
|
|
602
1289
|
}
|
|
603
1290
|
export interface ItemDeleteParams {
|
|
604
1291
|
id_or_name: string;
|
|
@@ -617,17 +1304,79 @@ export interface ItemEventsParams {
|
|
|
617
1304
|
*/
|
|
618
1305
|
wait?: number;
|
|
619
1306
|
}
|
|
620
|
-
export
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
1307
|
+
export type ItemPerformOperationParams = ItemPerformOperationParams.AuthorizeVaultItemOperationRequest | ItemPerformOperationParams.CollectVaultItemOperationRequest | ItemPerformOperationParams.PrepareCheckoutVaultItemOperationRequest | ItemPerformOperationParams.FillVaultItemOperationRequest;
|
|
1308
|
+
export declare namespace ItemPerformOperationParams {
|
|
1309
|
+
interface AuthorizeVaultItemOperationRequest {
|
|
1310
|
+
/**
|
|
1311
|
+
* Path param
|
|
1312
|
+
*/
|
|
1313
|
+
id_or_name: string;
|
|
1314
|
+
/**
|
|
1315
|
+
* Body param
|
|
1316
|
+
*/
|
|
1317
|
+
type: 'authorize';
|
|
1318
|
+
}
|
|
1319
|
+
interface CollectVaultItemOperationRequest {
|
|
1320
|
+
/**
|
|
1321
|
+
* Path param
|
|
1322
|
+
*/
|
|
1323
|
+
id_or_name: string;
|
|
1324
|
+
/**
|
|
1325
|
+
* Body param
|
|
1326
|
+
*/
|
|
1327
|
+
type: 'collect';
|
|
1328
|
+
}
|
|
1329
|
+
interface PrepareCheckoutVaultItemOperationRequest {
|
|
1330
|
+
/**
|
|
1331
|
+
* Path param
|
|
1332
|
+
*/
|
|
1333
|
+
id_or_name: string;
|
|
1334
|
+
/**
|
|
1335
|
+
* Body param: Required when preparing an unused AgentCard card for Square. Consent
|
|
1336
|
+
* is bound to this browser and declared merchant origin, not a tab. Wait for the
|
|
1337
|
+
* item's ready_to_submit status before native Pay and submit within its readiness
|
|
1338
|
+
* deadline. Unused preparations expire automatically; every preparation is
|
|
1339
|
+
* single-use, including after failure or expiry.
|
|
1340
|
+
*/
|
|
1341
|
+
checkout: VaultCheckoutContext;
|
|
1342
|
+
/**
|
|
1343
|
+
* Body param
|
|
1344
|
+
*/
|
|
1345
|
+
type: 'prepare_checkout';
|
|
1346
|
+
}
|
|
1347
|
+
interface FillVaultItemOperationRequest {
|
|
1348
|
+
/**
|
|
1349
|
+
* Path param
|
|
1350
|
+
*/
|
|
1351
|
+
id_or_name: string;
|
|
1352
|
+
/**
|
|
1353
|
+
* Body param: Browser session ID, not a reusable browser name.
|
|
1354
|
+
*/
|
|
1355
|
+
browser_id: string;
|
|
1356
|
+
/**
|
|
1357
|
+
* Body param: Field bindings for this step. No two bindings may resolve to the
|
|
1358
|
+
* same element.
|
|
1359
|
+
*/
|
|
1360
|
+
fields: Array<VaultFillField>;
|
|
1361
|
+
/**
|
|
1362
|
+
* Body param
|
|
1363
|
+
*/
|
|
1364
|
+
type: 'fill';
|
|
1365
|
+
/**
|
|
1366
|
+
* Body param: Exact current top-level page URL, including path, query, and
|
|
1367
|
+
* fragment. Must match exactly one open page in the browser; zero or multiple
|
|
1368
|
+
* matches fail. No prefix or glob matching. Required for cards, which must use
|
|
1369
|
+
* HTTPS without embedded credentials. Optional for credentials, where omission
|
|
1370
|
+
* requires exactly one open page.
|
|
1371
|
+
*/
|
|
1372
|
+
page_url?: string;
|
|
1373
|
+
/**
|
|
1374
|
+
* Body param: Total operation deadline in milliseconds, not a per-field timeout.
|
|
1375
|
+
*/
|
|
1376
|
+
timeout_ms?: number;
|
|
1377
|
+
}
|
|
629
1378
|
}
|
|
630
|
-
export type ItemUpsertParams = ItemUpsertParams.WalletVaultItemRequest | ItemUpsertParams.CardVaultItemRequest;
|
|
1379
|
+
export type ItemUpsertParams = ItemUpsertParams.WalletVaultItemRequest | ItemUpsertParams.CardVaultItemRequest | ItemUpsertParams.CredentialVaultItemRequest;
|
|
631
1380
|
export declare namespace ItemUpsertParams {
|
|
632
1381
|
interface WalletVaultItemRequest {
|
|
633
1382
|
/**
|
|
@@ -785,8 +1534,24 @@ export declare namespace ItemUpsertParams {
|
|
|
785
1534
|
*/
|
|
786
1535
|
type: 'card';
|
|
787
1536
|
}
|
|
1537
|
+
interface CredentialVaultItemRequest {
|
|
1538
|
+
/**
|
|
1539
|
+
* Path param
|
|
1540
|
+
*/
|
|
1541
|
+
id_or_name: string;
|
|
1542
|
+
/**
|
|
1543
|
+
* Body param: Credential fields are for login and other non-payment credentials.
|
|
1544
|
+
* Do not store, collect, or fill credit card data in credential items. Use wallet
|
|
1545
|
+
* and card item types for credit cards and payment checkout instead.
|
|
1546
|
+
*/
|
|
1547
|
+
spec: CredentialVaultItemSpecInput;
|
|
1548
|
+
/**
|
|
1549
|
+
* Body param
|
|
1550
|
+
*/
|
|
1551
|
+
type: 'credential';
|
|
1552
|
+
}
|
|
788
1553
|
}
|
|
789
1554
|
export declare namespace Items {
|
|
790
|
-
export { type AgentcardCheckoutAuthorization as AgentcardCheckoutAuthorization, type CardVaultItemSpec as CardVaultItemSpec, type CardVaultItemState as CardVaultItemState, type VaultCardAliases as VaultCardAliases, type VaultItem as VaultItem, type VaultItemAction as VaultItemAction, type VaultItemEvent as VaultItemEvent, type VaultPaymentMethod as VaultPaymentMethod, type WalletVaultItemSpec as WalletVaultItemSpec, type WalletVaultItemState as WalletVaultItemState, type ItemListResponse as ItemListResponse, type ItemEventsResponse as ItemEventsResponse, type ItemRetrieveParams as ItemRetrieveParams, type ItemUpdateParams as ItemUpdateParams, type ItemDeleteParams as ItemDeleteParams, type ItemEventsParams as ItemEventsParams, type ItemPerformOperationParams as ItemPerformOperationParams, type ItemUpsertParams as ItemUpsertParams, };
|
|
1555
|
+
export { type AgentcardCheckoutAuthorization as AgentcardCheckoutAuthorization, type AgentcardCheckoutPreparation as AgentcardCheckoutPreparation, type AuthorizeVaultItemOperationRequest as AuthorizeVaultItemOperationRequest, type CardVaultItemSpec as CardVaultItemSpec, type CardVaultItemState as CardVaultItemState, type CollectVaultItemOperationRequest as CollectVaultItemOperationRequest, type CredentialCollectionAction as CredentialCollectionAction, type CredentialVaultFieldDefinition as CredentialVaultFieldDefinition, type CredentialVaultFieldInput as CredentialVaultFieldInput, type CredentialVaultFieldState as CredentialVaultFieldState, type CredentialVaultFieldType as CredentialVaultFieldType, type CredentialVaultFieldUpdate as CredentialVaultFieldUpdate, type CredentialVaultItem as CredentialVaultItem, type CredentialVaultItemRequest as CredentialVaultItemRequest, type CredentialVaultItemSpec as CredentialVaultItemSpec, type CredentialVaultItemSpecInput as CredentialVaultItemSpecInput, type CredentialVaultItemSpecUpdate as CredentialVaultItemSpecUpdate, type CredentialVaultItemState as CredentialVaultItemState, type CredentialVaultItemUpdateRequest as CredentialVaultItemUpdateRequest, type FillVaultItemOperationRequest as FillVaultItemOperationRequest, type FillVaultItemOperationResult as FillVaultItemOperationResult, type PrepareCheckoutVaultItemOperationRequest as PrepareCheckoutVaultItemOperationRequest, type VaultCardAliases as VaultCardAliases, type VaultCardFillField as VaultCardFillField, type VaultCheckoutContext as VaultCheckoutContext, type VaultFillField as VaultFillField, type VaultFillFieldResult as VaultFillFieldResult, type VaultItem as VaultItem, type VaultItemAction as VaultItemAction, type VaultItemEvent as VaultItemEvent, type VaultItemOperationResponse as VaultItemOperationResponse, type VaultPaymentMethod as VaultPaymentMethod, type WalletVaultItemSpec as WalletVaultItemSpec, type WalletVaultItemState as WalletVaultItemState, type ItemListResponse as ItemListResponse, type ItemEventsResponse as ItemEventsResponse, type ItemRetrieveParams as ItemRetrieveParams, type ItemUpdateParams as ItemUpdateParams, type ItemDeleteParams as ItemDeleteParams, type ItemEventsParams as ItemEventsParams, type ItemPerformOperationParams as ItemPerformOperationParams, type ItemUpsertParams as ItemUpsertParams, };
|
|
791
1556
|
}
|
|
792
1557
|
//# sourceMappingURL=items.d.ts.map
|