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

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 (102) hide show
  1. package/LICENSE +201 -0
  2. package/README.md +66 -4
  3. package/lib/.lazy.json +1 -0
  4. package/lib/_bundle/lazy.js +4 -0
  5. package/lib/_bundle/sdk.js +2 -0
  6. package/lib/_bundle/sdk.js.map +1 -0
  7. package/lib/credentials.d.ts +24 -0
  8. package/lib/credentials.d.ts.map +1 -0
  9. package/lib/credentials.js +1 -0
  10. package/lib/errors.d.ts +42 -0
  11. package/lib/errors.d.ts.map +1 -0
  12. package/lib/errors.js +1 -0
  13. package/lib/index.d.ts +26 -0
  14. package/lib/index.d.ts.map +1 -0
  15. package/lib/index.js +7 -0
  16. package/lib/index.lazy.js +7 -0
  17. package/lib/index.lazy.js.map +1 -0
  18. package/lib/pagination.d.ts +10 -0
  19. package/lib/pagination.d.ts.map +1 -0
  20. package/lib/pagination.js +1 -0
  21. package/lib/protocol.d.ts +19 -0
  22. package/lib/protocol.d.ts.map +1 -0
  23. package/lib/protocol.js +1 -0
  24. package/lib/retry.d.ts +50 -0
  25. package/lib/retry.d.ts.map +1 -0
  26. package/lib/retry.js +1 -0
  27. package/lib/services/api_keys.d.ts +63 -0
  28. package/lib/services/api_keys.d.ts.map +1 -0
  29. package/lib/services/api_keys.js +2 -0
  30. package/lib/services/api_keys.js.map +1 -0
  31. package/lib/services/auth.d.ts +32 -0
  32. package/lib/services/auth.d.ts.map +1 -0
  33. package/lib/services/auth.js +2 -0
  34. package/lib/services/auth.js.map +1 -0
  35. package/lib/services/browser_tools.d.ts +166 -0
  36. package/lib/services/browser_tools.d.ts.map +1 -0
  37. package/lib/services/browser_tools.js +2 -0
  38. package/lib/services/browser_tools.js.map +1 -0
  39. package/lib/services/captchas.d.ts +72 -0
  40. package/lib/services/captchas.d.ts.map +1 -0
  41. package/lib/services/captchas.js +2 -0
  42. package/lib/services/captchas.js.map +1 -0
  43. package/lib/services/credentials.d.ts +127 -0
  44. package/lib/services/credentials.d.ts.map +1 -0
  45. package/lib/services/credentials.js +2 -0
  46. package/lib/services/credentials.js.map +1 -0
  47. package/lib/services/extensions.d.ts +122 -0
  48. package/lib/services/extensions.d.ts.map +1 -0
  49. package/lib/services/extensions.js +2 -0
  50. package/lib/services/extensions.js.map +1 -0
  51. package/lib/services/files.d.ts +144 -0
  52. package/lib/services/files.d.ts.map +1 -0
  53. package/lib/services/files.js +2 -0
  54. package/lib/services/files.js.map +1 -0
  55. package/lib/services/index.d.ts +11 -0
  56. package/lib/services/index.d.ts.map +1 -0
  57. package/lib/services/index.js +10 -0
  58. package/lib/services/profiles.d.ts +422 -0
  59. package/lib/services/profiles.d.ts.map +1 -0
  60. package/lib/services/profiles.js +2 -0
  61. package/lib/services/profiles.js.map +1 -0
  62. package/lib/services/projects.d.ts +50 -0
  63. package/lib/services/projects.d.ts.map +1 -0
  64. package/lib/services/projects.js +2 -0
  65. package/lib/services/projects.js.map +1 -0
  66. package/lib/services/sessions.d.ts +1977 -0
  67. package/lib/services/sessions.d.ts.map +1 -0
  68. package/lib/services/sessions.js +44 -0
  69. package/lib/services/sessions.js.map +1 -0
  70. package/lib/services.lazy/api_keys.js +1 -0
  71. package/lib/services.lazy/auth.js +1 -0
  72. package/lib/services.lazy/browser_tools.js +1 -0
  73. package/lib/services.lazy/captchas.js +1 -0
  74. package/lib/services.lazy/credentials.js +1 -0
  75. package/lib/services.lazy/extensions.js +1 -0
  76. package/lib/services.lazy/files.js +1 -0
  77. package/lib/services.lazy/index.js +3 -0
  78. package/lib/services.lazy/profiles.js +1 -0
  79. package/lib/services.lazy/projects.js +1 -0
  80. package/lib/services.lazy/sessions.js +4 -0
  81. package/lib/traits.d.ts +11 -0
  82. package/lib/traits.d.ts.map +1 -0
  83. package/lib/traits.js +1 -0
  84. package/package.json +82 -2
  85. package/src/credentials.ts +63 -0
  86. package/src/errors.ts +51 -0
  87. package/src/index.ts +25 -0
  88. package/src/pagination.ts +9 -0
  89. package/src/protocol.ts +77 -0
  90. package/src/retry.ts +69 -0
  91. package/src/services/api_keys.ts +124 -0
  92. package/src/services/auth.ts +101 -0
  93. package/src/services/browser_tools.ts +338 -0
  94. package/src/services/captchas.ts +216 -0
  95. package/src/services/credentials.ts +292 -0
  96. package/src/services/extensions.ts +338 -0
  97. package/src/services/files.ts +456 -0
  98. package/src/services/index.ts +11 -0
  99. package/src/services/profiles.ts +871 -0
  100. package/src/services/projects.ts +146 -0
  101. package/src/services/sessions.ts +4515 -0
  102. package/src/traits.ts +46 -0
