@onkernel/sdk 0.102.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.
Files changed (42) hide show
  1. package/CHANGELOG.md +15 -0
  2. package/package.json +1 -1
  3. package/resources/auth/connections.d.mts +8 -0
  4. package/resources/auth/connections.d.mts.map +1 -1
  5. package/resources/auth/connections.d.ts +8 -0
  6. package/resources/auth/connections.d.ts.map +1 -1
  7. package/resources/config-registry/config-registry.d.mts +10 -0
  8. package/resources/config-registry/config-registry.d.mts.map +1 -1
  9. package/resources/config-registry/config-registry.d.ts +10 -0
  10. package/resources/config-registry/config-registry.d.ts.map +1 -1
  11. package/resources/config-registry/config-registry.js.map +1 -1
  12. package/resources/config-registry/config-registry.mjs.map +1 -1
  13. package/resources/vaults/index.d.mts +1 -1
  14. package/resources/vaults/index.d.mts.map +1 -1
  15. package/resources/vaults/index.d.ts +1 -1
  16. package/resources/vaults/index.d.ts.map +1 -1
  17. package/resources/vaults/index.js.map +1 -1
  18. package/resources/vaults/index.mjs.map +1 -1
  19. package/resources/vaults/items.d.mts +456 -54
  20. package/resources/vaults/items.d.mts.map +1 -1
  21. package/resources/vaults/items.d.ts +456 -54
  22. package/resources/vaults/items.d.ts.map +1 -1
  23. package/resources/vaults/items.js +30 -11
  24. package/resources/vaults/items.js.map +1 -1
  25. package/resources/vaults/items.mjs +30 -11
  26. package/resources/vaults/items.mjs.map +1 -1
  27. package/resources/vaults/vaults.d.mts +2 -2
  28. package/resources/vaults/vaults.d.mts.map +1 -1
  29. package/resources/vaults/vaults.d.ts +2 -2
  30. package/resources/vaults/vaults.d.ts.map +1 -1
  31. package/resources/vaults/vaults.js.map +1 -1
  32. package/resources/vaults/vaults.mjs.map +1 -1
  33. package/src/resources/auth/connections.ts +10 -0
  34. package/src/resources/config-registry/config-registry.ts +12 -0
  35. package/src/resources/vaults/index.ts +15 -0
  36. package/src/resources/vaults/items.ts +530 -53
  37. package/src/resources/vaults/vaults.ts +30 -0
  38. package/src/version.ts +1 -1
  39. package/version.d.mts +1 -1
  40. package/version.d.ts +1 -1
  41. package/version.js +1 -1
  42. 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
- * Requested cards accept a replacement specification. Pending issuance requests
32
- * may update provider-supported fields on their existing request, subject to
33
- * atomic provider approval checks; omitted optional fields remain unchanged and
34
- * explicit empty lists clear them. Wallet/provider binding and unsupported fields
35
- * cannot change after authorization starts. An uncertain update enters
36
- * recovery_required and must not be retried. Checkout cards may be edited between
37
- * authorizations.
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
- * List vault items without secret values
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
@@ -146,7 +158,11 @@ export class Items extends APIResource {
146
158
  options?: RequestOptions,
147
159
  ): APIPromise<VaultItemOperationResponse> {
148
160
  const { id_or_name, ...body } = params;
149
- return this._client.post(path`/vaults/${id_or_name}/items/${key}/operations`, { body, ...options });
161
+ return this._client.post(path`/vaults/${id_or_name}/items/${key}/operations`, {
162
+ body,
163
+ maxRetries: 0,
164
+ ...options,
165
+ });
150
166
  }
151
167
 
152
168
  /**
@@ -155,7 +171,10 @@ export class Items extends APIResource {
155
171
  * card in any lifecycle state without polling the provider, reauthorizing,
156
172
  * replacing aliases, or resetting recovery. Conflicting specifications return 409.
157
173
  * Provider-specific authorization requirements and retry behavior are described in
158
- * 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.
159
178
  *
160
179
  * @example
161
180
  * ```ts
@@ -509,20 +528,366 @@ export namespace CardVaultItemState {
509
528
  }
510
529
 
511
530
  /**
512
- * Fill selected fields from one ready, unexpired card into a browser linked to its
513
- * vault. Only supported for card items created from Link wallets. Only invoke when
514
- * the item advertises `fill`. Browser and vault must belong to the same project.
515
- * Kernel checks access and allowed destinations before filling; providing a page
516
- * URL does not authorize a destination.
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.
517
879
  *
518
- * Find exactly one open page matching `page_url`. For each selector, search the
519
- * main frame and all descendant frames for editable inputs or selects matched
520
- * directly or contained within matching elements. Each selector must resolve to
521
- * one unique editable element across all frames; zero or multiple candidates fail.
522
- * Count each element once, even if multiple matching containers contain it.
523
- * Validate all bindings before filling. Select elements match an option by its
524
- * value, not its label. If the page navigates or a target disappears during
525
- * filling, stop rather than selecting a different page or element.
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.
526
891
  *
527
892
  * Fill in request order and stop on the first failure. This operation is not
528
893
  * atomic: previously filled fields are not rolled back. Never submit the form or
@@ -545,16 +910,18 @@ export interface FillVaultItemOperationRequest {
545
910
  /**
546
911
  * Field bindings for this step. No two bindings may resolve to the same element.
547
912
  */
