@typeship-ax/mcp 0.19.0 → 0.20.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.
Files changed (103) hide show
  1. package/AGENTS.md +3 -3
  2. package/README.md +1 -1
  3. package/api.json +7440 -6316
  4. package/api.md +7856 -6638
  5. package/dist/api-identity.d.ts.map +1 -1
  6. package/dist/api-identity.js +6 -1
  7. package/dist/core/http.d.ts +26 -14
  8. package/dist/core/http.d.ts.map +1 -1
  9. package/dist/core/http.js +90 -19
  10. package/dist/core/pagination.d.ts +8 -8
  11. package/dist/core/pagination.d.ts.map +1 -1
  12. package/dist/core/pagination.js +7 -16
  13. package/dist/errors.d.ts +4 -4
  14. package/dist/errors.d.ts.map +1 -1
  15. package/dist/errors.js +7 -7
  16. package/dist/index.d.ts +33 -19
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +37 -17
  19. package/dist/mcp-protocol.js +2 -2
  20. package/dist/mcp.d.ts.map +1 -1
  21. package/dist/mcp.js +6 -5
  22. package/dist/ops.d.ts +1 -1
  23. package/dist/ops.d.ts.map +1 -1
  24. package/dist/ops.js +39 -42
  25. package/dist/resources/api-keys.d.ts +10 -10
  26. package/dist/resources/api-keys.d.ts.map +1 -1
  27. package/dist/resources/api-keys.js +6 -6
  28. package/dist/resources/deliveries.d.ts +46 -0
  29. package/dist/resources/deliveries.d.ts.map +1 -0
  30. package/dist/resources/deliveries.js +70 -0
  31. package/dist/resources/drafts.d.ts +155 -0
  32. package/dist/resources/drafts.d.ts.map +1 -0
  33. package/dist/resources/drafts.js +230 -0
  34. package/dist/resources/files.d.ts +23 -0
  35. package/dist/resources/files.d.ts.map +1 -0
  36. package/dist/resources/files.js +38 -0
  37. package/dist/resources/generate.d.ts +14 -14
  38. package/dist/resources/generate.d.ts.map +1 -1
  39. package/dist/resources/generate.js +7 -7
  40. package/dist/resources/generations.d.ts +65 -21
  41. package/dist/resources/generations.d.ts.map +1 -1
  42. package/dist/resources/generations.js +67 -20
  43. package/dist/resources/organization.d.ts +18 -0
  44. package/dist/resources/organization.d.ts.map +1 -0
  45. package/dist/resources/{account.js → organization.js} +10 -10
  46. package/dist/resources/projects.d.ts +36 -126
  47. package/dist/resources/projects.d.ts.map +1 -1
  48. package/dist/resources/projects.js +21 -171
  49. package/dist/resources/publications.d.ts +46 -0
  50. package/dist/resources/publications.d.ts.map +1 -0
  51. package/dist/resources/publications.js +70 -0
  52. package/dist/resources/releases.d.ts +66 -0
  53. package/dist/resources/releases.d.ts.map +1 -0
  54. package/dist/resources/releases.js +101 -0
  55. package/dist/resources/spec-revisions.d.ts +85 -0
  56. package/dist/resources/spec-revisions.d.ts.map +1 -0
  57. package/dist/resources/spec-revisions.js +116 -0
  58. package/dist/resources/specs.d.ts +72 -0
  59. package/dist/resources/specs.d.ts.map +1 -0
  60. package/dist/resources/specs.js +107 -0
  61. package/dist/resources/targets.d.ts +42 -262
  62. package/dist/resources/targets.d.ts.map +1 -1
  63. package/dist/resources/targets.js +28 -407
  64. package/dist/schemas.d.ts.map +1 -1
  65. package/dist/schemas.js +143 -149
  66. package/dist/types.d.ts +1281 -1611
  67. package/dist/types.d.ts.map +1 -1
  68. package/dist/types.js +44 -49
  69. package/package.json +1 -1
  70. package/server.json +2 -2
  71. package/src/api-identity.ts +6 -2
  72. package/src/core/http.ts +89 -24
  73. package/src/core/pagination.ts +13 -23
  74. package/src/errors.ts +7 -7
  75. package/src/index.ts +41 -23
  76. package/src/mcp-protocol.ts +2 -2
  77. package/src/mcp.ts +7 -6
  78. package/src/ops.ts +40 -43
  79. package/src/resources/api-keys.ts +13 -16
  80. package/src/resources/deliveries.ts +139 -0
  81. package/src/resources/drafts.ts +422 -0
  82. package/src/resources/files.ts +68 -0
  83. package/src/resources/generate.ts +16 -19
  84. package/src/resources/generations.ts +146 -35
  85. package/src/resources/{account.ts → organization.ts} +14 -14
  86. package/src/resources/projects.ts +42 -337
  87. package/src/resources/publications.ts +139 -0
  88. package/src/resources/releases.ts +199 -0
  89. package/src/resources/spec-revisions.ts +237 -0
  90. package/src/resources/specs.ts +200 -0
  91. package/src/resources/targets.ts +57 -760
  92. package/src/schemas.ts +143 -149
  93. package/src/types.ts +1357 -1692
  94. package/dist/resources/account.d.ts +0 -18
  95. package/dist/resources/account.d.ts.map +0 -1
  96. package/dist/resources/definition-revisions.d.ts +0 -75
  97. package/dist/resources/definition-revisions.d.ts.map +0 -1
  98. package/dist/resources/definition-revisions.js +0 -142
  99. package/dist/resources/definitions.d.ts +0 -50
  100. package/dist/resources/definitions.d.ts.map +0 -1
  101. package/dist/resources/definitions.js +0 -73
  102. package/src/resources/definition-revisions.ts +0 -265
  103. 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 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,66 @@
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` response means the repository publishing workflow could not be dispatched.
27
+ *
28
+ * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
29
+ * `POST /releases/{release_id}/republish`
30
+ */
31
+ republish(releaseId: ReleaseId, params?: ReleasesRepublishParams, options?: RequestOptions): Promise<ReleaseResponseRead>;
32
+ }
33
+ export interface ReleasesListParams {
34
+ /**
35
+ * Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
36
+ * representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
37
+ * invalid_request. List query parameters must appear only once; unrecognized parameters also
38
+ * return 400.
39
+ */
40
+ limit?: number;
41
+ /**
42
+ * Opaque cursor from the preceding page's next_cursor. Valid only for the same organization,
43
+ * operation, filters, and ordering that issued it. Omit to start at the first page. Empty,
44
+ * malformed, or repeated cursors return 400 invalid_request. The page limit may change between
45
+ * requests.
46
+ */
47
+ cursor?: string;
48
+ /** Only releases of this Target. */
49
+ targetId?: TargetId;
50
+ }
51
+ /** Typed errors `list` can throw. */
52
+ export type ReleasesListError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
53
+ /** Typed errors `get` can throw. */
54
+ export type ReleasesGetError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
55
+ export interface ReleasesRepublishParams {
56
+ /**
57
+ * Identifies one logical write for 24 hours. The key is scoped to the authenticated organization
58
+ * and operation; generation without an organization uses a hashed network identity. Retrying the
59
+ * same method, path, query, If-Match header, and JSON body replays the original response. Reusing
60
+ * the key with changed intent returns 409. After expiry the key starts a new write.
61
+ */
62
+ idempotencyKey?: string;
63
+ }
64
+ /** Typed errors `republish` can throw. */
65
+ export type ReleasesRepublishError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | RateLimitedError | InternalServerError | BadGatewayError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
66
+ //# 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,E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B,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,101 @@
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` response means the repository publishing workflow could not be dispatched.
74
+ *
75
+ * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
76
+ * `POST /releases/{release_id}/republish`
77
+ */
78
+ async republish(releaseId, params, options) {
79
+ return this._core.requestData({
80
+ method: "POST",
81
+ path: `/releases/${encodeURIComponent(String(releaseId))}/republish`,
82
+ security: [{ "apiKey": [] }],
83
+ headers: {
84
+ "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
85
+ },
86
+ errors: {
87
+ "400": BadRequestError,
88
+ "401": UnauthorizedError,
89
+ "403": ForbiddenError,
90
+ "404": NotFoundError,
91
+ "409": ConflictError,
92
+ "429": RateLimitedError,
93
+ "500": InternalServerError,
94
+ "502": BadGatewayError,
95
+ },
96
+ idempotencyKey: "Idempotency-Key",
97
+ schemaKey: "releases.republish",
98
+ options,
99
+ });
100
+ }
101
+ }
@@ -0,0 +1,85 @@
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
+ * invalid_request. List query parameters must appear only once; unrecognized parameters also
43
+ * return 400.
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,
49
+ * malformed, or repeated cursors return 400 invalid_request. The page limit may change between
50
+ * requests.
51
+ */
52
+ cursor?: string;
53
+ /** Only revisions of this Spec. */
54
+ specId?: SpecId;
55
+ }
56
+ /** Typed errors `list` can throw. */
57
+ export type SpecRevisionsListError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
58
+ export interface SpecRevisionsGetParams {
59
+ /**
60
+ * Add related data to the response. `diagnostics` adds the `diagnostics` and `patch_diagnostics`
61
+ * arrays.
62
+ */
63
+ include?: "diagnostics";
64
+ }
65
+ /** Typed errors `get` can throw. */
66
+ export type SpecRevisionsGetError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
67
+ export interface SpecRevisionsListFilesParams {
68
+ /**
69
+ * Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
70
+ * representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
71
+ * invalid_request. List query parameters must appear only once; unrecognized parameters also
72
+ * return 400.
73
+ */
74
+ limit?: number;
75
+ /**
76
+ * Opaque cursor from the preceding page's next_cursor. Valid only for the same organization,
77
+ * operation, filters, and ordering that issued it. Omit to start at the first page. Empty,
78
+ * malformed, or repeated cursors return 400 invalid_request. The page limit may change between
79
+ * requests.
80
+ */
81
+ cursor?: string;
82
+ }
83
+ /** Typed errors `listFiles` can throw. */
84
+ export type SpecRevisionsListFilesError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
85
+ //# 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,O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pB,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;;;;;OAKG;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,72 @@
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.
36
+ *
37
+ * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
38
+ * `POST /specs/{spec_id}/refresh`
39
+ */
40
+ refresh(specId: SpecId, params?: SpecsRefreshParams, options?: RequestOptions): Promise<SpecRead>;
41
+ }
42
+ /** Typed errors `get` can throw. */
43
+ export type SpecsGetError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
44
+ export interface SpecsUpdateParams {
45
+ /**
46
+ * ETag from a preceding response. The write applies only if the resource still has that version;
47
+ * otherwise it returns 412 precondition_failed without changes. Omit to write the current
48
+ * version. See https://typeship.dev/docs/typeship-api#conditional-writes.
49
+ */
50
+ ifMatch?: string;
51
+ /**
52
+ * Identifies one logical write for 24 hours. The key is scoped to the authenticated organization
53
+ * and operation; generation without an organization uses a hashed network identity. Retrying the
54
+ * same method, path, query, If-Match header, and JSON body replays the original response. Reusing
55
+ * the key with changed intent returns 409. After expiry the key starts a new write.
56
+ */
57
+ idempotencyKey?: string;
58
+ }
59
+ /** Typed errors `update` can throw. */
60
+ export type SpecsUpdateError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | PreconditionFailedError | UnprocessableEntityError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
61
+ export interface SpecsRefreshParams {
62
+ /**
63
+ * Identifies one logical write for 24 hours. The key is scoped to the authenticated organization
64
+ * and operation; generation without an organization uses a hashed network identity. Retrying the
65
+ * same method, path, query, If-Match header, and JSON body replays the original response. Reusing
66
+ * the key with changed intent returns 409. After expiry the key starts a new write.
67
+ */
68
+ idempotencyKey?: string;
69
+ }
70
+ /** Typed errors `refresh` can throw. */
71
+ export type SpecsRefreshError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | UnprocessableEntityError | RateLimitedError | InternalServerError | BadGatewayError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
72
+ //# 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;;;;;;;;;OASG;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,107 @@
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.
79
+ *
80
+ * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
81
+ * `POST /specs/{spec_id}/refresh`
82
+ */
83
+ async refresh(specId, params, options) {
84
+ return this._core.requestData({
85
+ method: "POST",
86
+ path: `/specs/${encodeURIComponent(String(specId))}/refresh`,
87
+ security: [{ "apiKey": [] }],
88
+ headers: {
89
+ "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
90
+ },
91
+ errors: {
92
+ "400": BadRequestError,
93
+ "401": UnauthorizedError,
94
+ "403": ForbiddenError,
95
+ "404": NotFoundError,
96
+ "409": ConflictError,
97
+ "422": UnprocessableEntityError,
98
+ "429": RateLimitedError,
99
+ "500": InternalServerError,
100
+ "502": BadGatewayError,
101
+ },
102
+ idempotencyKey: "Idempotency-Key",
103
+ schemaKey: "specs.refresh",
104
+ options,
105
+ });
106
+ }
107
+ }