@@ -0,0 +1,292 @@
1
+ import * as API from "@distilled.cloud/core/api";
2
+ import * as C from "@distilled.cloud/core/category";
3
+ // AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-steel/specs/openapi.json). Do not edit.
4
+ import * as S from "@distilled.cloud/core/schema-lite";
5
+ import * as __L from "@distilled.cloud/core/schema-lite";
6
+ import type * as Redacted from "effect/Redacted";
7
+ import { UnknownSteelError } from "../errors.ts";
8
+ import { SteelProtocol, type SteelOpError, type SteelOpContext } from "../protocol.ts";
9
+ import * as Retry from "../retry.ts";
10
+ import * as T from "../traits.ts";
11
+ // Schema table, filled on first reach (see __S at the end).
12
+ const __s: any[] = [];
13
+
14
+ export type { SteelOpError, SteelOpContext };
15
+
16
+ /** Span facts shared by every operation (com.distilled.telemetry#service). */
17
+ const TELEMETRY = {
18
+ system: "steel-api",
19
+ responseHeaders: [
20
+ { header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" },
21
+ { header: "request-id", name: "http.response.header.request-id", transform: "list" },
22
+ ],
23
+ prefix: "Steel",
24
+ service: "Credentials",
25
+ propagate: "w3c",
26
+ } as const;
27
+
28
+ export class BadRequest
29
+ extends /*@__PURE__*/ T.applyErrorMatchers(
30
+ /*@__PURE__*/ S.TaggedError<BadRequest>()("BadRequest", {
31
+ code: S.Number,
32
+ message: S.String,
33
+ }).pipe(C.withBadRequestError),
34
+ [{ status: 400 }],
35
+ ) {}
36
+
37
+ export class Conflict
38
+ extends /*@__PURE__*/ T.applyErrorMatchers(
39
+ /*@__PURE__*/ S.TaggedError<Conflict>()("Conflict", {
40
+ code: S.Number,
41
+ message: S.String,
42
+ }).pipe(C.withConflictError),
43
+ [{ status: 409 }],
44
+ ) {}
45
+
46
+ export class NotFound
47
+ extends /*@__PURE__*/ T.applyErrorMatchers(
48
+ /*@__PURE__*/ S.TaggedError<NotFound>()("NotFound", {
49
+ code: S.Number,
50
+ message: S.String,
51
+ }).pipe(C.withBadRequestError),
52
+ [{ status: 404 }],
53
+ ) {}
54
+
55
+ /** Value for the credential */
56
+ export type CreateCredentialRequestValueMap = {
57
+ [key: string]: string | Redacted.Redacted<string> | undefined;
58
+ };
59
+ export interface CreateCredentialRequest {
60
+ /** Label for the credential */
61
+ label?: string | undefined;
62
+ /** The namespace the credential is stored against. Defaults to "default". */
63
+ namespace?: string | undefined;
64
+ /** Website origin the credential is for */
65
+ origin?: string | undefined;
66
+ /** Project to store the credential in. */
67
+ projectId?: string | undefined;
68
+ /** Value for the credential */
69
+ value: CreateCredentialRequestValueMap;
70
+ }
71
+ export interface CredentialMetadata {
72
+ /** Date and time the credential was created */
73
+ createdAt: string;
74
+ /** Label for the credential */
75
+ label?: string | undefined;
76
+ /** The namespace the credential is stored against. Defaults to "default". */
77
+ namespace?: string | undefined;
78
+ /** Website origin the credential is for */
79
+ origin?: string | undefined;
80
+ /** Date and time the credential was last updated */
81
+ updatedAt: string;
82
+ }
83
+ export interface DeleteCredentialRequest {
84
+ /** The namespace the credential is stored against. Defaults to "default". */
85
+ namespace?: string | undefined;
86
+ /** Website origin the credential is for */
87
+ origin: string;
88
+ /** Project to delete the credential from. */
89
+ projectId?: string | undefined;
90
+ }
91
+ export interface SuccessResponse {
92
+ success: boolean;
93
+ }
94
+ export interface ListCredentialsRequest {
95
+ /** Project to query credentials from. */
96
+ projectId?: string | undefined;
97
+ /** namespace credential is stored against */
98
+ namespace?: string | undefined;
99
+ /** website origin the credential is for */
100
+ origin?: string | undefined;
101
+ }
102
+ export interface CredentialListCredentialsItem {
103
+ /** Date and time the credential was created */
104
+ createdAt: string;
105
+ /** Label for the credential */
106
+ label?: string | undefined;
107
+ /** The namespace the credential is stored against. Defaults to "default". */
108
+ namespace?: string | undefined;
109
+ /** Website origin the credential is for */
110
+ origin?: string | undefined;
111
+ /** Date and time the credential was last updated */
112
+ updatedAt: string;
113
+ }
114
+ export type CredentialListCredentialsList = Array<CredentialListCredentialsItem>;
115
+ export interface CredentialList {
116
+ credentials: CredentialListCredentialsList;
117
+ }
118
+ /** Value for the credential */
119
+ export type UpdateCredentialRequestValueMap = {
120
+ [key: string]: string | Redacted.Redacted<string> | undefined;
121
+ };
122
+ export interface UpdateCredentialRequest {
123
+ /** Label for the credential */
124
+ label?: string | undefined;
125
+ /** The namespace the credential is stored against. Defaults to "default". */
126
+ namespace?: string | undefined;
127
+ /** Website origin the credential is for */
128
+ origin?: string | undefined;
129
+ /** Project to update the credential in. */
130
+ projectId?: string | undefined;
131
+ /** Value for the credential */
132
+ value?: UpdateCredentialRequestValueMap | undefined;
133
+ }
134
+ export type CreateCredentialError = BadRequest | Conflict | SteelOpError;
135
+ /** Stores credentials Encrypts and stores credentials for an origin */
136
+ export const createCredential: API.OperationMethod<
137
+ CreateCredentialRequest,
138
+ CredentialMetadata,
139
+ CreateCredentialError,
140
+ SteelOpContext
141
+ > = /*@__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],
145
+ protocol: SteelProtocol,
146
+ retry: Retry.Retry,
147
+ telemetry: TELEMETRY,
148
+ span: "CreateCredential",
149
+ }));
150
+
151
+ export type DeleteCredentialError = NotFound | SteelOpError;
152
+ /** Deletes credentials Deletes encrypted credentials from the database */
153
+ export const deleteCredential: API.OperationMethod<
154
+ DeleteCredentialRequest,
155
+ SuccessResponse,
156
+ DeleteCredentialError,
157
+ SteelOpContext
158
+ > = /*@__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],
162
+ protocol: SteelProtocol,
163
+ retry: Retry.Retry,
164
+ telemetry: TELEMETRY,
165
+ span: "DeleteCredential",
166
+ }));
167
+
168
+ export type ListCredentialsError = BadRequest | NotFound | SteelOpError;
169
+ /** List all credential metadata Fetches all credential metadata for the current organization. */
170
+ export const listCredentials: API.OperationMethod<
171
+ ListCredentialsRequest,
172
+ CredentialList,
173
+ ListCredentialsError,
174
+ SteelOpContext
175
+ > = /*@__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],
179
+ protocol: SteelProtocol,
180
+ retry: Retry.Retry,
181
+ telemetry: TELEMETRY,
182
+ span: "ListCredentials",
183
+ }));
184
+
185
+ export type UpdateCredentialError = BadRequest | NotFound | SteelOpError;
186
+ /** Updates credentials Encrypts and updates credentials for an origin */
187
+ export const updateCredential: API.OperationMethod<
188
+ UpdateCredentialRequest,
189
+ CredentialMetadata,
190
+ UpdateCredentialError,
191
+ SteelOpContext
192
+ > = /*@__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],
196
+ protocol: SteelProtocol,
197
+ retry: Retry.Retry,
198
+ telemetry: TELEMETRY,
199
+ span: "UpdateCredential",
200
+ }));
201
+
202
+ // Schema builders: each runs one schema initializer, on that schema's first use.
203
+ function __c0(j: number): any {
204
+ switch (j) {
205
+ case 0:
206
+ return S.suspend(() =>
207
+ S.Struct({
208
+ label: S.optional(S.String),
209
+ namespace: S.optional(S.String),
210
+ origin: S.optional(S.String),
211
+ projectId: S.optional(S.String),
212
+ value: __S(8, __c2, 0),
213
+ }).pipe(T.Http({ method: "POST", uri: "/v1/credentials", code: 200 })),
214
+ ).annotate({ identifier: "CreateCredentialRequest" });
215
+ }
216
+ }
217
+ function __c1(j: number): any {
218
+ switch (j) {
219
+ case 0:
220
+ return S.suspend(() =>
221
+ S.Struct({
222
+ createdAt: S.String,
223
+ label: S.optional(S.String),
224
+ namespace: S.optional(S.String),
225
+ origin: S.optional(S.String),
226
+ updatedAt: S.String,
227
+ }),
228
+ ).annotate({ identifier: "CredentialMetadata" });
229
+ }
230
+ }
231
+ function __c2(j: number): any {
232
+ switch (j) {
233
+ case 0:
234
+ return S.Record(S.String, /*@__PURE__*/ S.String.pipe(/*@__PURE__*/ T.SensitiveValue({})));
235
+ }
236
+ }
237
+ function __c3(j: number): any {
238
+ switch (j) {
239
+ case 0:
240
+ return S.suspend(() =>
241
+ S.Struct({
242
+ namespace: S.optional(S.String),
243
+ origin: S.String,
244
+ projectId: S.optional(S.String),
245
+ }).pipe(T.Http({ method: "DELETE", uri: "/v1/credentials", code: 200 })),
246
+ ).annotate({ identifier: "DeleteCredentialRequest" });
247
+ case 1:
248
+ return S.suspend(() =>
249
+ S.Struct({
250
+ success: S.Boolean,
251
+ }),
252
+ ).annotate({ identifier: "SuccessResponse" });
253
+ }
254
+ }
255
+ function __c4(j: number): any {
256
+ switch (j) {
257
+ case 0:
258
+ return S.suspend(() =>
259
+ S.Struct({
260
+ projectId: S.optional(S.String.pipe(T.Query())),
261
+ namespace: S.optional(S.String.pipe(T.Query())),
262
+ origin: S.optional(S.String.pipe(T.Query())),
263
+ }).pipe(T.Http({ method: "GET", uri: "/v1/credentials", code: 200 })),
264
+ ).annotate({ identifier: "ListCredentialsRequest" });
265
+ case 1:
266
+ return S.Array(__S(4, __c1, 0));
267
+ case 2:
268
+ return S.suspend(() =>
269
+ S.Struct({
270
+ credentials: __S(17, __c4, 1),
271
+ }),
272
+ ).annotate({ identifier: "CredentialList" });
273
+ }
274
+ }
275
+ function __c5(j: number): any {
276
+ switch (j) {
277
+ case 0:
278
+ return S.suspend(() =>
279
+ S.Struct({
280
+ label: S.optional(S.String),
281
+ namespace: S.optional(S.String),
282
+ origin: S.optional(S.String),
283
+ projectId: S.optional(S.String),
284
+ value: S.optional(__S(8, __c2, 0)),
285
+ }).pipe(T.Http({ method: "PUT", uri: "/v1/credentials", code: 200 })),
286
+ ).annotate({ identifier: "UpdateCredentialRequest" });
287
+ }
288
+ }
289
+ // Schema table: entry i is schema j of builder f, made on first reach.
290
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
291
+ return (__s[i] ??= __L.at(f, j));
292
+ }
@@ -0,0 +1,338 @@
1
+ import * as API from "@distilled.cloud/core/api";
2
+ import * as C from "@distilled.cloud/core/category";
3
+ // AUTO-GENERATED by scripts/generate.ts from .generated-specs (specs/spec-mirror-steel/specs/openapi.json). Do not edit.
4
+ import * as S from "@distilled.cloud/core/schema-lite";
5
+ import * as __L from "@distilled.cloud/core/schema-lite";
6
+ import { UnknownSteelError } from "../errors.ts";
7
+ import { SteelProtocol, type SteelOpError, type SteelOpContext } from "../protocol.ts";
8
+ import * as Retry from "../retry.ts";
9
+ import * as T from "../traits.ts";
10
+ // Schema table, filled on first reach (see __S at the end).
11
+ const __s: any[] = [];
12
+
13
+ export type { SteelOpError, SteelOpContext };
14
+
15
+ /** Span facts shared by every operation (com.distilled.telemetry#service). */
16
+ const TELEMETRY = {
17
+ system: "steel-api",
18
+ responseHeaders: [
19
+ { header: "x-request-id", name: "http.response.header.x-request-id", transform: "list" },
20
+ { header: "request-id", name: "http.response.header.request-id", transform: "list" },
21
+ ],
22
+ prefix: "Steel",
23
+ service: "Extensions",
24
+ labels: "steel",
25
+ propagate: "w3c",
26
+ } as const;
27
+
28
+ export class BadRequest
29
+ extends /*@__PURE__*/ T.applyErrorMatchers(
30
+ /*@__PURE__*/ S.TaggedError<BadRequest>()("BadRequest", {
31
+ code: S.Number,
32
+ message: S.String,
33
+ }).pipe(C.withBadRequestError),
34
+ [{ status: 400 }],
35
+ ) {}
36
+
37
+ export class Conflict
38
+ extends /*@__PURE__*/ T.applyErrorMatchers(
39
+ /*@__PURE__*/ S.TaggedError<Conflict>()("Conflict", {
40
+ code: S.Number,
41
+ message: S.String,
42
+ }).pipe(C.withConflictError),
43
+ [{ status: 409 }],
44
+ ) {}
45
+
46
+ export class NotFound
47
+ extends /*@__PURE__*/ T.applyErrorMatchers(
48
+ /*@__PURE__*/ S.TaggedError<NotFound>()("NotFound", {
49
+ code: S.Number,
50
+ message: S.String,
51
+ }).pipe(C.withBadRequestError),
52
+ [{ status: 404 }],
53
+ ) {}
54
+
55
+ export class PayloadTooLarge
56
+ extends /*@__PURE__*/ T.applyErrorMatchers(
57
+ /*@__PURE__*/ S.TaggedError<PayloadTooLarge>()("PayloadTooLarge", {
58
+ code: S.Number,
59
+ message: S.String,
60
+ }).pipe(C.withBadRequestError),
61
+ [{ status: 413 }],
62
+ ) {}
63
+
64
+ export interface DeleteAllExtensionsRequest {}
65
+ export interface DeleteResponse {
66
+ message: string;
67
+ }
68
+ export interface DeleteExtensionRequest {
69
+ /** Extension ID */
70
+ extensionId: string;
71
+ }
72
+ export interface DownloadExtensionRequest {
73
+ /** Extension ID */
74
+ extensionId: string;
75
+ }
76
+ export type DownloadExtensionResponse = Uint8Array;
77
+ export interface ListExtensionsRequest {}
78
+ export interface ExtensionListExtensionsItem {
79
+ /** Creation timestamp */
80
+ createdAt: string;
81
+ /** Unique extension identifier (e.g., ext_12345) */
82
+ id: string;
83
+ /** Extension name */
84
+ name: string;
85
+ /** Last update timestamp */
86
+ updatedAt: string;
87
+ }
88
+ /** List of extensions for the organization */
89
+ export type ExtensionListExtensionsList = Array<ExtensionListExtensionsItem>;
90
+ /** Response containing a list of extensions for the organization */
91
+ export interface ExtensionList {
92
+ /** Total number of extensions */
93
+ count: number;
94
+ /** List of extensions for the organization */
95
+ extensions: ExtensionListExtensionsList;
96
+ }
97
+ export interface UpdateExtensionRequest {
98
+ /** Extension ID */
99
+ extensionId: string;
100
+ /** Extension .zip/.crx file */
101
+ file?: Blob | Uint8Array | ArrayBuffer | undefined;
102
+ /** Extension URL */
103
+ url?: string | undefined;
104
+ }
105
+ export interface ExtensionUploadResponse {
106
+ /** Creation timestamp */
107
+ createdAt: string;
108
+ /** Unique extension identifier (e.g., ext_12345) */
109
+ id: string;
110
+ /** Extension name */
111
+ name: string;
112
+ /** Last update timestamp */
113
+ updatedAt: string;
114
+ }
115
+ export interface UploadExtensionRequest {
116
+ /** Extension .zip/.crx file */
117
+ file?: Blob | Uint8Array | ArrayBuffer | undefined;
118
+ /** Extension URL */
119
+ url?: string | undefined;
120
+ }
121
+ export type DeleteAllExtensionsError = BadRequest | SteelOpError;
122
+ /** Delete all extensions Delete all extensions for the organization */
123
+ export const deleteAllExtensions: API.OperationMethod<
124
+ DeleteAllExtensionsRequest,
125
+ DeleteResponse,
126
+ DeleteAllExtensionsError,
127
+ SteelOpContext
128
+ > = /*@__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],
132
+ protocol: SteelProtocol,
133
+ retry: Retry.Retry,
134
+ telemetry: TELEMETRY,
135
+ span: "DeleteAllExtensions",
136
+ }));
137
+
138
+ export type DeleteExtensionError = BadRequest | NotFound | SteelOpError;
139
+ /** Delete extension Delete an extension by ID */
140
+ export const deleteExtension: API.OperationMethod<
141
+ DeleteExtensionRequest,
142
+ DeleteResponse,
143
+ DeleteExtensionError,
144
+ SteelOpContext
145
+ > = /*@__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],
149
+ protocol: SteelProtocol,
150
+ retry: Retry.Retry,
151
+ telemetry: TELEMETRY,
152
+ span: "DeleteExtension",
153
+ }));
154
+
155
+ export type DownloadExtensionError = BadRequest | NotFound | SteelOpError;
156
+ /** Download extension Download an extension file by extension ID */
157
+ export const downloadExtension: API.OperationMethod<
158
+ DownloadExtensionRequest,
159
+ DownloadExtensionResponse,
160
+ DownloadExtensionError,
161
+ SteelOpContext
162
+ > = /*@__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],
166
+ protocol: SteelProtocol,
167
+ retry: Retry.Retry,
168
+ telemetry: TELEMETRY,
169
+ span: "DownloadExtension",
170
+ }));
171
+
172
+ export type ListExtensionsError = BadRequest | SteelOpError;
173
+ /** List extensions List all extensions for the organization */
174
+ export const listExtensions: API.OperationMethod<
175
+ ListExtensionsRequest,
176
+ ExtensionList,
177
+ ListExtensionsError,
178
+ SteelOpContext
179
+ > = /*@__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],
183
+ protocol: SteelProtocol,
184
+ retry: Retry.Retry,
185
+ telemetry: TELEMETRY,
186
+ span: "ListExtensions",
187
+ }));
188
+
189
+ export type UpdateExtensionError =
190
+ | BadRequest
191
+ | NotFound
192
+ | Conflict
193
+ | PayloadTooLarge
194
+ | SteelOpError;
195
+ /** Update extension Update a Chrome extension (.zip/.crx file or Chrome Web Store URL) for the organization */
196
+ export const updateExtension: API.OperationMethod<
197
+ UpdateExtensionRequest,
198
+ ExtensionUploadResponse,
199
+ UpdateExtensionError,
200
+ SteelOpContext
201
+ > = /*@__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],
205
+ protocol: SteelProtocol,
206
+ retry: Retry.Retry,
207
+ telemetry: TELEMETRY,
208
+ span: "UpdateExtension",
209
+ }));
210
+
211
+ export type UploadExtensionError = BadRequest | Conflict | PayloadTooLarge | SteelOpError;
212
+ /** Upload extension Upload a Chrome extension (.zip/.crx file or Chrome Web Store URL) for the organization */
213
+ export const uploadExtension: API.OperationMethod<
214
+ UploadExtensionRequest,
215
+ ExtensionUploadResponse,
216
+ UploadExtensionError,
217
+ SteelOpContext
218
+ > = /*@__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],
222
+ protocol: SteelProtocol,
223
+ retry: Retry.Retry,
224
+ telemetry: TELEMETRY,
225
+ span: "UploadExtension",
226
+ }));
227
+
228
+ // Schema builders: each runs one schema initializer, on that schema's first use.
229
+ function __c0(j: number): any {
230
+ switch (j) {
231
+ case 0:
232
+ return S.suspend(() =>
233
+ S.Struct({}).pipe(T.Http({ method: "DELETE", uri: "/v1/extensions", code: 200 })),
234
+ ).annotate({ identifier: "DeleteAllExtensionsRequest" });
235
+ }
236
+ }
237
+ function __c1(j: number): any {
238
+ switch (j) {
239
+ case 0:
240
+ return S.suspend(() =>
241
+ S.Struct({
242
+ message: S.String,
243
+ }),
244
+ ).annotate({ identifier: "DeleteResponse" });
245
+ }
246
+ }
247
+ function __c2(j: number): any {
248
+ switch (j) {
249
+ case 0:
250
+ return S.suspend(() =>
251
+ S.Struct({
252
+ extensionId: S.String.pipe(T.Label()),
253
+ }).pipe(T.Http({ method: "DELETE", uri: "/v1/extensions/{extensionId}", code: 200 })),
254
+ ).annotate({ identifier: "DeleteExtensionRequest" });
255
+ }
256
+ }
257
+ function __c3(j: number): any {
258
+ switch (j) {
259
+ case 0:
260
+ return S.suspend(() =>
261
+ S.Struct({
262
+ extensionId: S.String.pipe(T.Label()),
263
+ }).pipe(T.Http({ method: "GET", uri: "/v1/extensions/{extensionId}", code: 200 })),
264
+ ).annotate({ identifier: "DownloadExtensionRequest" });
265
+ case 1:
266
+ return S.instanceOf(Uint8Array).pipe(/*@__PURE__*/ T.BinaryResponse());
267
+ }
268
+ }
269
+ function __c4(j: number): any {
270
+ switch (j) {
271
+ case 0:
272
+ return S.suspend(() =>
273
+ S.Struct({}).pipe(T.Http({ method: "GET", uri: "/v1/extensions", code: 200 })),
274
+ ).annotate({ identifier: "ListExtensionsRequest" });
275
+ case 1:
276
+ return S.Array(__S(20, __c5, 0));
277
+ case 2:
278
+ return S.suspend(() =>
279
+ S.Struct({
280
+ count: S.Number,
281
+ extensions: __S(17, __c4, 1),
282
+ }),
283
+ ).annotate({ identifier: "ExtensionList" });
284
+ }
285
+ }
286
+ function __c5(j: number): any {
287
+ switch (j) {
288
+ case 0:
289
+ return S.suspend(() =>
290
+ S.Struct({
291
+ createdAt: S.String,
292
+ id: S.String,
293
+ name: S.String,
294
+ updatedAt: S.String,
295
+ }),
296
+ ).annotate({ identifier: "ExtensionListExtensionsItem" });
297
+ }
298
+ }
299
+ function __c6(j: number): any {
300
+ switch (j) {
301
+ case 0:
302
+ return S.suspend(() =>
303
+ S.Struct({
304
+ extensionId: S.String.pipe(T.Label()),
305
+ file: S.optional(
306
+ S.Union([S.instanceOf(Blob), S.instanceOf(Uint8Array), S.instanceOf(ArrayBuffer)]),
307
+ ),
308
+ url: S.optional(S.String),
309
+ }).pipe(
310
+ T.Http({
311
+ method: "PUT",
312
+ uri: "/v1/extensions/{extensionId}",
313
+ code: 200,
314
+ contentType: "multipart",
315
+ }),
316
+ ),
317
+ ).annotate({ identifier: "UpdateExtensionRequest" });
318
+ }
319
+ }
320
+ function __c7(j: number): any {
321
+ switch (j) {
322
+ case 0:
323
+ return S.suspend(() =>
324
+ S.Struct({
325
+ file: S.optional(
326
+ S.Union([S.instanceOf(Blob), S.instanceOf(Uint8Array), S.instanceOf(ArrayBuffer)]),
327
+ ),
328
+ url: S.optional(S.String),
329
+ }).pipe(
330
+ T.Http({ method: "POST", uri: "/v1/extensions", code: 200, contentType: "multipart" }),
331
+ ),
332
+ ).annotate({ identifier: "UploadExtensionRequest" });
333
+ }
334
+ }
335
+ // Schema table: entry i is schema j of builder f, made on first reach.
336
+ function __S(i: number, f: (j: number) => unknown, j: number): any {
337
+ return (__s[i] ??= __L.at(f, j));
338
+ }