@typeship-ax/mcp 0.19.0 → 0.21.0
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 +1 -1
- package/api.json +7519 -6363
- package/api.md +8015 -6765
- package/dist/api-identity.d.ts.map +1 -1
- package/dist/api-identity.js +6 -1
- 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/mcp-protocol.js +2 -2
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +6 -5
- package/dist/ops.d.ts +1 -1
- package/dist/ops.d.ts.map +1 -1
- package/dist/ops.js +40 -43
- package/dist/resources/api-keys.d.ts +16 -15
- package/dist/resources/api-keys.d.ts.map +1 -1
- package/dist/resources/api-keys.js +6 -6
- package/dist/resources/deliveries.d.ts +47 -0
- package/dist/resources/deliveries.d.ts.map +1 -0
- package/dist/resources/deliveries.js +70 -0
- package/dist/resources/drafts.d.ts +157 -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 +67 -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 +50 -139
- package/dist/resources/projects.d.ts.map +1 -1
- package/dist/resources/projects.js +29 -179
- package/dist/resources/publications.d.ts +47 -0
- package/dist/resources/publications.d.ts.map +1 -0
- package/dist/resources/publications.js +70 -0
- package/dist/resources/releases.d.ts +68 -0
- package/dist/resources/releases.d.ts.map +1 -0
- package/dist/resources/releases.js +102 -0
- package/dist/resources/spec-revisions.d.ts +87 -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 +73 -0
- package/dist/resources/specs.d.ts.map +1 -0
- package/dist/resources/specs.js +108 -0
- package/dist/resources/targets.d.ts +48 -267
- 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 +143 -149
- package/dist/types.d.ts +1320 -1637
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +84 -76
- package/package.json +1 -1
- package/server.json +2 -2
- package/src/api-identity.ts +6 -2
- 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/mcp-protocol.ts +2 -2
- package/src/mcp.ts +7 -6
- package/src/ops.ts +41 -44
- package/src/resources/api-keys.ts +19 -21
- package/src/resources/deliveries.ts +140 -0
- package/src/resources/drafts.ts +424 -0
- package/src/resources/files.ts +68 -0
- package/src/resources/generate.ts +16 -19
- package/src/resources/generations.ts +148 -35
- package/src/resources/{account.ts → organization.ts} +14 -14
- package/src/resources/projects.ts +56 -350
- package/src/resources/publications.ts +140 -0
- package/src/resources/releases.ts +201 -0
- package/src/resources/spec-revisions.ts +239 -0
- package/src/resources/specs.ts +201 -0
- package/src/resources/targets.ts +63 -765
- package/src/schemas.ts +143 -149
- package/src/types.ts +1418 -1740
- 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,70 @@
|
|
|
1
|
+
// typeship — publications resource.
|
|
2
|
+
// Generated by typeship — https://typeship.dev
|
|
3
|
+
import { paginate } from "../core/pagination.js";
|
|
4
|
+
import { BadRequestError, ForbiddenError, InternalServerError, NotFoundError, RateLimitedError, UnauthorizedError, } from "../errors.js";
|
|
5
|
+
export class PublicationsResource {
|
|
6
|
+
_core;
|
|
7
|
+
constructor(_core) {
|
|
8
|
+
this._core = _core;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* List publications
|
|
12
|
+
*
|
|
13
|
+
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
14
|
+
* `GET /publications`
|
|
15
|
+
*/
|
|
16
|
+
list(params, options) {
|
|
17
|
+
return paginate(this._core, {
|
|
18
|
+
method: "GET",
|
|
19
|
+
path: "/publications",
|
|
20
|
+
security: [{ "apiKey": [] }],
|
|
21
|
+
query: {
|
|
22
|
+
limit: params?.limit,
|
|
23
|
+
cursor: params?.cursor,
|
|
24
|
+
release_id: params?.releaseId,
|
|
25
|
+
},
|
|
26
|
+
errors: {
|
|
27
|
+
"400": BadRequestError,
|
|
28
|
+
"401": UnauthorizedError,
|
|
29
|
+
"403": ForbiddenError,
|
|
30
|
+
"404": NotFoundError,
|
|
31
|
+
"429": RateLimitedError,
|
|
32
|
+
"500": InternalServerError,
|
|
33
|
+
},
|
|
34
|
+
idempotent: true,
|
|
35
|
+
schemaKey: "publications.list",
|
|
36
|
+
options,
|
|
37
|
+
}, {
|
|
38
|
+
style: "cursor",
|
|
39
|
+
itemsField: "data",
|
|
40
|
+
cursorParam: "cursor",
|
|
41
|
+
nextCursorField: "next_cursor",
|
|
42
|
+
hasMoreField: "has_more",
|
|
43
|
+
limitParam: "limit",
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get publishing status
|
|
48
|
+
*
|
|
49
|
+
* Returns the registry publishing status for a release. A status in another organization returns
|
|
50
|
+
* 404 resource_not_found.
|
|
51
|
+
* `GET /publications/{publication_id}`
|
|
52
|
+
*/
|
|
53
|
+
async get(publicationId, options) {
|
|
54
|
+
return this._core.requestData({
|
|
55
|
+
method: "GET",
|
|
56
|
+
path: `/publications/${encodeURIComponent(String(publicationId))}`,
|
|
57
|
+
security: [{ "apiKey": [] }],
|
|
58
|
+
errors: {
|
|
59
|
+
"401": UnauthorizedError,
|
|
60
|
+
"403": ForbiddenError,
|
|
61
|
+
"404": NotFoundError,
|
|
62
|
+
"429": RateLimitedError,
|
|
63
|
+
"500": InternalServerError,
|
|
64
|
+
},
|
|
65
|
+
idempotent: true,
|
|
66
|
+
schemaKey: "publications.get",
|
|
67
|
+
options,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,68 @@
|
|
|
1
|
+
import { HttpCore, type RequestOptions } from "../core/http.js";
|
|
2
|
+
import { PagePromise } from "../core/pagination.js";
|
|
3
|
+
import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadGatewayError, BadRequestError, ConflictError, ForbiddenError, InternalServerError, NotFoundError, RateLimitedError, UnauthorizedError } from "../errors.js";
|
|
4
|
+
import type { ReleaseId, ReleaseRead, ReleaseResponseRead, TargetId } from "../types.js";
|
|
5
|
+
export declare class ReleasesResource {
|
|
6
|
+
private readonly _core;
|
|
7
|
+
constructor(_core: HttpCore);
|
|
8
|
+
/**
|
|
9
|
+
* List releases
|
|
10
|
+
*
|
|
11
|
+
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
12
|
+
* `GET /releases`
|
|
13
|
+
*/
|
|
14
|
+
list(params?: ReleasesListParams, options?: RequestOptions): PagePromise<ReleaseRead, ReleasesListError>;
|
|
15
|
+
/**
|
|
16
|
+
* Get an immutable release
|
|
17
|
+
* `GET /releases/{release_id}`
|
|
18
|
+
*/
|
|
19
|
+
get(releaseId: ReleaseId, options?: RequestOptions): Promise<ReleaseResponseRead>;
|
|
20
|
+
/**
|
|
21
|
+
* Retry publishing an exact release
|
|
22
|
+
*
|
|
23
|
+
* Retries publishing the specified release through its repository workflow. Uses that release's
|
|
24
|
+
* version and accepted commit, even if a newer Draft or release exists.
|
|
25
|
+
*
|
|
26
|
+
* A `502 repository_unavailable` means the repository publishing workflow could not be
|
|
27
|
+
* dispatched, and nothing was changed.
|
|
28
|
+
*
|
|
29
|
+
* A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
|
|
30
|
+
* `POST /releases/{release_id}/republish`
|
|
31
|
+
*/
|
|
32
|
+
republish(releaseId: ReleaseId, params?: ReleasesRepublishParams, options?: RequestOptions): Promise<ReleaseResponseRead>;
|
|
33
|
+
}
|
|
34
|
+
export interface ReleasesListParams {
|
|
35
|
+
/**
|
|
36
|
+
* Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
|
|
37
|
+
* representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
|
|
38
|
+
* input_invalid. List query parameters must appear only once; repeated or unrecognized parameters
|
|
39
|
+
* return 400 query_param_invalid.
|
|
40
|
+
*/
|
|
41
|
+
limit?: number;
|
|
42
|
+
/**
|
|
43
|
+
* Opaque cursor from the preceding page's next_cursor. Valid only for the same organization,
|
|
44
|
+
* operation, filters, and ordering that issued it. Omit to start at the first page. Empty or
|
|
45
|
+
* malformed cursors, and cursors issued for different filters, return 400 cursor_invalid; start
|
|
46
|
+
* again from the first page. Repeated cursors return 400 query_param_invalid. The page limit may
|
|
47
|
+
* change between requests.
|
|
48
|
+
*/
|
|
49
|
+
cursor?: string;
|
|
50
|
+
/** Only releases of this Target. */
|
|
51
|
+
targetId?: TargetId;
|
|
52
|
+
}
|
|
53
|
+
/** Typed errors `list` can throw. */
|
|
54
|
+
export type ReleasesListError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
55
|
+
/** Typed errors `get` can throw. */
|
|
56
|
+
export type ReleasesGetError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
57
|
+
export interface ReleasesRepublishParams {
|
|
58
|
+
/**
|
|
59
|
+
* Identifies one logical write for 24 hours. The key is scoped to the authenticated organization
|
|
60
|
+
* and operation; generation without an organization uses a hashed network identity. Retrying the
|
|
61
|
+
* same method, path, query, If-Match header, and JSON body replays the original response. Reusing
|
|
62
|
+
* the key with changed intent returns 409. After expiry the key starts a new write.
|
|
63
|
+
*/
|
|
64
|
+
idempotencyKey?: string;
|
|
65
|
+
}
|
|
66
|
+
/** Typed errors `republish` can throw. */
|
|
67
|
+
export type ReleasesRepublishError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | RateLimitedError | InternalServerError | BadGatewayError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
68
|
+
//# sourceMappingURL=releases.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"releases.d.ts","sourceRoot":"","sources":["../../src/resources/releases.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,eAAe,EACf,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAEV,SAAS,EAGT,WAAW,EAEX,mBAAmB,EACnB,QAAQ,EACT,MAAM,aAAa,CAAC;AAErB,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;OAKG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC,WAAW,EAAE,iBAAiB,CAAC;IA+BxG;;;OAGG;IACG,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAkBvF;;;;;;;;;;;OAWG;IACG,SAAS,CACb,SAAS,EAAE,SAAS,EACpB,MAAM,CAAC,EAAE,uBAAuB,EAChC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,mBAAmB,CAAC;CAuBhC;AAED,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,qCAAqC;AACrC,MAAM,MAAM,iBAAiB,GACzB,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,gBAAgB,GACxB,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,MAAM,WAAW,uBAAuB;IACtC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,0CAA0C;AAC1C,MAAM,MAAM,sBAAsB,GAC9B,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,eAAe,GACf,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
|
|
@@ -0,0 +1,102 @@
|
|
|
1
|
+
// typeship — releases resource.
|
|
2
|
+
// Generated by typeship — https://typeship.dev
|
|
3
|
+
import { paginate } from "../core/pagination.js";
|
|
4
|
+
import { BadGatewayError, BadRequestError, ConflictError, ForbiddenError, InternalServerError, NotFoundError, RateLimitedError, UnauthorizedError, } from "../errors.js";
|
|
5
|
+
export class ReleasesResource {
|
|
6
|
+
_core;
|
|
7
|
+
constructor(_core) {
|
|
8
|
+
this._core = _core;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* List releases
|
|
12
|
+
*
|
|
13
|
+
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
14
|
+
* `GET /releases`
|
|
15
|
+
*/
|
|
16
|
+
list(params, options) {
|
|
17
|
+
return paginate(this._core, {
|
|
18
|
+
method: "GET",
|
|
19
|
+
path: "/releases",
|
|
20
|
+
security: [{ "apiKey": [] }],
|
|
21
|
+
query: {
|
|
22
|
+
limit: params?.limit,
|
|
23
|
+
cursor: params?.cursor,
|
|
24
|
+
target_id: params?.targetId,
|
|
25
|
+
},
|
|
26
|
+
errors: {
|
|
27
|
+
"400": BadRequestError,
|
|
28
|
+
"401": UnauthorizedError,
|
|
29
|
+
"403": ForbiddenError,
|
|
30
|
+
"404": NotFoundError,
|
|
31
|
+
"429": RateLimitedError,
|
|
32
|
+
"500": InternalServerError,
|
|
33
|
+
},
|
|
34
|
+
idempotent: true,
|
|
35
|
+
schemaKey: "releases.list",
|
|
36
|
+
options,
|
|
37
|
+
}, {
|
|
38
|
+
style: "cursor",
|
|
39
|
+
itemsField: "data",
|
|
40
|
+
cursorParam: "cursor",
|
|
41
|
+
nextCursorField: "next_cursor",
|
|
42
|
+
hasMoreField: "has_more",
|
|
43
|
+
limitParam: "limit",
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get an immutable release
|
|
48
|
+
* `GET /releases/{release_id}`
|
|
49
|
+
*/
|
|
50
|
+
async get(releaseId, options) {
|
|
51
|
+
return this._core.requestData({
|
|
52
|
+
method: "GET",
|
|
53
|
+
path: `/releases/${encodeURIComponent(String(releaseId))}`,
|
|
54
|
+
security: [{ "apiKey": [] }],
|
|
55
|
+
errors: {
|
|
56
|
+
"401": UnauthorizedError,
|
|
57
|
+
"403": ForbiddenError,
|
|
58
|
+
"404": NotFoundError,
|
|
59
|
+
"429": RateLimitedError,
|
|
60
|
+
"500": InternalServerError,
|
|
61
|
+
},
|
|
62
|
+
idempotent: true,
|
|
63
|
+
schemaKey: "releases.get",
|
|
64
|
+
options,
|
|
65
|
+
});
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Retry publishing an exact release
|
|
69
|
+
*
|
|
70
|
+
* Retries publishing the specified release through its repository workflow. Uses that release's
|
|
71
|
+
* version and accepted commit, even if a newer Draft or release exists.
|
|
72
|
+
*
|
|
73
|
+
* A `502 repository_unavailable` means the repository publishing workflow could not be
|
|
74
|
+
* dispatched, and nothing was changed.
|
|
75
|
+
*
|
|
76
|
+
* A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
|
|
77
|
+
* `POST /releases/{release_id}/republish`
|
|
78
|
+
*/
|
|
79
|
+
async republish(releaseId, params, options) {
|
|
80
|
+
return this._core.requestData({
|
|
81
|
+
method: "POST",
|
|
82
|
+
path: `/releases/${encodeURIComponent(String(releaseId))}/republish`,
|
|
83
|
+
security: [{ "apiKey": [] }],
|
|
84
|
+
headers: {
|
|
85
|
+
"Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
|
|
86
|
+
},
|
|
87
|
+
errors: {
|
|
88
|
+
"400": BadRequestError,
|
|
89
|
+
"401": UnauthorizedError,
|
|
90
|
+
"403": ForbiddenError,
|
|
91
|
+
"404": NotFoundError,
|
|
92
|
+
"409": ConflictError,
|
|
93
|
+
"429": RateLimitedError,
|
|
94
|
+
"500": InternalServerError,
|
|
95
|
+
"502": BadGatewayError,
|
|
96
|
+
},
|
|
97
|
+
idempotencyKey: "Idempotency-Key",
|
|
98
|
+
schemaKey: "releases.republish",
|
|
99
|
+
options,
|
|
100
|
+
});
|
|
101
|
+
}
|
|
102
|
+
}
|
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import { HttpCore, type RequestOptions } from "../core/http.js";
|
|
2
|
+
import { PagePromise } from "../core/pagination.js";
|
|
3
|
+
import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadRequestError, ForbiddenError, InternalServerError, NotFoundError, RateLimitedError, UnauthorizedError } from "../errors.js";
|
|
4
|
+
import type { SpecId, SpecRevisionFileRead, SpecRevisionId, SpecRevisionRead, SpecRevisionResponseRead } from "../types.js";
|
|
5
|
+
export declare class SpecRevisionsResource {
|
|
6
|
+
private readonly _core;
|
|
7
|
+
constructor(_core: HttpCore);
|
|
8
|
+
/**
|
|
9
|
+
* List Spec Revisions
|
|
10
|
+
*
|
|
11
|
+
* Lists Spec Revisions, newest first. Source content is not included; list a revision's files
|
|
12
|
+
* with listSpecRevisionFiles.
|
|
13
|
+
*
|
|
14
|
+
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
15
|
+
* `GET /spec-revisions`
|
|
16
|
+
*/
|
|
17
|
+
list(params?: SpecRevisionsListParams, options?: RequestOptions): PagePromise<SpecRevisionRead, SpecRevisionsListError>;
|
|
18
|
+
/**
|
|
19
|
+
* Get a Spec Revision
|
|
20
|
+
*
|
|
21
|
+
* Returns metadata for a saved Spec Revision with a Diagnostics summary. Pass
|
|
22
|
+
* `include=diagnostics` to add every Diagnostic, evaluated with the Spec's current patches and
|
|
23
|
+
* Diagnostic policy. List its source files and resolved document with listSpecRevisionFiles.
|
|
24
|
+
* `GET /spec-revisions/{spec_revision_id}`
|
|
25
|
+
*/
|
|
26
|
+
get(specRevisionId: SpecRevisionId, params?: SpecRevisionsGetParams, options?: RequestOptions): Promise<SpecRevisionResponseRead>;
|
|
27
|
+
/**
|
|
28
|
+
* List a Spec Revision's files
|
|
29
|
+
*
|
|
30
|
+
* Lists the captured source files and the resolved document Typeship generated from, ordered by
|
|
31
|
+
* path. Read content with getFile.
|
|
32
|
+
*
|
|
33
|
+
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
34
|
+
* `GET /spec-revisions/{spec_revision_id}/files`
|
|
35
|
+
*/
|
|
36
|
+
listFiles(specRevisionId: SpecRevisionId, params?: SpecRevisionsListFilesParams, options?: RequestOptions): PagePromise<SpecRevisionFileRead, SpecRevisionsListFilesError>;
|
|
37
|
+
}
|
|
38
|
+
export interface SpecRevisionsListParams {
|
|
39
|
+
/**
|
|
40
|
+
* Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
|
|
41
|
+
* representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
|
|
42
|
+
* input_invalid. List query parameters must appear only once; repeated or unrecognized parameters
|
|
43
|
+
* return 400 query_param_invalid.
|
|
44
|
+
*/
|
|
45
|
+
limit?: number;
|
|
46
|
+
/**
|
|
47
|
+
* Opaque cursor from the preceding page's next_cursor. Valid only for the same organization,
|
|
48
|
+
* operation, filters, and ordering that issued it. Omit to start at the first page. Empty or
|
|
49
|
+
* malformed cursors, and cursors issued for different filters, return 400 cursor_invalid; start
|
|
50
|
+
* again from the first page. Repeated cursors return 400 query_param_invalid. The page limit may
|
|
51
|
+
* change between requests.
|
|
52
|
+
*/
|
|
53
|
+
cursor?: string;
|
|
54
|
+
/** Only revisions of this Spec. */
|
|
55
|
+
specId?: SpecId;
|
|
56
|
+
}
|
|
57
|
+
/** Typed errors `list` can throw. */
|
|
58
|
+
export type SpecRevisionsListError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
59
|
+
export interface SpecRevisionsGetParams {
|
|
60
|
+
/**
|
|
61
|
+
* Add related data to the response. `diagnostics` adds the `diagnostics` and `patch_diagnostics`
|
|
62
|
+
* arrays.
|
|
63
|
+
*/
|
|
64
|
+
include?: "diagnostics";
|
|
65
|
+
}
|
|
66
|
+
/** Typed errors `get` can throw. */
|
|
67
|
+
export type SpecRevisionsGetError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
68
|
+
export interface SpecRevisionsListFilesParams {
|
|
69
|
+
/**
|
|
70
|
+
* Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
|
|
71
|
+
* representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
|
|
72
|
+
* input_invalid. List query parameters must appear only once; repeated or unrecognized parameters
|
|
73
|
+
* return 400 query_param_invalid.
|
|
74
|
+
*/
|
|
75
|
+
limit?: number;
|
|
76
|
+
/**
|
|
77
|
+
* Opaque cursor from the preceding page's next_cursor. Valid only for the same organization,
|
|
78
|
+
* operation, filters, and ordering that issued it. Omit to start at the first page. Empty or
|
|
79
|
+
* malformed cursors, and cursors issued for different filters, return 400 cursor_invalid; start
|
|
80
|
+
* again from the first page. Repeated cursors return 400 query_param_invalid. The page limit may
|
|
81
|
+
* change between requests.
|
|
82
|
+
*/
|
|
83
|
+
cursor?: string;
|
|
84
|
+
}
|
|
85
|
+
/** Typed errors `listFiles` can throw. */
|
|
86
|
+
export type SpecRevisionsListFilesError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
87
|
+
//# sourceMappingURL=spec-revisions.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"spec-revisions.d.ts","sourceRoot":"","sources":["../../src/resources/spec-revisions.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,EACb,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACV,MAAM,EAKN,oBAAoB,EACpB,cAAc,EAGd,gBAAgB,EAEhB,wBAAwB,EACzB,MAAM,aAAa,CAAC;AAErB,qBAAa,qBAAqB;IACpB,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;;;;OAQG;IACH,IAAI,CACF,MAAM,CAAC,EAAE,uBAAuB,EAChC,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,gBAAgB,EAAE,sBAAsB,CAAC;IA+BxD;;;;;;;OAOG;IACG,GAAG,CACP,cAAc,EAAE,cAAc,EAC9B,MAAM,CAAC,EAAE,sBAAsB,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,wBAAwB,CAAC;IAsBpC;;;;;;;;OAQG;IACH,SAAS,CACP,cAAc,EAAE,cAAc,EAC9B,MAAM,CAAC,EAAE,4BAA4B,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,oBAAoB,EAAE,2BAA2B,CAAC;CA6BlE;AAED,MAAM,WAAW,uBAAuB;IACtC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,mCAAmC;IACnC,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qCAAqC;AACrC,MAAM,MAAM,sBAAsB,GAC9B,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,MAAM,WAAW,sBAAsB;IACrC;;;OAGG;IACH,OAAO,CAAC,EAAE,aAAa,CAAC;CACzB;AAED,oCAAoC;AACpC,MAAM,MAAM,qBAAqB,GAC7B,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,MAAM,WAAW,4BAA4B;IAC3C;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,0CAA0C;AAC1C,MAAM,MAAM,2BAA2B,GACnC,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
|
|
@@ -0,0 +1,116 @@
|
|
|
1
|
+
// typeship — specRevisions resource.
|
|
2
|
+
// Generated by typeship — https://typeship.dev
|
|
3
|
+
import { paginate } from "../core/pagination.js";
|
|
4
|
+
import { BadRequestError, ForbiddenError, InternalServerError, NotFoundError, RateLimitedError, UnauthorizedError, } from "../errors.js";
|
|
5
|
+
export class SpecRevisionsResource {
|
|
6
|
+
_core;
|
|
7
|
+
constructor(_core) {
|
|
8
|
+
this._core = _core;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* List Spec Revisions
|
|
12
|
+
*
|
|
13
|
+
* Lists Spec Revisions, newest first. Source content is not included; list a revision's files
|
|
14
|
+
* with listSpecRevisionFiles.
|
|
15
|
+
*
|
|
16
|
+
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
17
|
+
* `GET /spec-revisions`
|
|
18
|
+
*/
|
|
19
|
+
list(params, options) {
|
|
20
|
+
return paginate(this._core, {
|
|
21
|
+
method: "GET",
|
|
22
|
+
path: "/spec-revisions",
|
|
23
|
+
security: [{ "apiKey": [] }],
|
|
24
|
+
query: {
|
|
25
|
+
limit: params?.limit,
|
|
26
|
+
cursor: params?.cursor,
|
|
27
|
+
spec_id: params?.specId,
|
|
28
|
+
},
|
|
29
|
+
errors: {
|
|
30
|
+
"400": BadRequestError,
|
|
31
|
+
"401": UnauthorizedError,
|
|
32
|
+
"403": ForbiddenError,
|
|
33
|
+
"404": NotFoundError,
|
|
34
|
+
"429": RateLimitedError,
|
|
35
|
+
"500": InternalServerError,
|
|
36
|
+
},
|
|
37
|
+
idempotent: true,
|
|
38
|
+
schemaKey: "specRevisions.list",
|
|
39
|
+
options,
|
|
40
|
+
}, {
|
|
41
|
+
style: "cursor",
|
|
42
|
+
itemsField: "data",
|
|
43
|
+
cursorParam: "cursor",
|
|
44
|
+
nextCursorField: "next_cursor",
|
|
45
|
+
hasMoreField: "has_more",
|
|
46
|
+
limitParam: "limit",
|
|
47
|
+
});
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Get a Spec Revision
|
|
51
|
+
*
|
|
52
|
+
* Returns metadata for a saved Spec Revision with a Diagnostics summary. Pass
|
|
53
|
+
* `include=diagnostics` to add every Diagnostic, evaluated with the Spec's current patches and
|
|
54
|
+
* Diagnostic policy. List its source files and resolved document with listSpecRevisionFiles.
|
|
55
|
+
* `GET /spec-revisions/{spec_revision_id}`
|
|
56
|
+
*/
|
|
57
|
+
async get(specRevisionId, params, options) {
|
|
58
|
+
return this._core.requestData({
|
|
59
|
+
method: "GET",
|
|
60
|
+
path: `/spec-revisions/${encodeURIComponent(String(specRevisionId))}`,
|
|
61
|
+
security: [{ "apiKey": [] }],
|
|
62
|
+
query: {
|
|
63
|
+
include: params?.include,
|
|
64
|
+
},
|
|
65
|
+
errors: {
|
|
66
|
+
"400": BadRequestError,
|
|
67
|
+
"401": UnauthorizedError,
|
|
68
|
+
"403": ForbiddenError,
|
|
69
|
+
"404": NotFoundError,
|
|
70
|
+
"429": RateLimitedError,
|
|
71
|
+
"500": InternalServerError,
|
|
72
|
+
},
|
|
73
|
+
idempotent: true,
|
|
74
|
+
schemaKey: "specRevisions.get",
|
|
75
|
+
options,
|
|
76
|
+
});
|
|
77
|
+
}
|
|
78
|
+
/**
|
|
79
|
+
* List a Spec Revision's files
|
|
80
|
+
*
|
|
81
|
+
* Lists the captured source files and the resolved document Typeship generated from, ordered by
|
|
82
|
+
* path. Read content with getFile.
|
|
83
|
+
*
|
|
84
|
+
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
85
|
+
* `GET /spec-revisions/{spec_revision_id}/files`
|
|
86
|
+
*/
|
|
87
|
+
listFiles(specRevisionId, params, options) {
|
|
88
|
+
return paginate(this._core, {
|
|
89
|
+
method: "GET",
|
|
90
|
+
path: `/spec-revisions/${encodeURIComponent(String(specRevisionId))}/files`,
|
|
91
|
+
security: [{ "apiKey": [] }],
|
|
92
|
+
query: {
|
|
93
|
+
limit: params?.limit,
|
|
94
|
+
cursor: params?.cursor,
|
|
95
|
+
},
|
|
96
|
+
errors: {
|
|
97
|
+
"400": BadRequestError,
|
|
98
|
+
"401": UnauthorizedError,
|
|
99
|
+
"403": ForbiddenError,
|
|
100
|
+
"404": NotFoundError,
|
|
101
|
+
"429": RateLimitedError,
|
|
102
|
+
"500": InternalServerError,
|
|
103
|
+
},
|
|
104
|
+
idempotent: true,
|
|
105
|
+
schemaKey: "specRevisions.listFiles",
|
|
106
|
+
options,
|
|
107
|
+
}, {
|
|
108
|
+
style: "cursor",
|
|
109
|
+
itemsField: "data",
|
|
110
|
+
cursorParam: "cursor",
|
|
111
|
+
nextCursorField: "next_cursor",
|
|
112
|
+
hasMoreField: "has_more",
|
|
113
|
+
limitParam: "limit",
|
|
114
|
+
});
|
|
115
|
+
}
|
|
116
|
+
}
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
import { HttpCore, type RequestOptions } from "../core/http.js";
|
|
2
|
+
import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadGatewayError, BadRequestError, ConflictError, ForbiddenError, InternalServerError, NotFoundError, PreconditionFailedError, RateLimitedError, UnauthorizedError, UnprocessableEntityError } from "../errors.js";
|
|
3
|
+
import type { SpecId, SpecRead, SpecUpdateRequest } from "../types.js";
|
|
4
|
+
export declare class SpecsResource {
|
|
5
|
+
private readonly _core;
|
|
6
|
+
constructor(_core: HttpCore);
|
|
7
|
+
/**
|
|
8
|
+
* Get a Spec
|
|
9
|
+
* `GET /specs/{spec_id}`
|
|
10
|
+
*/
|
|
11
|
+
get(specId: SpecId, options?: RequestOptions): Promise<SpecRead>;
|
|
12
|
+
/**
|
|
13
|
+
* Update and resolve a Spec
|
|
14
|
+
*
|
|
15
|
+
* Resolves the source files before saving the update and records a new Spec Revision when the
|
|
16
|
+
* source changes.
|
|
17
|
+
* Omitted fields remain unchanged; supplied objects and arrays replace the whole field.
|
|
18
|
+
* If the Spec or its Project configuration changes during validation, returns 409
|
|
19
|
+
* resource_changed without saving the rejected update. Retrieve the current Spec and Project,
|
|
20
|
+
* reconcile your changes,
|
|
21
|
+
* and submit a new request with a new Idempotency-Key if using one.
|
|
22
|
+
*
|
|
23
|
+
* See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
|
|
24
|
+
* and If-Match.
|
|
25
|
+
*
|
|
26
|
+
* A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
|
|
27
|
+
* `PATCH /specs/{spec_id}`
|
|
28
|
+
*/
|
|
29
|
+
update(specId: SpecId, body: SpecUpdateRequest, params?: SpecsUpdateParams, options?: RequestOptions): Promise<SpecRead>;
|
|
30
|
+
/**
|
|
31
|
+
* Refresh a Spec from its configured source
|
|
32
|
+
*
|
|
33
|
+
* Fetches the configured source now and creates a new Spec Revision only when its content
|
|
34
|
+
* changes. Diagnostics then reads that revision. If automatic generation is enabled, refresh
|
|
35
|
+
* queues generation for active Targets even when the source is unchanged. A `502
|
|
36
|
+
* follow_up_failed` means the new Spec Revision was recorded but generation could not be queued.
|
|
37
|
+
*
|
|
38
|
+
* A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
|
|
39
|
+
* `POST /specs/{spec_id}/refresh`
|
|
40
|
+
*/
|
|
41
|
+
refresh(specId: SpecId, params?: SpecsRefreshParams, options?: RequestOptions): Promise<SpecRead>;
|
|
42
|
+
}
|
|
43
|
+
/** Typed errors `get` can throw. */
|
|
44
|
+
export type SpecsGetError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
45
|
+
export interface SpecsUpdateParams {
|
|
46
|
+
/**
|
|
47
|
+
* ETag from a preceding response. The write applies only if the resource still has that version;
|
|
48
|
+
* otherwise it returns 412 precondition_failed without changes. Omit to write the current
|
|
49
|
+
* version. See https://typeship.dev/docs/typeship-api#conditional-writes.
|
|
50
|
+
*/
|
|
51
|
+
ifMatch?: string;
|
|
52
|
+
/**
|
|
53
|
+
* Identifies one logical write for 24 hours. The key is scoped to the authenticated organization
|
|
54
|
+
* and operation; generation without an organization uses a hashed network identity. Retrying the
|
|
55
|
+
* same method, path, query, If-Match header, and JSON body replays the original response. Reusing
|
|
56
|
+
* the key with changed intent returns 409. After expiry the key starts a new write.
|
|
57
|
+
*/
|
|
58
|
+
idempotencyKey?: string;
|
|
59
|
+
}
|
|
60
|
+
/** Typed errors `update` can throw. */
|
|
61
|
+
export type SpecsUpdateError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | PreconditionFailedError | UnprocessableEntityError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
62
|
+
export interface SpecsRefreshParams {
|
|
63
|
+
/**
|
|
64
|
+
* Identifies one logical write for 24 hours. The key is scoped to the authenticated organization
|
|
65
|
+
* and operation; generation without an organization uses a hashed network identity. Retrying the
|
|
66
|
+
* same method, path, query, If-Match header, and JSON body replays the original response. Reusing
|
|
67
|
+
* the key with changed intent returns 409. After expiry the key starts a new write.
|
|
68
|
+
*/
|
|
69
|
+
idempotencyKey?: string;
|
|
70
|
+
}
|
|
71
|
+
/** Typed errors `refresh` can throw. */
|
|
72
|
+
export type SpecsRefreshError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | UnprocessableEntityError | RateLimitedError | InternalServerError | BadGatewayError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
73
|
+
//# sourceMappingURL=specs.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"specs.d.ts","sourceRoot":"","sources":["../../src/resources/specs.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,eAAe,EACf,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,uBAAuB,EACvB,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAQ,MAAM,EAAE,QAAQ,EAAE,iBAAiB,EAAE,MAAM,aAAa,CAAC;AAE7E,qBAAa,aAAa;IACZ,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;OAGG;IACG,GAAG,CAAC,MAAM,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC;IAkBtE;;;;;;;;;;;;;;;;OAgBG;IACG,MAAM,CACV,MAAM,EAAE,MAAM,EACd,IAAI,EAAE,iBAAiB,EACvB,MAAM,CAAC,EAAE,iBAAiB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,QAAQ,CAAC;IA2BpB;;;;;;;;;;OAUG;IACG,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,QAAQ,CAAC;CAwBxG;AAED,oCAAoC;AACpC,MAAM,MAAM,aAAa,GACrB,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,MAAM,WAAW,iBAAiB;IAChC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,uCAAuC;AACvC,MAAM,MAAM,gBAAgB,GACxB,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,aAAa,GACb,uBAAuB,GACvB,wBAAwB,GACxB,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,wCAAwC;AACxC,MAAM,MAAM,iBAAiB,GACzB,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,aAAa,GACb,wBAAwB,GACxB,gBAAgB,GAChB,mBAAmB,GACnB,eAAe,GACf,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
|
|
@@ -0,0 +1,108 @@
|
|
|
1
|
+
// typeship — specs resource.
|
|
2
|
+
// Generated by typeship — https://typeship.dev
|
|
3
|
+
import { BadGatewayError, BadRequestError, ConflictError, ForbiddenError, InternalServerError, NotFoundError, PreconditionFailedError, RateLimitedError, UnauthorizedError, UnprocessableEntityError, } from "../errors.js";
|
|
4
|
+
export class SpecsResource {
|
|
5
|
+
_core;
|
|
6
|
+
constructor(_core) {
|
|
7
|
+
this._core = _core;
|
|
8
|
+
}
|
|
9
|
+
/**
|
|
10
|
+
* Get a Spec
|
|
11
|
+
* `GET /specs/{spec_id}`
|
|
12
|
+
*/
|
|
13
|
+
async get(specId, options) {
|
|
14
|
+
return this._core.requestData({
|
|
15
|
+
method: "GET",
|
|
16
|
+
path: `/specs/${encodeURIComponent(String(specId))}`,
|
|
17
|
+
security: [{ "apiKey": [] }],
|
|
18
|
+
errors: {
|
|
19
|
+
"401": UnauthorizedError,
|
|
20
|
+
"403": ForbiddenError,
|
|
21
|
+
"404": NotFoundError,
|
|
22
|
+
"429": RateLimitedError,
|
|
23
|
+
"500": InternalServerError,
|
|
24
|
+
},
|
|
25
|
+
idempotent: true,
|
|
26
|
+
schemaKey: "specs.get",
|
|
27
|
+
options,
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Update and resolve a Spec
|
|
32
|
+
*
|
|
33
|
+
* Resolves the source files before saving the update and records a new Spec Revision when the
|
|
34
|
+
* source changes.
|
|
35
|
+
* Omitted fields remain unchanged; supplied objects and arrays replace the whole field.
|
|
36
|
+
* If the Spec or its Project configuration changes during validation, returns 409
|
|
37
|
+
* resource_changed without saving the rejected update. Retrieve the current Spec and Project,
|
|
38
|
+
* reconcile your changes,
|
|
39
|
+
* and submit a new request with a new Idempotency-Key if using one.
|
|
40
|
+
*
|
|
41
|
+
* See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
|
|
42
|
+
* and If-Match.
|
|
43
|
+
*
|
|
44
|
+
* A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
|
|
45
|
+
* `PATCH /specs/{spec_id}`
|
|
46
|
+
*/
|
|
47
|
+
async update(specId, body, params, options) {
|
|
48
|
+
return this._core.requestData({
|
|
49
|
+
method: "PATCH",
|
|
50
|
+
path: `/specs/${encodeURIComponent(String(specId))}`,
|
|
51
|
+
security: [{ "apiKey": [] }],
|
|
52
|
+
headers: {
|
|
53
|
+
"If-Match": params?.ifMatch === undefined ? undefined : String(params?.ifMatch),
|
|
54
|
+
"Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
|
|
55
|
+
},
|
|
56
|
+
body,
|
|
57
|
+
errors: {
|
|
58
|
+
"400": BadRequestError,
|
|
59
|
+
"401": UnauthorizedError,
|
|
60
|
+
"403": ForbiddenError,
|
|
61
|
+
"404": NotFoundError,
|
|
62
|
+
"409": ConflictError,
|
|
63
|
+
"412": PreconditionFailedError,
|
|
64
|
+
"422": UnprocessableEntityError,
|
|
65
|
+
"429": RateLimitedError,
|
|
66
|
+
"500": InternalServerError,
|
|
67
|
+
},
|
|
68
|
+
idempotencyKey: "Idempotency-Key",
|
|
69
|
+
schemaKey: "specs.update",
|
|
70
|
+
options,
|
|
71
|
+
});
|
|
72
|
+
}
|
|
73
|
+
/**
|
|
74
|
+
* Refresh a Spec from its configured source
|
|
75
|
+
*
|
|
76
|
+
* Fetches the configured source now and creates a new Spec Revision only when its content
|
|
77
|
+
* changes. Diagnostics then reads that revision. If automatic generation is enabled, refresh
|
|
78
|
+
* queues generation for active Targets even when the source is unchanged. A `502
|
|
79
|
+
* follow_up_failed` means the new Spec Revision was recorded but generation could not be queued.
|
|
80
|
+
*
|
|
81
|
+
* A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
|
|
82
|
+
* `POST /specs/{spec_id}/refresh`
|
|
83
|
+
*/
|
|
84
|
+
async refresh(specId, params, options) {
|
|
85
|
+
return this._core.requestData({
|
|
86
|
+
method: "POST",
|
|
87
|
+
path: `/specs/${encodeURIComponent(String(specId))}/refresh`,
|
|
88
|
+
security: [{ "apiKey": [] }],
|
|
89
|
+
headers: {
|
|
90
|
+
"Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
|
|
91
|
+
},
|
|
92
|
+
errors: {
|
|
93
|
+
"400": BadRequestError,
|
|
94
|
+
"401": UnauthorizedError,
|
|
95
|
+
"403": ForbiddenError,
|
|
96
|
+
"404": NotFoundError,
|
|
97
|
+
"409": ConflictError,
|
|
98
|
+
"422": UnprocessableEntityError,
|
|
99
|
+
"429": RateLimitedError,
|
|
100
|
+
"500": InternalServerError,
|
|
101
|
+
"502": BadGatewayError,
|
|
102
|
+
},
|
|
103
|
+
idempotencyKey: "Idempotency-Key",
|
|
104
|
+
schemaKey: "specs.refresh",
|
|
105
|
+
options,
|
|
106
|
+
});
|
|
107
|
+
}
|
|
108
|
+
}
|