@typeship-ax/cli 0.20.0 → 0.21.1
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/AGENTS.md +3 -3
- package/README.md +2 -2
- package/api.json +7355 -6233
- package/api.md +332 -398
- package/dist/api-identity.d.ts.map +1 -1
- package/dist/api-identity.js +6 -1
- package/dist/cli.js +15 -15
- package/dist/core/http.d.ts +26 -14
- package/dist/core/http.d.ts.map +1 -1
- package/dist/core/http.js +90 -19
- package/dist/core/pagination.d.ts +8 -8
- package/dist/core/pagination.d.ts.map +1 -1
- package/dist/core/pagination.js +7 -16
- package/dist/errors.d.ts +4 -4
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +7 -7
- package/dist/index.d.ts +33 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +37 -17
- package/dist/ops.d.ts +1 -1
- package/dist/ops.d.ts.map +1 -1
- package/dist/ops.js +39 -42
- package/dist/resources/api-keys.d.ts +10 -10
- package/dist/resources/api-keys.d.ts.map +1 -1
- package/dist/resources/api-keys.js +6 -6
- package/dist/resources/deliveries.d.ts +46 -0
- package/dist/resources/deliveries.d.ts.map +1 -0
- package/dist/resources/deliveries.js +70 -0
- package/dist/resources/drafts.d.ts +155 -0
- package/dist/resources/drafts.d.ts.map +1 -0
- package/dist/resources/drafts.js +230 -0
- package/dist/resources/files.d.ts +23 -0
- package/dist/resources/files.d.ts.map +1 -0
- package/dist/resources/files.js +38 -0
- package/dist/resources/generate.d.ts +14 -14
- package/dist/resources/generate.d.ts.map +1 -1
- package/dist/resources/generate.js +7 -7
- package/dist/resources/generations.d.ts +65 -21
- package/dist/resources/generations.d.ts.map +1 -1
- package/dist/resources/generations.js +67 -20
- package/dist/resources/organization.d.ts +18 -0
- package/dist/resources/organization.d.ts.map +1 -0
- package/dist/resources/{account.js → organization.js} +10 -10
- package/dist/resources/projects.d.ts +36 -126
- package/dist/resources/projects.d.ts.map +1 -1
- package/dist/resources/projects.js +21 -171
- package/dist/resources/publications.d.ts +46 -0
- package/dist/resources/publications.d.ts.map +1 -0
- package/dist/resources/publications.js +70 -0
- package/dist/resources/releases.d.ts +66 -0
- package/dist/resources/releases.d.ts.map +1 -0
- package/dist/resources/releases.js +101 -0
- package/dist/resources/spec-revisions.d.ts +85 -0
- package/dist/resources/spec-revisions.d.ts.map +1 -0
- package/dist/resources/spec-revisions.js +116 -0
- package/dist/resources/specs.d.ts +72 -0
- package/dist/resources/specs.d.ts.map +1 -0
- package/dist/resources/specs.js +107 -0
- package/dist/resources/targets.d.ts +42 -262
- package/dist/resources/targets.d.ts.map +1 -1
- package/dist/resources/targets.js +28 -407
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +149 -154
- package/dist/types.d.ts +1281 -1611
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +44 -49
- package/package.json +1 -1
- package/src/api-identity.ts +6 -2
- package/src/cli.ts +16 -16
- package/src/core/http.ts +89 -24
- package/src/core/pagination.ts +13 -23
- package/src/errors.ts +7 -7
- package/src/index.ts +41 -23
- package/src/ops.ts +40 -43
- package/src/resources/api-keys.ts +13 -16
- package/src/resources/deliveries.ts +139 -0
- package/src/resources/drafts.ts +422 -0
- package/src/resources/files.ts +68 -0
- package/src/resources/generate.ts +16 -19
- package/src/resources/generations.ts +146 -35
- package/src/resources/{account.ts → organization.ts} +14 -14
- package/src/resources/projects.ts +42 -337
- package/src/resources/publications.ts +139 -0
- package/src/resources/releases.ts +199 -0
- package/src/resources/spec-revisions.ts +237 -0
- package/src/resources/specs.ts +200 -0
- package/src/resources/targets.ts +57 -760
- package/src/schemas.ts +149 -154
- package/src/types.ts +1357 -1692
- package/dist/resources/account.d.ts +0 -18
- package/dist/resources/account.d.ts.map +0 -1
- package/dist/resources/definition-revisions.d.ts +0 -75
- package/dist/resources/definition-revisions.d.ts.map +0 -1
- package/dist/resources/definition-revisions.js +0 -142
- package/dist/resources/definitions.d.ts +0 -50
- package/dist/resources/definitions.d.ts.map +0 -1
- package/dist/resources/definitions.js +0 -73
- package/src/resources/definition-revisions.ts +0 -265
- package/src/resources/definitions.ts +0 -146
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
// typeship — files resource.
|
|
2
|
+
// Generated by typeship — https://typeship.dev
|
|
3
|
+
|
|
4
|
+
import { HttpCore, type RequestOptions } from "../core/http.js";
|
|
5
|
+
import {
|
|
6
|
+
ResponseParseError,
|
|
7
|
+
TransportError,
|
|
8
|
+
UnexpectedApiError,
|
|
9
|
+
ValidationError,
|
|
10
|
+
BadRequestError,
|
|
11
|
+
ForbiddenError,
|
|
12
|
+
InternalServerError,
|
|
13
|
+
NotFoundError,
|
|
14
|
+
RateLimitedError,
|
|
15
|
+
UnauthorizedError,
|
|
16
|
+
} from "../errors.js";
|
|
17
|
+
import type { FileId, FileResponse, FileResponseRead } from "../types.js";
|
|
18
|
+
|
|
19
|
+
export class FilesResource {
|
|
20
|
+
constructor(private readonly _core: HttpCore) {}
|
|
21
|
+
/**
|
|
22
|
+
* Get a file
|
|
23
|
+
*
|
|
24
|
+
* Returns one bounded chunk of an immutable file: at most 24 KiB, as UTF-8 text or, for binary
|
|
25
|
+
* bytes, base64. When next_cursor is not null, repeat the request with cursor and concatenate the
|
|
26
|
+
* chunks in order. A file ID always returns the same bytes.
|
|
27
|
+
* `GET /files/{file_id}`
|
|
28
|
+
*/
|
|
29
|
+
async get(fileId: FileId, params?: FilesGetParams, options?: RequestOptions): Promise<FileResponseRead> {
|
|
30
|
+
return this._core.requestData<FileResponseRead, FilesGetError>({
|
|
31
|
+
method: "GET",
|
|
32
|
+
path: `/files/${encodeURIComponent(String(fileId))}`,
|
|
33
|
+
security: [{"apiKey":[]}],
|
|
34
|
+
query: {
|
|
35
|
+
cursor: params?.cursor,
|
|
36
|
+
},
|
|
37
|
+
errors: {
|
|
38
|
+
"400": BadRequestError,
|
|
39
|
+
"401": UnauthorizedError,
|
|
40
|
+
"403": ForbiddenError,
|
|
41
|
+
"404": NotFoundError,
|
|
42
|
+
"429": RateLimitedError,
|
|
43
|
+
"500": InternalServerError,
|
|
44
|
+
},
|
|
45
|
+
idempotent: true,
|
|
46
|
+
schemaKey: "files.get",
|
|
47
|
+
options,
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
export interface FilesGetParams {
|
|
53
|
+
/** next_cursor from the preceding chunk of this file. */
|
|
54
|
+
cursor?: string;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** Typed errors `get` can throw. */
|
|
58
|
+
export type FilesGetError =
|
|
59
|
+
| BadRequestError
|
|
60
|
+
| UnauthorizedError
|
|
61
|
+
| ForbiddenError
|
|
62
|
+
| NotFoundError
|
|
63
|
+
| RateLimitedError
|
|
64
|
+
| InternalServerError
|
|
65
|
+
| UnexpectedApiError
|
|
66
|
+
| ResponseParseError
|
|
67
|
+
| TransportError
|
|
68
|
+
| ValidationError;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// typeship — generate resource.
|
|
2
2
|
// Generated by typeship — https://typeship.dev
|
|
3
3
|
|
|
4
|
-
import { HttpCore, type
|
|
4
|
+
import { HttpCore, type RequestOptions } from "../core/http.js";
|
|
5
5
|
import {
|
|
6
6
|
ResponseParseError,
|
|
7
7
|
TransportError,
|
|
@@ -23,7 +23,7 @@ import type { GenerateRequest, GenerationResult, GenerationResultRead } from "..
|
|
|
23
23
|
export class GenerateResource {
|
|
24
24
|
constructor(private readonly _core: HttpCore) {}
|
|
25
25
|
/**
|
|
26
|
-
* Generate one package from a
|
|
26
|
+
* Generate one package from a Spec
|
|
27
27
|
*
|
|
28
28
|
* Returns one generated package without creating a Project.
|
|
29
29
|
*
|
|
@@ -33,12 +33,12 @@ export class GenerateResource {
|
|
|
33
33
|
* Use `download.url` to save the complete ZIP, verify `download.sha256`, and extract it into an
|
|
34
34
|
* empty directory. The link expires at `download.expires_at` and grants access to anyone who has
|
|
35
35
|
* it. CLI, MCP, and SDK calls supply an idempotency key automatically. Agents should request
|
|
36
|
-
* `fields=["download","
|
|
37
|
-
*
|
|
38
|
-
*
|
|
36
|
+
* `fields=["download","coverage","warnings","claim"]` to keep the MCP result compact; files can
|
|
37
|
+
* exceed the response limit. Download the ZIP instead of repeating generation to retrieve omitted
|
|
38
|
+
* files.
|
|
39
39
|
*
|
|
40
40
|
* Anonymous and Free requests include the first 25 operations. Paid plans include all operations.
|
|
41
|
-
* Anonymous requests are rate limited by IP address. Check `
|
|
41
|
+
* Anonymous requests are rate limited by IP address. Check `coverage` for omitted operations; an
|
|
42
42
|
* invalid API key returns `401`.
|
|
43
43
|
*
|
|
44
44
|
* An anonymous URL request without source headers may return `claim.url`. Sign in through that
|
|
@@ -51,8 +51,8 @@ export class GenerateResource {
|
|
|
51
51
|
body: GenerateRequest,
|
|
52
52
|
params?: GenerateRunParams,
|
|
53
53
|
options?: RequestOptions,
|
|
54
|
-
): Promise<
|
|
55
|
-
return this._core.
|
|
54
|
+
): Promise<GenerationResultRead> {
|
|
55
|
+
return this._core.requestData<GenerationResultRead, GenerateRunError>({
|
|
56
56
|
method: "POST",
|
|
57
57
|
path: "/generate",
|
|
58
58
|
security: [{},{"apiKey":[]}],
|
|
@@ -90,11 +90,8 @@ export class GenerateResource {
|
|
|
90
90
|
* creates a new download.
|
|
91
91
|
* `GET /generate/download`
|
|
92
92
|
*/
|
|
93
|
-
async downloadPackage(
|
|
94
|
-
|
|
95
|
-
options?: RequestOptions,
|
|
96
|
-
): Promise<ApiResult<Blob, GenerateDownloadPackageError>> {
|
|
97
|
-
return this._core.request<Blob, GenerateDownloadPackageError>({
|
|
93
|
+
async downloadPackage(params: GenerateDownloadPackageParams, options?: RequestOptions): Promise<Blob> {
|
|
94
|
+
return this._core.requestData<Blob, GenerateDownloadPackageError>({
|
|
98
95
|
method: "GET",
|
|
99
96
|
path: "/generate/download",
|
|
100
97
|
security: [{}],
|
|
@@ -116,15 +113,15 @@ export class GenerateResource {
|
|
|
116
113
|
|
|
117
114
|
export interface GenerateRunParams {
|
|
118
115
|
/**
|
|
119
|
-
* Identifies one logical write for 24 hours. The key is scoped to the authenticated
|
|
120
|
-
* operation;
|
|
121
|
-
* path, query, If-Match header, and JSON body replays the original response. Reusing
|
|
122
|
-
* changed intent returns 409. After expiry the key starts a new write.
|
|
116
|
+
* Identifies one logical write for 24 hours. The key is scoped to the authenticated organization
|
|
117
|
+
* and operation; generation without an organization uses a hashed network identity. Retrying the
|
|
118
|
+
* same method, path, query, If-Match header, and JSON body replays the original response. Reusing
|
|
119
|
+
* the key with changed intent returns 409. After expiry the key starts a new write.
|
|
123
120
|
*/
|
|
124
121
|
idempotencyKey?: string;
|
|
125
122
|
}
|
|
126
123
|
|
|
127
|
-
/**
|
|
124
|
+
/** Typed errors `run` can throw. */
|
|
128
125
|
export type GenerateRunError =
|
|
129
126
|
| BadRequestError
|
|
130
127
|
| UnauthorizedError
|
|
@@ -145,7 +142,7 @@ export interface GenerateDownloadPackageParams {
|
|
|
145
142
|
token: string;
|
|
146
143
|
}
|
|
147
144
|
|
|
148
|
-
/**
|
|
145
|
+
/** Typed errors `downloadPackage` can throw. */
|
|
149
146
|
export type GenerateDownloadPackageError =
|
|
150
147
|
| BadRequestError
|
|
151
148
|
| NotFoundError
|
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
// typeship — generations resource.
|
|
2
2
|
// Generated by typeship — https://typeship.dev
|
|
3
3
|
|
|
4
|
-
import { HttpCore, type
|
|
4
|
+
import { HttpCore, type RequestOptions } from "../core/http.js";
|
|
5
|
+
import { paginate, PagePromise } from "../core/pagination.js";
|
|
5
6
|
import {
|
|
6
7
|
ResponseParseError,
|
|
7
8
|
TransportError,
|
|
@@ -14,24 +15,77 @@ import {
|
|
|
14
15
|
RateLimitedError,
|
|
15
16
|
UnauthorizedError,
|
|
16
17
|
} from "../errors.js";
|
|
17
|
-
import type {
|
|
18
|
+
import type {
|
|
19
|
+
FileList,
|
|
20
|
+
FileListRead,
|
|
21
|
+
FileModel,
|
|
22
|
+
FileModelRead,
|
|
23
|
+
GenerationId,
|
|
24
|
+
GenerationList,
|
|
25
|
+
GenerationListRead,
|
|
26
|
+
GenerationResponse,
|
|
27
|
+
GenerationResponseRead,
|
|
28
|
+
GenerationStatus,
|
|
29
|
+
GenerationSummary,
|
|
30
|
+
GenerationSummaryRead,
|
|
31
|
+
ProjectId,
|
|
32
|
+
TargetId,
|
|
33
|
+
} from "../types.js";
|
|
18
34
|
|
|
19
35
|
export class GenerationsResource {
|
|
20
36
|
constructor(private readonly _core: HttpCore) {}
|
|
21
37
|
/**
|
|
22
|
-
*
|
|
38
|
+
* List generations
|
|
23
39
|
*
|
|
24
|
-
*
|
|
25
|
-
*
|
|
26
|
-
* is complete. Successful results include files, or a file index when the package is too large to
|
|
27
|
-
* inline.
|
|
28
|
-
* `GET /generations/{generation_id}`
|
|
40
|
+
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
41
|
+
* `GET /generations`
|
|
29
42
|
*/
|
|
30
|
-
|
|
31
|
-
|
|
43
|
+
list(
|
|
44
|
+
params?: GenerationsListParams,
|
|
32
45
|
options?: RequestOptions,
|
|
33
|
-
):
|
|
34
|
-
return this._core
|
|
46
|
+
): PagePromise<GenerationSummaryRead, GenerationsListError> {
|
|
47
|
+
return paginate<GenerationSummaryRead, GenerationsListError>(this._core, {
|
|
48
|
+
method: "GET",
|
|
49
|
+
path: "/generations",
|
|
50
|
+
security: [{"apiKey":[]}],
|
|
51
|
+
query: {
|
|
52
|
+
limit: params?.limit,
|
|
53
|
+
cursor: params?.cursor,
|
|
54
|
+
project_id: params?.projectId,
|
|
55
|
+
target_id: params?.targetId,
|
|
56
|
+
status: params?.status,
|
|
57
|
+
},
|
|
58
|
+
errors: {
|
|
59
|
+
"400": BadRequestError,
|
|
60
|
+
"401": UnauthorizedError,
|
|
61
|
+
"403": ForbiddenError,
|
|
62
|
+
"404": NotFoundError,
|
|
63
|
+
"429": RateLimitedError,
|
|
64
|
+
"500": InternalServerError,
|
|
65
|
+
},
|
|
66
|
+
idempotent: true,
|
|
67
|
+
schemaKey: "generations.list",
|
|
68
|
+
options,
|
|
69
|
+
}, {
|
|
70
|
+
style: "cursor",
|
|
71
|
+
itemsField: "data",
|
|
72
|
+
cursorParam: "cursor",
|
|
73
|
+
nextCursorField: "next_cursor",
|
|
74
|
+
hasMoreField: "has_more",
|
|
75
|
+
limitParam: "limit",
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* Get a generation
|
|
81
|
+
*
|
|
82
|
+
* Returns the status of that Generation. `queued` and `running` mean generation is still in
|
|
83
|
+
* progress. `completed` means generated files are saved, not that repository delivery or a Draft
|
|
84
|
+
* is complete. List its files with listGenerationFiles and read each with getFile.
|
|
85
|
+
* `GET /generations/{generation_id}`
|
|
86
|
+
*/
|
|
87
|
+
async get(generationId: GenerationId, options?: RequestOptions): Promise<GenerationResponseRead> {
|
|
88
|
+
return this._core.requestData<GenerationResponseRead, GenerationsGetError>({
|
|
35
89
|
method: "GET",
|
|
36
90
|
path: `/generations/${encodeURIComponent(String(generationId))}`,
|
|
37
91
|
security: [{"apiKey":[]}],
|
|
@@ -43,29 +97,31 @@ export class GenerationsResource {
|
|
|
43
97
|
"500": InternalServerError,
|
|
44
98
|
},
|
|
45
99
|
idempotent: true,
|
|
46
|
-
schemaKey: "generations.
|
|
100
|
+
schemaKey: "generations.get",
|
|
47
101
|
options,
|
|
48
102
|
});
|
|
49
103
|
}
|
|
50
104
|
|
|
51
105
|
/**
|
|
52
|
-
*
|
|
106
|
+
* List a Generation's files
|
|
53
107
|
*
|
|
54
|
-
*
|
|
55
|
-
*
|
|
56
|
-
* `
|
|
108
|
+
* Lists the generated package's files, ordered by path. Read content with getFile.
|
|
109
|
+
*
|
|
110
|
+
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
111
|
+
* `GET /generations/{generation_id}/files`
|
|
57
112
|
*/
|
|
58
|
-
|
|
113
|
+
listFiles(
|
|
59
114
|
generationId: GenerationId,
|
|
60
|
-
params
|
|
115
|
+
params?: GenerationsListFilesParams,
|
|
61
116
|
options?: RequestOptions,
|
|
62
|
-
):
|
|
63
|
-
return this._core
|
|
117
|
+
): PagePromise<FileModelRead, GenerationsListFilesError> {
|
|
118
|
+
return paginate<FileModelRead, GenerationsListFilesError>(this._core, {
|
|
64
119
|
method: "GET",
|
|
65
|
-
path: `/generations/${encodeURIComponent(String(generationId))}/
|
|
120
|
+
path: `/generations/${encodeURIComponent(String(generationId))}/files`,
|
|
66
121
|
security: [{"apiKey":[]}],
|
|
67
122
|
query: {
|
|
68
|
-
|
|
123
|
+
limit: params?.limit,
|
|
124
|
+
cursor: params?.cursor,
|
|
69
125
|
},
|
|
70
126
|
errors: {
|
|
71
127
|
"400": BadRequestError,
|
|
@@ -76,8 +132,15 @@ export class GenerationsResource {
|
|
|
76
132
|
"500": InternalServerError,
|
|
77
133
|
},
|
|
78
134
|
idempotent: true,
|
|
79
|
-
schemaKey: "generations.
|
|
135
|
+
schemaKey: "generations.listFiles",
|
|
80
136
|
options,
|
|
137
|
+
}, {
|
|
138
|
+
style: "cursor",
|
|
139
|
+
itemsField: "data",
|
|
140
|
+
cursorParam: "cursor",
|
|
141
|
+
nextCursorField: "next_cursor",
|
|
142
|
+
hasMoreField: "has_more",
|
|
143
|
+
limitParam: "limit",
|
|
81
144
|
});
|
|
82
145
|
}
|
|
83
146
|
|
|
@@ -85,15 +148,15 @@ export class GenerationsResource {
|
|
|
85
148
|
async wait(
|
|
86
149
|
generationId: GenerationId,
|
|
87
150
|
options: RequestOptions & { intervalMs?: number; waitTimeoutMs?: number } = {},
|
|
88
|
-
): Promise<
|
|
89
|
-
const { intervalMs =
|
|
151
|
+
): Promise<GenerationResponseRead> {
|
|
152
|
+
const { intervalMs = 3_000, waitTimeoutMs = 600_000, ...requestOptions } = options;
|
|
90
153
|
const deadline = Date.now() + waitTimeoutMs;
|
|
91
154
|
while (true) {
|
|
92
155
|
if (requestOptions.signal?.aborted) {
|
|
93
156
|
throw requestOptions.signal.reason ?? new Error("Generation wait aborted.");
|
|
94
157
|
}
|
|
95
|
-
const result = await this.
|
|
96
|
-
if (
|
|
158
|
+
const result = await this.get(generationId, requestOptions);
|
|
159
|
+
if (result.status !== "queued" && result.status !== "running") return result;
|
|
97
160
|
if (Date.now() >= deadline) throw new Error("Timed out waiting for Generation " + generationId + ".");
|
|
98
161
|
await new Promise<void>((resolve) =>
|
|
99
162
|
setTimeout(resolve, Math.min(intervalMs, deadline - Date.now())));
|
|
@@ -101,8 +164,44 @@ export class GenerationsResource {
|
|
|
101
164
|
}
|
|
102
165
|
}
|
|
103
166
|
|
|
104
|
-
|
|
105
|
-
|
|
167
|
+
export interface GenerationsListParams {
|
|
168
|
+
/**
|
|
169
|
+
* Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
|
|
170
|
+
* representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
|
|
171
|
+
* invalid_request. List query parameters must appear only once; unrecognized parameters also
|
|
172
|
+
* return 400.
|
|
173
|
+
*/
|
|
174
|
+
limit?: number;
|
|
175
|
+
/**
|
|
176
|
+
* Opaque cursor from the preceding page's next_cursor. Valid only for the same organization,
|
|
177
|
+
* operation, filters, and ordering that issued it. Omit to start at the first page. Empty,
|
|
178
|
+
* malformed, or repeated cursors return 400 invalid_request. The page limit may change between
|
|
179
|
+
* requests.
|
|
180
|
+
*/
|
|
181
|
+
cursor?: string;
|
|
182
|
+
/** Only Generations in this Project. */
|
|
183
|
+
projectId?: ProjectId;
|
|
184
|
+
/** Only Generations of this Target. */
|
|
185
|
+
targetId?: TargetId;
|
|
186
|
+
/** Only Generations with this status. */
|
|
187
|
+
status?: GenerationStatus;
|
|
188
|
+
}
|
|
189
|
+
|
|
190
|
+
/** Typed errors `list` can throw. */
|
|
191
|
+
export type GenerationsListError =
|
|
192
|
+
| BadRequestError
|
|
193
|
+
| UnauthorizedError
|
|
194
|
+
| ForbiddenError
|
|
195
|
+
| NotFoundError
|
|
196
|
+
| RateLimitedError
|
|
197
|
+
| InternalServerError
|
|
198
|
+
| UnexpectedApiError
|
|
199
|
+
| ResponseParseError
|
|
200
|
+
| TransportError
|
|
201
|
+
| ValidationError;
|
|
202
|
+
|
|
203
|
+
/** Typed errors `get` can throw. */
|
|
204
|
+
export type GenerationsGetError =
|
|
106
205
|
| UnauthorizedError
|
|
107
206
|
| ForbiddenError
|
|
108
207
|
| NotFoundError
|
|
@@ -113,13 +212,25 @@ export type GenerationsRetrieveError =
|
|
|
113
212
|
| TransportError
|
|
114
213
|
| ValidationError;
|
|
115
214
|
|
|
116
|
-
export interface
|
|
117
|
-
/**
|
|
118
|
-
|
|
215
|
+
export interface GenerationsListFilesParams {
|
|
216
|
+
/**
|
|
217
|
+
* Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
|
|
218
|
+
* representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
|
|
219
|
+
* invalid_request. List query parameters must appear only once; unrecognized parameters also
|
|
220
|
+
* return 400.
|
|
221
|
+
*/
|
|
222
|
+
limit?: number;
|
|
223
|
+
/**
|
|
224
|
+
* Opaque cursor from the preceding page's next_cursor. Valid only for the same organization,
|
|
225
|
+
* operation, filters, and ordering that issued it. Omit to start at the first page. Empty,
|
|
226
|
+
* malformed, or repeated cursors return 400 invalid_request. The page limit may change between
|
|
227
|
+
* requests.
|
|
228
|
+
*/
|
|
229
|
+
cursor?: string;
|
|
119
230
|
}
|
|
120
231
|
|
|
121
|
-
/**
|
|
122
|
-
export type
|
|
232
|
+
/** Typed errors `listFiles` can throw. */
|
|
233
|
+
export type GenerationsListFilesError =
|
|
123
234
|
| BadRequestError
|
|
124
235
|
| UnauthorizedError
|
|
125
236
|
| ForbiddenError
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
// typeship —
|
|
1
|
+
// typeship — organization resource.
|
|
2
2
|
// Generated by typeship — https://typeship.dev
|
|
3
3
|
|
|
4
|
-
import { HttpCore, type
|
|
4
|
+
import { HttpCore, type RequestOptions } from "../core/http.js";
|
|
5
5
|
import {
|
|
6
6
|
ResponseParseError,
|
|
7
7
|
TransportError,
|
|
@@ -12,21 +12,21 @@ import {
|
|
|
12
12
|
RateLimitedError,
|
|
13
13
|
UnauthorizedError,
|
|
14
14
|
} from "../errors.js";
|
|
15
|
-
import type {
|
|
15
|
+
import type { Organization, OrganizationRead } from "../types.js";
|
|
16
16
|
|
|
17
|
-
export class
|
|
17
|
+
export class OrganizationResource {
|
|
18
18
|
constructor(private readonly _core: HttpCore) {}
|
|
19
19
|
/**
|
|
20
|
-
* The
|
|
20
|
+
* The organization behind the presented credentials
|
|
21
21
|
*
|
|
22
|
-
* Returns the
|
|
23
|
-
* `whoami`.
|
|
24
|
-
* `GET /
|
|
22
|
+
* Returns the organization associated with your credential. The Typeship CLI uses this endpoint
|
|
23
|
+
* for `whoami`.
|
|
24
|
+
* `GET /organization`
|
|
25
25
|
*/
|
|
26
|
-
async
|
|
27
|
-
return this._core.
|
|
26
|
+
async get(options?: RequestOptions): Promise<OrganizationRead> {
|
|
27
|
+
return this._core.requestData<OrganizationRead, OrganizationGetError>({
|
|
28
28
|
method: "GET",
|
|
29
|
-
path: "/
|
|
29
|
+
path: "/organization",
|
|
30
30
|
security: [{"apiKey":[]}],
|
|
31
31
|
errors: {
|
|
32
32
|
"401": UnauthorizedError,
|
|
@@ -35,14 +35,14 @@ export class AccountResource {
|
|
|
35
35
|
"500": InternalServerError,
|
|
36
36
|
},
|
|
37
37
|
idempotent: true,
|
|
38
|
-
schemaKey: "
|
|
38
|
+
schemaKey: "organization.get",
|
|
39
39
|
options,
|
|
40
40
|
});
|
|
41
41
|
}
|
|
42
42
|
}
|
|
43
43
|
|
|
44
|
-
/**
|
|
45
|
-
export type
|
|
44
|
+
/** Typed errors `get` can throw. */
|
|
45
|
+
export type OrganizationGetError =
|
|
46
46
|
| UnauthorizedError
|
|
47
47
|
| ForbiddenError
|
|
48
48
|
| RateLimitedError
|