548
- fields: Array<VaultCardFillField>;
913
+ fields: Array<VaultFillField>;
914
+
915
+ type: 'fill';
549
916
 
550
917
  /**
551
918
  * Exact current top-level page URL, including path, query, and fragment. Must
552
919
  * match exactly one open page in the browser; zero or multiple matches fail. No
553
- * prefix or glob matching. Must use HTTPS without embedded credentials.
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.
554
923
  */
555
- page_url: string;
556
-
557
- type: 'fill';
924
+ page_url?: string;
558
925
 
559
926
  /**
560
927
  * Total operation deadline in milliseconds, not a per-field timeout.
@@ -690,6 +1057,22 @@ export interface VaultCheckoutContext {
690
1057
  merchant_origin: string;
691
1058
  }
692
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
+
693
1076
  export interface VaultFillFieldResult {
694
1077
  /**
695
1078
  * Zero-based index into the request fields array.
@@ -716,7 +1099,7 @@ export interface VaultFillFieldResult {
716
1099
  | 'execution_failed';
717
1100
  }
718
1101
 
719
- export type VaultItem = VaultItem.WalletVaultItem | VaultItem.CardVaultItem;
1102
+ export type VaultItem = VaultItem.WalletVaultItem | VaultItem.CardVaultItem | CredentialVaultItem;
720
1103
 
721
1104
  export namespace VaultItem {
722
1105
  export interface WalletVaultItem {
@@ -777,7 +1160,7 @@ export namespace VaultItem {
777
1160
  export interface AvailableOperation {
778
1161
  description: string;
779
1162
 
780
- type: 'authorize' | 'prepare_checkout' | 'fill';
1163
+ type: 'authorize' | 'collect' | 'prepare_checkout' | 'fill';
781
1164
  }
782
1165
 
783
1166
  /**
@@ -836,7 +1219,7 @@ export namespace VaultItem {
836
1219
  export interface AvailableOperation {
837
1220
  description: string;
838
1221
 
839
- type: 'authorize' | 'prepare_checkout' | 'fill';
1222
+ type: 'authorize' | 'collect' | 'prepare_checkout' | 'fill';
840
1223
  }
841
1224
  }
842
1225
  }
@@ -909,6 +1292,7 @@ export interface VaultItemEvent {
909
1292
  export type VaultItemOperationResponse =
910
1293
  | VaultItemOperationResponse.WalletVaultItem
911
1294
  | VaultItemOperationResponse.CardVaultItem
1295
+ | CredentialVaultItem
912
1296
  | FillVaultItemOperationResult;
913
1297
 
914
1298
  export namespace VaultItemOperationResponse {
@@ -970,7 +1354,7 @@ export namespace VaultItemOperationResponse {
970
1354
  export interface AvailableOperation {
971
1355
  description: string;
972
1356
 
973
- type: 'authorize' | 'prepare_checkout' | 'fill';
1357
+ type: 'authorize' | 'collect' | 'prepare_checkout' | 'fill';
974
1358
  }
975
1359
 
976
1360
  /**
@@ -1029,7 +1413,7 @@ export namespace VaultItemOperationResponse {
1029
1413
  export interface AvailableOperation {
1030
1414
  description: string;
1031
1415
 
1032
- type: 'authorize' | 'prepare_checkout' | 'fill';
1416
+ type: 'authorize' | 'collect' | 'prepare_checkout' | 'fill';
1033
1417
  }
1034
1418
  }
1035
1419
  }
@@ -1219,21 +1603,65 @@ export interface ItemRetrieveParams {
1219
1603
 
1220
1604
  /**
1221
1605
  * Query param: Hold for up to this many seconds while the item is pending
1222
- * authorization or approval.
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.
1223
1610
  */
