@distilled.cloud/steel 1.0.0-rc.19 → 1.0.0-rc.21

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 (91) hide show
  1. package/README.md +9 -6
  2. package/lib/.lazy.json +1 -1
  3. package/lib/_bundle/sdk.js +1 -1
  4. package/lib/_bundle/sdk.js.map +1 -1
  5. package/lib/credentials.d.ts +8 -3
  6. package/lib/credentials.d.ts.map +1 -1
  7. package/lib/errors.d.ts +12 -8
  8. package/lib/errors.d.ts.map +1 -1
  9. package/lib/errors.js +1 -1
  10. package/lib/index.d.ts +2 -3
  11. package/lib/index.d.ts.map +1 -1
  12. package/lib/index.js +0 -1
  13. package/lib/pagination.d.ts.map +1 -1
  14. package/lib/protocol.d.ts +9 -12
  15. package/lib/protocol.d.ts.map +1 -1
  16. package/lib/retry.d.ts.map +1 -1
  17. package/lib/services/api_keys.d.ts +38 -0
  18. package/lib/services/api_keys.d.ts.map +1 -1
  19. package/lib/services/api_keys.js +1 -1
  20. package/lib/services/api_keys.js.map +1 -1
  21. package/lib/services/auth.d.ts.map +1 -1
  22. package/lib/services/auth.js +1 -1
  23. package/lib/services/auth.js.map +1 -1
  24. package/lib/services/browser_tools.d.ts +35 -0
  25. package/lib/services/browser_tools.d.ts.map +1 -1
  26. package/lib/services/browser_tools.js +1 -1
  27. package/lib/services/browser_tools.js.map +1 -1
  28. package/lib/services/captchas.d.ts +32 -0
  29. package/lib/services/captchas.d.ts.map +1 -1
  30. package/lib/services/captchas.js +1 -1
  31. package/lib/services/captchas.js.map +1 -1
  32. package/lib/services/credentials.d.ts +54 -0
  33. package/lib/services/credentials.d.ts.map +1 -1
  34. package/lib/services/credentials.js +1 -1
  35. package/lib/services/credentials.js.map +1 -1
  36. package/lib/services/extensions.d.ts +47 -1
  37. package/lib/services/extensions.d.ts.map +1 -1
  38. package/lib/services/extensions.js +1 -1
  39. package/lib/services/extensions.js.map +1 -1
  40. package/lib/services/files.d.ts +57 -3
  41. package/lib/services/files.d.ts.map +1 -1
  42. package/lib/services/files.js +1 -1
  43. package/lib/services/files.js.map +1 -1
  44. package/lib/services/index.d.ts +2 -0
  45. package/lib/services/index.d.ts.map +1 -1
  46. package/lib/services/index.js +2 -0
  47. package/lib/services/profiles.d.ts +64 -5
  48. package/lib/services/profiles.d.ts.map +1 -1
  49. package/lib/services/profiles.js +1 -1
  50. package/lib/services/profiles.js.map +1 -1
  51. package/lib/services/projects.d.ts +32 -0
  52. package/lib/services/projects.d.ts.map +1 -1
  53. package/lib/services/projects.js +1 -1
  54. package/lib/services/projects.js.map +1 -1
  55. package/lib/services/secret_connections.d.ts +233 -0
  56. package/lib/services/secret_connections.d.ts.map +1 -0
  57. package/lib/services/secret_connections.js +2 -0
  58. package/lib/services/secret_connections.js.map +1 -0
  59. package/lib/services/sessions.d.ts +526 -233
  60. package/lib/services/sessions.d.ts.map +1 -1
  61. package/lib/services/sessions.js +50 -41
  62. package/lib/services/sessions.js.map +1 -1
  63. package/lib/services/vaults.d.ts +149 -0
  64. package/lib/services/vaults.d.ts.map +1 -0
  65. package/lib/services/vaults.js +2 -0
  66. package/lib/services/vaults.js.map +1 -0
  67. package/lib/services.lazy/index.js +2 -2
  68. package/lib/services.lazy/secret_connections.js +1 -0
  69. package/lib/services.lazy/sessions.js +2 -2
  70. package/lib/services.lazy/vaults.js +1 -0
  71. package/lib/traits.d.ts.map +1 -1
  72. package/package.json +5 -5
  73. package/src/credentials.ts +18 -12
  74. package/src/errors.ts +13 -5
  75. package/src/index.ts +2 -3
  76. package/src/protocol.ts +18 -30
  77. package/src/services/api_keys.ts +87 -7
  78. package/src/services/auth.ts +3 -2
  79. package/src/services/browser_tools.ts +101 -28
  80. package/src/services/captchas.ts +85 -17
  81. package/src/services/credentials.ts +129 -25
  82. package/src/services/extensions.ts +136 -34
  83. package/src/services/files.ts +172 -58
  84. package/src/services/index.ts +2 -0
  85. package/src/services/profiles.ts +198 -60
  86. package/src/services/projects.ts +79 -12
  87. package/src/services/secret_connections.ts +538 -0
  88. package/src/services/sessions.ts +1384 -794
  89. package/src/services/vaults.ts +369 -0
  90. package/lib/index.lazy.js +0 -7
  91. package/lib/index.lazy.js.map +0 -1
