@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
|
@@ -13,7 +13,11 @@ export class Items extends APIResource {
|
|
|
13
13
|
* and live data that can be requested through `expand`. Read each operation's
|
|
14
14
|
* description before using it. Expanded data is fetched from the provider and is
|
|
15
15
|
* not persisted in the vault item. Requesting an unavailable expansion returns 409
|
|
16
|
-
* instead of a partial item.
|
|
16
|
+
* instead of a partial item. Pending credential items return a collection action.
|
|
17
|
+
* Kernel-hosted active collection links are renewed atomically on expiry for ready
|
|
18
|
+
* or pending items without changing the item version. Invoke collect to open a
|
|
19
|
+
* form for a ready item without clearing values. Sensitive credential values are
|
|
20
|
+
* never returned.
|
|
17
21
|
*
|
|
18
22
|
* @example
|
|
19
23
|
* ```ts
|
|
@@ -28,13 +32,18 @@ export class Items extends APIResource {
|
|
|
28
32
|
}
|
|
29
33
|
|
|
30
34
|
/**
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
36
|
-
*
|
|
37
|
-
*
|
|
35
|
+
* Credential updates require type credential and the current version, and change
|
|
36
|
+
* only values or description; omitted values are preserved, nonempty strings
|
|
37
|
+
* replace, and null or empty strings clear supported fields. Clearing required
|
|
38
|
+
* text/email/password values returns pending_collection; browser forms still
|
|
39
|
+
* require nonempty required inputs. Card updates may omit type for compatibility
|
|
40
|
+
* with legacy requests. Requested cards accept a replacement specification.
|
|
41
|
+
* Pending issuance requests may update provider-supported fields on their existing
|
|
42
|
+
* request, subject to atomic provider approval checks; omitted optional fields
|
|
43
|
+
* remain unchanged and explicit empty lists clear them. Wallet/provider binding
|
|
44
|
+
* and unsupported fields cannot change after authorization starts. An uncertain
|
|
45
|
+
* update enters recovery_required and must not be retried. Checkout cards may be
|
|
46
|
+
* edited between authorizations.
|
|
38
47
|
*
|
|
39
48
|
* @example
|
|
40
49
|
* ```ts
|
|
@@ -51,6 +60,7 @@ export class Items extends APIResource {
|
|
|
51
60
|
* context:
|
|
52
61
|
* '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.',
|
|
53
62
|
* },
|
|
63
|
+
* type: 'card',
|
|
54
64
|
* });
|
|
55
65
|
* ```
|
|
56
66
|
*/
|
|
@@ -60,7 +70,9 @@ export class Items extends APIResource {
|
|
|
60
70
|
}
|
|
61
71
|
|
|
62
72
|
/**
|
|
63
|
-
*
|
|
73
|
+
* Credential entries include safe field metadata and non-sensitive values. Listing
|
|
74
|
+
* never creates or renews collection sessions; only an existing unexpired active
|
|
75
|
+
* session is included. Use single-item GET or collect to obtain a fresh link.
|
|
64
76
|
*
|
|
65
77
|
* @example
|
|
66
78
|
* ```ts
|
|
@@ -74,9 +86,11 @@ export class Items extends APIResource {
|
|
|
74
86
|
}
|
|
75
87
|
|
|
76
88
|
/**
|
|
77
|
-
* Unresolved payment operations block deletion, including operations on
|
|
78
|
-
* cards of a wallet.
|
|
79
|
-
*
|
|
89
|
+
* Unresolved payment operations normally block deletion, including operations on
|
|
90
|
+
* child cards of a wallet. An AgentCard card in recovery_required whose checkout
|
|
91
|
+
* create response returned no authorization ID may be explicitly abandoned by
|
|
92
|
+
* deleting that card directly; deleting its wallet or vault remains blocked.
|
|
93
|
+
* Deleting or recreating an item is not proof that a payment did not occur.
|
|
80
94
|
*
|
|
81
95
|
* @example
|
|
82
96
|
* ```ts
|
|
@@ -111,16 +125,27 @@ export class Items extends APIResource {
|
|
|
111
125
|
|
|
112
126
|
/**
|
|
113
127
|
* Retrieve the item first and invoke only an operation listed in
|
|
114
|
-
* `available_operations`, following its natural-language description.
|
|
115
|
-
*
|
|
116
|
-
*
|
|
117
|
-
*
|
|
118
|
-
*
|
|
128
|
+
* `available_operations`, following its natural-language description. Availability
|
|
129
|
+
* is rechecked at execution time; unavailable operations return 409. Authorization
|
|
130
|
+
* and preparation may call an external provider and return updated state. Link
|
|
131
|
+
* cards advertise authorize without checkout context. Eligible unused AgentCard
|
|
132
|
+
* cards advertise prepare_checkout, which requires checkout context and obtains
|
|
133
|
+
* device approval before native Square Pay. Keep the returned approval page open,
|
|
134
|
+
* poll until ready_to_submit, then submit before preparation.expires_at. Unused
|
|
135
|
+
* preparations expire automatically and cannot be reused. If spend-request
|
|
136
|
+
* creation is rate limited, returns HTTP 429 with code
|
|
119
137
|
* `spend_request_rate_limited`; stop and back off before retrying.
|
|
120
138
|
*
|
|
139
|
+
* Fill returns a value-free execution result. Validation failures before writing
|
|
140
|
+
* return 400 (invalid request or targets), 403 (access or destination denied), 404
|
|
141
|
+
* (resource not found), or 409 (item or browser not ready). Once writing starts,
|
|
142
|
+
* known partial failures and indeterminate field outcomes return 200 with status
|
|
143
|
+
* `failed` or `unknown`, not an automatic-retry signal. A transport error may
|
|
144
|
+
* leave the outcome unknown; do not automatically retry.
|
|
145
|
+
*
|
|
121
146
|
* @example
|
|
122
147
|
* ```ts
|
|
123
|
-
* const
|
|
148
|
+
* const vaultItemOperationResponse =
|
|
124
149
|
* await client.vaults.items.performOperation('key', {
|
|
125
150
|
* id_or_name: 'id_or_name',
|
|
126
151
|
* type: 'authorize',
|
|
@@ -131,9 +156,13 @@ export class Items extends APIResource {
|
|
|
131
156
|
key: string,
|
|
132
157
|
params: ItemPerformOperationParams,
|
|
133
158
|
options?: RequestOptions,
|
|
134
|
-
): APIPromise<
|
|
159
|
+
): APIPromise<VaultItemOperationResponse> {
|
|
135
160
|
const { id_or_name, ...body } = params;
|
|
136
|
-
return this._client.post(path`/vaults/${id_or_name}/items/${key}/operations`, {
|
|
161
|
+
return this._client.post(path`/vaults/${id_or_name}/items/${key}/operations`, {
|
|
162
|
+
body,
|
|
163
|
+
maxRetries: 0,
|
|
164
|
+
...options,
|
|
165
|
+
});
|
|
137
166
|
}
|
|
138
167
|
|
|
139
168
|
/**
|
|
@@ -142,7 +171,10 @@ export class Items extends APIResource {
|
|
|
142
171
|
* card in any lifecycle state without polling the provider, reauthorizing,
|
|
143
172
|
* replacing aliases, or resetting recovery. Conflicting specifications return 409.
|
|
144
173
|
* Provider-specific authorization requirements and retry behavior are described in
|
|
145
|
-
* the item's request schema.
|
|
174
|
+
* the item's request schema. Do not use credential items to store, collect, or
|
|
175
|
+
* fill credit card data, including card numbers (PANs), security codes (CVV/CVC),
|
|
176
|
+
* or expiration dates. Use wallet and card item types for credit cards and payment
|
|
177
|
+
* checkout instead.
|
|
146
178
|
*
|
|
147
179
|
* @example
|
|
148
180
|
* ```ts
|
|
@@ -223,6 +255,50 @@ export interface AgentcardCheckoutAuthorization {
|
|
|
223
255
|
replay_status?: number;
|
|
224
256
|
}
|
|
225
257
|
|
|
258
|
+
/**
|
|
259
|
+
* One-use Square checkout preparation. Keep the approval page open through token
|
|
260
|
+
* handoff. The amount is display-only and does not constrain the merchant's
|
|
261
|
+
* eventual charge.
|
|
262
|
+
*/
|
|
263
|
+
export interface AgentcardCheckoutPreparation {
|
|
264
|
+
browser_id: string;
|
|
265
|
+
|
|
266
|
+
created_at: string;
|
|
267
|
+
|
|
268
|
+
environment: 'production' | 'sandbox';
|
|
269
|
+
|
|
270
|
+
merchant_origin: string;
|
|
271
|
+
|
|
272
|
+
/**
|
|
273
|
+
* Preparation consumed means egress claimed the preparation and it cannot be
|
|
274
|
+
* reused. It does not mean the attempt settled. Use the enclosing item's status as
|
|
275
|
+
* the lifecycle indicator; item consumed means the attempt settled, not that an
|
|
276
|
+
* order or charge succeeded.
|
|
277
|
+
*/
|
|
278
|
+
status: 'creating' | 'awaiting_approval' | 'ready' | 'consumed' | 'cancelled' | 'expired' | 'unknown';
|
|
279
|
+
|
|
280
|
+
id?: string;
|
|
281
|
+
|
|
282
|
+
approval_url?: string;
|
|
283
|
+
|
|
284
|
+
/**
|
|
285
|
+
* When ready, the absolute deadline to submit the first native request; no later
|
|
286
|
+
* than provider readiness expiry or 30 seconds after Kernel first observes
|
|
287
|
+
* readiness. Polling never extends this deadline.
|
|
288
|
+
*/
|
|
289
|
+
expires_at?: string;
|
|
290
|
+
}
|
|
291
|
+
|
|
292
|
+
/**
|
|
293
|
+
* Authorize a Link card using its existing purchase specification. Use only after
|
|
294
|
+
* explicit user approval and when the item advertises authorize. Do not
|
|
295
|
+
* automatically retry provider failures or indeterminate outcomes. Checkout
|
|
296
|
+
* context is not accepted.
|
|
297
|
+
*/
|
|
298
|
+
export interface AuthorizeVaultItemOperationRequest {
|
|
299
|
+
type: 'authorize';
|
|
300
|
+
}
|
|
301
|
+
|
|
226
302
|
/**
|
|
227
303
|
* Live payment card. Test-mode card creation is not supported.
|
|
228
304
|
*/
|
|
@@ -398,12 +474,27 @@ export namespace CardVaultItemState {
|
|
|
398
474
|
provider: 'agentcard';
|
|
399
475
|
|
|
400
476
|
/**
|
|
401
|
-
*
|
|
402
|
-
*
|
|
403
|
-
*
|
|
404
|
-
*
|
|
477
|
+
* ready_to_submit is device readiness for at most 30 seconds. consumed means the
|
|
478
|
+
* prepared attempt has settled, not that an order succeeded. stopped cannot be
|
|
479
|
+
* reused. outcome_unknown requires merchant reconciliation and blocks new
|
|
480
|
+
* requests. recovery_required means the original checkout outcome is unresolved.
|
|
481
|
+
* Automatic reuse is blocked. Known authorization IDs must be reconciled through
|
|
482
|
+
* provider observations or support. When no authorization ID was returned, an
|
|
483
|
+
* explicitly confirmed item deletion may abandon the unresolved attempt so the
|
|
484
|
+
* caller can create a replacement; deletion does not prove that the original
|
|
485
|
+
* attempt failed. It does not mean declined or expired.
|
|
405
486
|
*/
|
|
406
|
-
status:
|
|
487
|
+
status:
|
|
488
|
+
| 'requested'
|
|
489
|
+
| 'ready'
|
|
490
|
+
| 'preparing'
|
|
491
|
+
| 'ready_to_submit'
|
|
492
|
+
| 'pending_approval'
|
|
493
|
+
| 'consumed'
|
|
494
|
+
| 'stopped'
|
|
495
|
+
| 'outcome_unknown'
|
|
496
|
+
| 'degraded'
|
|
497
|
+
| 'recovery_required';
|
|
407
498
|
|
|
408
499
|
aliases?: ItemsAPI.VaultCardAliases;
|
|
409
500
|
|
|
@@ -415,6 +506,13 @@ export namespace CardVaultItemState {
|
|
|
415
506
|
|
|
416
507
|
masks?: AgentCardCardState.Masks;
|
|
417
508
|
|
|
509
|
+
/**
|
|
510
|
+
* One-use Square checkout preparation. Keep the approval page open through token
|
|
511
|
+
* handoff. The amount is display-only and does not constrain the merchant's
|
|
512
|
+
* eventual charge.
|
|
513
|
+
*/
|
|
514
|
+
preparation?: ItemsAPI.AgentcardCheckoutPreparation;
|
|
515
|
+
|
|
418
516
|
status_reason?: string;
|
|
419
517
|
}
|
|
420
518
|
|
|
@@ -429,6 +527,446 @@ export namespace CardVaultItemState {
|
|
|
429
527
|
}
|
|
430
528
|
}
|
|
431
529
|
|
|
530
|
+
/**
|
|
531
|
+
* Return the credential item with its collection action. Supported for ready and
|
|
532
|
+
* pending_collection credential items. Always render the same form from every
|
|
533
|
+
* form-supported field; totp fields have no form input and are omitted. No
|
|
534
|
+
* caller-selected field subsets or form overrides are accepted. Reuse an active
|
|
535
|
+
* Kernel-hosted session or renew an expired session atomically. Customer-hosted
|
|
536
|
+
* forms use their own backend and ordinary item GET/PATCH. Opening the form does
|
|
537
|
+
* not clear values or change readiness or item version. To observe edits on a
|
|
538
|
+
* ready item, record its version and poll GET without wait until the version
|
|
539
|
+
* changes, then reconcile the returned state. Version changes may also come from
|
|
540
|
+
* PATCH; they do not identify a particular form submission. Customer-hosted apps
|
|
541
|
+
* use their own submission callback, including for unchanged forms. The wait
|
|
542
|
+
* parameter waits for readiness, not edits.
|
|
543
|
+
*/
|
|
544
|
+
export interface CollectVaultItemOperationRequest {
|
|
545
|
+
type: 'collect';
|
|
546
|
+
}
|
|
547
|
+
|
|
548
|
+
/**
|
|
549
|
+
* One schema-derived form for the item, available in ready or pending_collection
|
|
550
|
+
* state. Render every form-supported field as editable; omit totp fields and
|
|
551
|
+
* preserve their stored seeds. Prefill non-sensitive values, and allow existing
|
|
552
|
+
* sensitive values to be preserved or replaced without ever revealing them. No
|
|
553
|
+
* field subsets or per-request form configuration exist. Validate required fields
|
|
554
|
+
* against the resulting values, including preserved secrets. Submit changed values
|
|
555
|
+
* only, using the version used to render the form. Scoped hosted submission
|
|
556
|
+
* rejects totp edits; seed writes require the ordinary authenticated item API.
|
|
557
|
+
* Customer forms likewise omit totp from their payloads. Save edits atomically. A
|
|
558
|
+
* successful hosted submission increments the version, marks ready, and consumes
|
|
559
|
+
* the session; an empty edit may complete collection while preserving values. A
|
|
560
|
+
* customer form uses PATCH for changed values and does not send an empty PATCH
|
|
561
|
+
* when nothing changed. Kernel-hosted bearer sessions require no Kernel account
|
|
562
|
+
* and are bound to the item version. Expired, superseded, consumed, or
|
|
563
|
+
* deleted-item sessions cannot submit. Authenticated item GET renews expired
|
|
564
|
+
* active sessions for ready or pending items; pending items always receive an
|
|
565
|
+
* action. A ready item with no active session omits the action until collect is
|
|
566
|
+
* invoked. Concurrent renewals return the same link. Renewal changes neither
|
|
567
|
+
* values nor item version. An expired link cannot renew itself. The hosted form
|
|
568
|
+
* handles its collection protocol; callers only open the returned URL and do not
|
|
569
|
+
* extract or submit its token through the public API. For customer-hosted forms,
|
|
570
|
+
* use @onkernel/vault-react and an authenticated customer backend calling the
|
|
571
|
+
* ordinary item GET/PATCH API. Kernel does not store customer collection URLs or
|
|
572
|
+
* authenticate the customer's end users. Treat URLs and submitted values as
|
|
573
|
+
* secrets and exclude them from logs, traces, and errors.
|
|
574
|
+
*/
|
|
575
|
+
export interface CredentialCollectionAction {
|
|
576
|
+
/**
|
|
577
|
+
* Expiry of the Kernel-hosted collection link (30 minutes after issuance).
|
|
578
|
+
*/
|
|
579
|
+
expires_at: string;
|
|
580
|
+
|
|
581
|
+
name: 'collect';
|
|
582
|
+
|
|
583
|
+
/**
|
|
584
|
+
* Time-scoped hosted form URL (vault.kernel.sh in production). Open this URL as
|
|
585
|
+
* returned; treat it as a secret.
|
|
586
|
+
*/
|
|
587
|
+
url: string;
|
|
588
|
+
}
|
|
589
|
+
|
|
590
|
+
export interface CredentialVaultFieldDefinition {
|
|
591
|
+
/**
|
|
592
|
+
* Whether a nonempty value is required for readiness and form submission.
|
|
593
|
+
*/
|
|
594
|
+
required: boolean;
|
|
595
|
+
|
|
596
|
+
/**
|
|
597
|
+
* Whether the value is omitted from every item response. Reserve true for secrets
|
|
598
|
+
* such as passwords, API tokens, and TOTP seeds. Ordinary usernames and email
|
|
599
|
+
* addresses should be false so the form can display and prefill them.
|
|
600
|
+
*/
|
|
601
|
+
sensitive: boolean;
|
|
602
|
+
|
|
603
|
+
/**
|
|
604
|
+
* Text, email, and password have form inputs; totp does not and is omitted from
|
|
605
|
+
* both Kernel-hosted and customer React forms. Password and totp must be
|
|
606
|
+
* sensitive. A totp value is an RFC 4648 Base32 generator seed (case-insensitive,
|
|
607
|
+
* optional trailing padding), not an otpauth URI or current code. Reject invalid
|
|
608
|
+
* or empty decoded seeds. Browser fill generates an RFC 6238 code at execution
|
|
609
|
+
* time using HMAC-SHA1, 6 digits, and a 30-second period. Preserve leading zeros;
|
|
610
|
+
* never fill the seed. Custom algorithms, digits, periods, and form enrollment are
|
|
611
|
+
* unsupported.
|
|
612
|
+
*/
|
|
613
|
+
type: CredentialVaultFieldType;
|
|
614
|
+
}
|
|
615
|
+
|
|
616
|
+
export interface CredentialVaultFieldInput {
|
|
617
|
+
/**
|
|
618
|
+
* Text, email, and password have form inputs; totp does not and is omitted from
|
|
619
|
+
* both Kernel-hosted and customer React forms. Password and totp must be
|
|
620
|
+
* sensitive. A totp value is an RFC 4648 Base32 generator seed (case-insensitive,
|
|
621
|
+
* optional trailing padding), not an otpauth URI or current code. Reject invalid
|
|
622
|
+
* or empty decoded seeds. Browser fill generates an RFC 6238 code at execution
|
|
623
|
+
* time using HMAC-SHA1, 6 digits, and a 30-second period. Preserve leading zeros;
|
|
624
|
+
* never fill the seed. Custom algorithms, digits, periods, and form enrollment are
|
|
625
|
+
* unsupported.
|
|
626
|
+
*/
|
|
627
|
+
type: CredentialVaultFieldType;
|
|
628
|
+
|
|
629
|
+
required?: boolean;
|
|
630
|
+
|
|
631
|
+
/**
|
|
632
|
+
* Set false explicitly for ordinary usernames, email addresses, and other
|
|
633
|
+
* non-secret identifiers. Reserve true for secrets such as passwords, API tokens,
|
|
634
|
+
* and TOTP seeds. Password and totp fields must be true. Omission defaults to true
|
|
635
|
+
* for safety; do not rely on that default for every field. False permits API reads
|
|
636
|
+
* and form prefilling.
|
|
637
|
+
*/
|
|
638
|
+
sensitive?: boolean;
|
|
639
|
+
|
|
640
|
+
/**
|
|
641
|
+
* Optional initial value satisfying the declared type, at most 16 KiB in UTF-8
|
|
642
|
+
* bytes. Omit to leave unset; null and empty strings are rejected on creation.
|
|
643
|
+
* Sensitive values are encrypted and never copied into the returned spec.
|
|
644
|
+
*/
|
|
645
|
+
value?: string;
|
|
646
|
+
}
|
|
647
|
+
|
|
648
|
+
export interface CredentialVaultFieldState {
|
|
649
|
+
has_value: boolean;
|
|
650
|
+
|
|
651
|
+
/**
|
|
652
|
+
* Present exactly when has_value is true and the field is not sensitive. Reflects
|
|
653
|
+
* the latest developer or human edit. For totp, has_value indicates a stored seed;
|
|
654
|
+
* neither the seed nor a generated code is returned.
|
|
655
|
+
*/
|
|
656
|
+
value?: string;
|
|
657
|
+
}
|
|
658
|
+
|
|
659
|
+
/**
|
|
660
|
+
* Text, email, and password have form inputs; totp does not and is omitted from
|
|
661
|
+
* both Kernel-hosted and customer React forms. Password and totp must be
|
|
662
|
+
* sensitive. A totp value is an RFC 4648 Base32 generator seed (case-insensitive,
|
|
663
|
+
* optional trailing padding), not an otpauth URI or current code. Reject invalid
|
|
664
|
+
* or empty decoded seeds. Browser fill generates an RFC 6238 code at execution
|
|
665
|
+
* time using HMAC-SHA1, 6 digits, and a 30-second period. Preserve leading zeros;
|
|
666
|
+
* never fill the seed. Custom algorithms, digits, periods, and form enrollment are
|
|
667
|
+
* unsupported.
|
|
668
|
+
*/
|
|
669
|
+
export type CredentialVaultFieldType = 'text' | 'email' | 'password' | 'totp';
|
|
670
|
+
|
|
671
|
+
export interface CredentialVaultFieldUpdate {
|
|
672
|
+
/**
|
|
673
|
+
* Replacement value (at most 16 KiB in UTF-8 bytes), or null or an empty string to
|
|
674
|
+
* immediately clear the stored value. Clearing a required form-supported field
|
|
675
|
+
* reopens collection; clearing an optional field does not prevent readiness.
|
|
676
|
+
* Values must satisfy the declared field type. For totp, value is the generator
|
|
677
|
+
* seed, never a current code. Clearing a required totp field returns 400 because
|
|
678
|
+
* it cannot be collected in a form.
|
|
679
|
+
*/
|
|
680
|
+
value: string | null;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
export interface CredentialVaultItem {
|
|
684
|
+
id: string;
|
|
685
|
+
|
|
686
|
+
available_expansions: Array<CredentialVaultItem.AvailableExpansion>;
|
|
687
|
+
|
|
688
|
+
/**
|
|
689
|
+
* Advertises collect for ready and pending_collection items. Browser fill is
|
|
690
|
+
* advertised only when separately implemented and eligible.
|
|
691
|
+
*/
|
|
692
|
+
available_operations: Array<CredentialVaultItem.AvailableOperation>;
|
|
693
|
+
|
|
694
|
+
created_at: string;
|
|
695
|
+
|
|
696
|
+
/**
|
|
697
|
+
* Immutable item key assigned when the item is created.
|
|
698
|
+
*/
|
|
699
|
+
key: string;
|
|
700
|
+
|
|
701
|
+
spec: CredentialVaultItemSpec;
|
|
702
|
+
|
|
703
|
+
state: CredentialVaultItemState;
|
|
704
|
+
|
|
705
|
+
type: 'credential';
|
|
706
|
+
|
|
707
|
+
updated_at: string;
|
|
708
|
+
|
|
709
|
+
/**
|
|
710
|
+
* Starts at 1 and increments on PATCH and successful hosted submission, but not
|
|
711
|
+
* collection-link renewal.
|
|
712
|
+
*/
|
|
713
|
+
version: number;
|
|
714
|
+
|
|
715
|
+
/**
|
|
716
|
+
* One schema-derived form for the item, available in ready or pending_collection
|
|
717
|
+
* state. Render every form-supported field as editable; omit totp fields and
|
|
718
|
+
* preserve their stored seeds. Prefill non-sensitive values, and allow existing
|
|
719
|
+
* sensitive values to be preserved or replaced without ever revealing them. No
|
|
720
|
+
* field subsets or per-request form configuration exist. Validate required fields
|
|
721
|
+
* against the resulting values, including preserved secrets. Submit changed values
|
|
722
|
+
* only, using the version used to render the form. Scoped hosted submission
|
|
723
|
+
* rejects totp edits; seed writes require the ordinary authenticated item API.
|
|
724
|
+
* Customer forms likewise omit totp from their payloads. Save edits atomically. A
|
|
725
|
+
* successful hosted submission increments the version, marks ready, and consumes
|
|
726
|
+
* the session; an empty edit may complete collection while preserving values. A
|
|
727
|
+
* customer form uses PATCH for changed values and does not send an empty PATCH
|
|
728
|
+
* when nothing changed. Kernel-hosted bearer sessions require no Kernel account
|
|
729
|
+
* and are bound to the item version. Expired, superseded, consumed, or
|
|
730
|
+
* deleted-item sessions cannot submit. Authenticated item GET renews expired
|
|
731
|
+
* active sessions for ready or pending items; pending items always receive an
|
|
732
|
+
* action. A ready item with no active session omits the action until collect is
|
|
733
|
+
* invoked. Concurrent renewals return the same link. Renewal changes neither
|
|
734
|
+
* values nor item version. An expired link cannot renew itself. The hosted form
|
|
735
|
+
* handles its collection protocol; callers only open the returned URL and do not
|
|
736
|
+
* extract or submit its token through the public API. For customer-hosted forms,
|
|
737
|
+
* use @onkernel/vault-react and an authenticated customer backend calling the
|
|
738
|
+
* ordinary item GET/PATCH API. Kernel does not store customer collection URLs or
|
|
739
|
+
* authenticate the customer's end users. Treat URLs and submitted values as
|
|
740
|
+
* secrets and exclude them from logs, traces, and errors.
|
|
741
|
+
*/
|
|
742
|
+
action?: CredentialCollectionAction;
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
export namespace CredentialVaultItem {
|
|
746
|
+
/**
|
|
747
|
+
* Live data that can currently be requested by passing its type to the item GET
|
|
748
|
+
* expand parameter.
|
|
749
|
+
*/
|
|
750
|
+
export interface AvailableExpansion {
|
|
751
|
+
description: string;
|
|
752
|
+
|
|
753
|
+
type: 'payment_methods';
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
/**
|
|
757
|
+
* An operation that is currently valid for this item. Read the description before
|
|
758
|
+
* invoking it through the item operations endpoint.
|
|
759
|
+
*/
|
|
760
|
+
export interface AvailableOperation {
|
|
761
|
+
description: string;
|
|
762
|
+
|
|
763
|
+
type: 'authorize' | 'collect' | 'prepare_checkout' | 'fill';
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
|
|
767
|
+
/**
|
|
768
|
+
* Create a credential item without a wallet or external provider. Do not use
|
|
769
|
+
* credential items to store, collect, or fill credit card data, including card
|
|
770
|
+
* numbers (PANs), security codes (CVV/CVC), or expiration dates. Use wallet and
|
|
771
|
+
* card item types for credit cards and payment checkout instead. If all required
|
|
772
|
+
* fields have values, return ready without a collection action; collect can still
|
|
773
|
+
* open its form. Otherwise return pending_collection with a time-scoped
|
|
774
|
+
* Kernel-hosted collection action. Missing optional fields alone do not trigger
|
|
775
|
+
* collection. Repeating the original creation request returns the current item
|
|
776
|
+
* without overwriting later edits; a different request at the same key
|
|
777
|
+
* returns 409. Use PATCH for updates. Required totp fields must include a valid
|
|
778
|
+
* seed on creation; otherwise return 400 rather than opening a form that cannot
|
|
779
|
+
* collect it. Optional totp fields may be unset and populated later through PATCH.
|
|
780
|
+
*/
|
|
781
|
+
export interface CredentialVaultItemRequest {
|
|
782
|
+
/**
|
|
783
|
+
* Credential fields are for login and other non-payment credentials. Do not store,
|
|
784
|
+
* collect, or fill credit card data in credential items. Use wallet and card item
|
|
785
|
+
* types for credit cards and payment checkout instead.
|
|
786
|
+
*/
|
|
787
|
+
spec: CredentialVaultItemSpecInput;
|
|
788
|
+
|
|
789
|
+
type: 'credential';
|
|
790
|
+
}
|
|
791
|
+
|
|
792
|
+
export interface CredentialVaultItemSpec {
|
|
793
|
+
fields: { [key: string]: CredentialVaultFieldDefinition };
|
|
794
|
+
|
|
795
|
+
/**
|
|
796
|
+
* Recognizable site or service name displayed verbatim as the form title, without
|
|
797
|
+
* suffixes such as sign-in credentials. Display text only, not an enforced
|
|
798
|
+
* destination policy.
|
|
799
|
+
*/
|
|
800
|
+
description?: string;
|
|
801
|
+
}
|
|
802
|
+
|
|
803
|
+
/**
|
|
804
|
+
* Credential fields are for login and other non-payment credentials. Do not store,
|
|
805
|
+
* collect, or fill credit card data in credential items. Use wallet and card item
|
|
806
|
+
* types for credit cards and payment checkout instead.
|
|
807
|
+
*/
|
|
808
|
+
export interface CredentialVaultItemSpecInput {
|
|
809
|
+
fields: { [key: string]: CredentialVaultFieldInput };
|
|
810
|
+
|
|
811
|
+
/**
|
|
812
|
+
* The site's recognizable display name, used verbatim as the user-facing form
|
|
813
|
+
* title (for example, Hacker News). Use only the site or service name; do not
|
|
814
|
+
* append sign-in, login, credentials, or task instructions. This is display text,
|
|
815
|
+
* not an enforced destination policy. At most 16 KiB in UTF-8 bytes.
|
|
816
|
+
*/
|
|
817
|
+
description?: string;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
export interface CredentialVaultItemSpecUpdate {
|
|
821
|
+
/**
|
|
822
|
+
* Recognizable site or service name used as the form title, without suffixes such
|
|
823
|
+
* as sign-in credentials. An empty string clears it. Display text only, not an
|
|
824
|
+
* enforced destination policy. The server also enforces a 16 KiB UTF-8 byte limit.
|
|
825
|
+
*/
|
|
826
|
+
description?: string;
|
|
827
|
+
|
|
828
|
+
fields?: { [key: string]: CredentialVaultFieldUpdate };
|
|
829
|
+
}
|
|
830
|
+
|
|
831
|
+
export interface CredentialVaultItemState {
|
|
832
|
+
/**
|
|
833
|
+
* Exactly one entry for each declared field.
|
|
834
|
+
*/
|
|
835
|
+
fields: { [key: string]: CredentialVaultFieldState };
|
|
836
|
+
|
|
837
|
+
/**
|
|
838
|
+
* Ready means all required fields have values, not that a login succeeded.
|
|
839
|
+
* Optional fields may remain unset.
|
|
840
|
+
*/
|
|
841
|
+
status: 'pending_collection' | 'ready';
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
/**
|
|
845
|
+
* Atomically update description and selected values. Omitted properties are
|
|
846
|
+
* preserved. Field names, types, required flags, and sensitivity cannot change.
|
|
847
|
+
* Unknown field names return 400; stale versions or mismatched item types return
|
|
848
|
+
* 409 without changing the item. A successful update increments version and
|
|
849
|
+
* invalidates outstanding Kernel-hosted collection sessions. If required values
|
|
850
|
+
* remain missing, return pending_collection and a fresh collection action.
|
|
851
|
+
* Otherwise return ready without an action; collect can open the form again
|
|
852
|
+
* without clearing values. Customer URLs have no Kernel-managed expiry.
|
|
853
|
+
*/
|
|
854
|
+
export interface CredentialVaultItemUpdateRequest {
|
|
855
|
+
spec: CredentialVaultItemSpecUpdate;
|
|
856
|
+
|
|
857
|
+
type: 'credential';
|
|
858
|
+
|
|
859
|
+
/**
|
|
860
|
+
* Expected current item version from the latest read.
|
|
861
|
+
*/
|
|
862
|
+
version: number;
|
|
863
|
+
|
|
864
|
+
/**
|
|
865
|
+
* Optional immutable item ID precondition. Returns 409 if the key now identifies a
|
|
866
|
+
* different item. Accepted writes target this immutable ID, preventing
|
|
867
|
+
* replacement-key races. Supply this when submitting a form bound to a previously
|
|
868
|
+
* read item.
|
|
869
|
+
*/
|
|
870
|
+
expected_item_id?: string;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
/**
|
|
874
|
+
* Fill selected fields from one ready credential or ready, unexpired Link card
|
|
875
|
+
* into a browser linked to its vault. Only invoke when the item advertises `fill`.
|
|
876
|
+
* Browser and vault must belong to the same project. Kernel checks access and
|
|
877
|
+
* allowed destinations before filling; providing a page URL does not authorize a
|
|
878
|
+
* destination.
|
|
879
|
+
*
|
|
880
|
+
* Find exactly one open page matching `page_url`. Credential items may omit
|
|
881
|
+
* `page_url` to require exactly one open page; cards require an HTTPS page URL.
|
|
882
|
+
* Credentials have no destination allowlist. TOTP fields generate a current code
|
|
883
|
+
* immediately before writing; their seeds never enter the browser. For each
|
|
884
|
+
* selector, search the main frame and all descendant frames for editable inputs or
|
|
885
|
+
* selects matched directly or contained within matching elements. Each selector
|
|
886
|
+
* must resolve to one unique editable element across all frames; zero or multiple
|
|
887
|
+
* candidates fail. Count each element once, even if multiple matching containers
|
|
888
|
+
* contain it. Validate all bindings before filling. Select elements match an
|
|
889
|
+
* option by its value, not its label. If the page navigates or a target disappears
|
|
890
|
+
* during filling, stop rather than selecting a different page or element.
|
|
891
|
+
*
|
|
892
|
+
* Fill in request order and stop on the first failure. This operation is not
|
|
893
|
+
* atomic: previously filled fields are not rolled back. Never submit the form or
|
|
894
|
+
* click buttons, though input/change events may trigger site behavior. Fill is the
|
|
895
|
+
* preferred browser-checkout path. Aliases remain an alternative for explicitly
|
|
896
|
+
* chosen egress-substitution integrations. Do not automatically retry or fall back
|
|
897
|
+
* to aliases after a failed or indeterminate operation.
|
|
898
|
+
*
|
|
899
|
+
* Secret values are never returned or included in operation logs, traces, audit
|
|
900
|
+
* events, or error details. This does not prevent an agent with unrestricted
|
|
901
|
+
* browser access from reading values from the page or other browser observation
|
|
902
|
+
* surfaces.
|
|
903
|
+
*/
|
|
904
|
+
export interface FillVaultItemOperationRequest {
|
|
905
|
+
/**
|
|
906
|
+
* Browser session ID, not a reusable browser name.
|
|
907
|
+
*/
|
|
908
|
+
browser_id: string;
|
|
909
|
+
|
|
910
|
+
/**
|
|
911
|
+
* Field bindings for this step. No two bindings may resolve to the same element.
|
|
912
|
+
*/
|
|
913
|
+
fields: Array<VaultFillField>;
|
|
914
|
+
|
|
915
|
+
type: 'fill';
|
|
916
|
+
|
|
917
|
+
/**
|
|
918
|
+
* Exact current top-level page URL, including path, query, and fragment. Must
|
|
919
|
+
* match exactly one open page in the browser; zero or multiple matches fail. No
|
|
920
|
+
* prefix or glob matching. Required for cards, which must use HTTPS without
|
|
921
|
+
* embedded credentials. Optional for credentials, where omission requires exactly
|
|
922
|
+
* one open page.
|
|
923
|
+
*/
|
|
924
|
+
page_url?: string;
|
|
925
|
+
|
|
926
|
+
/**
|
|
927
|
+
* Total operation deadline in milliseconds, not a per-field timeout.
|
|
928
|
+
*/
|
|
929
|
+
timeout_ms?: number;
|
|
930
|
+
}
|
|
931
|
+
|
|
932
|
+
export interface FillVaultItemOperationResult {
|
|
933
|
+
/**
|
|
934
|
+
* Exactly one result per request binding, in request order. After the first failed
|
|
935
|
+
* or unknown field, all remaining fields are not_attempted.
|
|
936
|
+
*/
|
|
937
|
+
fields: Array<VaultFillFieldResult>;
|
|
938
|
+
|
|
939
|
+
/**
|
|
940
|
+
* Completed only when all fields were filled. Failed when execution stopped with
|
|
941
|
+
* known outcomes. Unknown when any field's outcome cannot be determined. None of
|
|
942
|
+
* these statuses confirms payment or merchant acceptance.
|
|
943
|
+
*/
|
|
944
|
+
status: 'completed' | 'failed' | 'unknown';
|
|
945
|
+
|
|
946
|
+
type: 'fill';
|
|
947
|
+
}
|
|
948
|
+
|
|
949
|
+
/**
|
|
950
|
+
* Prepare an unused AgentCard card for Square checkout. Deliver the returned
|
|
951
|
+
* approval URL and keep the approval page open. Poll the item until
|
|
952
|
+
* ready_to_submit, then submit native Pay before preparation.expires_at. Readiness
|
|
953
|
+
* lasts at most 30 seconds. Unused preparations expire automatically. Preparations
|
|
954
|
+
* are single-use even after failure or expiry; do not automatically retry and
|
|
955
|
+
* reconcile uncertain outcomes with the merchant.
|
|
956
|
+
*/
|
|
957
|
+
export interface PrepareCheckoutVaultItemOperationRequest {
|
|
958
|
+
/**
|
|
959
|
+
* Required when preparing an unused AgentCard card for Square. Consent is bound to
|
|
960
|
+
* this browser and declared merchant origin, not a tab. Wait for the item's
|
|
961
|
+
* ready_to_submit status before native Pay and submit within its readiness
|
|
962
|
+
* deadline. Unused preparations expire automatically; every preparation is
|
|
963
|
+
* single-use, including after failure or expiry.
|
|
964
|
+
*/
|
|
965
|
+
checkout: VaultCheckoutContext;
|
|
966
|
+
|
|
967
|
+
type: 'prepare_checkout';
|
|
968
|
+
}
|
|
969
|
+
|
|
432
970
|
export interface VaultCardAliases {
|
|
433
971
|
cvc: string;
|
|
434
972
|
|
|
@@ -439,7 +977,129 @@ export interface VaultCardAliases {
|
|
|
439
977
|
number: string;
|
|
440
978
|
}
|
|
441
979
|
|
|
442
|
-
|
|
980
|
+
/**
|
|
981
|
+
* Combined expiration derived from the stored month and year; not a separate
|
|
982
|
+
* stored secret.
|
|
983
|
+
*/
|
|
984
|
+
export type VaultCardFillField =
|
|
985
|
+
| VaultCardFillField.VaultCardStoredFillField
|
|
986
|
+
| VaultCardFillField.VaultCardExpirationFillField;
|
|
987
|
+
|
|
988
|
+
export namespace VaultCardFillField {
|
|
989
|
+
export interface VaultCardStoredFillField {
|
|
990
|
+
/**
|
|
991
|
+
* Field in the decrypted card, not an alias. Number and CVC preserve leading
|
|
992
|
+
* zeros; month uses two digits and year uses four digits. Billing fields use the
|
|
993
|
+
* provider's stored billing address (name, line1, line2, city, state, postal_code,
|
|
994
|
+
* country) without reformatting. Request only needed billing fields. An absent or
|
|
995
|
+
* empty requested billing field returns 400 field_unavailable before any browser
|
|
996
|
+
* writes; it does not make other card fields unavailable.
|
|
997
|
+
*/
|
|
998
|
+
field:
|
|
999
|
+
| 'number'
|
|
1000
|
+
| 'exp_month'
|
|
1001
|
+
| 'exp_year'
|
|
1002
|
+
| 'cvc'
|
|
1003
|
+
| 'billing_name'
|
|
1004
|
+
| 'billing_line1'
|
|
1005
|
+
| 'billing_line2'
|
|
1006
|
+
| 'billing_city'
|
|
1007
|
+
| 'billing_state'
|
|
1008
|
+
| 'billing_postal_code'
|
|
1009
|
+
| 'billing_country';
|
|
1010
|
+
|
|
1011
|
+
/**
|
|
1012
|
+
* CSS selector for an editable input or select, or a containing element. Must
|
|
1013
|
+
* resolve to one unique editable element across all page frames.
|
|
1014
|
+
*/
|
|
1015
|
+
selector: string;
|
|
1016
|
+
}
|
|
1017
|
+
|
|
1018
|
+
/**
|
|
1019
|
+
* Combined expiration derived from the stored month and year; not a separate
|
|
1020
|
+
* stored secret.
|
|
1021
|
+
*/
|
|
1022
|
+
export interface VaultCardExpirationFillField {
|
|
1023
|
+
field: 'expiration';
|
|
1024
|
+
|
|
1025
|
+
format: 'MM/YY' | 'MM/YYYY';
|
|
1026
|
+
|
|
1027
|
+
/**
|
|
1028
|
+
* CSS selector for an editable input or select, or a containing element. Must
|
|
1029
|
+
* resolve to one unique editable element across all page frames.
|
|
1030
|
+
*/
|
|
1031
|
+
selector: string;
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
|
|
1035
|
+
/**
|
|
1036
|
+
* Required when preparing an unused AgentCard card for Square. Consent is bound to
|
|
1037
|
+
* this browser and declared merchant origin, not a tab. Wait for the item's
|
|
1038
|
+
* ready_to_submit status before native Pay and submit within its readiness
|
|
1039
|
+
* deadline. Unused preparations expire automatically; every preparation is
|
|
1040
|
+
* single-use, including after failure or expiry.
|
|
1041
|
+
*/
|
|
1042
|
+
export interface VaultCheckoutContext {
|
|
1043
|
+
/**
|
|
1044
|
+
* Active browser session with this vault bound to it.
|
|
1045
|
+
*/
|
|
1046
|
+
browser_id: string;
|
|
1047
|
+
|
|
1048
|
+
/**
|
|
1049
|
+
* Square environment, independent of the AgentCard credential mode.
|
|
1050
|
+
*/
|
|
1051
|
+
environment: 'production' | 'sandbox';
|
|
1052
|
+
|
|
1053
|
+
/**
|
|
1054
|
+
* Canonical HTTPS origin of the top-level merchant document, not the Square
|
|
1055
|
+
* iframe. HTTP localhost is accepted for tests.
|
|
1056
|
+
*/
|
|
1057
|
+
merchant_origin: string;
|
|
1058
|
+
}
|
|
1059
|
+
|
|
1060
|
+
export interface VaultFillField {
|
|
1061
|
+
/**
|
|
1062
|
+
* A declared credential field name or a supported card field. Unset credential
|
|
1063
|
+
* fields cannot be filled.
|
|
1064
|
+
*/
|
|
1065
|
+
field: string;
|
|
1066
|
+
|
|
1067
|
+
selector: string;
|
|
1068
|
+
|
|
1069
|
+
/**
|
|
1070
|
+
* Required only for a card's combined expiration field. Forbidden for other card
|
|
1071
|
+
* fields and all credential fields.
|
|
1072
|
+
*/
|
|
1073
|
+
format?: 'MM/YY' | 'MM/YYYY';
|
|
1074
|
+
}
|
|
1075
|
+
|
|
1076
|
+
export interface VaultFillFieldResult {
|
|
1077
|
+
/**
|
|
1078
|
+
* Zero-based index into the request fields array.
|
|
1079
|
+
*/
|
|
1080
|
+
index: number;
|
|
1081
|
+
|
|
1082
|
+
/**
|
|
1083
|
+
* Filled means the fill action completed, not that the website retained or
|
|
1084
|
+
* accepted the value.
|
|
1085
|
+
*/
|
|
1086
|
+
status: 'filled' | 'failed' | 'not_attempted' | 'unknown';
|
|
1087
|
+
|
|
1088
|
+
/**
|
|
1089
|
+
* Present only for failed or unknown fields. Never includes secret values, DOM
|
|
1090
|
+
* content, or raw browser errors.
|
|
1091
|
+
*/
|
|
1092
|
+
error_code?:
|
|
1093
|
+
| 'target_changed'
|
|
1094
|
+
| 'element_not_found'
|
|
1095
|
+
| 'ambiguous_selector'
|
|
1096
|
+
| 'element_not_editable'
|
|
1097
|
+
| 'option_not_found'
|
|
1098
|
+
| 'timeout'
|
|
1099
|
+
| 'execution_failed';
|
|
1100
|
+
}
|
|
1101
|
+
|
|
1102
|
+
export type VaultItem = VaultItem.WalletVaultItem | VaultItem.CardVaultItem | CredentialVaultItem;
|
|
443
1103
|
|
|
444
1104
|
export namespace VaultItem {
|
|
445
1105
|
export interface WalletVaultItem {
|
|
@@ -500,7 +1160,7 @@ export namespace VaultItem {
|
|
|
500
1160
|
export interface AvailableOperation {
|
|
501
1161
|
description: string;
|
|
502
1162
|
|
|
503
|
-
type: 'authorize';
|
|
1163
|
+
type: 'authorize' | 'collect' | 'prepare_checkout' | 'fill';
|
|
504
1164
|
}
|
|
505
1165
|
|
|
506
1166
|
/**
|
|
@@ -559,7 +1219,7 @@ export namespace VaultItem {
|
|
|
559
1219
|
export interface AvailableOperation {
|
|
560
1220
|
description: string;
|
|
561
1221
|
|
|
562
|
-
type: 'authorize';
|
|
1222
|
+
type: 'authorize' | 'collect' | 'prepare_checkout' | 'fill';
|
|
563
1223
|
}
|
|
564
1224
|
}
|
|
565
1225
|
}
|
|
@@ -624,6 +1284,140 @@ export interface VaultItemEvent {
|
|
|
624
1284
|
data?: { [key: string]: unknown };
|
|
625
1285
|
}
|
|
626
1286
|
|
|
1287
|
+
/**
|
|
1288
|
+
* Authorization and preparation return the existing item shape. Fill returns a
|
|
1289
|
+
* value-free execution result; it does not persist transient field outcomes on the
|
|
1290
|
+
* item.
|
|
1291
|
+
*/
|
|
1292
|
+
export type VaultItemOperationResponse =
|
|
1293
|
+
| VaultItemOperationResponse.WalletVaultItem
|
|
1294
|
+
| VaultItemOperationResponse.CardVaultItem
|
|
1295
|
+
| CredentialVaultItem
|
|
1296
|
+
| FillVaultItemOperationResult;
|
|
1297
|
+
|
|
1298
|
+
export namespace VaultItemOperationResponse {
|
|
1299
|
+
export interface WalletVaultItem {
|
|
1300
|
+
id: string;
|
|
1301
|
+
|
|
1302
|
+
available_expansions: Array<WalletVaultItem.AvailableExpansion>;
|
|
1303
|
+
|
|
1304
|
+
available_operations: Array<WalletVaultItem.AvailableOperation>;
|
|
1305
|
+
|
|
1306
|
+
created_at: string;
|
|
1307
|
+
|
|
1308
|
+
/**
|
|
1309
|
+
* Immutable item key assigned when the item is created.
|
|
1310
|
+
*/
|
|
1311
|
+
key: string;
|
|
1312
|
+
|
|
1313
|
+
/**
|
|
1314
|
+
* AgentCard wallet. Omit provider_config to use Kernel-managed credentials, or
|
|
1315
|
+
* select a customer-owned configuration. Mode (sandbox vs live) is determined by
|
|
1316
|
+
* the selected credential; there is no per-item test flag. Without user_id,
|
|
1317
|
+
* creation returns a hosted enrollment action and Kernel polls until the user
|
|
1318
|
+
* connects. user_id may only reference a user already enrolled by a wallet in this
|
|
1319
|
+
* organization under the same configuration.
|
|
1320
|
+
*/
|
|
1321
|
+
spec: ItemsAPI.WalletVaultItemSpec;
|
|
1322
|
+
|
|
1323
|
+
state: ItemsAPI.WalletVaultItemState;
|
|
1324
|
+
|
|
1325
|
+
type: 'wallet';
|
|
1326
|
+
|
|
1327
|
+
updated_at: string;
|
|
1328
|
+
|
|
1329
|
+
action?: ItemsAPI.VaultItemAction;
|
|
1330
|
+
|
|
1331
|
+
/**
|
|
1332
|
+
* Live, non-persisted data requested through the item GET expand parameter.
|
|
1333
|
+
*/
|
|
1334
|
+
expanded?: WalletVaultItem.Expanded;
|
|
1335
|
+
|
|
1336
|
+
expires_at?: string;
|
|
1337
|
+
}
|
|
1338
|
+
|
|
1339
|
+
export namespace WalletVaultItem {
|
|
1340
|
+
/**
|
|
1341
|
+
* Live data that can currently be requested by passing its type to the item GET
|
|
1342
|
+
* expand parameter.
|
|
1343
|
+
*/
|
|
1344
|
+
export interface AvailableExpansion {
|
|
1345
|
+
description: string;
|
|
1346
|
+
|
|
1347
|
+
type: 'payment_methods';
|
|
1348
|
+
}
|
|
1349
|
+
|
|
1350
|
+
/**
|
|
1351
|
+
* An operation that is currently valid for this item. Read the description before
|
|
1352
|
+
* invoking it through the item operations endpoint.
|
|
1353
|
+
*/
|
|
1354
|
+
export interface AvailableOperation {
|
|
1355
|
+
description: string;
|
|
1356
|
+
|
|
1357
|
+
type: 'authorize' | 'collect' | 'prepare_checkout' | 'fill';
|
|
1358
|
+
}
|
|
1359
|
+
|
|
1360
|
+
/**
|
|
1361
|
+
* Live, non-persisted data requested through the item GET expand parameter.
|
|
1362
|
+
*/
|
|
1363
|
+
export interface Expanded {
|
|
1364
|
+
payment_methods?: Array<ItemsAPI.VaultPaymentMethod>;
|
|
1365
|
+
}
|
|
1366
|
+
}
|
|
1367
|
+
|
|
1368
|
+
export interface CardVaultItem {
|
|
1369
|
+
id: string;
|
|
1370
|
+
|
|
1371
|
+
available_expansions: Array<CardVaultItem.AvailableExpansion>;
|
|
1372
|
+
|
|
1373
|
+
available_operations: Array<CardVaultItem.AvailableOperation>;
|
|
1374
|
+
|
|
1375
|
+
created_at: string;
|
|
1376
|
+
|
|
1377
|
+
/**
|
|
1378
|
+
* Immutable item key assigned when the item is created.
|
|
1379
|
+
*/
|
|
1380
|
+
key: string;
|
|
1381
|
+
|
|
1382
|
+
/**
|
|
1383
|
+
* Live payment card. Test-mode card creation is not supported.
|
|
1384
|
+
*/
|
|
1385
|
+
spec: ItemsAPI.CardVaultItemSpec;
|
|
1386
|
+
|
|
1387
|
+
state: ItemsAPI.CardVaultItemState;
|
|
1388
|
+
|
|
1389
|
+
type: 'card';
|
|
1390
|
+
|
|
1391
|
+
updated_at: string;
|
|
1392
|
+
|
|
1393
|
+
action?: ItemsAPI.VaultItemAction;
|
|
1394
|
+
|
|
1395
|
+
expires_at?: string;
|
|
1396
|
+
}
|
|
1397
|
+
|
|
1398
|
+
export namespace CardVaultItem {
|
|
1399
|
+
/**
|
|
1400
|
+
* Live data that can currently be requested by passing its type to the item GET
|
|
1401
|
+
* expand parameter.
|
|
1402
|
+
*/
|
|
1403
|
+
export interface AvailableExpansion {
|
|
1404
|
+
description: string;
|
|
1405
|
+
|
|
1406
|
+
type: 'payment_methods';
|
|
1407
|
+
}
|
|
1408
|
+
|
|
1409
|
+
/**
|
|
1410
|
+
* An operation that is currently valid for this item. Read the description before
|
|
1411
|
+
* invoking it through the item operations endpoint.
|
|
1412
|
+
*/
|
|
1413
|
+
export interface AvailableOperation {
|
|
1414
|
+
description: string;
|
|
1415
|
+
|
|
1416
|
+
type: 'authorize' | 'collect' | 'prepare_checkout' | 'fill';
|
|
1417
|
+
}
|
|
1418
|
+
}
|
|
1419
|
+
}
|
|
1420
|
+
|
|
627
1421
|
export interface VaultPaymentMethod {
|
|
628
1422
|
id: string;
|
|
629
1423
|
|
|
@@ -809,21 +1603,65 @@ export interface ItemRetrieveParams {
|
|
|
809
1603
|
|
|
810
1604
|
/**
|
|
811
1605
|
* Query param: Hold for up to this many seconds while the item is pending
|
|
812
|
-
* authorization or
|
|
1606
|
+
* authorization, approval, or credential collection. Return the current item when
|
|
1607
|
+
* ready or when the wait elapses. This does not wait for edits to an already-ready
|
|
1608
|
+
* credential; poll GET without wait and compare version to observe changes after
|
|
1609
|
+
* collect.
|
|
813
1610
|
*/
|
|
814
1611
|
wait?: number;
|
|
815
1612
|
}
|
|
816
1613
|
|
|
817
|
-
export
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
*/
|
|
821
|
-
id_or_name: string;
|
|
1614
|
+
export type ItemUpdateParams =
|
|
1615
|
+
| ItemUpdateParams.CardVaultItemUpdateRequest
|
|
1616
|
+
| ItemUpdateParams.CredentialVaultItemUpdateRequest;
|
|
822
1617
|
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
1618
|
+
export declare namespace ItemUpdateParams {
|
|
1619
|
+
export interface CardVaultItemUpdateRequest {
|
|
1620
|
+
/**
|
|
1621
|
+
* Path param
|
|
1622
|
+
*/
|
|
1623
|
+
id_or_name: string;
|
|
1624
|
+
|
|
1625
|
+
/**
|
|
1626
|
+
* Body param: Live payment card. Test-mode card creation is not supported.
|
|
1627
|
+
*/
|
|
1628
|
+
spec: CardVaultItemSpec;
|
|
1629
|
+
|
|
1630
|
+
/**
|
|
1631
|
+
* Body param
|
|
1632
|
+
*/
|
|
1633
|
+
type?: 'card';
|
|
1634
|
+
}
|
|
1635
|
+
|
|
1636
|
+
export interface CredentialVaultItemUpdateRequest {
|
|
1637
|
+
/**
|
|
1638
|
+
* Path param
|
|
1639
|
+
*/
|
|
1640
|
+
id_or_name: string;
|
|
1641
|
+
|
|
1642
|
+
/**
|
|
1643
|
+
* Body param
|
|
1644
|
+
*/
|
|
1645
|
+
spec: CredentialVaultItemSpecUpdate;
|
|
1646
|
+
|
|
1647
|
+
/**
|
|
1648
|
+
* Body param
|
|
1649
|
+
*/
|
|
1650
|
+
type: 'credential';
|
|
1651
|
+
|
|
1652
|
+
/**
|
|
1653
|
+
* Body param: Expected current item version from the latest read.
|
|
1654
|
+
*/
|
|
1655
|
+
version: number;
|
|
1656
|
+
|
|
1657
|
+
/**
|
|
1658
|
+
* Body param: Optional immutable item ID precondition. Returns 409 if the key now
|
|
1659
|
+
* identifies a different item. Accepted writes target this immutable ID,
|
|
1660
|
+
* preventing replacement-key races. Supply this when submitting a form bound to a
|
|
1661
|
+
* previously read item.
|
|
1662
|
+
*/
|
|
1663
|
+
expected_item_id?: string;
|
|
1664
|
+
}
|
|
827
1665
|
}
|
|
828
1666
|
|
|
829
1667
|
export interface ItemDeleteParams {
|
|
@@ -847,21 +1685,100 @@ export interface ItemEventsParams {
|
|
|
847
1685
|
wait?: number;
|
|
848
1686
|
}
|
|
849
1687
|
|
|
850
|
-
export
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
1688
|
+
export type ItemPerformOperationParams =
|
|
1689
|
+
| ItemPerformOperationParams.AuthorizeVaultItemOperationRequest
|
|
1690
|
+
| ItemPerformOperationParams.CollectVaultItemOperationRequest
|
|
1691
|
+
| ItemPerformOperationParams.PrepareCheckoutVaultItemOperationRequest
|
|
1692
|
+
| ItemPerformOperationParams.FillVaultItemOperationRequest;
|
|
855
1693
|
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
1694
|
+
export declare namespace ItemPerformOperationParams {
|
|
1695
|
+
export interface AuthorizeVaultItemOperationRequest {
|
|
1696
|
+
/**
|
|
1697
|
+
* Path param
|
|
1698
|
+
*/
|
|
1699
|
+
id_or_name: string;
|
|
1700
|
+
|
|
1701
|
+
/**
|
|
1702
|
+
* Body param
|
|
1703
|
+
*/
|
|
1704
|
+
type: 'authorize';
|
|
1705
|
+
}
|
|
1706
|
+
|
|
1707
|
+
export interface CollectVaultItemOperationRequest {
|
|
1708
|
+
/**
|
|
1709
|
+
* Path param
|
|
1710
|
+
*/
|
|
1711
|
+
id_or_name: string;
|
|
1712
|
+
|
|
1713
|
+
/**
|
|
1714
|
+
* Body param
|
|
1715
|
+
*/
|
|
1716
|
+
type: 'collect';
|
|
1717
|
+
}
|
|
1718
|
+
|
|
1719
|
+
export interface PrepareCheckoutVaultItemOperationRequest {
|
|
1720
|
+
/**
|
|
1721
|
+
* Path param
|
|
1722
|
+
*/
|
|
1723
|
+
id_or_name: string;
|
|
1724
|
+
|
|
1725
|
+
/**
|
|
1726
|
+
* Body param: Required when preparing an unused AgentCard card for Square. Consent
|
|
1727
|
+
* is bound to this browser and declared merchant origin, not a tab. Wait for the
|
|
1728
|
+
* item's ready_to_submit status before native Pay and submit within its readiness
|
|
1729
|
+
* deadline. Unused preparations expire automatically; every preparation is
|
|
1730
|
+
* single-use, including after failure or expiry.
|
|
1731
|
+
*/
|
|
1732
|
+
checkout: VaultCheckoutContext;
|
|
1733
|
+
|
|
1734
|
+
/**
|
|
1735
|
+
* Body param
|
|
1736
|
+
*/
|
|
1737
|
+
type: 'prepare_checkout';
|
|
1738
|
+
}
|
|
1739
|
+
|
|
1740
|
+
export interface FillVaultItemOperationRequest {
|
|
1741
|
+
/**
|
|
1742
|
+
* Path param
|
|
1743
|
+
*/
|
|
1744
|
+
id_or_name: string;
|
|
1745
|
+
|
|
1746
|
+
/**
|
|
1747
|
+
* Body param: Browser session ID, not a reusable browser name.
|
|
1748
|
+
*/
|
|
1749
|
+
browser_id: string;
|
|
1750
|
+
|
|
1751
|
+
/**
|
|
1752
|
+
* Body param: Field bindings for this step. No two bindings may resolve to the
|
|
1753
|
+
* same element.
|
|
1754
|
+
*/
|
|
1755
|
+
fields: Array<VaultFillField>;
|
|
1756
|
+
|
|
1757
|
+
/**
|
|
1758
|
+
* Body param
|
|
1759
|
+
*/
|
|
1760
|
+
type: 'fill';
|
|
1761
|
+
|
|
1762
|
+
/**
|
|
1763
|
+
* Body param: Exact current top-level page URL, including path, query, and
|
|
1764
|
+
* fragment. Must match exactly one open page in the browser; zero or multiple
|
|
1765
|
+
* matches fail. No prefix or glob matching. Required for cards, which must use
|
|
1766
|
+
* HTTPS without embedded credentials. Optional for credentials, where omission
|
|
1767
|
+
* requires exactly one open page.
|
|
1768
|
+
*/
|
|
1769
|
+
page_url?: string;
|
|
1770
|
+
|
|
1771
|
+
/**
|
|
1772
|
+
* Body param: Total operation deadline in milliseconds, not a per-field timeout.
|
|
1773
|
+
*/
|
|
1774
|
+
timeout_ms?: number;
|
|
1775
|
+
}
|
|
860
1776
|
}
|
|
861
1777
|
|
|
862
1778
|
export type ItemUpsertParams =
|
|
863
1779
|
| ItemUpsertParams.WalletVaultItemRequest
|
|
864
|
-
| ItemUpsertParams.CardVaultItemRequest
|
|
1780
|
+
| ItemUpsertParams.CardVaultItemRequest
|
|
1781
|
+
| ItemUpsertParams.CredentialVaultItemRequest;
|
|
865
1782
|
|
|
866
1783
|
export declare namespace ItemUpsertParams {
|
|
867
1784
|
export interface WalletVaultItemRequest {
|
|
@@ -1048,17 +1965,60 @@ export declare namespace ItemUpsertParams {
|
|
|
1048
1965
|
*/
|
|
1049
1966
|
type: 'card';
|
|
1050
1967
|
}
|
|
1968
|
+
|
|
1969
|
+
export interface CredentialVaultItemRequest {
|
|
1970
|
+
/**
|
|
1971
|
+
* Path param
|
|
1972
|
+
*/
|
|
1973
|
+
id_or_name: string;
|
|
1974
|
+
|
|
1975
|
+
/**
|
|
1976
|
+
* Body param: Credential fields are for login and other non-payment credentials.
|
|
1977
|
+
* Do not store, collect, or fill credit card data in credential items. Use wallet
|
|
1978
|
+
* and card item types for credit cards and payment checkout instead.
|
|
1979
|
+
*/
|
|
1980
|
+
spec: CredentialVaultItemSpecInput;
|
|
1981
|
+
|
|
1982
|
+
/**
|
|
1983
|
+
* Body param
|
|
1984
|
+
*/
|
|
1985
|
+
type: 'credential';
|
|
1986
|
+
}
|
|
1051
1987
|
}
|
|
1052
1988
|
|
|
1053
1989
|
export declare namespace Items {
|
|
1054
1990
|
export {
|
|
1055
1991
|
type AgentcardCheckoutAuthorization as AgentcardCheckoutAuthorization,
|
|
1992
|
+
type AgentcardCheckoutPreparation as AgentcardCheckoutPreparation,
|
|
1993
|
+
type AuthorizeVaultItemOperationRequest as AuthorizeVaultItemOperationRequest,
|
|
1056
1994
|
type CardVaultItemSpec as CardVaultItemSpec,
|
|
1057
1995
|
type CardVaultItemState as CardVaultItemState,
|
|
1996
|
+
type CollectVaultItemOperationRequest as CollectVaultItemOperationRequest,
|
|
1997
|
+
type CredentialCollectionAction as CredentialCollectionAction,
|
|
1998
|
+
type CredentialVaultFieldDefinition as CredentialVaultFieldDefinition,
|
|
1999
|
+
type CredentialVaultFieldInput as CredentialVaultFieldInput,
|
|
2000
|
+
type CredentialVaultFieldState as CredentialVaultFieldState,
|
|
2001
|
+
type CredentialVaultFieldType as CredentialVaultFieldType,
|
|
2002
|
+
type CredentialVaultFieldUpdate as CredentialVaultFieldUpdate,
|
|
2003
|
+
type CredentialVaultItem as CredentialVaultItem,
|
|
2004
|
+
type CredentialVaultItemRequest as CredentialVaultItemRequest,
|
|
2005
|
+
type CredentialVaultItemSpec as CredentialVaultItemSpec,
|
|
2006
|
+
type CredentialVaultItemSpecInput as CredentialVaultItemSpecInput,
|
|
2007
|
+
type CredentialVaultItemSpecUpdate as CredentialVaultItemSpecUpdate,
|
|
2008
|
+
type CredentialVaultItemState as CredentialVaultItemState,
|
|
2009
|
+
type CredentialVaultItemUpdateRequest as CredentialVaultItemUpdateRequest,
|
|
2010
|
+
type FillVaultItemOperationRequest as FillVaultItemOperationRequest,
|
|
2011
|
+
type FillVaultItemOperationResult as FillVaultItemOperationResult,
|
|
2012
|
+
type PrepareCheckoutVaultItemOperationRequest as PrepareCheckoutVaultItemOperationRequest,
|
|
1058
2013
|
type VaultCardAliases as VaultCardAliases,
|
|
2014
|
+
type VaultCardFillField as VaultCardFillField,
|
|
2015
|
+
type VaultCheckoutContext as VaultCheckoutContext,
|
|
2016
|
+
type VaultFillField as VaultFillField,
|
|
2017
|
+
type VaultFillFieldResult as VaultFillFieldResult,
|
|
1059
2018
|
type VaultItem as VaultItem,
|
|
1060
2019
|
type VaultItemAction as VaultItemAction,
|
|
1061
2020
|
type VaultItemEvent as VaultItemEvent,
|
|
2021
|
+
type VaultItemOperationResponse as VaultItemOperationResponse,
|
|
1062
2022
|
type VaultPaymentMethod as VaultPaymentMethod,
|
|
1063
2023
|
type WalletVaultItemSpec as WalletVaultItemSpec,
|
|
1064
2024
|
type WalletVaultItemState as WalletVaultItemState,
|