1224
1611
  wait?: number;
1225
1612
  }
1226
1613
 
1227
- export interface ItemUpdateParams {
1228
- /**
1229
- * Path param
1230
- */
1231
- id_or_name: string;
1614
+ export type ItemUpdateParams =
1615
+ | ItemUpdateParams.CardVaultItemUpdateRequest
1616
+ | ItemUpdateParams.CredentialVaultItemUpdateRequest;
1232
1617
 
1233
- /**
1234
- * Body param: Live payment card. Test-mode card creation is not supported.
1235
- */
1236
- spec: CardVaultItemSpec;
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
+ }
1237
1665
  }
1238
1666
 
1239
1667
  export interface ItemDeleteParams {
@@ -1259,6 +1687,7 @@ export interface ItemEventsParams {
1259
1687
 
1260
1688
  export type ItemPerformOperationParams =
1261
1689
  | ItemPerformOperationParams.AuthorizeVaultItemOperationRequest
1690
+ | ItemPerformOperationParams.CollectVaultItemOperationRequest
1262
1691
  | ItemPerformOperationParams.PrepareCheckoutVaultItemOperationRequest
1263
1692
  | ItemPerformOperationParams.FillVaultItemOperationRequest;
1264
1693
 
@@ -1275,6 +1704,18 @@ export declare namespace ItemPerformOperationParams {
1275
1704
  type: 'authorize';
1276
1705
  }
1277
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
+
1278
1719
  export interface PrepareCheckoutVaultItemOperationRequest {
1279
1720
  /**
1280
1721
  * Path param
@@ -1311,20 +1752,21 @@ export declare namespace ItemPerformOperationParams {
1311
1752
  * Body param: Field bindings for this step. No two bindings may resolve to the
1312
1753
  * same element.
1313
1754
  */
1314
- fields: Array<VaultCardFillField>;
1755
+ fields: Array<VaultFillField>;
1315
1756
 
1316
1757
  /**
1317
- * Body param: Exact current top-level page URL, including path, query, and
1318
- * fragment. Must match exactly one open page in the browser; zero or multiple
1319
- * matches fail. No prefix or glob matching. Must use HTTPS without embedded
1320
- * credentials.
1758
+ * Body param
1321
1759
  */
1322
- page_url: string;
1760
+ type: 'fill';
1323
1761
 
1324
1762
  /**
1325
- * Body param
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.
1326
1768
  */
1327
- type: 'fill';
1769
+ page_url?: string;
1328
1770
 
1329
1771
  /**
1330
1772
  * Body param: Total operation deadline in milliseconds, not a per-field timeout.
@@ -1335,7 +1777,8 @@ export declare namespace ItemPerformOperationParams {
1335
1777
 
1336
1778
  export type ItemUpsertParams =
1337
1779
  | ItemUpsertParams.WalletVaultItemRequest
1338
- | ItemUpsertParams.CardVaultItemRequest;
1780
+ | ItemUpsertParams.CardVaultItemRequest
1781
+ | ItemUpsertParams.CredentialVaultItemRequest;
1339
1782
 
1340
1783
  export declare namespace ItemUpsertParams {
1341
1784
  export interface WalletVaultItemRequest {
@@ -1522,6 +1965,25 @@ export declare namespace ItemUpsertParams {
1522
1965
  */
1523
1966
  type: 'card';
1524
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
+ }
1525
1987
  }
1526
1988
 
1527
1989
  export declare namespace Items {
@@ -1531,12 +1993,27 @@ export declare namespace Items {
1531
1993
  type AuthorizeVaultItemOperationRequest as AuthorizeVaultItemOperationRequest,
1532
1994
  type CardVaultItemSpec as CardVaultItemSpec,
1533
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,
1534
2010
  type FillVaultItemOperationRequest as FillVaultItemOperationRequest,
1535
2011
  type FillVaultItemOperationResult as FillVaultItemOperationResult,
1536
2012
  type PrepareCheckoutVaultItemOperationRequest as PrepareCheckoutVaultItemOperationRequest,
1537
2013
  type VaultCardAliases as VaultCardAliases,
1538
2014
  type VaultCardFillField as VaultCardFillField,
1539
2015
  type VaultCheckoutContext as VaultCheckoutContext,
2016
+ type VaultFillField as VaultFillField,
1540
2017
  type VaultFillFieldResult as VaultFillFieldResult,
1541
2018
  type VaultItem as VaultItem,
1542
2019
  type VaultItemAction as VaultItemAction,