@@ -4,7 +4,7 @@ import * as C from "@distilled.cloud/core/category";
4
4
  import * as S from "@distilled.cloud/core/schema-lite";
5
5
  import * as __L from "@distilled.cloud/core/schema-lite";
6
6
  import type * as Redacted from "effect/Redacted";
7
- import { UnknownSteelError } from "../errors.ts";
7
+ import { SteelServiceErrors } from "../errors.ts";
8
8
  import { SteelProtocol, type SteelOpError, type SteelOpContext } from "../protocol.ts";
9
9
  import * as Retry from "../retry.ts";
10
10
  import * as T from "../traits.ts";
@@ -30,33 +30,58 @@ export class BadRequest
30
30
  /*@__PURE__*/ S.TaggedError<BadRequest>()("BadRequest", {
31
31
  code: S.Number,
32
32
  message: S.String,
33
+ body: /*@__PURE__*/ S.optional(
34
+ /*@__PURE__*/ S.Union([/*@__PURE__*/ S.suspend(() => __S(3, __c0, 3)), S.String]),
35
+ ),
36
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
33
37
  }).pipe(C.withBadRequestError),
34
38
  [{ status: 400 }],
35
- ) {}
39
+ )
40
+ {
41
+ declare readonly body?: ErrorResponse | string;
42
+ }
36
43
 
37
44
  export class Conflict
38
45
  extends /*@__PURE__*/ T.applyErrorMatchers(
39
46
  /*@__PURE__*/ S.TaggedError<Conflict>()("Conflict", {
40
47
  code: S.Number,
41
48
  message: S.String,
49
+ body: /*@__PURE__*/ S.optional(
50
+ /*@__PURE__*/ S.Union([/*@__PURE__*/ S.suspend(() => __S(3, __c0, 3)), S.String]),
51
+ ),
52
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
42
53
  }).pipe(C.withConflictError),
43
54
  [{ status: 409 }],
44
- ) {}
55
+ )
56
+ {
57
+ declare readonly body?: ErrorResponse | string;
58
+ }
45
59
 
46
60
  export class NotFound
47
61
  extends /*@__PURE__*/ T.applyErrorMatchers(
48
62
  /*@__PURE__*/ S.TaggedError<NotFound>()("NotFound", {
49
63
  code: S.Number,
50
64
  message: S.String,
65
+ body: /*@__PURE__*/ S.optional(
66
+ /*@__PURE__*/ S.Union([/*@__PURE__*/ S.suspend(() => __S(3, __c0, 3)), S.String]),
67
+ ),
68
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
51
69
  }).pipe(C.withBadRequestError),
52
70
  [{ status: 404 }],
53
- ) {}
71
+ )
72
+ {
73
+ declare readonly body?: ErrorResponse | string;
74
+ }
54
75
 
76
+ /** Canonical http(s) origins, besides `origin`, this credential may be filled on, such as its login host or identity provider (e.g. `https://login.example.com`). Only the credential's origin and these ever match a page, exactly; at most 20. */
77
+ export type CreateCredentialRequestAdditionalOriginsList = Array<string>;
55
78
  /** Value for the credential */
56
79
  export type CreateCredentialRequestValueMap = {
57
80
  [key: string]: string | Redacted.Redacted<string> | undefined;
58
81
  };
