@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.
Files changed (103) hide show
  1. package/AGENTS.md +3 -3
  2. package/README.md +1 -1
  3. package/api.json +7519 -6363
  4. package/api.md +8015 -6765
  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 +40 -43
  25. package/dist/resources/api-keys.d.ts +16 -15
  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 +47 -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 +157 -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 +67 -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 +50 -139
  47. package/dist/resources/projects.d.ts.map +1 -1
  48. package/dist/resources/projects.js +29 -179
  49. package/dist/resources/publications.d.ts +47 -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 +68 -0
  53. package/dist/resources/releases.d.ts.map +1 -0
  54. package/dist/resources/releases.js +102 -0
  55. package/dist/resources/spec-revisions.d.ts +87 -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 +73 -0
  59. package/dist/resources/specs.d.ts.map +1 -0
  60. package/dist/resources/specs.js +108 -0
  61. package/dist/resources/targets.d.ts +48 -267
  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 +1320 -1637
  67. package/dist/types.d.ts.map +1 -1
  68. package/dist/types.js +84 -76
  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 +41 -44
  79. package/src/resources/api-keys.ts +19 -21
  80. package/src/resources/deliveries.ts +140 -0
  81. package/src/resources/drafts.ts +424 -0
  82. package/src/resources/files.ts +68 -0
  83. package/src/resources/generate.ts +16 -19
  84. package/src/resources/generations.ts +148 -35
  85. package/src/resources/{account.ts → organization.ts} +14 -14
  86. package/src/resources/projects.ts +56 -350
  87. package/src/resources/publications.ts +140 -0
  88. package/src/resources/releases.ts +201 -0
  89. package/src/resources/spec-revisions.ts +239 -0
  90. package/src/resources/specs.ts +201 -0
  91. package/src/resources/targets.ts +63 -765
  92. package/src/schemas.ts +143 -149
  93. package/src/types.ts +1418 -1740
  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,201 @@
