@onkernel/sdk 0.99.0 → 0.101.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 +23 -0
- package/client.d.mts +3 -0
- package/client.d.mts.map +1 -1
- package/client.d.ts +3 -0
- package/client.d.ts.map +1 -1
- package/client.js +3 -0
- package/client.js.map +1 -1
- package/client.mjs +3 -0
- package/client.mjs.map +1 -1
- package/lib/browser-routing.d.mts.map +1 -1
- package/lib/browser-routing.d.ts.map +1 -1
- package/lib/browser-routing.js +23 -6
- package/lib/browser-routing.js.map +1 -1
- package/lib/browser-routing.mjs +23 -6
- package/lib/browser-routing.mjs.map +1 -1
- package/package.json +1 -1
- package/resources/browsers/telemetry.d.mts +4 -3
- package/resources/browsers/telemetry.d.mts.map +1 -1
- package/resources/browsers/telemetry.d.ts +4 -3
- package/resources/browsers/telemetry.d.ts.map +1 -1
- package/resources/config-registry/config-registry.d.mts +14 -7
- package/resources/config-registry/config-registry.d.mts.map +1 -1
- package/resources/config-registry/config-registry.d.ts +14 -7
- 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/index.d.mts +1 -0
- package/resources/index.d.mts.map +1 -1
- package/resources/index.d.ts +1 -0
- package/resources/index.d.ts.map +1 -1
- package/resources/index.js +3 -1
- package/resources/index.js.map +1 -1
- package/resources/index.mjs +1 -0
- package/resources/index.mjs.map +1 -1
- package/resources/invocations.d.mts +44 -15
- package/resources/invocations.d.mts.map +1 -1
- package/resources/invocations.d.ts +44 -15
- package/resources/invocations.d.ts.map +1 -1
- package/resources/organization/entitlements.d.mts +20 -0
- package/resources/organization/entitlements.d.mts.map +1 -1
- package/resources/organization/entitlements.d.ts +20 -0
- package/resources/organization/entitlements.d.ts.map +1 -1
- package/resources/organization/limits.d.mts +10 -1
- package/resources/organization/limits.d.mts.map +1 -1
- package/resources/organization/limits.d.ts +10 -1
- package/resources/organization/limits.d.ts.map +1 -1
- package/resources/organization/limits.js +1 -1
- package/resources/organization/limits.mjs +1 -1
- package/resources/proxies.d.mts +36 -18
- package/resources/proxies.d.mts.map +1 -1
- package/resources/proxies.d.ts +36 -18
- package/resources/proxies.d.ts.map +1 -1
- package/resources/vault-provider-configs.d.mts +179 -0
- package/resources/vault-provider-configs.d.mts.map +1 -0
- package/resources/vault-provider-configs.d.ts +179 -0
- package/resources/vault-provider-configs.d.ts.map +1 -0
- package/resources/vault-provider-configs.js +99 -0
- package/resources/vault-provider-configs.js.map +1 -0
- package/resources/vault-provider-configs.mjs +95 -0
- package/resources/vault-provider-configs.mjs.map +1 -0
- package/resources/vaults/items.d.mts +296 -38
- package/resources/vaults/items.d.mts.map +1 -1
- package/resources/vaults/items.d.ts +296 -38
- package/resources/vaults/items.d.ts.map +1 -1
- package/resources/vaults/items.js +86 -4
- package/resources/vaults/items.js.map +1 -1
- package/resources/vaults/items.mjs +86 -4
- package/resources/vaults/items.mjs.map +1 -1
- package/resources/vaults/vaults.d.mts +31 -2
- package/resources/vaults/vaults.d.mts.map +1 -1
- package/resources/vaults/vaults.d.ts +31 -2
- package/resources/vaults/vaults.d.ts.map +1 -1
- package/resources/vaults/vaults.js +31 -2
- package/resources/vaults/vaults.js.map +1 -1
- package/resources/vaults/vaults.mjs +31 -2
- package/resources/vaults/vaults.mjs.map +1 -1
- package/src/client.ts +19 -0
- package/src/lib/browser-routing.ts +27 -6
- package/src/resources/browsers/telemetry.ts +5 -2
- package/src/resources/config-registry/config-registry.ts +15 -7
- package/src/resources/index.ts +8 -0
- package/src/resources/invocations.ts +44 -15
- package/src/resources/organization/entitlements.ts +23 -0
- package/src/resources/organization/limits.ts +12 -1
- package/src/resources/proxies.ts +36 -18
- package/src/resources/vault-provider-configs.ts +250 -0
- package/src/resources/vaults/items.ts +333 -39
- package/src/resources/vaults/vaults.ts +31 -2
- package/src/version.ts +1 -1
- package/version.d.mts +1 -1
- package/version.d.mts.map +1 -1
- package/version.d.ts +1 -1
- package/version.d.ts.map +1 -1
- package/version.js +1 -1
- package/version.js.map +1 -1
- package/version.mjs +1 -1
- package/version.mjs.map +1 -1
|
@@ -14,6 +14,13 @@ export class Items extends APIResource {
|
|
|
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
16
|
* instead of a partial item.
|
|
17
|
+
*
|
|
18
|
+
* @example
|
|
19
|
+
* ```ts
|
|
20
|
+
* const vaultItem = await client.vaults.items.retrieve('x', {
|
|
21
|
+
* id_or_name: 'id_or_name',
|
|
22
|
+
* });
|
|
23
|
+
* ```
|
|
17
24
|
*/
|
|
18
25
|
retrieve(key: string, params: ItemRetrieveParams, options?: RequestOptions): APIPromise<VaultItem> {
|
|
19
26
|
const { id_or_name, ...query } = params;
|
|
@@ -21,7 +28,31 @@ export class Items extends APIResource {
|
|
|
21
28
|
}
|
|
22
29
|
|
|
23
30
|
/**
|
|
24
|
-
*
|
|
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.
|
|
38
|
+
*
|
|
39
|
+
* @example
|
|
40
|
+
* ```ts
|
|
41
|
+
* const vaultItem = await client.vaults.items.update('x', {
|
|
42
|
+
* id_or_name: 'id_or_name',
|
|
43
|
+
* spec: {
|
|
44
|
+
* provider: 'link',
|
|
45
|
+
* wallet: 'link-wallet',
|
|
46
|
+
* payment_method_id: 'pm_example',
|
|
47
|
+
* amount: 3000,
|
|
48
|
+
* currency: 'usd',
|
|
49
|
+
* merchant_name: 'Example Store',
|
|
50
|
+
* merchant_url: 'https://store.example.com',
|
|
51
|
+
* context:
|
|
52
|
+
* 'The order total changed to USD 30.00 including shipping and taxes for one notebook. Update this unapproved request rather than creating a second payment.',
|
|
53
|
+
* },
|
|
54
|
+
* });
|
|
55
|
+
* ```
|
|
25
56
|
*/
|
|
26
57
|
update(key: string, params: ItemUpdateParams, options?: RequestOptions): APIPromise<VaultItem> {
|
|
27
58
|
const { id_or_name, ...body } = params;
|
|
@@ -30,13 +61,29 @@ export class Items extends APIResource {
|
|
|
30
61
|
|
|
31
62
|
/**
|
|
32
63
|
* List vault items without secret values
|
|
64
|
+
*
|
|
65
|
+
* @example
|
|
66
|
+
* ```ts
|
|
67
|
+
* const vaultItems = await client.vaults.items.list(
|
|
68
|
+
* 'id_or_name',
|
|
69
|
+
* );
|
|
70
|
+
* ```
|
|
33
71
|
*/
|
|
34
72
|
list(idOrName: string, options?: RequestOptions): APIPromise<ItemListResponse> {
|
|
35
73
|
return this._client.get(path`/vaults/${idOrName}/items`, options);
|
|
36
74
|
}
|
|
37
75
|
|
|
38
76
|
/**
|
|
39
|
-
*
|
|
77
|
+
* Unresolved payment operations block deletion, including operations on child
|
|
78
|
+
* cards of a wallet. Reconcile the original attempt with the provider or support
|
|
79
|
+
* first; deleting or recreating an item is not proof that a payment did not occur.
|
|
80
|
+
*
|
|
81
|
+
* @example
|
|
82
|
+
* ```ts
|
|
83
|
+
* await client.vaults.items.delete('x', {
|
|
84
|
+
* id_or_name: 'id_or_name',
|
|
85
|
+
* });
|
|
86
|
+
* ```
|
|
40
87
|
*/
|
|
41
88
|
delete(key: string, params: ItemDeleteParams, options?: RequestOptions): APIPromise<void> {
|
|
42
89
|
const { id_or_name } = params;
|
|
@@ -48,6 +95,14 @@ export class Items extends APIResource {
|
|
|
48
95
|
|
|
49
96
|
/**
|
|
50
97
|
* List immutable audit events for a vault item
|
|
98
|
+
*
|
|
99
|
+
* @example
|
|
100
|
+
* ```ts
|
|
101
|
+
* const vaultItemEvents = await client.vaults.items.events(
|
|
102
|
+
* 'key',
|
|
103
|
+
* { id_or_name: 'id_or_name' },
|
|
104
|
+
* );
|
|
105
|
+
* ```
|
|
51
106
|
*/
|
|
52
107
|
events(key: string, params: ItemEventsParams, options?: RequestOptions): APIPromise<ItemEventsResponse> {
|
|
53
108
|
const { id_or_name, ...query } = params;
|
|
@@ -57,7 +112,20 @@ export class Items extends APIResource {
|
|
|
57
112
|
/**
|
|
58
113
|
* Retrieve the item first and invoke only an operation listed in
|
|
59
114
|
* `available_operations`, following its natural-language description. Operations
|
|
60
|
-
* may call an external provider and
|
|
115
|
+
* may call an external provider and return updated state. Link cards advertise
|
|
116
|
+
* authorize. AgentCard cards are created with PUT and request approval when their
|
|
117
|
+
* aliases are used at checkout; they do not expose this operation. If
|
|
118
|
+
* spend-request creation is rate limited, returns HTTP 429 with code
|
|
119
|
+
* `spend_request_rate_limited`; stop and back off before retrying.
|
|
120
|
+
*
|
|
121
|
+
* @example
|
|
122
|
+
* ```ts
|
|
123
|
+
* const vaultItem =
|
|
124
|
+
* await client.vaults.items.performOperation('key', {
|
|
125
|
+
* id_or_name: 'id_or_name',
|
|
126
|
+
* type: 'authorize',
|
|
127
|
+
* });
|
|
128
|
+
* ```
|
|
61
129
|
*/
|
|
62
130
|
performOperation(
|
|
63
131
|
key: string,
|
|
@@ -69,7 +137,21 @@ export class Items extends APIResource {
|
|
|
69
137
|
}
|
|
70
138
|
|
|
71
139
|
/**
|
|
72
|
-
* Create
|
|
140
|
+
* Create an item under a key unique within its vault, or retrieve the existing
|
|
141
|
+
* item when its specification matches. An identical card PUT returns the existing
|
|
142
|
+
* card in any lifecycle state without polling the provider, reauthorizing,
|
|
143
|
+
* replacing aliases, or resetting recovery. Conflicting specifications return 409.
|
|
144
|
+
* Provider-specific authorization requirements and retry behavior are described in
|
|
145
|
+
* the item's request schema.
|
|
146
|
+
*
|
|
147
|
+
* @example
|
|
148
|
+
* ```ts
|
|
149
|
+
* const vaultItem = await client.vaults.items.upsert('x', {
|
|
150
|
+
* id_or_name: 'id_or_name',
|
|
151
|
+
* spec: { provider: 'link' },
|
|
152
|
+
* type: 'card',
|
|
153
|
+
* });
|
|
154
|
+
* ```
|
|
73
155
|
*/
|
|
74
156
|
upsert(key: string, params: ItemUpsertParams, options?: RequestOptions): APIPromise<VaultItem> {
|
|
75
157
|
const { id_or_name, ...body } = params;
|
|
@@ -142,14 +224,16 @@ export interface AgentcardCheckoutAuthorization {
|
|
|
142
224
|
}
|
|
143
225
|
|
|
144
226
|
/**
|
|
145
|
-
*
|
|
146
|
-
* for spec.merchant / spec.amount. The card stays ready after each authorization.
|
|
227
|
+
* Live payment card. Test-mode card creation is not supported.
|
|
147
228
|
*/
|
|
148
229
|
export type CardVaultItemSpec =
|
|
149
230
|
| CardVaultItemSpec.LinkCardVaultItemSpec
|
|
150
231
|
| CardVaultItemSpec.AgentCardCardVaultItemSpec;
|
|
151
232
|
|
|
152
233
|
export namespace CardVaultItemSpec {
|
|
234
|
+
/**
|
|
235
|
+
* Live payment card. Test-mode card creation is not supported.
|
|
236
|
+
*/
|
|
153
237
|
export interface LinkCardVaultItemSpec {
|
|
154
238
|
/**
|
|
155
239
|
* Integer amount in minor currency units.
|
|
@@ -173,12 +257,6 @@ export namespace CardVaultItemSpec {
|
|
|
173
257
|
|
|
174
258
|
provider: 'link';
|
|
175
259
|
|
|
176
|
-
/**
|
|
177
|
-
* Whether Link should return test credentials instead of a live payment
|
|
178
|
-
* credential.
|
|
179
|
-
*/
|
|
180
|
-
test: boolean;
|
|
181
|
-
|
|
182
260
|
/**
|
|
183
261
|
* Wallet item key used to mint this card.
|
|
184
262
|
*/
|
|
@@ -243,8 +321,9 @@ export namespace CardVaultItemSpec {
|
|
|
243
321
|
}
|
|
244
322
|
|
|
245
323
|
/**
|
|
246
|
-
* AgentCard reusable card.
|
|
247
|
-
*
|
|
324
|
+
* AgentCard reusable live payment card. Test-mode card creation is not supported.
|
|
325
|
+
* Each checkout creates an approval-gated authorization for spec.merchant /
|
|
326
|
+
* spec.amount. The card stays ready after each authorization.
|
|
248
327
|
*/
|
|
249
328
|
export interface AgentCardCardVaultItemSpec {
|
|
250
329
|
/**
|
|
@@ -280,7 +359,21 @@ export namespace CardVaultItemState {
|
|
|
280
359
|
export interface LinkCardState {
|
|
281
360
|
provider: 'link';
|
|
282
361
|
|
|
283
|
-
|
|
362
|
+
/**
|
|
363
|
+
* recovery_required means an original provider operation has an unresolved
|
|
364
|
+
* outcome. Do not retry, delete, or replace it. Known references may be observed
|
|
365
|
+
* safely, but unknown creation without an ID and uncertain card-material retrieval
|
|
366
|
+
* require manual reconciliation with the provider or support. There is no reset or
|
|
367
|
+
* caller-asserted reconciliation operation.
|
|
368
|
+
*/
|
|
369
|
+
status:
|
|
370
|
+
| 'requested'
|
|
371
|
+
| 'pending_authorization'
|
|
372
|
+
| 'ready'
|
|
373
|
+
| 'consumed'
|
|
374
|
+
| 'expired'
|
|
375
|
+
| 'declined'
|
|
376
|
+
| 'recovery_required';
|
|
284
377
|
|
|
285
378
|
aliases?: ItemsAPI.VaultCardAliases;
|
|
286
379
|
|
|
@@ -304,7 +397,13 @@ export namespace CardVaultItemState {
|
|
|
304
397
|
export interface AgentCardCardState {
|
|
305
398
|
provider: 'agentcard';
|
|
306
399
|
|
|
307
|
-
|
|
400
|
+
/**
|
|
401
|
+
* recovery_required means the original checkout outcome is unresolved. Do not
|
|
402
|
+
* retry, delete, or replace it. Known authorization IDs may be reconciled through
|
|
403
|
+
* provider observations; otherwise contact the provider or support for manual
|
|
404
|
+
* reconciliation. It does not mean declined or expired.
|
|
405
|
+
*/
|
|
406
|
+
status: 'requested' | 'ready' | 'pending_approval' | 'degraded' | 'recovery_required';
|
|
308
407
|
|
|
309
408
|
aliases?: ItemsAPI.VaultCardAliases;
|
|
310
409
|
|
|
@@ -358,9 +457,12 @@ export namespace VaultItem {
|
|
|
358
457
|
key: string;
|
|
359
458
|
|
|
360
459
|
/**
|
|
361
|
-
* AgentCard wallet.
|
|
362
|
-
*
|
|
363
|
-
*
|
|
460
|
+
* AgentCard wallet. Omit provider_config to use Kernel-managed credentials, or
|
|
461
|
+
* select a customer-owned configuration. Mode (sandbox vs live) is determined by
|
|
462
|
+
* the selected credential; there is no per-item test flag. Without user_id,
|
|
463
|
+
* creation returns a hosted enrollment action and Kernel polls until the user
|
|
464
|
+
* connects. user_id may only reference a user already enrolled by a wallet in this
|
|
465
|
+
* organization under the same configuration.
|
|
364
466
|
*/
|
|
365
467
|
spec: ItemsAPI.WalletVaultItemSpec;
|
|
366
468
|
|
|
@@ -424,8 +526,7 @@ export namespace VaultItem {
|
|
|
424
526
|
key: string;
|
|
425
527
|
|
|
426
528
|
/**
|
|
427
|
-
*
|
|
428
|
-
* for spec.merchant / spec.amount. The card stays ready after each authorization.
|
|
529
|
+
* Live payment card. Test-mode card creation is not supported.
|
|
429
530
|
*/
|
|
430
531
|
spec: ItemsAPI.CardVaultItemSpec;
|
|
431
532
|
|
|
@@ -574,9 +675,12 @@ export namespace VaultPaymentMethod {
|
|
|
574
675
|
}
|
|
575
676
|
|
|
576
677
|
/**
|
|
577
|
-
* AgentCard wallet.
|
|
578
|
-
*
|
|
579
|
-
*
|
|
678
|
+
* AgentCard wallet. Omit provider_config to use Kernel-managed credentials, or
|
|
679
|
+
* select a customer-owned configuration. Mode (sandbox vs live) is determined by
|
|
680
|
+
* the selected credential; there is no per-item test flag. Without user_id,
|
|
681
|
+
* creation returns a hosted enrollment action and Kernel polls until the user
|
|
682
|
+
* connects. user_id may only reference a user already enrolled by a wallet in this
|
|
683
|
+
* organization under the same configuration.
|
|
580
684
|
*/
|
|
581
685
|
export type WalletVaultItemSpec =
|
|
582
686
|
| WalletVaultItemSpec.LinkWalletVaultItemSpec
|
|
@@ -591,28 +695,73 @@ export namespace WalletVaultItemSpec {
|
|
|
591
695
|
|
|
592
696
|
export namespace LinkWalletVaultItemSpec {
|
|
593
697
|
export interface Authorization {
|
|
594
|
-
client: Authorization.
|
|
698
|
+
client: Authorization.KernelManagedOAuthClient | Authorization.CustomerManagedOAuthClient;
|
|
595
699
|
|
|
596
700
|
method: 'oauth';
|
|
597
701
|
}
|
|
598
702
|
|
|
599
703
|
export namespace Authorization {
|
|
600
|
-
export interface
|
|
704
|
+
export interface KernelManagedOAuthClient {
|
|
601
705
|
type: 'kernel_managed';
|
|
602
706
|
}
|
|
707
|
+
|
|
708
|
+
export interface CustomerManagedOAuthClient {
|
|
709
|
+
/**
|
|
710
|
+
* Select a provider config by ID or name. Responses return the ID. Renaming a
|
|
711
|
+
* config does not change existing wallet bindings; a wallet cannot switch to a
|
|
712
|
+
* different config after creation.
|
|
713
|
+
*/
|
|
714
|
+
provider_config: CustomerManagedOAuthClient.ProviderConfig;
|
|
715
|
+
|
|
716
|
+
type: 'customer_managed';
|
|
717
|
+
}
|
|
718
|
+
|
|
719
|
+
export namespace CustomerManagedOAuthClient {
|
|
720
|
+
/**
|
|
721
|
+
* Select a provider config by ID or name. Responses return the ID. Renaming a
|
|
722
|
+
* config does not change existing wallet bindings; a wallet cannot switch to a
|
|
723
|
+
* different config after creation.
|
|
724
|
+
*/
|
|
725
|
+
export interface ProviderConfig {
|
|
726
|
+
id?: string;
|
|
727
|
+
|
|
728
|
+
name?: string;
|
|
729
|
+
}
|
|
730
|
+
}
|
|
603
731
|
}
|
|
604
732
|
}
|
|
605
733
|
|
|
606
734
|
/**
|
|
607
|
-
* AgentCard wallet.
|
|
608
|
-
*
|
|
609
|
-
*
|
|
735
|
+
* AgentCard wallet. Omit provider_config to use Kernel-managed credentials, or
|
|
736
|
+
* select a customer-owned configuration. Mode (sandbox vs live) is determined by
|
|
737
|
+
* the selected credential; there is no per-item test flag. Without user_id,
|
|
738
|
+
* creation returns a hosted enrollment action and Kernel polls until the user
|
|
739
|
+
* connects. user_id may only reference a user already enrolled by a wallet in this
|
|
740
|
+
* organization under the same configuration.
|
|
610
741
|
*/
|
|
611
742
|
export interface AgentCardWalletVaultItemSpec {
|
|
612
743
|
provider: 'agentcard';
|
|
613
744
|
|
|
745
|
+
/**
|
|
746
|
+
* Select an AgentCard configuration. The wallet's configuration cannot be changed
|
|
747
|
+
* after creation.
|
|
748
|
+
*/
|
|
749
|
+
provider_config?: AgentCardWalletVaultItemSpec.ProviderConfig;
|
|
750
|
+
|
|
614
751
|
user_id?: string;
|
|
615
752
|
}
|
|
753
|
+
|
|
754
|
+
export namespace AgentCardWalletVaultItemSpec {
|
|
755
|
+
/**
|
|
756
|
+
* Select an AgentCard configuration. The wallet's configuration cannot be changed
|
|
757
|
+
* after creation.
|
|
758
|
+
*/
|
|
759
|
+
export interface ProviderConfig {
|
|
760
|
+
id?: string;
|
|
761
|
+
|
|
762
|
+
name?: string;
|
|
763
|
+
}
|
|
764
|
+
}
|
|
616
765
|
}
|
|
617
766
|
|
|
618
767
|
export type WalletVaultItemState =
|
|
@@ -672,9 +821,7 @@ export interface ItemUpdateParams {
|
|
|
672
821
|
id_or_name: string;
|
|
673
822
|
|
|
674
823
|
/**
|
|
675
|
-
* Body param:
|
|
676
|
-
* authorization for spec.merchant / spec.amount. The card stays ready after each
|
|
677
|
-
* authorization.
|
|
824
|
+
* Body param: Live payment card. Test-mode card creation is not supported.
|
|
678
825
|
*/
|
|
679
826
|
spec: CardVaultItemSpec;
|
|
680
827
|
}
|
|
@@ -724,11 +871,16 @@ export declare namespace ItemUpsertParams {
|
|
|
724
871
|
id_or_name: string;
|
|
725
872
|
|
|
726
873
|
/**
|
|
727
|
-
* Body param: AgentCard wallet.
|
|
728
|
-
*
|
|
729
|
-
*
|
|
874
|
+
* Body param: AgentCard wallet. Omit provider_config to use Kernel-managed
|
|
875
|
+
* credentials, or select a customer-owned configuration. Mode (sandbox vs live) is
|
|
876
|
+
* determined by the selected credential; there is no per-item test flag. Without
|
|
877
|
+
* user_id, creation returns a hosted enrollment action and Kernel polls until the
|
|
878
|
+
* user connects. user_id may only reference a user already enrolled by a wallet in
|
|
879
|
+
* this organization under the same configuration.
|
|
730
880
|
*/
|
|
731
|
-
spec:
|
|
881
|
+
spec:
|
|
882
|
+
| WalletVaultItemRequest.LinkWalletVaultItemRequestSpec
|
|
883
|
+
| WalletVaultItemRequest.AgentCardWalletVaultItemSpec;
|
|
732
884
|
|
|
733
885
|
/**
|
|
734
886
|
* Body param
|
|
@@ -736,6 +888,150 @@ export declare namespace ItemUpsertParams {
|
|
|
736
888
|
type: 'wallet';
|
|
737
889
|
}
|
|
738
890
|
|
|
891
|
+
export namespace WalletVaultItemRequest {
|
|
892
|
+
export interface LinkWalletVaultItemRequestSpec {
|
|
893
|
+
/**
|
|
894
|
+
* Kernel starts and completes the user's Link authorization flow.
|
|
895
|
+
*/
|
|
896
|
+
authorization:
|
|
897
|
+
| LinkWalletVaultItemRequestSpec.KernelManagedLinkAuthorizationInput
|
|
898
|
+
| LinkWalletVaultItemRequestSpec.ImportedLinkAuthorizationInput;
|
|
899
|
+
|
|
900
|
+
provider: 'link';
|
|
901
|
+
}
|
|
902
|
+
|
|
903
|
+
export namespace LinkWalletVaultItemRequestSpec {
|
|
904
|
+
/**
|
|
905
|
+
* Kernel starts and completes the user's Link authorization flow.
|
|
906
|
+
*/
|
|
907
|
+
export interface KernelManagedLinkAuthorizationInput {
|
|
908
|
+
client: KernelManagedLinkAuthorizationInput.Client;
|
|
909
|
+
|
|
910
|
+
method: 'oauth';
|
|
911
|
+
}
|
|
912
|
+
|
|
913
|
+
export namespace KernelManagedLinkAuthorizationInput {
|
|
914
|
+
export interface Client {
|
|
915
|
+
type: 'kernel_managed';
|
|
916
|
+
}
|
|
917
|
+
}
|
|
918
|
+
|
|
919
|
+
/**
|
|
920
|
+
* The customer's backend completes Link OAuth and supplies the resulting tokens.
|
|
921
|
+
* For a new wallet, Kernel verifies the access token can access Link payment
|
|
922
|
+
* methods without consuming or rotating the refresh token. Valid access creates a
|
|
923
|
+
* wallet with state.status=connected. An expired, invalid, revoked, or
|
|
924
|
+
* insufficiently scoped access token returns 400 and no wallet is created. Refresh
|
|
925
|
+
* expired tokens in your backend before importing them. A failed import does not
|
|
926
|
+
* modify existing wallets. After successful import, Kernel owns subsequent
|
|
927
|
+
* refresh-token rotation; the customer must stop refreshing this grant. Import
|
|
928
|
+
* does not verify the refresh token: if it or the configured client credentials
|
|
929
|
+
* are rejected during a later refresh, the imported wallet becomes degraded. An
|
|
930
|
+
* unknown refresh outcome also leaves it degraded; Kernel does not retry a refresh
|
|
931
|
+
* token that may already have been consumed. There is no in-place reauthorization
|
|
932
|
+
* operation for an imported wallet. If this imported wallet's credentials become
|
|
933
|
+
* unusable, obtain a fresh Link OAuth grant in your backend and create a wallet
|
|
934
|
+
* under a NEW wallet key. Use the new wallet for NEW cards and payments, not to
|
|
935
|
+
* retry an old payment whose outcome is uncertain. This does not replace the old
|
|
936
|
+
* grant, rebind existing cards, or resolve their payment outcomes. Retain the old
|
|
937
|
+
* wallet and its cards while reconciling any uncertain payments with the provider
|
|
938
|
+
* or support. Do not repeat an uncertain payment on the new wallet, and do not
|
|
939
|
+
* treat deletion as evidence that it did not execute. Deletion of the old wallet
|
|
940
|
+
* can remain blocked by unresolved child cards. Repeating a create for the same
|
|
941
|
+
* item key and non-secret spec returns the existing wallet without replacing
|
|
942
|
+
* tokens, even if they have rotated or the wallet needs reconnection. ID and name
|
|
943
|
+
* references resolving to the same config are equivalent. A different config or
|
|
944
|
+
* non-secret spec returns 409. This create operation does not replace an existing
|
|
945
|
+
* grant.
|
|
946
|
+
*/
|
|
947
|
+
export interface ImportedLinkAuthorizationInput {
|
|
948
|
+
client: ImportedLinkAuthorizationInput.Client;
|
|
949
|
+
|
|
950
|
+
method: 'oauth';
|
|
951
|
+
|
|
952
|
+
/**
|
|
953
|
+
* Send the token pair from your backend. Both tokens must be from the same Link
|
|
954
|
+
* grant under the referenced client. Supply a currently valid access token. Kernel
|
|
955
|
+
* refreshes when needed after import and uses the expiry returned by Link for
|
|
956
|
+
* subsequent tokens. Tokens are never returned in wallet responses, events, or
|
|
957
|
+
* logs.
|
|
958
|
+
*/
|
|
959
|
+
tokens: ImportedLinkAuthorizationInput.Tokens;
|
|
960
|
+
}
|
|
961
|
+
|
|
962
|
+
export namespace ImportedLinkAuthorizationInput {
|
|
963
|
+
export interface Client {
|
|
964
|
+
/**
|
|
965
|
+
* Select a provider config by ID or name. Responses return the ID. Renaming a
|
|
966
|
+
* config does not change existing wallet bindings; a wallet cannot switch to a
|
|
967
|
+
* different config after creation.
|
|
968
|
+
*/
|
|
969
|
+
provider_config: Client.ProviderConfig;
|
|
970
|
+
|
|
971
|
+
type: 'customer_managed';
|
|
972
|
+
}
|
|
973
|
+
|
|
974
|
+
export namespace Client {
|
|
975
|
+
/**
|
|
976
|
+
* Select a provider config by ID or name. Responses return the ID. Renaming a
|
|
977
|
+
* config does not change existing wallet bindings; a wallet cannot switch to a
|
|
978
|
+
* different config after creation.
|
|
979
|
+
*/
|
|
980
|
+
export interface ProviderConfig {
|
|
981
|
+
id?: string;
|
|
982
|
+
|
|
983
|
+
name?: string;
|
|
984
|
+
}
|
|
985
|
+
}
|
|
986
|
+
|
|
987
|
+
/**
|
|
988
|
+
* Send the token pair from your backend. Both tokens must be from the same Link
|
|
989
|
+
* grant under the referenced client. Supply a currently valid access token. Kernel
|
|
990
|
+
* refreshes when needed after import and uses the expiry returned by Link for
|
|
991
|
+
* subsequent tokens. Tokens are never returned in wallet responses, events, or
|
|
992
|
+
* logs.
|
|
993
|
+
*/
|
|
994
|
+
export interface Tokens {
|
|
995
|
+
access_token: string;
|
|
996
|
+
|
|
997
|
+
refresh_token: string;
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
}
|
|
1001
|
+
|
|
1002
|
+
/**
|
|
1003
|
+
* AgentCard wallet. Omit provider_config to use Kernel-managed credentials, or
|
|
1004
|
+
* select a customer-owned configuration. Mode (sandbox vs live) is determined by
|
|
1005
|
+
* the selected credential; there is no per-item test flag. Without user_id,
|
|
1006
|
+
* creation returns a hosted enrollment action and Kernel polls until the user
|
|
1007
|
+
* connects. user_id may only reference a user already enrolled by a wallet in this
|
|
1008
|
+
* organization under the same configuration.
|
|
1009
|
+
*/
|
|
1010
|
+
export interface AgentCardWalletVaultItemSpec {
|
|
1011
|
+
provider: 'agentcard';
|
|
1012
|
+
|
|
1013
|
+
/**
|
|
1014
|
+
* Select an AgentCard configuration. The wallet's configuration cannot be changed
|
|
1015
|
+
* after creation.
|
|
1016
|
+
*/
|
|
1017
|
+
provider_config?: AgentCardWalletVaultItemSpec.ProviderConfig;
|
|
1018
|
+
|
|
1019
|
+
user_id?: string;
|
|
1020
|
+
}
|
|
1021
|
+
|
|
1022
|
+
export namespace AgentCardWalletVaultItemSpec {
|
|
1023
|
+
/**
|
|
1024
|
+
* Select an AgentCard configuration. The wallet's configuration cannot be changed
|
|
1025
|
+
* after creation.
|
|
1026
|
+
*/
|
|
1027
|
+
export interface ProviderConfig {
|
|
1028
|
+
id?: string;
|
|
1029
|
+
|
|
1030
|
+
name?: string;
|
|
1031
|
+
}
|
|
1032
|
+
}
|
|
1033
|
+
}
|
|
1034
|
+
|
|
739
1035
|
export interface CardVaultItemRequest {
|
|
740
1036
|
/**
|
|
741
1037
|
* Path param
|
|
@@ -743,9 +1039,7 @@ export declare namespace ItemUpsertParams {
|
|
|
743
1039
|
id_or_name: string;
|
|
744
1040
|
|
|
745
1041
|
/**
|
|
746
|
-
* Body param:
|
|
747
|
-
* authorization for spec.merchant / spec.amount. The card stays ready after each
|
|
748
|
-
* authorization.
|
|
1042
|
+
* Body param: Live payment card. Test-mode card creation is not supported.
|
|
749
1043
|
*/
|
|
750
1044
|
spec: CardVaultItemSpec;
|
|
751
1045
|
|
|
@@ -34,6 +34,11 @@ export class Vaults extends APIResource {
|
|
|
34
34
|
|
|
35
35
|
/**
|
|
36
36
|
* Get a vault
|
|
37
|
+
*
|
|
38
|
+
* @example
|
|
39
|
+
* ```ts
|
|
40
|
+
* const vault = await client.vaults.retrieve('id_or_name');
|
|
41
|
+
* ```
|
|
37
42
|
*/
|
|
38
43
|
retrieve(idOrName: string, options?: RequestOptions): APIPromise<Vault> {
|
|
39
44
|
return this._client.get(path`/vaults/${idOrName}`, options);
|
|
@@ -41,6 +46,14 @@ export class Vaults extends APIResource {
|
|
|
41
46
|
|
|
42
47
|
/**
|
|
43
48
|
* List vaults in the current project
|
|
49
|
+
*
|
|
50
|
+
* @example
|
|
51
|
+
* ```ts
|
|
52
|
+
* // Automatically fetches more pages as needed.
|
|
53
|
+
* for await (const vault of client.vaults.list()) {
|
|
54
|
+
* // ...
|
|
55
|
+
* }
|
|
56
|
+
* ```
|
|
44
57
|
*/
|
|
45
58
|
list(
|
|
46
59
|
query: VaultListParams | null | undefined = {},
|
|
@@ -50,7 +63,14 @@ export class Vaults extends APIResource {
|
|
|
50
63
|
}
|
|
51
64
|
|
|
52
65
|
/**
|
|
53
|
-
*
|
|
66
|
+
* Unresolved payment operations block deletion. Reconcile the original attempt
|
|
67
|
+
* with the provider or support first; deleting or recreating an item is not proof
|
|
68
|
+
* that a payment did not occur.
|
|
69
|
+
*
|
|
70
|
+
* @example
|
|
71
|
+
* ```ts
|
|
72
|
+
* await client.vaults.delete('id_or_name');
|
|
73
|
+
* ```
|
|
54
74
|
*/
|
|
55
75
|
delete(idOrName: string, options?: RequestOptions): APIPromise<void> {
|
|
56
76
|
return this._client.delete(path`/vaults/${idOrName}`, {
|
|
@@ -60,7 +80,16 @@ export class Vaults extends APIResource {
|
|
|
60
80
|
}
|
|
61
81
|
|
|
62
82
|
/**
|
|
63
|
-
*
|
|
83
|
+
* Free organizations can store up to 3 non-deleted vaults across all projects.
|
|
84
|
+
* Paid plans and active trials have no vault cap. Retrieving an existing vault by
|
|
85
|
+
* name succeeds even at the limit.
|
|
86
|
+
*
|
|
87
|
+
* @example
|
|
88
|
+
* ```ts
|
|
89
|
+
* const vault = await client.vaults.upsert({
|
|
90
|
+
* name: 'checkout',
|
|
91
|
+
* });
|
|
92
|
+
* ```
|
|
64
93
|
*/
|
|
65
94
|
upsert(body: VaultUpsertParams, options?: RequestOptions): APIPromise<Vault> {
|
|
66
95
|
return this._client.post('/vaults', { body, ...options });
|
package/src/version.ts
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.101.0'; // x-release-please-version
|
package/version.d.mts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.101.0";
|
|
2
2
|
//# sourceMappingURL=version.d.mts.map
|
package/version.d.mts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.mts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,YAAY,CAAC"}
|
package/version.d.ts
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export declare const VERSION = "0.
|
|
1
|
+
export declare const VERSION = "0.101.0";
|
|
2
2
|
//# sourceMappingURL=version.d.ts.map
|
package/version.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,
|
|
1
|
+
{"version":3,"file":"version.d.ts","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,eAAO,MAAM,OAAO,YAAY,CAAC"}
|
package/version.js
CHANGED
package/version.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.js","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":";;;AAAa,QAAA,OAAO,GAAG,SAAS,CAAC,CAAC,2BAA2B"}
|
package/version.mjs
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
|
-
export const VERSION = '0.
|
|
1
|
+
export const VERSION = '0.101.0'; // x-release-please-version
|
|
2
2
|
//# sourceMappingURL=version.mjs.map
|
package/version.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,
|
|
1
|
+
{"version":3,"file":"version.mjs","sourceRoot":"","sources":["src/version.ts"],"names":[],"mappings":"AAAA,MAAM,CAAC,MAAM,OAAO,GAAG,SAAS,CAAC,CAAC,2BAA2B"}
|