@onkernel/sdk 0.121.0 → 0.122.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 (67) hide show
  1. package/CHANGELOG.md +11 -0
  2. package/client.d.mts +2 -2
  3. package/client.d.mts.map +1 -1
  4. package/client.d.ts +2 -2
  5. package/client.d.ts.map +1 -1
  6. package/client.js.map +1 -1
  7. package/client.mjs.map +1 -1
  8. package/package.json +1 -1
  9. package/resources/browser-pools.d.mts +8 -4
  10. package/resources/browser-pools.d.mts.map +1 -1
  11. package/resources/browser-pools.d.ts +8 -4
  12. package/resources/browser-pools.d.ts.map +1 -1
  13. package/resources/browsers/browsers.d.mts +29 -26
  14. package/resources/browsers/browsers.d.mts.map +1 -1
  15. package/resources/browsers/browsers.d.ts +29 -26
  16. package/resources/browsers/browsers.d.ts.map +1 -1
  17. package/resources/browsers/browsers.js.map +1 -1
  18. package/resources/browsers/browsers.mjs.map +1 -1
  19. package/resources/browsers/telemetry.d.mts +80 -32
  20. package/resources/browsers/telemetry.d.mts.map +1 -1
  21. package/resources/browsers/telemetry.d.ts +80 -32
  22. package/resources/browsers/telemetry.d.ts.map +1 -1
  23. package/resources/config-registry/config-registry.d.mts +2 -2
  24. package/resources/config-registry/config-registry.d.ts +2 -2
  25. package/resources/index.d.mts +1 -1
  26. package/resources/index.d.mts.map +1 -1
  27. package/resources/index.d.ts +1 -1
  28. package/resources/index.d.ts.map +1 -1
  29. package/resources/index.js.map +1 -1
  30. package/resources/index.mjs.map +1 -1
  31. package/resources/proxies.d.mts +12 -12
  32. package/resources/proxies.d.ts +12 -12
  33. package/resources/vaults/index.d.mts +1 -1
  34. package/resources/vaults/index.d.mts.map +1 -1
  35. package/resources/vaults/index.d.ts +1 -1
  36. package/resources/vaults/index.d.ts.map +1 -1
  37. package/resources/vaults/index.js.map +1 -1
  38. package/resources/vaults/index.mjs.map +1 -1
  39. package/resources/vaults/items.d.mts +45 -6
  40. package/resources/vaults/items.d.mts.map +1 -1
  41. package/resources/vaults/items.d.ts +45 -6
  42. package/resources/vaults/items.d.ts.map +1 -1
  43. package/resources/vaults/items.js +2 -2
  44. package/resources/vaults/items.mjs +2 -2
  45. package/resources/vaults/vaults.d.mts +62 -1
  46. package/resources/vaults/vaults.d.mts.map +1 -1
  47. package/resources/vaults/vaults.d.ts +62 -1
  48. package/resources/vaults/vaults.d.ts.map +1 -1
  49. package/resources/vaults/vaults.js +19 -0
  50. package/resources/vaults/vaults.js.map +1 -1
  51. package/resources/vaults/vaults.mjs +19 -0
  52. package/resources/vaults/vaults.mjs.map +1 -1
  53. package/src/client.ts +2 -0
  54. package/src/resources/browser-pools.ts +8 -4
  55. package/src/resources/browsers/browsers.ts +29 -26
  56. package/src/resources/browsers/telemetry.ts +111 -32
  57. package/src/resources/config-registry/config-registry.ts +2 -2
  58. package/src/resources/index.ts +1 -0
  59. package/src/resources/proxies.ts +12 -12
  60. package/src/resources/vaults/index.ts +1 -0
  61. package/src/resources/vaults/items.ts +47 -6
  62. package/src/resources/vaults/vaults.ts +73 -0
  63. package/src/version.ts +1 -1
  64. package/version.d.mts +1 -1
  65. package/version.d.ts +1 -1
  66. package/version.js +1 -1
  67. package/version.mjs +1 -1
@@ -194,15 +194,19 @@ export namespace BrowserCallStack {
194
194
  }
195
195
 
196
196
  /**
197
- * A visible captcha challenge reached a terminal outcome.
197
+ * A captcha challenge reached an observed or inferred terminal outcome.
198
198
  */
