@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 @@
|
|
|
1
|
+
{"version":3,"file":"files.d.ts","sourceRoot":"","sources":["../../src/resources/files.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,MAAM,EAAgB,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAE1E,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;;;OAOG;IACG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,cAAc,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAqBxG;AAED,MAAM,WAAW,cAAc;IAC7B,yDAAyD;IACzD,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,oCAAoC;AACpC,MAAM,MAAM,aAAa,GACrB,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
// typeship — files resource.
|
|
2
|
+
// Generated by typeship — https://typeship.dev
|
|
3
|
+
import { BadRequestError, ForbiddenError, InternalServerError, NotFoundError, RateLimitedError, UnauthorizedError, } from "../errors.js";
|
|
4
|
+
export class FilesResource {
|
|
5
|
+
_core;
|
|
6
|
+
constructor(_core) {
|
|
7
|
+
this._core = _core;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Get a file
|
|
11
|
+
*
|
|
12
|
+
* Returns one bounded chunk of an immutable file: at most 24 KiB, as UTF-8 text or, for binary
|
|
13
|
+
* bytes, base64. When next_cursor is not null, repeat the request with cursor and concatenate the
|
|
14
|
+
* chunks in order. A file ID always returns the same bytes.
|
|
15
|
+
* `GET /files/{file_id}`
|
|
16
|
+
*/
|
|
17
|
+
async get(fileId, params, options) {
|
|
18
|
+
return this._core.requestData({
|
|
19
|
+
method: "GET",
|
|
20
|
+
path: `/files/${encodeURIComponent(String(fileId))}`,
|
|
21
|
+
security: [{ "apiKey": [] }],
|
|
22
|
+
query: {
|
|
23
|
+
cursor: params?.cursor,
|
|
24
|
+
},
|
|
25
|
+
errors: {
|
|
26
|
+
"400": BadRequestError,
|
|
27
|
+
"401": UnauthorizedError,
|
|
28
|
+
"403": ForbiddenError,
|
|
29
|
+
"404": NotFoundError,
|
|
30
|
+
"429": RateLimitedError,
|
|
31
|
+
"500": InternalServerError,
|
|
32
|
+
},
|
|
33
|
+
idempotent: true,
|
|
34
|
+
schemaKey: "files.get",
|
|
35
|
+
options,
|
|
36
|
+
});
|
|
37
|
+
}
|
|
38
|
+
}
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { HttpCore, type
|
|
1
|
+
import { HttpCore, type RequestOptions } from "../core/http.js";
|
|
2
2
|
import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, ApiResponseError, BadRequestError, ConflictError, ForbiddenError, InternalServerError, NotFoundError, PayloadTooLargeError, RateLimitedError, UnauthorizedError, UnprocessableEntityError } from "../errors.js";
|
|
3
3
|
import type { GenerateRequest, GenerationResultRead } from "../types.js";
|
|
4
4
|
export declare class GenerateResource {
|
|
5
5
|
private readonly _core;
|
|
6
6
|
constructor(_core: HttpCore);
|
|
7
7
|
/**
|
|
8
|
-
* Generate one package from a
|
|
8
|
+
* Generate one package from a Spec
|
|
9
9
|
*
|
|
10
10
|
* Returns one generated package without creating a Project.
|
|
11
11
|
*
|
|
@@ -15,12 +15,12 @@ export declare class GenerateResource {
|
|
|
15
15
|
* Use `download.url` to save the complete ZIP, verify `download.sha256`, and extract it into an
|
|
16
16
|
* empty directory. The link expires at `download.expires_at` and grants access to anyone who has
|
|
17
17
|
* it. CLI, MCP, and SDK calls supply an idempotency key automatically. Agents should request
|
|
18
|
-
* `fields=["download","
|
|
19
|
-
*
|
|
20
|
-
*
|
|
18
|
+
* `fields=["download","coverage","warnings","claim"]` to keep the MCP result compact; files can
|
|
19
|
+
* exceed the response limit. Download the ZIP instead of repeating generation to retrieve omitted
|
|
20
|
+
* files.
|
|
21
21
|
*
|
|
22
22
|
* Anonymous and Free requests include the first 25 operations. Paid plans include all operations.
|
|
23
|
-
* Anonymous requests are rate limited by IP address. Check `
|
|
23
|
+
* Anonymous requests are rate limited by IP address. Check `coverage` for omitted operations; an
|
|
24
24
|
* invalid API key returns `401`.
|
|
25
25
|
*
|
|
26
26
|
* An anonymous URL request without source headers may return `claim.url`. Sign in through that
|
|
@@ -29,7 +29,7 @@ export declare class GenerateResource {
|
|
|
29
29
|
* A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
|
|
30
30
|
* `POST /generate`
|
|
31
31
|
*/
|
|
32
|
-
run(body: GenerateRequest, params?: GenerateRunParams, options?: RequestOptions): Promise<
|
|
32
|
+
run(body: GenerateRequest, params?: GenerateRunParams, options?: RequestOptions): Promise<GenerationResultRead>;
|
|
33
33
|
/**
|
|
34
34
|
* Download a generated package
|
|
35
35
|
*
|
|
@@ -43,23 +43,23 @@ export declare class GenerateResource {
|
|
|
43
43
|
* creates a new download.
|
|
44
44
|
* `GET /generate/download`
|
|
45
45
|
*/
|
|
46
|
-
downloadPackage(params: GenerateDownloadPackageParams, options?: RequestOptions): Promise<
|
|
46
|
+
downloadPackage(params: GenerateDownloadPackageParams, options?: RequestOptions): Promise<Blob>;
|
|
47
47
|
}
|
|
48
48
|
export interface GenerateRunParams {
|
|
49
49
|
/**
|
|
50
|
-
* Identifies one logical write for 24 hours. The key is scoped to the authenticated
|
|
51
|
-
* operation;
|
|
52
|
-
* path, query, If-Match header, and JSON body replays the original response. Reusing
|
|
53
|
-
* changed intent returns 409. After expiry the key starts a new write.
|
|
50
|
+
* Identifies one logical write for 24 hours. The key is scoped to the authenticated organization
|
|
51
|
+
* and operation; generation without an organization uses a hashed network identity. Retrying the
|
|
52
|
+
* same method, path, query, If-Match header, and JSON body replays the original response. Reusing
|
|
53
|
+
* the key with changed intent returns 409. After expiry the key starts a new write.
|
|
54
54
|
*/
|
|
55
55
|
idempotencyKey?: string;
|
|
56
56
|
}
|
|
57
|
-
/**
|
|
57
|
+
/** Typed errors `run` can throw. */
|
|
58
58
|
export type GenerateRunError = BadRequestError | UnauthorizedError | ForbiddenError | ConflictError | PayloadTooLargeError | UnprocessableEntityError | RateLimitedError | InternalServerError | ApiResponseError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
59
59
|
export interface GenerateDownloadPackageParams {
|
|
60
60
|
/** Private download token from download.url in the generation result. */
|
|
61
61
|
token: string;
|
|
62
62
|
}
|
|
63
|
-
/**
|
|
63
|
+
/** Typed errors `downloadPackage` can throw. */
|
|
64
64
|
export type GenerateDownloadPackageError = BadRequestError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
65
65
|
//# sourceMappingURL=generate.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/resources/generate.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/resources/generate.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EACl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9
|
/**
|
|
10
|
-
* Generate one package from a
|
|
10
|
+
* Generate one package from a Spec
|
|
11
11
|
*
|
|
12
12
|
* Returns one generated package without creating a Project.
|
|
13
13
|
*
|
|
@@ -17,12 +17,12 @@ export class GenerateResource {
|
|
|
17
17
|
* Use `download.url` to save the complete ZIP, verify `download.sha256`, and extract it into an
|
|
18
18
|
* empty directory. The link expires at `download.expires_at` and grants access to anyone who has
|
|
19
19
|
* it. CLI, MCP, and SDK calls supply an idempotency key automatically. Agents should request
|
|
20
|
-
* `fields=["download","
|
|
21
|
-
*
|
|
22
|
-
*
|
|
20
|
+
* `fields=["download","coverage","warnings","claim"]` to keep the MCP result compact; files can
|
|
21
|
+
* exceed the response limit. Download the ZIP instead of repeating generation to retrieve omitted
|
|
22
|
+
* files.
|
|
23
23
|
*
|
|
24
24
|
* Anonymous and Free requests include the first 25 operations. Paid plans include all operations.
|
|
25
|
-
* Anonymous requests are rate limited by IP address. Check `
|
|
25
|
+
* Anonymous requests are rate limited by IP address. Check `coverage` for omitted operations; an
|
|
26
26
|
* invalid API key returns `401`.
|
|
27
27
|
*
|
|
28
28
|
* An anonymous URL request without source headers may return `claim.url`. Sign in through that
|
|
@@ -32,7 +32,7 @@ export class GenerateResource {
|
|
|
32
32
|
* `POST /generate`
|
|
33
33
|
*/
|
|
34
34
|
async run(body, params, options) {
|
|
35
|
-
return this._core.
|
|
35
|
+
return this._core.requestData({
|
|
36
36
|
method: "POST",
|
|
37
37
|
path: "/generate",
|
|
38
38
|
security: [{}, { "apiKey": [] }],
|
|
@@ -70,7 +70,7 @@ export class GenerateResource {
|
|
|
70
70
|
* `GET /generate/download`
|
|
71
71
|
*/
|
|
72
72
|
async downloadPackage(params, options) {
|
|
73
|
-
return this._core.
|
|
73
|
+
return this._core.requestData({
|
|
74
74
|
method: "GET",
|
|
75
75
|
path: "/generate/download",
|
|
76
76
|
security: [{}],
|
|
@@ -1,39 +1,83 @@
|
|
|
1
|
-
import { HttpCore, type
|
|
1
|
+
import { HttpCore, type RequestOptions } from "../core/http.js";
|
|
2
|
+
import { PagePromise } from "../core/pagination.js";
|
|
2
3
|
import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadRequestError, ForbiddenError, InternalServerError, NotFoundError, RateLimitedError, UnauthorizedError } from "../errors.js";
|
|
3
|
-
import type { GenerationId, GenerationResponseRead } from "../types.js";
|
|
4
|
+
import type { FileModelRead, GenerationId, GenerationResponseRead, GenerationStatus, GenerationSummaryRead, ProjectId, TargetId } from "../types.js";
|
|
4
5
|
export declare class GenerationsResource {
|
|
5
6
|
private readonly _core;
|
|
6
7
|
constructor(_core: HttpCore);
|
|
7
8
|
/**
|
|
8
|
-
*
|
|
9
|
+
* List generations
|
|
9
10
|
*
|
|
10
|
-
*
|
|
11
|
-
*
|
|
12
|
-
|
|
13
|
-
|
|
11
|
+
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
12
|
+
* `GET /generations`
|
|
13
|
+
*/
|
|
14
|
+
list(params?: GenerationsListParams, options?: RequestOptions): PagePromise<GenerationSummaryRead, GenerationsListError>;
|
|
15
|
+
/**
|
|
16
|
+
* Get a generation
|
|
17
|
+
*
|
|
18
|
+
* Returns the status of that Generation. `queued` and `running` mean generation is still in
|
|
19
|
+
* progress. `completed` means generated files are saved, not that repository delivery or a Draft
|
|
20
|
+
* is complete. List its files with listGenerationFiles and read each with getFile.
|
|
14
21
|
* `GET /generations/{generation_id}`
|
|
15
22
|
*/
|
|
16
|
-
|
|
23
|
+
get(generationId: GenerationId, options?: RequestOptions): Promise<GenerationResponseRead>;
|
|
17
24
|
/**
|
|
18
|
-
*
|
|
25
|
+
* List a Generation's files
|
|
26
|
+
*
|
|
27
|
+
* Lists the generated package's files, ordered by path. Read content with getFile.
|
|
19
28
|
*
|
|
20
|
-
*
|
|
21
|
-
* `
|
|
22
|
-
* `GET /generations/{generation_id}/file`
|
|
29
|
+
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
30
|
+
* `GET /generations/{generation_id}/files`
|
|
23
31
|
*/
|
|
24
|
-
|
|
32
|
+
listFiles(generationId: GenerationId, params?: GenerationsListFilesParams, options?: RequestOptions): PagePromise<FileModelRead, GenerationsListFilesError>;
|
|
25
33
|
/** Poll until files are generated or the Generation fails. */
|
|
26
34
|
wait(generationId: GenerationId, options?: RequestOptions & {
|
|
27
35
|
intervalMs?: number;
|
|
28
36
|
waitTimeoutMs?: number;
|
|
29
|
-
}): Promise<
|
|
37
|
+
}): Promise<GenerationResponseRead>;
|
|
30
38
|
}
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
39
|
+
export interface GenerationsListParams {
|
|
40
|
+
/**
|
|
41
|
+
* Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
|
|
42
|
+
* representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
|
|
43
|
+
* invalid_request. List query parameters must appear only once; unrecognized parameters also
|
|
44
|
+
* return 400.
|
|
45
|
+
*/
|
|
46
|
+
limit?: number;
|
|
47
|
+
/**
|
|
48
|
+
* Opaque cursor from the preceding page's next_cursor. Valid only for the same organization,
|
|
49
|
+
* operation, filters, and ordering that issued it. Omit to start at the first page. Empty,
|
|
50
|
+
* malformed, or repeated cursors return 400 invalid_request. The page limit may change between
|
|
51
|
+
* requests.
|
|
52
|
+
*/
|
|
53
|
+
cursor?: string;
|
|
54
|
+
/** Only Generations in this Project. */
|
|
55
|
+
projectId?: ProjectId;
|
|
56
|
+
/** Only Generations of this Target. */
|
|
57
|
+
targetId?: TargetId;
|
|
58
|
+
/** Only Generations with this status. */
|
|
59
|
+
status?: GenerationStatus;
|
|
60
|
+
}
|
|
61
|
+
/** Typed errors `list` can throw. */
|
|
62
|
+
export type GenerationsListError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
63
|
+
/** Typed errors `get` can throw. */
|
|
64
|
+
export type GenerationsGetError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
65
|
+
export interface GenerationsListFilesParams {
|
|
66
|
+
/**
|
|
67
|
+
* Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
|
|
68
|
+
* representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
|
|
69
|
+
* invalid_request. List query parameters must appear only once; unrecognized parameters also
|
|
70
|
+
* return 400.
|
|
71
|
+
*/
|
|
72
|
+
limit?: number;
|
|
73
|
+
/**
|
|
74
|
+
* Opaque cursor from the preceding page's next_cursor. Valid only for the same organization,
|
|
75
|
+
* operation, filters, and ordering that issued it. Omit to start at the first page. Empty,
|
|
76
|
+
* malformed, or repeated cursors return 400 invalid_request. The page limit may change between
|
|
77
|
+
* requests.
|
|
78
|
+
*/
|
|
79
|
+
cursor?: string;
|
|
36
80
|
}
|
|
37
|
-
/**
|
|
38
|
-
export type
|
|
81
|
+
/** Typed errors `listFiles` can throw. */
|
|
82
|
+
export type GenerationsListFilesError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
39
83
|
//# sourceMappingURL=generations.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"generations.d.ts","sourceRoot":"","sources":["../../src/resources/generations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,
|
|
1
|
+
{"version":3,"file":"generations.d.ts","sourceRoot":"","sources":["../../src/resources/generations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAY,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,aAAa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,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,oCAAoC;AACpC,MAAM,MAAM,mBAAmB,GAC3B,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,MAAM,WAAW,0BAA0B;IACzC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,0CAA0C;AAC1C,MAAM,MAAM,yBAAyB,GACjC,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// typeship — generations resource.
|
|
2
2
|
// Generated by typeship — https://typeship.dev
|
|
3
|
+
import { paginate } from "../core/pagination.js";
|
|
3
4
|
import { BadRequestError, ForbiddenError, InternalServerError, NotFoundError, RateLimitedError, UnauthorizedError, } from "../errors.js";
|
|
4
5
|
export class GenerationsResource {
|
|
5
6
|
_core;
|
|
@@ -7,16 +8,53 @@ export class GenerationsResource {
|
|
|
7
8
|
this._core = _core;
|
|
8
9
|
}
|
|
9
10
|
/**
|
|
10
|
-
*
|
|
11
|
+
* List generations
|
|
11
12
|
*
|
|
12
|
-
*
|
|
13
|
-
*
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
14
|
+
* `GET /generations`
|
|
15
|
+
*/
|
|
16
|
+
list(params, options) {
|
|
17
|
+
return paginate(this._core, {
|
|
18
|
+
method: "GET",
|
|
19
|
+
path: "/generations",
|
|
20
|
+
security: [{ "apiKey": [] }],
|
|
21
|
+
query: {
|
|
22
|
+
limit: params?.limit,
|
|
23
|
+
cursor: params?.cursor,
|
|
24
|
+
project_id: params?.projectId,
|
|
25
|
+
target_id: params?.targetId,
|
|
26
|
+
status: params?.status,
|
|
27
|
+
},
|
|
28
|
+
errors: {
|
|
29
|
+
"400": BadRequestError,
|
|
30
|
+
"401": UnauthorizedError,
|
|
31
|
+
"403": ForbiddenError,
|
|
32
|
+
"404": NotFoundError,
|
|
33
|
+
"429": RateLimitedError,
|
|
34
|
+
"500": InternalServerError,
|
|
35
|
+
},
|
|
36
|
+
idempotent: true,
|
|
37
|
+
schemaKey: "generations.list",
|
|
38
|
+
options,
|
|
39
|
+
}, {
|
|
40
|
+
style: "cursor",
|
|
41
|
+
itemsField: "data",
|
|
42
|
+
cursorParam: "cursor",
|
|
43
|
+
nextCursorField: "next_cursor",
|
|
44
|
+
hasMoreField: "has_more",
|
|
45
|
+
limitParam: "limit",
|
|
46
|
+
});
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Get a generation
|
|
50
|
+
*
|
|
51
|
+
* Returns the status of that Generation. `queued` and `running` mean generation is still in
|
|
52
|
+
* progress. `completed` means generated files are saved, not that repository delivery or a Draft
|
|
53
|
+
* is complete. List its files with listGenerationFiles and read each with getFile.
|
|
16
54
|
* `GET /generations/{generation_id}`
|
|
17
55
|
*/
|
|
18
|
-
async
|
|
19
|
-
return this._core.
|
|
56
|
+
async get(generationId, options) {
|
|
57
|
+
return this._core.requestData({
|
|
20
58
|
method: "GET",
|
|
21
59
|
path: `/generations/${encodeURIComponent(String(generationId))}`,
|
|
22
60
|
security: [{ "apiKey": [] }],
|
|
@@ -28,24 +66,26 @@ export class GenerationsResource {
|
|
|
28
66
|
"500": InternalServerError,
|
|
29
67
|
},
|
|
30
68
|
idempotent: true,
|
|
31
|
-
schemaKey: "generations.
|
|
69
|
+
schemaKey: "generations.get",
|
|
32
70
|
options,
|
|
33
71
|
});
|
|
34
72
|
}
|
|
35
73
|
/**
|
|
36
|
-
*
|
|
74
|
+
* List a Generation's files
|
|
75
|
+
*
|
|
76
|
+
* Lists the generated package's files, ordered by path. Read content with getFile.
|
|
37
77
|
*
|
|
38
|
-
*
|
|
39
|
-
* `
|
|
40
|
-
* `GET /generations/{generation_id}/file`
|
|
78
|
+
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
79
|
+
* `GET /generations/{generation_id}/files`
|
|
41
80
|
*/
|
|
42
|
-
|
|
43
|
-
return this._core
|
|
81
|
+
listFiles(generationId, params, options) {
|
|
82
|
+
return paginate(this._core, {
|
|
44
83
|
method: "GET",
|
|
45
|
-
path: `/generations/${encodeURIComponent(String(generationId))}/
|
|
84
|
+
path: `/generations/${encodeURIComponent(String(generationId))}/files`,
|
|
46
85
|
security: [{ "apiKey": [] }],
|
|
47
86
|
query: {
|
|
48
|
-
|
|
87
|
+
limit: params?.limit,
|
|
88
|
+
cursor: params?.cursor,
|
|
49
89
|
},
|
|
50
90
|
errors: {
|
|
51
91
|
"400": BadRequestError,
|
|
@@ -56,20 +96,27 @@ export class GenerationsResource {
|
|
|
56
96
|
"500": InternalServerError,
|
|
57
97
|
},
|
|
58
98
|
idempotent: true,
|
|
59
|
-
schemaKey: "generations.
|
|
99
|
+
schemaKey: "generations.listFiles",
|
|
60
100
|
options,
|
|
101
|
+
}, {
|
|
102
|
+
style: "cursor",
|
|
103
|
+
itemsField: "data",
|
|
104
|
+
cursorParam: "cursor",
|
|
105
|
+
nextCursorField: "next_cursor",
|
|
106
|
+
hasMoreField: "has_more",
|
|
107
|
+
limitParam: "limit",
|
|
61
108
|
});
|
|
62
109
|
}
|
|
63
110
|
/** Poll until files are generated or the Generation fails. */
|
|
64
111
|
async wait(generationId, options = {}) {
|
|
65
|
-
const { intervalMs =
|
|
112
|
+
const { intervalMs = 3_000, waitTimeoutMs = 600_000, ...requestOptions } = options;
|
|
66
113
|
const deadline = Date.now() + waitTimeoutMs;
|
|
67
114
|
while (true) {
|
|
68
115
|
if (requestOptions.signal?.aborted) {
|
|
69
116
|
throw requestOptions.signal.reason ?? new Error("Generation wait aborted.");
|
|
70
117
|
}
|
|
71
|
-
const result = await this.
|
|
72
|
-
if (
|
|
118
|
+
const result = await this.get(generationId, requestOptions);
|
|
119
|
+
if (result.status !== "queued" && result.status !== "running")
|
|
73
120
|
return result;
|
|
74
121
|
if (Date.now() >= deadline)
|
|
75
122
|
throw new Error("Timed out waiting for Generation " + generationId + ".");
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { HttpCore, type RequestOptions } from "../core/http.js";
|
|
2
|
+
import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, ForbiddenError, InternalServerError, RateLimitedError, UnauthorizedError } from "../errors.js";
|
|
3
|
+
import type { OrganizationRead } from "../types.js";
|
|
4
|
+
export declare class OrganizationResource {
|
|
5
|
+
private readonly _core;
|
|
6
|
+
constructor(_core: HttpCore);
|
|
7
|
+
/**
|
|
8
|
+
* The organization behind the presented credentials
|
|
9
|
+
*
|
|
10
|
+
* Returns the organization associated with your credential. The Typeship CLI uses this endpoint
|
|
11
|
+
* for `whoami`.
|
|
12
|
+
* `GET /organization`
|
|
13
|
+
*/
|
|
14
|
+
get(options?: RequestOptions): Promise<OrganizationRead>;
|
|
15
|
+
}
|
|
16
|
+
/** Typed errors `get` can throw. */
|
|
17
|
+
export type OrganizationGetError = UnauthorizedError | ForbiddenError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
18
|
+
//# sourceMappingURL=organization.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"organization.d.ts","sourceRoot":"","sources":["../../src/resources/organization.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAgB,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAElE,qBAAa,oBAAoB;IACnB,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;;OAMG;IACG,GAAG,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,gBAAgB,CAAC;CAgB/D;AAED,oCAAoC;AACpC,MAAM,MAAM,oBAAoB,GAC5B,iBAAiB,GACjB,cAAc,GACd,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
|
|
@@ -1,22 +1,22 @@
|
|
|
1
|
-
// typeship —
|
|
1
|
+
// typeship — organization resource.
|
|
2
2
|
// Generated by typeship — https://typeship.dev
|
|
3
3
|
import { ForbiddenError, InternalServerError, RateLimitedError, UnauthorizedError, } from "../errors.js";
|
|
4
|
-
export class
|
|
4
|
+
export class OrganizationResource {
|
|
5
5
|
_core;
|
|
6
6
|
constructor(_core) {
|
|
7
7
|
this._core = _core;
|
|
8
8
|
}
|
|
9
9
|
/**
|
|
10
|
-
* The
|
|
10
|
+
* The organization behind the presented credentials
|
|
11
11
|
*
|
|
12
|
-
* Returns the
|
|
13
|
-
* `whoami`.
|
|
14
|
-
* `GET /
|
|
12
|
+
* Returns the organization associated with your credential. The Typeship CLI uses this endpoint
|
|
13
|
+
* for `whoami`.
|
|
14
|
+
* `GET /organization`
|
|
15
15
|
*/
|
|
16
|
-
async
|
|
17
|
-
return this._core.
|
|
16
|
+
async get(options) {
|
|
17
|
+
return this._core.requestData({
|
|
18
18
|
method: "GET",
|
|
19
|
-
path: "/
|
|
19
|
+
path: "/organization",
|
|
20
20
|
security: [{ "apiKey": [] }],
|
|
21
21
|
errors: {
|
|
22
22
|
"401": UnauthorizedError,
|
|
@@ -25,7 +25,7 @@ export class AccountResource {
|
|
|
25
25
|
"500": InternalServerError,
|
|
26
26
|
},
|
|
27
27
|
idempotent: true,
|
|
28
|
-
schemaKey: "
|
|
28
|
+
schemaKey: "organization.get",
|
|
29
29
|
options,
|
|
30
30
|
});
|
|
31
31
|
}
|