@distilled.cloud/steel 0.0.0 → 1.0.0-rc.20
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/LICENSE +201 -0
- package/README.md +66 -4
- package/lib/.lazy.json +1 -0
- package/lib/_bundle/lazy.js +4 -0
- package/lib/_bundle/sdk.js +2 -0
- package/lib/_bundle/sdk.js.map +1 -0
- package/lib/credentials.d.ts +24 -0
- package/lib/credentials.d.ts.map +1 -0
- package/lib/credentials.js +1 -0
- package/lib/errors.d.ts +39 -0
- package/lib/errors.d.ts.map +1 -0
- package/lib/errors.js +1 -0
- package/lib/index.d.ts +26 -0
- package/lib/index.d.ts.map +1 -0
- package/lib/index.js +7 -0
- package/lib/index.lazy.js +7 -0
- package/lib/index.lazy.js.map +1 -0
- package/lib/pagination.d.ts +10 -0
- package/lib/pagination.d.ts.map +1 -0
- package/lib/pagination.js +1 -0
- package/lib/protocol.d.ts +19 -0
- package/lib/protocol.d.ts.map +1 -0
- package/lib/protocol.js +1 -0
- package/lib/retry.d.ts +50 -0
- package/lib/retry.d.ts.map +1 -0
- package/lib/retry.js +1 -0
- package/lib/services/api_keys.d.ts +63 -0
- package/lib/services/api_keys.d.ts.map +1 -0
- package/lib/services/api_keys.js +2 -0
- package/lib/services/api_keys.js.map +1 -0
- package/lib/services/auth.d.ts +32 -0
- package/lib/services/auth.d.ts.map +1 -0
- package/lib/services/auth.js +2 -0
- package/lib/services/auth.js.map +1 -0
- package/lib/services/browser_tools.d.ts +166 -0
- package/lib/services/browser_tools.d.ts.map +1 -0
- package/lib/services/browser_tools.js +2 -0
- package/lib/services/browser_tools.js.map +1 -0
- package/lib/services/captchas.d.ts +72 -0
- package/lib/services/captchas.d.ts.map +1 -0
- package/lib/services/captchas.js +2 -0
- package/lib/services/captchas.js.map +1 -0
- package/lib/services/credentials.d.ts +127 -0
- package/lib/services/credentials.d.ts.map +1 -0
- package/lib/services/credentials.js +2 -0
- package/lib/services/credentials.js.map +1 -0
- package/lib/services/extensions.d.ts +122 -0
- package/lib/services/extensions.d.ts.map +1 -0
- package/lib/services/extensions.js +2 -0
- package/lib/services/extensions.js.map +1 -0
- package/lib/services/files.d.ts +144 -0
- package/lib/services/files.d.ts.map +1 -0
- package/lib/services/files.js +2 -0
- package/lib/services/files.js.map +1 -0
- package/lib/services/index.d.ts +11 -0
- package/lib/services/index.d.ts.map +1 -0
- package/lib/services/index.js +10 -0
- package/lib/services/profiles.d.ts +422 -0
- package/lib/services/profiles.d.ts.map +1 -0
- package/lib/services/profiles.js +2 -0
- package/lib/services/profiles.js.map +1 -0
- package/lib/services/projects.d.ts +50 -0
- package/lib/services/projects.d.ts.map +1 -0
- package/lib/services/projects.js +2 -0
- package/lib/services/projects.js.map +1 -0
- package/lib/services/sessions.d.ts +1977 -0
- package/lib/services/sessions.d.ts.map +1 -0
- package/lib/services/sessions.js +44 -0
- package/lib/services/sessions.js.map +1 -0
- package/lib/services.lazy/api_keys.js +1 -0
- package/lib/services.lazy/auth.js +1 -0
- package/lib/services.lazy/browser_tools.js +1 -0
- package/lib/services.lazy/captchas.js +1 -0
- package/lib/services.lazy/credentials.js +1 -0
- package/lib/services.lazy/extensions.js +1 -0
- package/lib/services.lazy/files.js +1 -0
- package/lib/services.lazy/index.js +3 -0
- package/lib/services.lazy/profiles.js +1 -0
- package/lib/services.lazy/projects.js +1 -0
- package/lib/services.lazy/sessions.js +4 -0
- package/lib/traits.d.ts +11 -0
- package/lib/traits.d.ts.map +1 -0
- package/lib/traits.js +1 -0
- package/package.json +83 -2
- package/src/credentials.ts +63 -0
- package/src/errors.ts +51 -0
- package/src/index.ts +25 -0
- package/src/pagination.ts +9 -0
- package/src/protocol.ts +76 -0
- package/src/retry.ts +69 -0
- package/src/services/api_keys.ts +124 -0
- package/src/services/auth.ts +101 -0
- package/src/services/browser_tools.ts +338 -0
- package/src/services/captchas.ts +216 -0
- package/src/services/credentials.ts +292 -0
- package/src/services/extensions.ts +338 -0
- package/src/services/files.ts +456 -0
- package/src/services/index.ts +11 -0
- package/src/services/profiles.ts +871 -0
- package/src/services/projects.ts +146 -0
- package/src/services/sessions.ts +4515 -0
- package/src/traits.ts +46 -0
|
@@ -0,0 +1,146 @@
|
|
|
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: "Projects",
|
|
24
|
+
labels: "steel",
|
|
25
|
+
propagate: "w3c",
|
|
26
|
+
} as const;
|
|
27
|
+
|
|
28
|
+
export class NotFound
|
|
29
|
+
extends /*@__PURE__*/ T.applyErrorMatchers(
|
|
30
|
+
/*@__PURE__*/ S.TaggedError<NotFound>()("NotFound", {
|
|
31
|
+
code: S.Number,
|
|
32
|
+
message: S.String,
|
|
33
|
+
}).pipe(C.withBadRequestError),
|
|
34
|
+
[{ status: 404 }],
|
|
35
|
+
) {}
|
|
36
|
+
|
|
37
|
+
export interface GetProjectRequest {
|
|
38
|
+
id: string;
|
|
39
|
+
}
|
|
40
|
+
export interface Project {
|
|
41
|
+
createdAt: string;
|
|
42
|
+
id: string;
|
|
43
|
+
isDefault: boolean;
|
|
44
|
+
isProduction: boolean;
|
|
45
|
+
name: string;
|
|
46
|
+
promotedToProductionAt: string | null;
|
|
47
|
+
slug: string;
|
|
48
|
+
updatedAt: string;
|
|
49
|
+
}
|
|
50
|
+
export interface ListProjectsRequest {}
|
|
51
|
+
export interface ProjectsResponseProjectsItem {
|
|
52
|
+
createdAt: string;
|
|
53
|
+
id: string;
|
|
54
|
+
isDefault: boolean;
|
|
55
|
+
isProduction: boolean;
|
|
56
|
+
name: string;
|
|
57
|
+
promotedToProductionAt: string | null;
|
|
58
|
+
slug: string;
|
|
59
|
+
updatedAt: string;
|
|
60
|
+
}
|
|
61
|
+
export type ProjectsResponseProjectsList = Array<ProjectsResponseProjectsItem>;
|
|
62
|
+
export interface ProjectsResponse {
|
|
63
|
+
projects: ProjectsResponseProjectsList;
|
|
64
|
+
}
|
|
65
|
+
export type GetProjectError = NotFound | SteelOpError;
|
|
66
|
+
/** Get project Get a project by ID. */
|
|
67
|
+
export const getProject: API.OperationMethod<
|
|
68
|
+
GetProjectRequest,
|
|
69
|
+
Project,
|
|
70
|
+
GetProjectError,
|
|
71
|
+
SteelOpContext
|
|
72
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
73
|
+
input: __S(0, __c0, 0) as any as S.Schema<GetProjectRequest>,
|
|
74
|
+
output: __S(4, __c1, 0) as any as S.Schema<Project>,
|
|
75
|
+
errors: [NotFound, UnknownSteelError],
|
|
76
|
+
protocol: SteelProtocol,
|
|
77
|
+
retry: Retry.Retry,
|
|
78
|
+
telemetry: TELEMETRY,
|
|
79
|
+
span: "GetProject",
|
|
80
|
+
}));
|
|
81
|
+
|
|
82
|
+
export type ListProjectsError = SteelOpError;
|
|
83
|
+
/** List projects List projects for the authenticated organization. */
|
|
84
|
+
export const listProjects: API.OperationMethod<
|
|
85
|
+
ListProjectsRequest,
|
|
86
|
+
ProjectsResponse,
|
|
87
|
+
ListProjectsError,
|
|
88
|
+
SteelOpContext
|
|
89
|
+
> = /*@__PURE__*/ API.make(() => ({
|
|
90
|
+
input: __S(8, __c2, 0) as any as S.Schema<ListProjectsRequest>,
|
|
91
|
+
output: __S(10, __c2, 2) as any as S.Schema<ProjectsResponse>,
|
|
92
|
+
errors: [UnknownSteelError],
|
|
93
|
+
protocol: SteelProtocol,
|
|
94
|
+
retry: Retry.Retry,
|
|
95
|
+
telemetry: TELEMETRY,
|
|
96
|
+
span: "ListProjects",
|
|
97
|
+
}));
|
|
98
|
+
|
|
99
|
+
// Schema builders: each runs one schema initializer, on that schema's first use.
|
|
100
|
+
function __c0(j: number): any {
|
|
101
|
+
switch (j) {
|
|
102
|
+
case 0:
|
|
103
|
+
return S.suspend(() =>
|
|
104
|
+
S.Struct({
|
|
105
|
+
id: S.String.pipe(T.Label()),
|
|
106
|
+
}).pipe(T.Http({ method: "GET", uri: "/v1/projects/{id}", code: 200 })),
|
|
107
|
+
).annotate({ identifier: "GetProjectRequest" });
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
function __c1(j: number): any {
|
|
111
|
+
switch (j) {
|
|
112
|
+
case 0:
|
|
113
|
+
return S.suspend(() =>
|
|
114
|
+
S.Struct({
|
|
115
|
+
createdAt: S.String,
|
|
116
|
+
id: S.String,
|
|
117
|
+
isDefault: S.Boolean,
|
|
118
|
+
isProduction: S.Boolean,
|
|
119
|
+
name: S.String,
|
|
120
|
+
promotedToProductionAt: S.NullOr(S.String),
|
|
121
|
+
slug: S.String,
|
|
122
|
+
updatedAt: S.String,
|
|
123
|
+
}),
|
|
124
|
+
).annotate({ identifier: "Project" });
|
|
125
|
+
}
|
|
126
|
+
}
|
|
127
|
+
function __c2(j: number): any {
|
|
128
|
+
switch (j) {
|
|
129
|
+
case 0:
|
|
130
|
+
return S.suspend(() =>
|
|
131
|
+
S.Struct({}).pipe(T.Http({ method: "GET", uri: "/v1/projects", code: 200 })),
|
|
132
|
+
).annotate({ identifier: "ListProjectsRequest" });
|
|
133
|
+
case 1:
|
|
134
|
+
return S.Array(__S(4, __c1, 0));
|
|
135
|
+
case 2:
|
|
136
|
+
return S.suspend(() =>
|
|
137
|
+
S.Struct({
|
|
138
|
+
projects: __S(9, __c2, 1),
|
|
139
|
+
}),
|
|
140
|
+
).annotate({ identifier: "ProjectsResponse" });
|
|
141
|
+
}
|
|
142
|
+
}
|
|
143
|
+
// Schema table: entry i is schema j of builder f, made on first reach.
|
|
144
|
+
function __S(i: number, f: (j: number) => unknown, j: number): any {
|
|
145
|
+
return (__s[i] ??= __L.at(f, j));
|
|
146
|
+
}
|