199
199
  export interface BrowserCaptchaChallengeResultEvent {
200
200
  category: 'captcha';
201
201
 
202
202
  /**
203
- * Per-challenge payload. This event is emitted once per challenge and determines
204
- * its overall outcome; captcha_solve_started and captcha_solve_result describe
205
- * individual tasks and may occur multiple times within the challenge.
203
+ * An observed challenge emits one outcome across any number of solver tasks. For
204
+ * eligible providers without a widget observer, each successful token task emits
205
+ * an inferred solved result instead; multiple such results may belong to one
206
+ * challenge. Failed tasks and image_challenge rounds produce no inferred result.
207
+ * Exactly one of challenge_id or task_id is present: challenge_id on an observed
208
+ * result, task_id on an inferred one. A challenge whose tasks all fail produces
209
+ * task events only, so consumers fall back to captcha_solve_result for it.
206
210
  */
207
211
  data: BrowserCaptchaChallengeResultEvent.Data;
208
212
 
@@ -226,15 +230,17 @@ export interface BrowserCaptchaChallengeResultEvent {
226
230
 
227
231
  export namespace BrowserCaptchaChallengeResultEvent {
228
232
  /**
229
- * Per-challenge payload. This event is emitted once per challenge and determines
230
- * its overall outcome; captcha_solve_started and captcha_solve_result describe
231
- * individual tasks and may occur multiple times within the challenge.
233
+ * An observed challenge emits one outcome across any number of solver tasks. For
234
+ * eligible providers without a widget observer, each successful token task emits
235
+ * an inferred solved result instead; multiple such results may belong to one
236
+ * challenge. Failed tasks and image_challenge rounds produce no inferred result.
237
+ * Exactly one of challenge_id or task_id is present: challenge_id on an observed
238
+ * result, task_id on an inferred one. A challenge whose tasks all fail produces
239
+ * task events only, so consumers fall back to captcha_solve_result for it.
232
240
  */
233
241
  export interface Data {
234
242
  /**
235
- * Captcha kind. Enterprise reCAPTCHA variants are grouped into their version
236
- * bucket (recaptcha_v2 or recaptcha_v3), press-and-hold challenges use
237
- * press_and_hold, and unlisted kinds use other.
243
+ * @deprecated Deprecated: use captcha_provider.
238
244
  */
239
245
  captcha_type:
240
246
  | 'hcaptcha'
@@ -245,34 +251,67 @@ export namespace BrowserCaptchaChallengeResultEvent {
245
251
  | 'press_and_hold'
246
252
  | 'other';
247
253
 
254
+ /**
255
+ * Wall-clock duration from the challenge appearing to its terminal outcome,
256
+ * covering every solver attempt in between. For an inferred result, the duration
257
+ * of its solver task.
258
+ */
259
+ duration_ms: number;
260
+
261
+ /**
262
+ * Terminal outcome of a challenge. solved: the page observed the challenge clear
263
+ * after a solver attempt, or an inferred result reports a token for the whole
264
+ * widget without page observation. failure: a terminal solver failure occurred, or
265
+ * all attempts ended while the challenge remained. timeout: the challenge-level
266
+ * wait budget expired while the challenge remained. abandoned: observation ended
267
+ * without an attributable terminal challenge outcome. This includes a dismissed
268
+ * widget or page unload without a solved signal or terminal solver outcome, and a
269
+ * token appearing while multiple same-provider challenges are open, because the
270
+ * producer cannot attribute that token to this visible challenge. A
271
+ * captcha_solve_result with the same challenge_id may therefore report success
272
+ * while the challenge result reports abandoned. A solved challenge does not prove
273
+ * the site accepted the token or that the guarded action succeeded.
274
+ */
275
+ status: 'solved' | 'failure' | 'timeout' | 'abandoned';
276
+
277
+ /**
278
+ * Captcha product the challenge belongs to, not the service that solved it.
279
+ * Enterprise reCAPTCHA variants are grouped into their version bucket
280
+ * (recaptcha_v2 or recaptcha_v3), FunCaptcha uses arkose, press-and-hold
281
+ * challenges served by HUMAN (formerly PerimeterX) use human, and unlisted
282
+ * products use other.
283
+ */
284
+ captcha_provider?:
285
+ | 'hcaptcha'
286
+ | 'recaptcha_v2'
287
+ | 'recaptcha_v3'
288
+ | 'turnstile'
289
+ | 'geetest'
290
+ | 'arkose'
291
+ | 'human'
292
+ | 'other';
293
+
248
294
  /**
249
295
  * Opaque identifier shared by events for one visible challenge. An image-grid
250
296
  * captcha may create multiple task_id values for one challenge_id. The same value
251
297
  * may continue across a page reload when the challenge episode continues. It does
252
298
  * not indicate task ordering or challenge completion.
253
299
  */
254
- challenge_id: string;
300
+ challenge_id?: string;
255
301
 
256
302
  /**
257
- * Wall-clock duration from the challenge appearing to its terminal outcome,
258
- * covering every solver attempt in between.
303
+ * True when the relay derived this result from a successful token task without
304
+ * observing the page. An inferred result has task_id instead of challenge_id.
305
+ * Absent on page-observed results.
259
306
  */
260
- duration_ms: number;
307
+ inferred?: boolean;
261
308
 
262
309
  /**
263
- * Terminal outcome of the visible challenge. solved: the page observed the
264
- * challenge clear after a solver attempt. failure: a terminal solver failure
265
- * occurred, or all attempts ended while the challenge remained. timeout: the
266
- * challenge-level wait budget expired while the challenge remained. abandoned:
267
- * observation ended without an attributable terminal challenge outcome. This
268
- * includes a dismissed widget or page unload without a solved signal or terminal
269
- * solver outcome, and a token appearing while multiple same-provider challenges
270
- * are open, because the producer cannot attribute that token to this visible
271
- * challenge. A captcha_solve_result with the same challenge_id may therefore
272
- * report success while the challenge result reports abandoned. A solved challenge
273
- * does not prove the site accepted the token or that the guarded action succeeded.
310
+ * The task_id of the solver task an inferred result was derived from. Join on it
311
+ * to pair the result with that task's captcha_solve_started and
312
+ * captcha_solve_result. Present only when inferred is true.
274
313
  */
275
- status: 'solved' | 'failure' | 'timeout' | 'abandoned';
314
+ task_id?: string;
276
315
 
277
316
  /**
278
317
  * Host of the page where the challenge appeared.
@@ -315,9 +354,7 @@ export interface BrowserCaptchaSolveResultEvent {
315
354
  export namespace BrowserCaptchaSolveResultEvent {
316
355
  export interface Data {
317
356
  /**
318
- * Captcha kind. Enterprise reCAPTCHA variants are grouped into their version
319
- * bucket (recaptcha_v2 or recaptcha_v3), press-and-hold challenges use
320
- * press_and_hold, and unlisted kinds use other.
357
+ * @deprecated Deprecated: use captcha_provider and task_kind.
321
358
  */
322
359
  captcha_type:
323
360
  | 'hcaptcha'
@@ -343,6 +380,23 @@ export namespace BrowserCaptchaSolveResultEvent {
343
380
  */
344
381
  status: 'success' | 'failure' | 'timeout' | 'abandoned';
345
382
 
383
+ /**
384
+ * Captcha product the challenge belongs to, not the service that solved it.
385
+ * Enterprise reCAPTCHA variants are grouped into their version bucket
386
+ * (recaptcha_v2 or recaptcha_v3), FunCaptcha uses arkose, press-and-hold
387
+ * challenges served by HUMAN (formerly PerimeterX) use human, and unlisted
388
+ * products use other.
389
+ */
390
+ captcha_provider?:
391
+ | 'hcaptcha'
392
+ | 'recaptcha_v2'
393
+ | 'recaptcha_v3'
394
+ | 'turnstile'
395
+ | 'geetest'
396
+ | 'arkose'
397
+ | 'human'
398
+ | 'other';
399
+
346
400
  /**
347
401
  * Opaque identifier shared by events for one visible challenge. An image-grid
348
402
  * captcha may create multiple task_id values for one challenge_id. The same value
@@ -362,6 +416,11 @@ export namespace BrowserCaptchaSolveResultEvent {
362
416
  */
363
417
  task_id?: string;
364
418
 
419
+ /**
420
+ * What the solver task produces. Absent when the producer cannot tell.
421
+ */
422
+ task_kind?: 'token' | 'image_challenge' | 'press_and_hold';
423
+
365
424
  /**
366
425
  * Host of the page where the captcha was solved.
367
426
  */
@@ -415,9 +474,7 @@ export namespace BrowserCaptchaSolveStartedEvent {
415
474
  */
416
475
  export interface Data {
417
476
  /**
418
- * Captcha kind. Enterprise reCAPTCHA variants are grouped into their version
419
- * bucket (recaptcha_v2 or recaptcha_v3), press-and-hold challenges use
420
- * press_and_hold, and unlisted kinds use other.
477
+ * @deprecated Deprecated: use captcha_provider and task_kind.
421
478
  */
422
479
  captcha_type:
423
480
  | 'hcaptcha'
@@ -428,6 +485,23 @@ export namespace BrowserCaptchaSolveStartedEvent {
428
485
  | 'press_and_hold'
429
486
  | 'other';
430
487
 
488
+ /**
489
+ * Captcha product the challenge belongs to, not the service that solved it.
490
+ * Enterprise reCAPTCHA variants are grouped into their version bucket
491
+ * (recaptcha_v2 or recaptcha_v3), FunCaptcha uses arkose, press-and-hold
492
+ * challenges served by HUMAN (formerly PerimeterX) use human, and unlisted
493
+ * products use other.
494
+ */
495
+ captcha_provider?:
496
+ | 'hcaptcha'
497
+ | 'recaptcha_v2'
498
+ | 'recaptcha_v3'
499
+ | 'turnstile'
500
+ | 'geetest'
501
+ | 'arkose'
502
+ | 'human'
503
+ | 'other';
504
+
431
505
  /**
432
506
  * Opaque identifier shared by events for one visible challenge. An image-grid
433
507
  * captcha may create multiple task_id values for one challenge_id. The same value
@@ -441,6 +515,11 @@ export namespace BrowserCaptchaSolveStartedEvent {
441
515
  */
442
516
  task_id?: string;
443
517
 
518
+ /**
519
+ * What the solver task produces. Absent when the producer cannot tell.
520
+ */
521
+ task_kind?: 'token' | 'image_challenge' | 'press_and_hold';
522
+
444
523
  /**
445
524
  * Host of the page where the captcha is being solved. May be empty for solver
446
525
  * tasks that carry no page URL.
@@ -336,8 +336,8 @@ export namespace Proxy {
336
336
  */
337
337
  export interface IspProxyConfig {
338
338
  /**
339
- * ISO 3166 country code. Supported countries are US, GB, FR, DE, and SG. Defaults
340
- * to US if not provided.
339
+ * ISO 3166 country code. Supported countries are US, GB, FR, DE, SG, and KR.
340
+ * Defaults to US if not provided.
341
341
  */
342
342
  country?: string;
343
343
  }
@@ -210,6 +210,7 @@ export {
210
210
  export {
211
211
  Vaults,
212
212
  type Vault,
213
+ type VaultEncryptionKey,
213
214
  type VaultListParams,
214
215
  type VaultUpsertParams,
215
216
  type VaultsOffsetPagination,
@@ -166,8 +166,8 @@ export namespace ProxyCreateResponse {
166
166
  */
167
167
  export interface IspProxyConfig {
168
168
  /**
169
- * ISO 3166 country code. Supported countries are US, GB, FR, DE, and SG. Defaults
170
- * to US if not provided.
169
+ * ISO 3166 country code. Supported countries are US, GB, FR, DE, SG, and KR.
170
+ * Defaults to US if not provided.
171
171
  */
172
172
  country?: string;
173
173
  }
@@ -315,8 +315,8 @@ export namespace ProxyRetrieveResponse {
315
315
  */
316
316
  export interface IspProxyConfig {
317
317
  /**
318
- * ISO 3166 country code. Supported countries are US, GB, FR, DE, and SG. Defaults
319
- * to US if not provided.
318
+ * ISO 3166 country code. Supported countries are US, GB, FR, DE, SG, and KR.
319
+ * Defaults to US if not provided.
320
320
  */
321
321
  country?: string;
322
322
  }
@@ -464,8 +464,8 @@ export namespace ProxyUpdateResponse {
464
464
  */
465
465
  export interface IspProxyConfig {
466
466
  /**
467
- * ISO 3166 country code. Supported countries are US, GB, FR, DE, and SG. Defaults
468
- * to US if not provided.
467
+ * ISO 3166 country code. Supported countries are US, GB, FR, DE, SG, and KR.
468
+ * Defaults to US if not provided.
469
469
  */
470
470
  country?: string;
471
471
  }
@@ -613,8 +613,8 @@ export namespace ProxyListResponse {
613
613
  */
614
614
  export interface IspProxyConfig {
615
615
  /**
616
- * ISO 3166 country code. Supported countries are US, GB, FR, DE, and SG. Defaults
617
- * to US if not provided.
616
+ * ISO 3166 country code. Supported countries are US, GB, FR, DE, SG, and KR.
617
+ * Defaults to US if not provided.
618
618
  */
619
619
  country?: string;
620
620
  }
@@ -762,8 +762,8 @@ export namespace ProxyCheckResponse {
762
762
  */
763
763
  export interface IspProxyConfig {
764
764
  /**
765
- * ISO 3166 country code. Supported countries are US, GB, FR, DE, and SG. Defaults
766
- * to US if not provided.
765
+ * ISO 3166 country code. Supported countries are US, GB, FR, DE, SG, and KR.
766
+ * Defaults to US if not provided.
767
767
  */
768
768
  country?: string;
769
769
  }
@@ -891,8 +891,8 @@ export namespace ProxyCreateParams {
891
891
  */
892
892
  export interface IspProxyConfig {
893
893
  /**
894
- * ISO 3166 country code. Supported countries are US, GB, FR, DE, and SG. Defaults
895
- * to US if not provided.
894
+ * ISO 3166 country code. Supported countries are US, GB, FR, DE, SG, and KR.
895
+ * Defaults to US if not provided.
896
896
  */
897
897
  country?: string;
898
898
  }
@@ -75,6 +75,7 @@ export {
75
75
  export {
76
76
  Vaults,
77
77
  type Vault,
78
+ type VaultEncryptionKey,
78
79
  type VaultListParams,
79
80
  type VaultUpsertParams,
80
81
  type VaultsOffsetPagination,
@@ -146,8 +146,8 @@ export class Items extends APIResource {
146
146
  * return 400 (invalid request or targets), 403 (access or destination denied), 404
147
147
  * (resource not found), or 409 (item or browser not ready). Once writing starts,
148
148
  * known partial failures and indeterminate field outcomes return 200 with status
149
- * `failed` or `unknown`, not an automatic-retry signal. A transport error may
150
- * leave the outcome unknown; do not automatically retry.
149
+ * `failed` or `unknown`. Fill never submits the page, so it is safe to retry after
150
+ * a failure, an `unknown` outcome, or a transport error.
151
151
  *
152
152
  * @example
153
153
  * ```ts
@@ -769,6 +769,22 @@ export interface CredentialVaultFieldInput {
769
769
  */
770
770
  type: CredentialVaultFieldType;
771
771
 
772
+ /**
773
+ * Alternative to value for custom credential collection web apps. Use this only if
774
+ * you run your own credential collection web app and want values encrypted in the
775
+ * browser, sent to your backend still encrypted, and forwarded to Kernel's API
776
+ * still encrypted. In every other case, including server-side code that already
777
+ * holds the plaintext, use value. The field's value encrypted client-side as a
778
+ * compact JWE with alg ECDH-ES and enc A256GCM to the key from GET
779
+ * /vaults/{id_or_name}/encryption_key, with that key's kid in the protected
780
+ * header. Compression is not supported. The decrypted value follows the same rules
781
+ * as value, including that an empty string clears the field on update. A kid that
782
+ * is not this vault's key returns 400 encryption_key_mismatch; fetch the key again
783
+ * and re-encrypt. Other malformed or undecryptable values return 400
784
+ * invalid_request. The whole request body is limited to 128 KiB.
785
+ */
786
+ encrypted_value?: string;
787
+
772
788
  /**
773
789
  * Optional human-readable display label. It is returned as non-secret metadata and
774
790
  * never affects value keys, updates, or browser fills. Use single-line, trimmed
@@ -791,7 +807,9 @@ export interface CredentialVaultFieldInput {
791
807
  /**
792
808
  * Optional initial value satisfying the declared type, at most 16 KiB in UTF-8
793
809
  * bytes. Omit to leave unset; null and empty strings are rejected on creation.
794
- * Sensitive values are encrypted and never copied into the returned spec.
810
+ * Sensitive values are encrypted and never copied into the returned spec. Use this
811
+ * unless your own credential collection web app encrypts values in the browser;
812
+ * mutually exclusive with encrypted_value.
795
813
  */
796
814
  value?: string;
797
815
  }
@@ -819,7 +837,28 @@ export interface CredentialVaultFieldState {
819
837
  */
820
838
  export type CredentialVaultFieldType = 'text' | 'email' | 'password' | 'totp';
821
839
 
840
+ /**
841
+ * Set exactly one of value or encrypted_value. Use value unless the update comes
842
+ * from your own credential collection web app that encrypts values in the browser;
843
+ * see encrypted_value.
844
+ */
822
845
  export interface CredentialVaultFieldUpdate {
846
+ /**
847
+ * Alternative to value for custom credential collection web apps. Use this only if
848
+ * you run your own credential collection web app and want values encrypted in the
849
+ * browser, sent to your backend still encrypted, and forwarded to Kernel's API
850
+ * still encrypted. In every other case, including server-side code that already
851
+ * holds the plaintext, use value. The field's value encrypted client-side as a
852
+ * compact JWE with alg ECDH-ES and enc A256GCM to the key from GET
853
+ * /vaults/{id_or_name}/encryption_key, with that key's kid in the protected
854
+ * header. Compression is not supported. The decrypted value follows the same rules
855
+ * as value, including that an empty string clears the field on update. A kid that
856
+ * is not this vault's key returns 400 encryption_key_mismatch; fetch the key again
857
+ * and re-encrypt. Other malformed or undecryptable values return 400
858
+ * invalid_request. The whole request body is limited to 128 KiB.
859
+ */
860
+ encrypted_value?: string;
861
+
823
862
  /**
824
863
  * Replacement value (at most 16 KiB in UTF-8 bytes), or null or an empty string to
825
864
  * immediately clear the stored value. Clearing a required form-supported field
@@ -828,7 +867,7 @@ export interface CredentialVaultFieldUpdate {
828
867
  * seed, never a current code. Clearing a required totp field returns 400 because
829
868
  * it cannot be collected in a form.
830
869
  */
831
- value: string | null;
870
+ value?: string | null;
832
871
  }
833
872
 
834
873
  export interface CredentialVaultItem {
@@ -1067,8 +1106,10 @@ export interface CredentialVaultItemUpdateRequest {
1067
1106
  * atomic: previously filled fields are not rolled back. Never submit the form or
1068
1107
  * click buttons, though input/change events may trigger site behavior. Link and
1069
1108
  * Kernel cards use fill for browser checkout and do not expose aliases or support
1070
- * egress substitution. Do not automatically retry a failed or indeterminate
1071
- * operation.
1109
+ * egress substitution. Fill does not consume the item, so a failed or
1110
+ * indeterminate fill is safe to retry; a retry rewrites the same fields. A retry
1111
+ * right after an indeterminate fill may wait up to 15 seconds for the earlier
1112
+ * attempt's browser lock to expire.
1072
1113
  *
1073
1114
  * Secret values are never returned or included in operation logs, traces, audit
1074
1115
  * events, or error details. This does not prevent an agent with unrestricted
@@ -132,6 +132,26 @@ export class Vaults extends APIResource {
132
132
  });
133
133
  }
134
134
 
135
+ /**
136
+ * Returns the public key that custom credential collection web apps use to encrypt
137
+ * values in the browser. Use this only if you run your own credential collection
138
+ * web app and want values encrypted in the browser, sent to your backend still
139
+ * encrypted, and forwarded to Kernel's API still encrypted. In every other case,
140
+ * including server-side code that already holds the plaintext, use value. The page
141
+ * encrypts each value to this key, your backend forwards the ciphertext unchanged
142
+ * as encrypted_value when creating or updating a credential item in this vault,
143
+ * and Kernel decrypts it.
144
+ *
145
+ * @example
146
+ * ```ts
147
+ * const vaultEncryptionKey =
148
+ * await client.vaults.retrieveEncryptionKey('id_or_name');
149
+ * ```
150
+ */
151
+ retrieveEncryptionKey(idOrName: string, options?: RequestOptions): APIPromise<VaultEncryptionKey> {
152
+ return this._client.get(path`/vaults/${idOrName}/encryption_key`, options);
153
+ }
154
+
135
155
  /**
136
156
  * Free organizations can store up to 3 non-deleted vaults across all projects.
137
157
  * Paid plans and active trials have no vault cap. Retrieving an existing vault by
@@ -164,6 +184,58 @@ export interface Vault {
164
184
  updated_at: string;
165
185
  }
166
186
 
187
+ /**
188
+ * Public key for encrypted_value on credential fields. Use this only if you run
189
+ * your own credential collection web app and want values encrypted in the browser,
190
+ * sent to your backend still encrypted, and forwarded to Kernel's API still
191
+ * encrypted. In every other case, including server-side code that already holds
192
+ * the plaintext, use value. Each vault has its own key; a value encrypted for one
193
+ * vault is rejected by every other vault. The key is created on first request and
194
+ * stays the same for the vault's lifetime, so it may be cached.
195
+ */
196
+ export interface VaultEncryptionKey {
197
+ /**
198
+ * JWE key management algorithm.
199
+ */
200
+ alg: 'ECDH-ES';
201
+
202
+ /**
203
+ * JWE content encryption algorithm.
204
+ */
205
+ enc: 'A256GCM';
206
+
207
+ /**
208
+ * P-256 public key in JWK form.
209
+ */
210
+ jwk: VaultEncryptionKey.Jwk;
211
+
212
+ /**
213
+ * Key ID. Set it as the kid protected header of every encrypted_value.
214
+ */
215
+ kid: string;
216
+ }
217
+
218
+ export namespace VaultEncryptionKey {
219
+ /**
220
+ * P-256 public key in JWK form.
221
+ */
222
+ export interface Jwk {
223
+ crv: 'P-256';
224
+
225
+ kty: 'EC';
226
+
227
+ /**
228
+ * Base64url-encoded x coordinate.
229
+ */
230
+ x: string;
231
+
232
+ /**
233
+ * Base64url-encoded y coordinate.
234
+ */
235
+ y: string;
236
+ }
237
+ }
238
+
167
239
  export interface VaultListParams extends OffsetPaginationParams {
168
240
  /**
169
241
  * Case-insensitive substring match against vault name. IDs match by exact value.
@@ -183,6 +255,7 @@ Vaults.Items = Items;
183
255
  export declare namespace Vaults {
184
256
  export {
185
257
  type Vault as Vault,
258
+ type VaultEncryptionKey as VaultEncryptionKey,
186
259
  type VaultsOffsetPagination as VaultsOffsetPagination,
187
260
  type VaultListParams as VaultListParams,
188
261
  type VaultUpsertParams as VaultUpsertParams,
package/src/version.ts CHANGED
@@ -1 +1 @@
1
- export const VERSION = '0.121.0'; // x-release-please-version
1
+ export const VERSION = '0.122.0'; // x-release-please-version
package/version.d.mts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.121.0";
1
+ export declare const VERSION = "0.122.0";
2
2
  //# sourceMappingURL=version.d.mts.map
package/version.d.ts CHANGED
@@ -1,2 +1,2 @@
1
- export declare const VERSION = "0.121.0";
1
+ export declare const VERSION = "0.122.0";
2
2
  //# sourceMappingURL=version.d.ts.map
package/version.js CHANGED
@@ -1,5 +1,5 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
3
  exports.VERSION = void 0;
4
- exports.VERSION = '0.121.0'; // x-release-please-version
4
+ exports.VERSION = '0.122.0'; // x-release-please-version
5
5
  //# sourceMappingURL=version.js.map
package/version.mjs CHANGED
@@ -1,2 +1,2 @@
1
- export const VERSION = '0.121.0'; // x-release-please-version
1
+ export const VERSION = '0.122.0'; // x-release-please-version
2
2
  //# sourceMappingURL=version.mjs.map