1
+ // typeship — specs resource.
2
+ // Generated by typeship — https://typeship.dev
3
+
4
+ import { HttpCore, type RequestOptions } from "../core/http.js";
5
+ import {
6
+ ResponseParseError,
7
+ TransportError,
8
+ UnexpectedApiError,
9
+ ValidationError,
10
+ BadGatewayError,
11
+ BadRequestError,
12
+ ConflictError,
13
+ ForbiddenError,
14
+ InternalServerError,
15
+ NotFoundError,
16
+ PreconditionFailedError,
17
+ RateLimitedError,
18
+ UnauthorizedError,
19
+ UnprocessableEntityError,
20
+ } from "../errors.js";
21
+ import type { Spec, SpecId, SpecRead, SpecUpdateRequest } from "../types.js";
22
+
23
+ export class SpecsResource {
24
+ constructor(private readonly _core: HttpCore) {}
25
+ /**
26
+ * Get a Spec
27
+ * `GET /specs/{spec_id}`
28
+ */
29
+ async get(specId: SpecId, options?: RequestOptions): Promise<SpecRead> {
30
+ return this._core.requestData<SpecRead, SpecsGetError>({
31
+ method: "GET",
32
+ path: `/specs/${encodeURIComponent(String(specId))}`,
33
+ security: [{"apiKey":[]}],
34
+ errors: {
35
+ "401": UnauthorizedError,
36
+ "403": ForbiddenError,
37
+ "404": NotFoundError,
38
+ "429": RateLimitedError,
39
+ "500": InternalServerError,
40
+ },
41
+ idempotent: true,
42
+ schemaKey: "specs.get",
43
+ options,
44
+ });
45
+ }
46
+
47
+ /**
48
+ * Update and resolve a Spec
49
+ *
50
+ * Resolves the source files before saving the update and records a new Spec Revision when the
51
+ * source changes.
52
+ * Omitted fields remain unchanged; supplied objects and arrays replace the whole field.
53
+ * If the Spec or its Project configuration changes during validation, returns 409
54
+ * resource_changed without saving the rejected update. Retrieve the current Spec and Project,
55
+ * reconcile your changes,
56
+ * and submit a new request with a new Idempotency-Key if using one.
57
+ *
58
+ * See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
59
+ * and If-Match.
60
+ *
61
+ * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
62
+ * `PATCH /specs/{spec_id}`
63
+ */
64
+ async update(
65
+ specId: SpecId,
66
+ body: SpecUpdateRequest,
67
+ params?: SpecsUpdateParams,
68
+ options?: RequestOptions,
69
+ ): Promise<SpecRead> {
70
+ return this._core.requestData<SpecRead, SpecsUpdateError>({
71
+ method: "PATCH",
72
+ path: `/specs/${encodeURIComponent(String(specId))}`,
73
+ security: [{"apiKey":[]}],
74
+ headers: {
75
+ "If-Match": params?.ifMatch === undefined ? undefined : String(params?.ifMatch),
76
+ "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
77
+ },
78
+ body,
79
+ errors: {
80
+ "400": BadRequestError,
81
+ "401": UnauthorizedError,
82
+ "403": ForbiddenError,
83
+ "404": NotFoundError,
84
+ "409": ConflictError,
85
+ "412": PreconditionFailedError,
86
+ "422": UnprocessableEntityError,
87
+ "429": RateLimitedError,
88
+ "500": InternalServerError,
89
+ },
90
+ idempotencyKey: "Idempotency-Key",
91
+ schemaKey: "specs.update",
92
+ options,
93
+ });
94
+ }
95
+
96
+ /**
97
+ * Refresh a Spec from its configured source
98
+ *
99
+ * Fetches the configured source now and creates a new Spec Revision only when its content
100
+ * changes. Diagnostics then reads that revision. If automatic generation is enabled, refresh
101
+ * queues generation for active Targets even when the source is unchanged. A `502
102
+ * follow_up_failed` means the new Spec Revision was recorded but generation could not be queued.
103
+ *
104
+ * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
105
+ * `POST /specs/{spec_id}/refresh`
106
+ */
107
+ async refresh(specId: SpecId, params?: SpecsRefreshParams, options?: RequestOptions): Promise<SpecRead> {
108
+ return this._core.requestData<SpecRead, SpecsRefreshError>({
109
+ method: "POST",
110
+ path: `/specs/${encodeURIComponent(String(specId))}/refresh`,
111
+ security: [{"apiKey":[]}],
112
+ headers: {
113
+ "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
114
+ },
115
+ errors: {
116
+ "400": BadRequestError,
117
+ "401": UnauthorizedError,
118
+ "403": ForbiddenError,
119
+ "404": NotFoundError,
120
+ "409": ConflictError,
121
+ "422": UnprocessableEntityError,
122
+ "429": RateLimitedError,
123
+ "500": InternalServerError,
124
+ "502": BadGatewayError,
125
+ },
126
+ idempotencyKey: "Idempotency-Key",
127
+ schemaKey: "specs.refresh",
128
+ options,
129
+ });
130
+ }
131
+ }
132
+
133
+ /** Typed errors `get` can throw. */
134
+ export type SpecsGetError =
135
+ | UnauthorizedError
136
+ | ForbiddenError
137
+ | NotFoundError
138
+ | RateLimitedError
139
+ | InternalServerError
140
+ | UnexpectedApiError
141
+ | ResponseParseError
142
+ | TransportError
143
+ | ValidationError;
144
+
145
+ export interface SpecsUpdateParams {
146
+ /**
147
+ * ETag from a preceding response. The write applies only if the resource still has that version;
148
+ * otherwise it returns 412 precondition_failed without changes. Omit to write the current
149
+ * version. See https://typeship.dev/docs/typeship-api#conditional-writes.
150
+ */
151
+ ifMatch?: string;
152
+ /**
153
+ * Identifies one logical write for 24 hours. The key is scoped to the authenticated organization
154
+ * and operation; generation without an organization uses a hashed network identity. Retrying the
155
+ * same method, path, query, If-Match header, and JSON body replays the original response. Reusing
156
+ * the key with changed intent returns 409. After expiry the key starts a new write.
157
+ */
158
+ idempotencyKey?: string;
159
+ }
160
+
161
+ /** Typed errors `update` can throw. */
162
+ export type SpecsUpdateError =
163
+ | BadRequestError
164
+ | UnauthorizedError
165
+ | ForbiddenError
166
+ | NotFoundError
167
+ | ConflictError
168
+ | PreconditionFailedError
169
+ | UnprocessableEntityError
170
+ | RateLimitedError
171
+ | InternalServerError
172
+ | UnexpectedApiError
173
+ | ResponseParseError
174
+ | TransportError
175
+ | ValidationError;
176
+
177
+ export interface SpecsRefreshParams {
178
+ /**
179
+ * Identifies one logical write for 24 hours. The key is scoped to the authenticated organization
180
+ * and operation; generation without an organization uses a hashed network identity. Retrying the
181
+ * same method, path, query, If-Match header, and JSON body replays the original response. Reusing
182
+ * the key with changed intent returns 409. After expiry the key starts a new write.
183
+ */
184
+ idempotencyKey?: string;
185
+ }
186
+
187
+ /** Typed errors `refresh` can throw. */
188
+ export type SpecsRefreshError =
189
+ | BadRequestError
190
+ | UnauthorizedError
191
+ | ForbiddenError
192
+ | NotFoundError
193
+ | ConflictError
194
+ | UnprocessableEntityError
195
+ | RateLimitedError
196
+ | InternalServerError
197
+ | BadGatewayError
198
+ | UnexpectedApiError
199
+ | ResponseParseError
200
+ | TransportError
201
+ | ValidationError;