59
82
  export interface CreateCredentialRequest {
83
+ /** Canonical http(s) origins, besides `origin`, this credential may be filled on, such as its login host or identity provider (e.g. `https://login.example.com`). Only the credential's origin and these ever match a page, exactly; at most 20. */
84
+ additionalOrigins?: CreateCredentialRequestAdditionalOriginsList | undefined;
60
85
  /** Label for the credential */
61
86
  label?: string | undefined;
62
87
  /** The namespace the credential is stored against. Defaults to "default". */
@@ -68,7 +93,11 @@ export interface CreateCredentialRequest {
68
93
  /** Value for the credential */
69
94
  value: CreateCredentialRequestValueMap;
70
95
  }
96
+ /** Canonical http(s) origins, besides `origin`, this credential may be filled on, such as its login host or identity provider (e.g. `https://login.example.com`). Only the credential's origin and these ever match a page, exactly; at most 20. */
97
+ export type CredentialMetadataAdditionalOriginsList = Array<string>;
71
98
  export interface CredentialMetadata {
99
+ /** Canonical http(s) origins, besides `origin`, this credential may be filled on, such as its login host or identity provider (e.g. `https://login.example.com`). Only the credential's origin and these ever match a page, exactly; at most 20. */
100
+ additionalOrigins?: CredentialMetadataAdditionalOriginsList | undefined;
72
101
  /** Date and time the credential was created */
73
102
  createdAt: string;
74
103
  /** Label for the credential */
@@ -99,7 +128,11 @@ export interface ListCredentialsRequest {
99
128
  /** website origin the credential is for */
100
129
  origin?: string | undefined;
101
130
  }
131
+ /** Canonical http(s) origins, besides `origin`, this credential may be filled on, such as its login host or identity provider (e.g. `https://login.example.com`). Only the credential's origin and these ever match a page, exactly; at most 20. */
132
+ export type CredentialListCredentialsItemAdditionalOriginsList = Array<string>;
102
133
  export interface CredentialListCredentialsItem {
134
+ /** Canonical http(s) origins, besides `origin`, this credential may be filled on, such as its login host or identity provider (e.g. `https://login.example.com`). Only the credential's origin and these ever match a page, exactly; at most 20. */
135
+ additionalOrigins?: CredentialListCredentialsItemAdditionalOriginsList | undefined;
103
136
  /** Date and time the credential was created */
104
137
  createdAt: string;
105
138
  /** Label for the credential */
@@ -115,11 +148,15 @@ export type CredentialListCredentialsList = Array<CredentialListCredentialsItem>
115
148
  export interface CredentialList {
116
149
  credentials: CredentialListCredentialsList;
117
150
  }
151
+ /** Canonical http(s) origins, besides `origin`, this credential may be filled on, such as its login host or identity provider (e.g. `https://login.example.com`). Only the credential's origin and these ever match a page, exactly; at most 20. Replaces the current list; [] clears it. */
152
+ export type UpdateCredentialRequestAdditionalOriginsList = Array<string>;
118
153
  /** Value for the credential */
119
154
  export type UpdateCredentialRequestValueMap = {
120
155
  [key: string]: string | Redacted.Redacted<string> | undefined;
121
156
  };
122
157
  export interface UpdateCredentialRequest {
158
+ /** Canonical http(s) origins, besides `origin`, this credential may be filled on, such as its login host or identity provider (e.g. `https://login.example.com`). Only the credential's origin and these ever match a page, exactly; at most 20. Replaces the current list; [] clears it. */
159
+ additionalOrigins?: UpdateCredentialRequestAdditionalOriginsList | undefined;
123
160
  /** Label for the credential */
124
161
  label?: string | undefined;
125
162
  /** The namespace the credential is stored against. Defaults to "default". */
@@ -131,6 +168,33 @@ export interface UpdateCredentialRequest {
131
168
  /** Value for the credential */
132
169
  value?: UpdateCredentialRequestValueMap | undefined;
133
170
  }
171
+ export interface ErrorResponseContextItem {
172
+ keyword: string;
173
+ message: string;
174
+ params: unknown;
175
+ }
176
+ export type ErrorResponseContextList = Array<ErrorResponseContextItem>;
177
+ /** Structured data about the error for the caller, e.g. `candidates` for credential_ambiguous. Never contains secret values. */
178
+ export type ErrorResponseDetailsMap = { [key: string]: unknown | undefined };
179
+ /** An error response from the API */
180
+ export interface ErrorResponse {
181
+ /** Stable machine-readable reason, e.g. 'budget_exceeded' or 'profile_not_ready'. Branch on this instead of parsing the message. */
182
+ code?: string | undefined;
183
+ context?: ErrorResponseContextList | undefined;
184
+ /** Structured data about the error for the caller, e.g. `candidates` for credential_ambiguous. Never contains secret values. */
185
+ details?: ErrorResponseDetailsMap | undefined;
186
+ error?: string | undefined;
187
+ linkToDocs?: string | undefined;
188
+ message: string;
189
+ /** The request field that caused the error, if any. */
190
+ param?: string | undefined;
191
+ /** Seconds to wait before retrying. Also sent as the Retry-After header. */
192
+ retryAfterSeconds?: number | undefined;
193
+ /** Whether the same request can succeed later without changes. False means fix the request or the account first. */
194
+ retryable?: boolean | undefined;
195
+ /** Where a person turns on the refused feature, e.g. verifying the account. Pass it to your user. */
196
+ unlockUrl?: string | undefined;
197
+ }
134
198
  export type CreateCredentialError = BadRequest | Conflict | SteelOpError;
135
199
  /** Stores credentials Encrypts and stores credentials for an origin */
136
200
  export const createCredential: API.OperationMethod<
@@ -139,9 +203,10 @@ export const createCredential: API.OperationMethod<
139
203
  CreateCredentialError,
140
204
  SteelOpContext
141
205
  > = /*@__PURE__*/ API.make(() => ({
142
- input: __S(0, __c0, 0) as any as S.Schema<CreateCredentialRequest>,
143
- output: __S(4, __c1, 0) as any as S.Schema<CredentialMetadata>,
144
- errors: [BadRequest, Conflict, UnknownSteelError],
206
+ input: __S(4, __c1, 0) as any as S.Schema<CreateCredentialRequest>,
207
+ output: __S(9, __c2, 1) as any as S.Schema<CredentialMetadata>,
208
+ errors: [BadRequest, Conflict],
209
+ serviceErrors: SteelServiceErrors,
145
210
  protocol: SteelProtocol,
146
211
  retry: Retry.Retry,
147
212
  telemetry: TELEMETRY,
@@ -156,9 +221,10 @@ export const deleteCredential: API.OperationMethod<
156
221
  DeleteCredentialError,
157
222
  SteelOpContext
158
223
  > = /*@__PURE__*/ API.make(() => ({
159
- input: __S(12, __c3, 0) as any as S.Schema<DeleteCredentialRequest>,
160
- output: __S(13, __c3, 1) as any as S.Schema<SuccessResponse>,
161
- errors: [NotFound, UnknownSteelError],
224
+ input: __S(16, __c4, 0) as any as S.Schema<DeleteCredentialRequest>,
225
+ output: __S(17, __c4, 1) as any as S.Schema<SuccessResponse>,
226
+ errors: [NotFound],
227
+ serviceErrors: SteelServiceErrors,
162
228
  protocol: SteelProtocol,
163
229
  retry: Retry.Retry,
164
230
  telemetry: TELEMETRY,
@@ -173,9 +239,10 @@ export const listCredentials: API.OperationMethod<
173
239
  ListCredentialsError,
174
240
  SteelOpContext
175
241
  > = /*@__PURE__*/ API.make(() => ({
176
- input: __S(16, __c4, 0) as any as S.Schema<ListCredentialsRequest>,
177
- output: __S(18, __c4, 2) as any as S.Schema<CredentialList>,
178
- errors: [BadRequest, NotFound, UnknownSteelError],
242
+ input: __S(20, __c5, 0) as any as S.Schema<ListCredentialsRequest>,
243
+ output: __S(22, __c5, 2) as any as S.Schema<CredentialList>,
244
+ errors: [BadRequest, NotFound],
245
+ serviceErrors: SteelServiceErrors,
179
246
  protocol: SteelProtocol,
180
247
  retry: Retry.Retry,
181
248
  telemetry: TELEMETRY,
@@ -190,9 +257,10 @@ export const updateCredential: API.OperationMethod<
190
257
  UpdateCredentialError,
191
258
  SteelOpContext
192
259
  > = /*@__PURE__*/ API.make(() => ({
193
- input: __S(20, __c5, 0) as any as S.Schema<UpdateCredentialRequest>,
194
- output: __S(4, __c1, 0) as any as S.Schema<CredentialMetadata>,
195
- errors: [BadRequest, NotFound, UnknownSteelError],
260
+ input: __S(24, __c6, 0) as any as S.Schema<UpdateCredentialRequest>,
261
+ output: __S(9, __c2, 1) as any as S.Schema<CredentialMetadata>,
262
+ errors: [BadRequest, NotFound],
263
+ serviceErrors: SteelServiceErrors,
196
264
  protocol: SteelProtocol,
197
265
  retry: Retry.Retry,
198
266
  telemetry: TELEMETRY,
@@ -205,20 +273,55 @@ function __c0(j: number): any {
205
273
  case 0:
206
274
  return S.suspend(() =>
207
275
  S.Struct({
276
+ keyword: S.String,
277
+ message: S.String,
278
+ params: S.Unknown,
279
+ }),
280
+ ).annotate({ identifier: "ErrorResponseContextItem" });
281
+ case 1:
282
+ return S.Array(__S(0, __c0, 0));
283
+ case 2:
284
+ return S.Record(S.String, S.Unknown);
285
+ case 3:
286
+ return S.suspend(() =>
287
+ S.Struct({
288
+ code: S.optional(S.String),
289
+ context: S.optional(__S(1, __c0, 1)),
290
+ details: S.optional(__S(2, __c0, 2)),
291
+ error: S.optional(S.String),
292
+ linkToDocs: S.optional(S.String),
293
+ message: S.String,
294
+ param: S.optional(S.String),
295
+ retryAfterSeconds: S.optional(S.Number),
296
+ retryable: S.optional(S.Boolean),
297
+ unlockUrl: S.optional(S.String),
298
+ }),
299
+ ).annotate({ identifier: "ErrorResponse" });
300
+ }
301
+ }
302
+ function __c1(j: number): any {
303
+ switch (j) {
304
+ case 0:
305
+ return S.suspend(() =>
306
+ S.Struct({
307
+ additionalOrigins: S.optional(__S(8, __c2, 0)),
208
308
  label: S.optional(S.String),
209
309
  namespace: S.optional(S.String),
210
310
  origin: S.optional(S.String),
211
311
  projectId: S.optional(S.String),
212
- value: __S(8, __c2, 0),
312
+ value: __S(12, __c3, 0),
213
313
  }).pipe(T.Http({ method: "POST", uri: "/v1/credentials", code: 200 })),
214
314
  ).annotate({ identifier: "CreateCredentialRequest" });
215
315
  }
216
316
  }
217
- function __c1(j: number): any {
317
+ function __c2(j: number): any {
218
318
  switch (j) {
219
319
  case 0:
320
+ return S.Array(S.String);
321
+ case 1:
220
322
  return S.suspend(() =>
221
323
  S.Struct({
324
+ additionalOrigins: S.optional(__S(8, __c2, 0)),
222
325
  createdAt: S.String,
223
326
  label: S.optional(S.String),
224
327
  namespace: S.optional(S.String),
@@ -228,13 +331,13 @@ function __c1(j: number): any {
228
331
  ).annotate({ identifier: "CredentialMetadata" });
229
332
  }
230
333
  }
231
- function __c2(j: number): any {
334
+ function __c3(j: number): any {
232
335
  switch (j) {
233
336
  case 0:
234
337
  return S.Record(S.String, /*@__PURE__*/ S.String.pipe(/*@__PURE__*/ T.SensitiveValue({})));
235
338
  }
236
339
  }
237
- function __c3(j: number): any {
340
+ function __c4(j: number): any {
238
341
  switch (j) {
239
342
  case 0:
240
343
  return S.suspend(() =>
@@ -252,7 +355,7 @@ function __c3(j: number): any {
252
355
  ).annotate({ identifier: "SuccessResponse" });
253
356
  }
254
357
  }
255
- function __c4(j: number): any {
358
+ function __c5(j: number): any {
256
359
  switch (j) {
257
360
  case 0:
258
361
  return S.suspend(() =>
@@ -263,25 +366,26 @@ function __c4(j: number): any {
263
366
  }).pipe(T.Http({ method: "GET", uri: "/v1/credentials", code: 200 })),
264
367
  ).annotate({ identifier: "ListCredentialsRequest" });
265
368
  case 1:
266
- return S.Array(__S(4, __c1, 0));
369
+ return S.Array(__S(9, __c2, 1));
267
370
  case 2:
268
371
  return S.suspend(() =>
269
372
  S.Struct({
270
- credentials: __S(17, __c4, 1),
373
+ credentials: __S(21, __c5, 1),
271
374
  }),
272
375
  ).annotate({ identifier: "CredentialList" });
273
376
  }
274
377
  }
275
- function __c5(j: number): any {
378
+ function __c6(j: number): any {
276
379
  switch (j) {
277
380
  case 0:
278
381
  return S.suspend(() =>
279
382
  S.Struct({
383
+ additionalOrigins: S.optional(__S(8, __c2, 0)),
280
384
  label: S.optional(S.String),
281
385
  namespace: S.optional(S.String),
282
386
  origin: S.optional(S.String),
283
387
  projectId: S.optional(S.String),
284
- value: S.optional(__S(8, __c2, 0)),
388
+ value: S.optional(__S(12, __c3, 0)),
285
389
  }).pipe(T.Http({ method: "PUT", uri: "/v1/credentials", code: 200 })),
286
390
  ).annotate({ identifier: "UpdateCredentialRequest" });
287
391
  }
@@ -1,9 +1,10 @@
1
1
  import * as API from "@distilled.cloud/core/api";
2
2
  import * as C from "@distilled.cloud/core/category";
3
+ import { BinaryStream } from "@distilled.cloud/core/protocol-rest";
3
4
  // AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-steel/specs/openapi.json). Do not edit.
4
5
  import * as S from "@distilled.cloud/core/schema-lite";
5
6
  import * as __L from "@distilled.cloud/core/schema-lite";
6
- import { UnknownSteelError } from "../errors.ts";
7
+ import { SteelServiceErrors } from "../errors.ts";
7
8
  import { SteelProtocol, type SteelOpError, type SteelOpContext } from "../protocol.ts";
8
9
  import * as Retry from "../retry.ts";
9
10
  import * as T from "../traits.ts";
@@ -30,36 +31,64 @@ export class BadRequest
30
31
  /*@__PURE__*/ S.TaggedError<BadRequest>()("BadRequest", {
31
32
  code: S.Number,
32
33
  message: S.String,
34
+ body: /*@__PURE__*/ S.optional(
35
+ /*@__PURE__*/ S.Union([/*@__PURE__*/ S.suspend(() => __S(3, __c0, 3)), S.String]),
36
+ ),
37
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
33
38
  }).pipe(C.withBadRequestError),
34
39
  [{ status: 400 }],
35
- ) {}
40
+ )
41
+ {
42
+ declare readonly body?: ErrorResponse | string;
43
+ }
36
44
 
37
45
  export class Conflict
38
46
  extends /*@__PURE__*/ T.applyErrorMatchers(
39
47
  /*@__PURE__*/ S.TaggedError<Conflict>()("Conflict", {
40
48
  code: S.Number,
41
49
  message: S.String,
50
+ body: /*@__PURE__*/ S.optional(
51
+ /*@__PURE__*/ S.Union([/*@__PURE__*/ S.suspend(() => __S(3, __c0, 3)), S.String]),
52
+ ),
53
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
42
54
  }).pipe(C.withConflictError),
43
55
  [{ status: 409 }],
44
- ) {}
56
+ )
57
+ {
58
+ declare readonly body?: ErrorResponse | string;
59
+ }
45
60
 
46
61
  export class NotFound
47
62
  extends /*@__PURE__*/ T.applyErrorMatchers(
48
63
  /*@__PURE__*/ S.TaggedError<NotFound>()("NotFound", {
49
64
  code: S.Number,
50
65
  message: S.String,
66
+ body: /*@__PURE__*/ S.optional(
67
+ /*@__PURE__*/ S.Union([/*@__PURE__*/ S.suspend(() => __S(3, __c0, 3)), S.String]),
68
+ ),
69
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
51
70
  }).pipe(C.withBadRequestError),
52
71
  [{ status: 404 }],
53
- ) {}
72
+ )
73
+ {
74
+ declare readonly body?: ErrorResponse | string;
75
+ }
54
76
 
55
77
  export class PayloadTooLarge
56
78
  extends /*@__PURE__*/ T.applyErrorMatchers(
57
79
  /*@__PURE__*/ S.TaggedError<PayloadTooLarge>()("PayloadTooLarge", {
58
80
  code: S.Number,
59
81
  message: S.String,
82
+ body: /*@__PURE__*/ S.optional(
83
+ /*@__PURE__*/ S.Union([/*@__PURE__*/ S.suspend(() => __S(3, __c0, 3)), S.String]),
84
+ ),
85
+ headers: /*@__PURE__*/ S.optional(/*@__PURE__*/ S.Record(S.String, S.String)),
60
86
  }).pipe(C.withBadRequestError),
61
87
  [{ status: 413 }],
62
- ) {}
88
+ )
89
+ {
90
+ declare readonly body?: ErrorResponse | string;
91
+ }
63
92
 
64
93
  export interface DeleteAllExtensionsRequest {}
65
94
  export interface DeleteResponse {
@@ -73,7 +102,11 @@ export interface DownloadExtensionRequest {
73
102
  /** Extension ID */
74
103
  extensionId: string;
75
104
  }
76
- export type DownloadExtensionResponse = Uint8Array;
105
+ export interface DownloadExtensionResponse {
106
+ body: BinaryStream;
107
+ /** Media type of the body, from the response's `Content-Type` header (e.g. `image/jpeg`). */
108
+ contentType?: string | undefined;
109
+ }
77
110
  export interface ListExtensionsRequest {}
78
111
  export interface ExtensionListExtensionsItem {
79
112
  /** Creation timestamp */
@@ -118,6 +151,33 @@ export interface UploadExtensionRequest {
118
151
  /** Extension URL */
119
152
  url?: string | undefined;
120
153
  }
154
+ export interface ErrorResponseContextItem {
155
+ keyword: string;
156
+ message: string;
157
+ params: unknown;
158
+ }
159
+ export type ErrorResponseContextList = Array<ErrorResponseContextItem>;
160
+ /** Structured data about the error for the caller, e.g. `candidates` for credential_ambiguous. Never contains secret values. */
161
+ export type ErrorResponseDetailsMap = { [key: string]: unknown | undefined };
162
+ /** An error response from the API */
163
+ export interface ErrorResponse {
164
+ /** Stable machine-readable reason, e.g. 'budget_exceeded' or 'profile_not_ready'. Branch on this instead of parsing the message. */
165
+ code?: string | undefined;
166
+ context?: ErrorResponseContextList | undefined;
167
+ /** Structured data about the error for the caller, e.g. `candidates` for credential_ambiguous. Never contains secret values. */
168
+ details?: ErrorResponseDetailsMap | undefined;
169
+ error?: string | undefined;
170
+ linkToDocs?: string | undefined;
171
+ message: string;
172
+ /** The request field that caused the error, if any. */
173
+ param?: string | undefined;
174
+ /** Seconds to wait before retrying. Also sent as the Retry-After header. */
175
+ retryAfterSeconds?: number | undefined;
176
+ /** Whether the same request can succeed later without changes. False means fix the request or the account first. */
177
+ retryable?: boolean | undefined;
178
+ /** Where a person turns on the refused feature, e.g. verifying the account. Pass it to your user. */
179
+ unlockUrl?: string | undefined;
180
+ }
121
181
  export type DeleteAllExtensionsError = BadRequest | SteelOpError;
122
182
  /** Delete all extensions Delete all extensions for the organization */
123
183
  export const deleteAllExtensions: API.OperationMethod<
@@ -126,9 +186,10 @@ export const deleteAllExtensions: API.OperationMethod<
126
186
  DeleteAllExtensionsError,
127
187
  SteelOpContext
128
188
  > = /*@__PURE__*/ API.make(() => ({
129
- input: __S(0, __c0, 0) as any as S.Schema<DeleteAllExtensionsRequest>,
130
- output: __S(4, __c1, 0) as any as S.Schema<DeleteResponse>,
131
- errors: [BadRequest, UnknownSteelError],
189
+ input: __S(4, __c1, 0) as any as S.Schema<DeleteAllExtensionsRequest>,
190
+ output: __S(8, __c2, 0) as any as S.Schema<DeleteResponse>,
191
+ errors: [BadRequest],
192
+ serviceErrors: SteelServiceErrors,
132
193
  protocol: SteelProtocol,
133
194
  retry: Retry.Retry,
134
195
  telemetry: TELEMETRY,
@@ -143,9 +204,10 @@ export const deleteExtension: API.OperationMethod<
143
204
  DeleteExtensionError,
144
205
  SteelOpContext
145
206
  > = /*@__PURE__*/ API.make(() => ({
146
- input: __S(8, __c2, 0) as any as S.Schema<DeleteExtensionRequest>,
147
- output: __S(4, __c1, 0) as any as S.Schema<DeleteResponse>,
148
- errors: [BadRequest, NotFound, UnknownSteelError],
207
+ input: __S(12, __c3, 0) as any as S.Schema<DeleteExtensionRequest>,
208
+ output: __S(8, __c2, 0) as any as S.Schema<DeleteResponse>,
209
+ errors: [BadRequest, NotFound],
210
+ serviceErrors: SteelServiceErrors,
149
211
  protocol: SteelProtocol,
150
212
  retry: Retry.Retry,
151
213
  telemetry: TELEMETRY,
@@ -160,9 +222,10 @@ export const downloadExtension: API.OperationMethod<
160
222
  DownloadExtensionError,
161
223
  SteelOpContext
162
224
  > = /*@__PURE__*/ API.make(() => ({
163
- input: __S(12, __c3, 0) as any as S.Schema<DownloadExtensionRequest>,
164
- output: __S(13, __c3, 1) as any as S.Codec<DownloadExtensionResponse>,
165
- errors: [BadRequest, NotFound, UnknownSteelError],
225
+ input: __S(16, __c4, 0) as any as S.Schema<DownloadExtensionRequest>,
226
+ output: __S(17, __c4, 1) as any as S.Schema<DownloadExtensionResponse>,
227
+ errors: [BadRequest, NotFound],
228
+ serviceErrors: SteelServiceErrors,
166
229
  protocol: SteelProtocol,
167
230
  retry: Retry.Retry,
168
231
  telemetry: TELEMETRY,
@@ -177,9 +240,10 @@ export const listExtensions: API.OperationMethod<
177
240
  ListExtensionsError,
178
241
  SteelOpContext
179
242
  > = /*@__PURE__*/ API.make(() => ({
180
- input: __S(16, __c4, 0) as any as S.Schema<ListExtensionsRequest>,
181
- output: __S(18, __c4, 2) as any as S.Schema<ExtensionList>,
182
- errors: [BadRequest, UnknownSteelError],
243
+ input: __S(20, __c5, 0) as any as S.Schema<ListExtensionsRequest>,
244
+ output: __S(22, __c5, 2) as any as S.Schema<ExtensionList>,
245
+ errors: [BadRequest],
246
+ serviceErrors: SteelServiceErrors,
183
247
  protocol: SteelProtocol,
184
248
  retry: Retry.Retry,
185
249
  telemetry: TELEMETRY,
@@ -199,9 +263,10 @@ export const updateExtension: API.OperationMethod<
199
263
  UpdateExtensionError,
200
264
  SteelOpContext
201
265
  > = /*@__PURE__*/ API.make(() => ({
202
- input: __S(24, __c6, 0) as any as S.Schema<UpdateExtensionRequest>,
203
- output: __S(20, __c5, 0) as any as S.Schema<ExtensionUploadResponse>,
204
- errors: [BadRequest, NotFound, Conflict, PayloadTooLarge, UnknownSteelError],
266
+ input: __S(28, __c7, 0) as any as S.Schema<UpdateExtensionRequest>,
267
+ output: __S(24, __c6, 0) as any as S.Schema<ExtensionUploadResponse>,
268
+ errors: [BadRequest, NotFound, Conflict, PayloadTooLarge],
269
+ serviceErrors: SteelServiceErrors,
205
270
  protocol: SteelProtocol,
206
271
  retry: Retry.Retry,
207
272
  telemetry: TELEMETRY,
@@ -216,9 +281,10 @@ export const uploadExtension: API.OperationMethod<
216
281
  UploadExtensionError,
217
282
  SteelOpContext
218
283
  > = /*@__PURE__*/ API.make(() => ({
219
- input: __S(28, __c7, 0) as any as S.Schema<UploadExtensionRequest>,
220
- output: __S(20, __c5, 0) as any as S.Schema<ExtensionUploadResponse>,
221
- errors: [BadRequest, Conflict, PayloadTooLarge, UnknownSteelError],
284
+ input: __S(32, __c8, 0) as any as S.Schema<UploadExtensionRequest>,
285
+ output: __S(24, __c6, 0) as any as S.Schema<ExtensionUploadResponse>,
286
+ errors: [BadRequest, Conflict, PayloadTooLarge],
287
+ serviceErrors: SteelServiceErrors,
222
288
  protocol: SteelProtocol,
223
289
  retry: Retry.Retry,
224
290
  telemetry: TELEMETRY,
@@ -227,6 +293,37 @@ export const uploadExtension: API.OperationMethod<
227
293
 
228
294
  // Schema builders: each runs one schema initializer, on that schema's first use.
229
295
  function __c0(j: number): any {
296
+ switch (j) {
297
+ case 0:
298
+ return S.suspend(() =>
299
+ S.Struct({
300
+ keyword: S.String,
301
+ message: S.String,
302
+ params: S.Unknown,
303
+ }),
304
+ ).annotate({ identifier: "ErrorResponseContextItem" });
305
+ case 1:
306
+ return S.Array(__S(0, __c0, 0));
307
+ case 2:
308
+ return S.Record(S.String, S.Unknown);
309
+ case 3:
310
+ return S.suspend(() =>
311
+ S.Struct({
312
+ code: S.optional(S.String),
313
+ context: S.optional(__S(1, __c0, 1)),
314
+ details: S.optional(__S(2, __c0, 2)),
315
+ error: S.optional(S.String),
316
+ linkToDocs: S.optional(S.String),
317
+ message: S.String,
318
+ param: S.optional(S.String),
319
+ retryAfterSeconds: S.optional(S.Number),
320
+ retryable: S.optional(S.Boolean),
321
+ unlockUrl: S.optional(S.String),
322
+ }),
323
+ ).annotate({ identifier: "ErrorResponse" });
324
+ }
325
+ }
326
+ function __c1(j: number): any {
230
327
  switch (j) {
231
328
  case 0:
232
329
  return S.suspend(() =>
@@ -234,7 +331,7 @@ function __c0(j: number): any {
234
331
  ).annotate({ identifier: "DeleteAllExtensionsRequest" });
235
332
  }
236
333
  }
237
- function __c1(j: number): any {
334
+ function __c2(j: number): any {
238
335
  switch (j) {
239
336
  case 0:
240
337
  return S.suspend(() =>
@@ -244,7 +341,7 @@ function __c1(j: number): any {
244
341
  ).annotate({ identifier: "DeleteResponse" });
245
342
  }
246
343
  }
247
- function __c2(j: number): any {
344
+ function __c3(j: number): any {
248
345
  switch (j) {
249
346
  case 0:
250
347
  return S.suspend(() =>
@@ -254,7 +351,7 @@ function __c2(j: number): any {
254
351
  ).annotate({ identifier: "DeleteExtensionRequest" });
255
352
  }
256
353
  }
257
- function __c3(j: number): any {
354
+ function __c4(j: number): any {
258
355
  switch (j) {
259
356
  case 0:
260
357
  return S.suspend(() =>
@@ -263,27 +360,32 @@ function __c3(j: number): any {
263
360
  }).pipe(T.Http({ method: "GET", uri: "/v1/extensions/{extensionId}", code: 200 })),
264
361
  ).annotate({ identifier: "DownloadExtensionRequest" });
265
362
  case 1:
266
- return S.instanceOf(Uint8Array).pipe(/*@__PURE__*/ T.BinaryResponse());
363
+ return S.suspend(() =>
364
+ S.Struct({
365
+ body: BinaryStream.pipe(T.RawResponse(), T.BinaryResponse()),
366
+ contentType: S.optional(S.String.pipe(T.Header("Content-Type"))),
367
+ }),
368
+ ).annotate({ identifier: "DownloadExtensionResponse" });
267
369
  }
268
370
  }
269
- function __c4(j: number): any {
371
+ function __c5(j: number): any {
270
372
  switch (j) {
271
373
  case 0:
272
374
  return S.suspend(() =>
273
375
  S.Struct({}).pipe(T.Http({ method: "GET", uri: "/v1/extensions", code: 200 })),
274
376
  ).annotate({ identifier: "ListExtensionsRequest" });
275
377
  case 1:
276
- return S.Array(__S(20, __c5, 0));
378
+ return S.Array(__S(24, __c6, 0));
277
379
  case 2:
278
380
  return S.suspend(() =>
279
381
  S.Struct({
280
382
  count: S.Number,
281
- extensions: __S(17, __c4, 1),
383
+ extensions: __S(21, __c5, 1),
282
384
  }),
283
385
  ).annotate({ identifier: "ExtensionList" });
284
386
  }
285
387
  }
286
- function __c5(j: number): any {
388
+ function __c6(j: number): any {
287
389
  switch (j) {
288
390
  case 0:
289
391
  return S.suspend(() =>
@@ -296,7 +398,7 @@ function __c5(j: number): any {
296
398
  ).annotate({ identifier: "ExtensionListExtensionsItem" });
297
399
  }
298
400
  }
299
- function __c6(j: number): any {
401
+ function __c7(j: number): any {
300
402
  switch (j) {
301
403
  case 0:
302
404
  return S.suspend(() =>
@@ -317,7 +419,7 @@ function __c6(j: number): any {
317
419
  ).annotate({ identifier: "UpdateExtensionRequest" });
318
420
  }
319
421
  }
320
- function __c7(j: number): any {
422
+ function __c8(j: number): any {
321
423
  switch (j) {
322
424
  case 0:
323
425
  return S.suspend(() =>