@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
@@ -1,7 +1,7 @@
1
1
  // typeship — targets resource.
2
2
  // Generated by typeship — https://typeship.dev
3
3
 
4
- import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
4
+ import { HttpCore, type RequestOptions } from "../core/http.js";
5
5
  import { paginate, PagePromise } from "../core/pagination.js";
6
6
  import {
7
7
  ResponseParseError,
@@ -23,46 +23,16 @@ import {
23
23
  import type {
24
24
  DeletedTarget,
25
25
  DeletedTargetRead,
26
- DeliveryId,
27
- DeliveryResponse,
28
- DeliveryResponseRead,
29
- DiscardDraftCustomizations,
30
- DraftConflictResolutionResponse,
31
- DraftConflictResolutionResponseRead,
32
- DraftCustomizationDiscardResponse,
33
- DraftCustomizationDiscardResponseRead,
34
- DraftFile,
35
- DraftFileContentResponse,
36
- DraftFileContentResponseRead,
37
- DraftFileList,
38
- DraftFileListRead,
39
- DraftFileRead,
40
- DraftFileSide,
41
- DraftHistoryRecoveryResponse,
42
- DraftHistoryRecoveryResponseRead,
43
26
  ProjectId,
44
- PublicationId,
45
- PublicationResponse,
46
- PublicationResponseRead,
47
- RecoverDraftHistory,
48
- ResolveDraftConflicts,
27
+ ReleaseResponse,
28
+ ReleaseResponseRead,
49
29
  Target,
50
30
  TargetAdoption,
51
- TargetDraftResponse,
52
- TargetDraftResponseRead,
53
- TargetDraftUpdate,
54
- TargetFields,
31
+ TargetCreateRequest,
55
32
  TargetId,
56
33
  TargetList,
57
34
  TargetListRead,
58
35
  TargetRead,
59
- TargetRelease,
60
- TargetReleaseId,
61
- TargetReleaseList,
62
- TargetReleaseListRead,
63
- TargetReleaseRead,
64
- TargetReleaseResponse,
65
- TargetReleaseResponseRead,
66
36
  TargetResponse,
67
37
  TargetResponseRead,
68
38
  TargetUpdateRequest,
@@ -71,23 +41,20 @@ import type {
71
41
  export class TargetsResource {
72
42
  constructor(private readonly _core: HttpCore) {}
73
43
  /**
74
- * List a project's Targets
44
+ * List Targets
75
45
  *
76
46
  * Auto-paginates: `for await (const item of …)` walks every page.
77
- * `GET /projects/{project_id}/targets`
47
+ * `GET /targets`
78
48
  */
79
- list(
80
- projectId: ProjectId,
81
- params?: TargetsListParams,
82
- options?: RequestOptions,
83
- ): PagePromise<TargetRead, TargetsListError> {
49
+ list(params?: TargetsListParams, options?: RequestOptions): PagePromise<TargetRead, TargetsListError> {
84
50
  return paginate<TargetRead, TargetsListError>(this._core, {
85
51
  method: "GET",
86
- path: `/projects/${encodeURIComponent(String(projectId))}/targets`,
52
+ path: "/targets",
87
53
  security: [{"apiKey":[]}],
88
54
  query: {
89
55
  limit: params?.limit,
90
56
  cursor: params?.cursor,
57
+ project_id: params?.projectId,
91
58
  },
92
59
  errors: {
93
60
  "400": BadRequestError,
@@ -117,17 +84,16 @@ export class TargetsResource {
117
84
  * can use the same generator.
118
85
  *
119
86
  * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
120
- * `POST /projects/{project_id}/targets`
87
+ * `POST /targets`
121
88
  */
122
89
  async create(
123
- projectId: ProjectId,
124
- body: TargetFields,
90
+ body: TargetCreateRequest,
125
91
  params?: TargetsCreateParams,
126
92
  options?: RequestOptions,
127
- ): Promise<ApiResult<TargetResponseRead, TargetsCreateError>> {
128
- return this._core.request<TargetResponseRead, TargetsCreateError>({
93
+ ): Promise<TargetResponseRead> {
94
+ return this._core.requestData<TargetResponseRead, TargetsCreateError>({
129
95
  method: "POST",
130
- path: `/projects/${encodeURIComponent(String(projectId))}/targets`,
96
+ path: "/targets",
131
97
  security: [{"apiKey":[]}],
132
98
  headers: {
133
99
  "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
@@ -151,14 +117,11 @@ export class TargetsResource {
151
117
  }
152
118
 
153
119
  /**
154
- * Retrieve a Target
120
+ * Get a Target
155
121
  * `GET /targets/{target_id}`
156
122
  */
157
- async retrieve(
158
- targetId: TargetId,
159
- options?: RequestOptions,
160
- ): Promise<ApiResult<TargetResponseRead, TargetsRetrieveError>> {
161
- return this._core.request<TargetResponseRead, TargetsRetrieveError>({
123
+ async get(targetId: TargetId, options?: RequestOptions): Promise<TargetResponseRead> {
124
+ return this._core.requestData<TargetResponseRead, TargetsGetError>({
162
125
  method: "GET",
163
126
  path: `/targets/${encodeURIComponent(String(targetId))}`,
164
127
  security: [{"apiKey":[]}],
@@ -170,7 +133,7 @@ export class TargetsResource {
170
133
  "500": InternalServerError,
171
134
  },
172
135
  idempotent: true,
173
- schemaKey: "targets.retrieve",
136
+ schemaKey: "targets.get",
174
137
  options,
175
138
  });
176
139
  }
@@ -190,8 +153,8 @@ export class TargetsResource {
190
153
  targetId: TargetId,
191
154
  params?: TargetsDeleteParams,
192
155
  options?: RequestOptions,
193
- ): Promise<ApiResult<DeletedTargetRead, TargetsDeleteError>> {
194
- return this._core.request<DeletedTargetRead, TargetsDeleteError>({
156
+ ): Promise<DeletedTargetRead> {
157
+ return this._core.requestData<DeletedTargetRead, TargetsDeleteError>({
195
158
  method: "DELETE",
196
159
  path: `/targets/${encodeURIComponent(String(targetId))}`,
197
160
  security: [{"apiKey":[]}],
@@ -215,21 +178,22 @@ export class TargetsResource {
215
178
  }
216
179
 
217
180
  /**
218
- * Update a Target, its Deliveries, or its next reviewed version
181
+ * Update a Target or its Deliveries
219
182
  *
220
183
  * Omitted fields keep their current values. Supplied config, checks, and deliveries replace their
221
184
  * complete stored values.
185
+ * With Project auto_generate enabled, changing Target config, checks, or Deliveries queues that
186
+ * Target's Generation. A queued or running Target reuses that Generation.
222
187
  * Omitting If-Match applies the update to the current resource; with If-Match, a stale ETag
223
188
  * returns 412 precondition_failed without saving.
224
- * Send proposed_version by itself; use the Draft endpoint to select a version directly.
189
+ * Select the next version through PATCH /drafts/{draft_id} on the Target's draft_id.
225
190
  *
226
191
  * A `409 target_busy` means the Target is publishing; wait for it to finish. A `409
227
192
  * delivery_conflict` means another Target owns the requested repository tree; retrieve both
228
193
  * Targets, choose a free destination, and retry.
229
- * A `502` response means the update was saved, but retiring an obsolete review or regenerating a
230
- * version selection failed. Retrieve the Target and follow the error's retryable and
231
- * suggested_action fields. Repeating an unfinished version selection resumes generation;
232
- * repeating a completed selection starts no new work.
194
+ * A `502 follow_up_failed` means the update was saved, but retiring an obsolete review or
195
+ * regenerating the Target failed. Retrieve the Target and follow the error's retryable and
196
+ * suggested_action fields.
233
197
  * See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
234
198
  * and If-Match.
235
199
  * `PATCH /targets/{target_id}`
@@ -239,8 +203,8 @@ export class TargetsResource {
239
203
  body: TargetUpdateRequest,
240
204
  params?: TargetsUpdateParams,
241
205
  options?: RequestOptions,
242
- ): Promise<ApiResult<TargetResponseRead, TargetsUpdateError>> {
243
- return this._core.request<TargetResponseRead, TargetsUpdateError>({
206
+ ): Promise<TargetResponseRead> {
207
+ return this._core.requestData<TargetResponseRead, TargetsUpdateError>({
244
208
  method: "PATCH",
245
209
  path: `/targets/${encodeURIComponent(String(targetId))}`,
246
210
  security: [{"apiKey":[]}],
@@ -267,144 +231,22 @@ export class TargetsResource {
267
231
  }
268
232
 
269
233
  /**
270
- * List immutable releases for a Target
271
- *
272
- * Auto-paginates: `for await (const item of …)` walks every page.
273
- * `GET /targets/{target_id}/releases`
274
- */
275
- listReleases(
276
- targetId: TargetId,
277
- params?: TargetsListReleasesParams,
278
- options?: RequestOptions,
279
- ): PagePromise<TargetReleaseRead, TargetsListReleasesError> {
280
- return paginate<TargetReleaseRead, TargetsListReleasesError>(this._core, {
281
- method: "GET",
282
- path: `/targets/${encodeURIComponent(String(targetId))}/releases`,
283
- security: [{"apiKey":[]}],
284
- query: {
285
- limit: params?.limit,
286
- cursor: params?.cursor,
287
- },
288
- errors: {
289
- "400": BadRequestError,
290
- "401": UnauthorizedError,
291
- "403": ForbiddenError,
292
- "404": NotFoundError,
293
- "429": RateLimitedError,
294
- "500": InternalServerError,
295
- },
296
- idempotent: true,
297
- schemaKey: "targets.listReleases",
298
- options,
299
- }, {
300
- style: "cursor",
301
- itemsField: "data",
302
- cursorParam: "cursor",
303
- nextCursorField: "next_cursor",
304
- hasMoreField: "has_more",
305
- limitParam: "limit",
306
- });
307
- }
308
-
309
- /**
310
- * Retrieve a Target's rolling Draft release
311
- *
312
- * Returns the Draft's status and its one next step, Current's version, the proposed version,
313
- * readiness, checks, and conflict counts. Every status is described on `status`. The response
314
- * carries an `ETag`; send it in `If-Match` when updating the Draft to avoid changing a newer
315
- * version selection.
316
- * `GET /targets/{target_id}/draft`
317
- */
318
- async retrieveDraft(
319
- targetId: TargetId,
320
- options?: RequestOptions,
321
- ): Promise<ApiResult<TargetDraftResponseRead, TargetsRetrieveDraftError>> {
322
- return this._core.request<TargetDraftResponseRead, TargetsRetrieveDraftError>({
323
- method: "GET",
324
- path: `/targets/${encodeURIComponent(String(targetId))}/draft`,
325
- security: [{"apiKey":[]}],
326
- errors: {
327
- "401": UnauthorizedError,
328
- "403": ForbiddenError,
329
- "404": NotFoundError,
330
- "429": RateLimitedError,
331
- "500": InternalServerError,
332
- },
333
- idempotent: true,
334
- schemaKey: "targets.retrieveDraft",
335
- options,
336
- });
337
- }
338
-
339
- /**
340
- * Select an exact Draft version or return to automatic versioning
341
- *
342
- * Checks your version choice against the required version bump, then regenerates the existing
343
- * Draft pull request.
344
- *
345
- * Send the Draft's `ETag` in `If-Match` to reject an intervening change with 412
346
- * precondition_failed before saving or regenerating. Omitting `If-Match` applies the selection to
347
- * the current Draft. Version is required; null restores automatic selection.
348
- *
349
- * A `502` response means the selected version was saved, but regeneration failed. Follow the
350
- * error's retryable and suggested_action fields. Repeating an unfinished selection resumes
351
- * generation; repeating a completed selection starts no new work. If using If-Match, retrieve the
352
- * Draft and confirm the saved selection before retrying with its current ETag.
353
- * A `409 target_busy` means the Target is publishing; wait and retry. A `409 version_occupied`
354
- * means the version is already released; retrieve the Draft and releases, choose a new version,
355
- * and retry.
356
- * See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
357
- * and If-Match.
358
- * `PATCH /targets/{target_id}/draft`
359
- */
360
- async updateDraft(
361
- targetId: TargetId,
362
- body: TargetDraftUpdate,
363
- params?: TargetsUpdateDraftParams,
364
- options?: RequestOptions,
365
- ): Promise<ApiResult<TargetDraftResponseRead, TargetsUpdateDraftError>> {
366
- return this._core.request<TargetDraftResponseRead, TargetsUpdateDraftError>({
367
- method: "PATCH",
368
- path: `/targets/${encodeURIComponent(String(targetId))}/draft`,
369
- security: [{"apiKey":[]}],
370
- headers: {
371
- "If-Match": params?.ifMatch === undefined ? undefined : String(params?.ifMatch),
372
- },
373
- body,
374
- errors: {
375
- "400": BadRequestError,
376
- "401": UnauthorizedError,
377
- "403": ForbiddenError,
378
- "404": NotFoundError,
379
- "409": ConflictError,
380
- "412": PreconditionFailedError,
381
- "422": UnprocessableEntityError,
382
- "429": RateLimitedError,
383
- "500": InternalServerError,
384
- "502": BadGatewayError,
385
- },
386
- schemaKey: "targets.updateDraft",
387
- options,
388
- });
389
- }
390
-
391
- /**
392
- * Adopt a verified existing package as Current
234
+ * Adopt a verified existing package as the latest release
393
235
  *
394
236
  * Checks the repository tag, package metadata, and registry artifact, then records the package as
395
- * an Imported Current release. Opens the first Typeship Draft at the next major version; review
396
- * it to establish the baseline for preserving existing code.
237
+ * an Imported latest release. Opens the first Typeship Draft at the next major version; review it
238
+ * to establish the baseline for preserving existing code.
397
239
  *
398
240
  * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
399
241
  * `POST /targets/{target_id}/adopt`
400
242
  */
401
- async adoptRelease(
243
+ async adopt(
402
244
  targetId: TargetId,
403
245
  body: TargetAdoption,
404
- params?: TargetsAdoptReleaseParams,
246
+ params?: TargetsAdoptParams,
405
247
  options?: RequestOptions,
406
- ): Promise<ApiResult<TargetReleaseResponseRead, TargetsAdoptReleaseError>> {
407
- return this._core.request<TargetReleaseResponseRead, TargetsAdoptReleaseError>({
248
+ ): Promise<ReleaseResponseRead> {
249
+ return this._core.requestData<ReleaseResponseRead, TargetsAdoptError>({
408
250
  method: "POST",
409
251
  path: `/targets/${encodeURIComponent(String(targetId))}/adopt`,
410
252
  security: [{"apiKey":[]}],
@@ -423,323 +265,7 @@ export class TargetsResource {
423
265
  "500": InternalServerError,
424
266
  },
425
267
  idempotencyKey: "Idempotency-Key",
426
- schemaKey: "targets.adoptRelease",
427
- options,
428
- });
429
- }
430
-
431
- /**
432
- * Retrieve an immutable Target release
433
- * `GET /target-releases/{target_release_id}`
434
- */
435
- async retrieveRelease(
436
- targetReleaseId: TargetReleaseId,
437
- options?: RequestOptions,
438
- ): Promise<ApiResult<TargetReleaseResponseRead, TargetsRetrieveReleaseError>> {
439
- return this._core.request<TargetReleaseResponseRead, TargetsRetrieveReleaseError>({
440
- method: "GET",
441
- path: `/target-releases/${encodeURIComponent(String(targetReleaseId))}`,
442
- security: [{"apiKey":[]}],
443
- errors: {
444
- "401": UnauthorizedError,
445
- "403": ForbiddenError,
446
- "404": NotFoundError,
447
- "429": RateLimitedError,
448
- "500": InternalServerError,
449
- },
450
- idempotent: true,
451
- schemaKey: "targets.retrieveRelease",
452
- options,
453
- });
454
- }
455
-
456
- /**
457
- * Retry publication of an exact Target release
458
- *
459
- * Retries publication of the specified release through its repository workflow. Uses that
460
- * release's version and accepted commit, even if a newer Draft or release exists.
461
- *
462
- * A `502` response means the repository publication workflow could not be dispatched.
463
- *
464
- * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
465
- * `POST /target-releases/{target_release_id}/republish`
466
- */
467
- async republishRelease(
468
- targetReleaseId: TargetReleaseId,
469
- params?: TargetsRepublishReleaseParams,
470
- options?: RequestOptions,
471
- ): Promise<ApiResult<TargetReleaseResponseRead, TargetsRepublishReleaseError>> {
472
- return this._core.request<TargetReleaseResponseRead, TargetsRepublishReleaseError>({
473
- method: "POST",
474
- path: `/target-releases/${encodeURIComponent(String(targetReleaseId))}/republish`,
475
- security: [{"apiKey":[]}],
476
- headers: {
477
- "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
478
- },
479
- errors: {
480
- "400": BadRequestError,
481
- "401": UnauthorizedError,
482
- "403": ForbiddenError,
483
- "404": NotFoundError,
484
- "409": ConflictError,
485
- "429": RateLimitedError,
486
- "500": InternalServerError,
487
- "502": BadGatewayError,
488
- },
489
- idempotencyKey: "Idempotency-Key",
490
- schemaKey: "targets.republishRelease",
491
- options,
492
- });
493
- }
494
-
495
- /**
496
- * List customized and conflicted files on a Draft
497
- *
498
- * Lists the Draft's files that differ from the last accepted package or need a conflict decision,
499
- * ordered by path, without file content. Each conflict names its kind, where the incoming version
500
- * comes from, the saved decision, and the sides you can read with retrieveDraftFileContent. With
501
- * `filter=history`, lists the files affected by a default-branch history rewrite instead; the
502
- * list is empty when none is pending.
503
- *
504
- * Returns `409 stale_draft` while Typeship has not integrated the Draft's latest commit (Draft
505
- * status generating or branch_changed), or when the Draft changes between pages.
506
- *
507
- * Auto-paginates: `for await (const item of …)` walks every page.
508
- * `GET /targets/{target_id}/draft/files`
509
- */
510
- listDraftFiles(
511
- targetId: TargetId,
512
- params?: TargetsListDraftFilesParams,
513
- options?: RequestOptions,
514
- ): PagePromise<DraftFileRead, TargetsListDraftFilesError> {
515
- return paginate<DraftFileRead, TargetsListDraftFilesError>(this._core, {
516
- method: "GET",
517
- path: `/targets/${encodeURIComponent(String(targetId))}/draft/files`,
518
- security: [{"apiKey":[]}],
519
- query: {
520
- filter: params?.filter,
521
- limit: params?.limit,
522
- cursor: params?.cursor,
523
- },
524
- errors: {
525
- "400": BadRequestError,
526
- "401": UnauthorizedError,
527
- "403": ForbiddenError,
528
- "404": NotFoundError,
529
- "409": ConflictError,
530
- "429": RateLimitedError,
531
- "500": InternalServerError,
532
- },
533
- idempotent: true,
534
- schemaKey: "targets.listDraftFiles",
535
- options,
536
- }, {
537
- style: "cursor",
538
- itemsField: "data",
539
- cursorParam: "cursor",
540
- nextCursorField: "next_cursor",
541
- hasMoreField: "has_more",
542
- limitParam: "limit",
543
- });
544
- }
545
-
546
- /**
547
- * Read one side of a Draft file
548
- *
549
- * Returns up to 24 KiB of one side of a conflicted or history-affected file: text as UTF-8,
550
- * binary content as base64. Follow `next_cursor` with the same path and side to read the rest,
551
- * and concatenate the chunks in order. A side where the file is absent returns 404.
552
- * `GET /targets/{target_id}/draft/files/content`
553
- */
554
- async retrieveDraftFileContent(
555
- targetId: TargetId,
556
- params: TargetsRetrieveDraftFileContentParams,
557
- options?: RequestOptions,
558
- ): Promise<ApiResult<DraftFileContentResponseRead, TargetsRetrieveDraftFileContentError>> {
559
- return this._core.request<DraftFileContentResponseRead, TargetsRetrieveDraftFileContentError>({
560
- method: "GET",
561
- path: `/targets/${encodeURIComponent(String(targetId))}/draft/files/content`,
562
- security: [{"apiKey":[]}],
563
- query: {
564
- path: params.path,
565
- side: params.side,
566
- cursor: params.cursor,
567
- },
568
- errors: {
569
- "400": BadRequestError,
570
- "401": UnauthorizedError,
571
- "403": ForbiddenError,
572
- "404": NotFoundError,
573
- "409": ConflictError,
574
- "429": RateLimitedError,
575
- "500": InternalServerError,
576
- },
577
- idempotent: true,
578
- schemaKey: "targets.retrieveDraftFileContent",
579
- options,
580
- });
581
- }
582
-
583
- /**
584
- * Resolve selected Draft conflicts
585
- *
586
- * Saves decisions for conflicts on the Draft's head_revision: keep the repository or incoming
587
- * version, or supply the final content as text or, for binary files, base64. Decisions save
588
- * together or not at all, and a decision can be replaced until it is applied. Use `dry_run` to
589
- * validate them first.
590
- *
591
- * Saving changes no files. When every conflict has a decision, `remaining_conflicts` is 0 and the
592
- * Draft status becomes `needs_generation`: generate the Target to apply the decisions and run its
593
- * checks. Applying them can report conflicts from the next merge stage.
594
- * `POST /targets/{target_id}/draft/conflicts/resolve`
595
- */
596
- async resolveDraftConflicts(
597
- targetId: TargetId,
598
- body: ResolveDraftConflicts,
599
- options?: RequestOptions,
600
- ): Promise<ApiResult<DraftConflictResolutionResponseRead, TargetsResolveDraftConflictsError>> {
601
- return this._core.request<DraftConflictResolutionResponseRead, TargetsResolveDraftConflictsError>({
602
- method: "POST",
603
- path: `/targets/${encodeURIComponent(String(targetId))}/draft/conflicts/resolve`,
604
- security: [{"apiKey":[]}],
605
- body,
606
- errors: {
607
- "400": BadRequestError,
608
- "401": UnauthorizedError,
609
- "403": ForbiddenError,
610
- "404": NotFoundError,
611
- "409": ConflictError,
612
- "429": RateLimitedError,
613
- "500": InternalServerError,
614
- },
615
- schemaKey: "targets.resolveDraftConflicts",
616
- options,
617
- });
618
- }
619
-
620
- /**
621
- * Discard selected Draft customizations
622
- *
623
- * Replaces the listed customized paths that are not conflicts with the generated files, in one
624
- * commit on the Draft branch. A listed file that exists only on the Draft is deleted. Use
625
- * `dry_run` to see the planned writes and deletions first. Resolve conflicts with
626
- * resolveDraftConflicts.
627
- *
628
- * After the commit, the Draft status is `branch_changed` until Typeship integrates it from the
629
- * repository's pull request event and reruns the checks; you do not need to generate the Target.
630
- * `POST /targets/{target_id}/draft/customizations/discard`
631
- */
632
- async discardDraftCustomizations(
633
- targetId: TargetId,
634
- body: DiscardDraftCustomizations,
635
- options?: RequestOptions,
636
- ): Promise<ApiResult<DraftCustomizationDiscardResponseRead, TargetsDiscardDraftCustomizationsError>> {
637
- return this._core.request<DraftCustomizationDiscardResponseRead, TargetsDiscardDraftCustomizationsError>({
638
- method: "POST",
639
- path: `/targets/${encodeURIComponent(String(targetId))}/draft/customizations/discard`,
640
- security: [{"apiKey":[]}],
641
- body,
642
- errors: {
643
- "400": BadRequestError,
644
- "401": UnauthorizedError,
645
- "403": ForbiddenError,
646
- "404": NotFoundError,
647
- "409": ConflictError,
648
- "429": RateLimitedError,
649
- "500": InternalServerError,
650
- },
651
- schemaKey: "targets.discardDraftCustomizations",
652
- options,
653
- });
654
- }
655
-
656
- /**
657
- * Approve recovery from rewritten default-branch history
658
- *
659
- * When the Draft status is `history_rewritten`, review the affected files with `listDraftFiles`
660
- * and `filter=history`, then approve with the Draft's `history_recovery` revisions. Approval
661
- * saves the recovery without changing Git, and the Draft status becomes `needs_generation`:
662
- * generate the Target to open a new Draft from the rewritten default branch. The previous Draft
663
- * branch stays available, and overlapping code comes back as conflicts to resolve. A rewritten
664
- * Draft branch alone needs no approval.
665
- * `POST /targets/{target_id}/draft/history/recover`
666
- */
667
- async recoverDraftHistory(
668
- targetId: TargetId,
669
- body: RecoverDraftHistory,
670
- options?: RequestOptions,
671
- ): Promise<ApiResult<DraftHistoryRecoveryResponseRead, TargetsRecoverDraftHistoryError>> {
672
- return this._core.request<DraftHistoryRecoveryResponseRead, TargetsRecoverDraftHistoryError>({
673
- method: "POST",
674
- path: `/targets/${encodeURIComponent(String(targetId))}/draft/history/recover`,
675
- security: [{"apiKey":[]}],
676
- body,
677
- errors: {
678
- "400": BadRequestError,
679
- "401": UnauthorizedError,
680
- "403": ForbiddenError,
681
- "404": NotFoundError,
682
- "409": ConflictError,
683
- "429": RateLimitedError,
684
- "500": InternalServerError,
685
- },
686
- schemaKey: "targets.recoverDraftHistory",
687
- options,
688
- });
689
- }
690
-
691
- /**
692
- * Retrieve a Delivery
693
- *
694
- * Returns the configured repository or hosted MCP Delivery for a Target. A Delivery in another
695
- * organization returns 404 not_found.
696
- * `GET /deliveries/{delivery_id}`
697
- */
698
- async retrieveDelivery(
699
- deliveryId: DeliveryId,
700
- options?: RequestOptions,
701
- ): Promise<ApiResult<DeliveryResponseRead, TargetsRetrieveDeliveryError>> {
702
- return this._core.request<DeliveryResponseRead, TargetsRetrieveDeliveryError>({
703
- method: "GET",
704
- path: `/deliveries/${encodeURIComponent(String(deliveryId))}`,
705
- security: [{"apiKey":[]}],
706
- errors: {
707
- "401": UnauthorizedError,
708
- "403": ForbiddenError,
709
- "404": NotFoundError,
710
- "429": RateLimitedError,
711
- "500": InternalServerError,
712
- },
713
- idempotent: true,
714
- schemaKey: "targets.retrieveDelivery",
715
- options,
716
- });
717
- }
718
-
719
- /**
720
- * Retrieve a Publication
721
- *
722
- * Returns the current registry publication state for a Target Release. A Publication in another
723
- * organization returns 404 not_found.
724
- * `GET /publications/{publication_id}`
725
- */
726
- async retrievePublication(
727
- publicationId: PublicationId,
728
- options?: RequestOptions,
729
- ): Promise<ApiResult<PublicationResponseRead, TargetsRetrievePublicationError>> {
730
- return this._core.request<PublicationResponseRead, TargetsRetrievePublicationError>({
731
- method: "GET",
732
- path: `/publications/${encodeURIComponent(String(publicationId))}`,
733
- security: [{"apiKey":[]}],
734
- errors: {
735
- "401": UnauthorizedError,
736
- "403": ForbiddenError,
737
- "404": NotFoundError,
738
- "429": RateLimitedError,
739
- "500": InternalServerError,
740
- },
741
- idempotent: true,
742
- schemaKey: "targets.retrievePublication",
268
+ schemaKey: "targets.adopt",
743
269
  options,
744
270
  });
745
271
  }
@@ -749,20 +275,23 @@ export interface TargetsListParams {
749
275
  /**
750
276
  * Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
751
277
  * representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
752
- * invalid_request. List query parameters must appear only once; unrecognized parameters also
753
- * return 400.
278
+ * input_invalid. List query parameters must appear only once; repeated or unrecognized parameters
279
+ * return 400 query_param_invalid.
754
280
  */
755
281
  limit?: number;
756
282
  /**
757
- * Opaque cursor from the preceding page's next_cursor. Valid only for the same account,
758
- * operation, filters, and ordering that issued it. Omit to start at the first page. Empty,
759
- * malformed, or repeated cursors return 400 invalid_request. The page limit may change between
760
- * requests.
283
+ * Opaque cursor from the preceding page's next_cursor. Valid only for the same organization,
284
+ * operation, filters, and ordering that issued it. Omit to start at the first page. Empty or
285
+ * malformed cursors, and cursors issued for different filters, return 400 cursor_invalid; start
286
+ * again from the first page. Repeated cursors return 400 query_param_invalid. The page limit may
287
+ * change between requests.
761
288
  */
762
289
  cursor?: string;
290
+ /** Only Targets in this Project. */
291
+ projectId?: ProjectId;
763
292
  }
764
293
 
765
- /** Every error `list` can produce, as a discriminated union. */
294
+ /** Typed errors `list` can throw. */
766
295
  export type TargetsListError =
767
296
  | BadRequestError
768
297
  | UnauthorizedError
@@ -777,15 +306,15 @@ export type TargetsListError =
777
306
 
778
307
  export interface TargetsCreateParams {
779
308
  /**
780
- * Identifies one logical write for 24 hours. The key is scoped to the authenticated account and
781
- * operation; account-less generation uses a hashed network identity. Retrying the same method,
782
- * path, query, If-Match header, and JSON body replays the original response. Reusing the key with
783
- * changed intent returns 409. After expiry the key starts a new write.
309
+ * Identifies one logical write for 24 hours. The key is scoped to the authenticated organization
310
+ * and operation; generation without an organization uses a hashed network identity. Retrying the
311
+ * same method, path, query, If-Match header, and JSON body replays the original response. Reusing
312
+ * the key with changed intent returns 409. After expiry the key starts a new write.
784
313
  */
785
314
  idempotencyKey?: string;
786
315
  }
787
316
 
788
- /** Every error `create` can produce, as a discriminated union. */
317
+ /** Typed errors `create` can throw. */
789
318
  export type TargetsCreateError =
790
319
  | BadRequestError
791
320
  | UnauthorizedError
@@ -801,8 +330,8 @@ export type TargetsCreateError =
801
330
  | TransportError
802
331
  | ValidationError;
803
332
 
804
- /** Every error `retrieve` can produce, as a discriminated union. */
805
- export type TargetsRetrieveError =
333
+ /** Typed errors `get` can throw. */
334
+ export type TargetsGetError =
806
335
  | UnauthorizedError
807
336
  | ForbiddenError
808
337
  | NotFoundError
@@ -822,7 +351,7 @@ export interface TargetsDeleteParams {
822
351
  ifMatch?: string;
823
352
  }
824
353
 
825
- /** Every error `delete` can produce, as a discriminated union. */
354
+ /** Typed errors `delete` can throw. */
826
355
  export type TargetsDeleteError =
827
356
  | BadRequestError
828
357
  | UnauthorizedError
@@ -846,7 +375,7 @@ export interface TargetsUpdateParams {
846
375
  ifMatch?: string;
847
376
  }
848
377
 
849
- /** Every error `update` can produce, as a discriminated union. */
378
+ /** Typed errors `update` can throw. */
850
379
  export type TargetsUpdateError =
851
380
  | BadRequestError
852
381
  | UnauthorizedError
@@ -864,86 +393,18 @@ export type TargetsUpdateError =
864
393
  | TransportError
865
394
  | ValidationError;
866
395
 
867
- export interface TargetsListReleasesParams {
868
- /**
869
- * Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
870
- * representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
871
- * invalid_request. List query parameters must appear only once; unrecognized parameters also
872
- * return 400.
873
- */
874
- limit?: number;
875
- /**
876
- * Opaque cursor from the preceding page's next_cursor. Valid only for the same account,
877
- * operation, filters, and ordering that issued it. Omit to start at the first page. Empty,
878
- * malformed, or repeated cursors return 400 invalid_request. The page limit may change between
879
- * requests.
880
- */
881
- cursor?: string;
882
- }
883
-
884
- /** Every error `listReleases` can produce, as a discriminated union. */
885
- export type TargetsListReleasesError =
886
- | BadRequestError
887
- | UnauthorizedError
888
- | ForbiddenError
889
- | NotFoundError
890
- | RateLimitedError
891
- | InternalServerError
892
- | UnexpectedApiError
893
- | ResponseParseError
894
- | TransportError
895
- | ValidationError;
896
-
897
- /** Every error `retrieveDraft` can produce, as a discriminated union. */
898
- export type TargetsRetrieveDraftError =
899
- | UnauthorizedError
900
- | ForbiddenError
901
- | NotFoundError
902
- | RateLimitedError
903
- | InternalServerError
904
- | UnexpectedApiError
905
- | ResponseParseError
906
- | TransportError
907
- | ValidationError;
908
-
909
- export interface TargetsUpdateDraftParams {
910
- /**
911
- * ETag from a preceding response. The write applies only if the resource still has that version;
912
- * otherwise it returns 412 precondition_failed without changes. Omit to write the current
913
- * version. See https://typeship.dev/docs/typeship-api#conditional-writes.
914
- */
915
- ifMatch?: string;
916
- }
917
-
918
- /** Every error `updateDraft` can produce, as a discriminated union. */
919
- export type TargetsUpdateDraftError =
920
- | BadRequestError
921
- | UnauthorizedError
922
- | ForbiddenError
923
- | NotFoundError
924
- | ConflictError
925
- | PreconditionFailedError
926
- | UnprocessableEntityError
927
- | RateLimitedError
928
- | InternalServerError
929
- | BadGatewayError
930
- | UnexpectedApiError
931
- | ResponseParseError
932
- | TransportError
933
- | ValidationError;
934
-
935
- export interface TargetsAdoptReleaseParams {
396
+ export interface TargetsAdoptParams {
936
397
  /**
937
- * Identifies one logical write for 24 hours. The key is scoped to the authenticated account and
938
- * operation; account-less generation uses a hashed network identity. Retrying the same method,
939
- * path, query, If-Match header, and JSON body replays the original response. Reusing the key with
940
- * changed intent returns 409. After expiry the key starts a new write.
398
+ * Identifies one logical write for 24 hours. The key is scoped to the authenticated organization
399
+ * and operation; generation without an organization uses a hashed network identity. Retrying the
400
+ * same method, path, query, If-Match header, and JSON body replays the original response. Reusing
401
+ * the key with changed intent returns 409. After expiry the key starts a new write.
941
402
  */
942
403
  idempotencyKey?: string;
943
404
  }
944
405
 
945
- /** Every error `adoptRelease` can produce, as a discriminated union. */
946
- export type TargetsAdoptReleaseError =
406
+ /** Typed errors `adopt` can throw. */
407
+ export type TargetsAdoptError =
947
408
  | BadRequestError
948
409
  | UnauthorizedError
949
410
  | ForbiddenError
@@ -956,166 +417,3 @@ export type TargetsAdoptReleaseError =
956
417
  | ResponseParseError
957
418
  | TransportError
958
419
  | ValidationError;
959
-
960
- /** Every error `retrieveRelease` can produce, as a discriminated union. */
961
- export type TargetsRetrieveReleaseError =
962
- | UnauthorizedError
963
- | ForbiddenError
964
- | NotFoundError
965
- | RateLimitedError
966
- | InternalServerError
967
- | UnexpectedApiError
968
- | ResponseParseError
969
- | TransportError
970
- | ValidationError;
971
-
972
- export interface TargetsRepublishReleaseParams {
973
- /**
974
- * Identifies one logical write for 24 hours. The key is scoped to the authenticated account and
975
- * operation; account-less generation uses a hashed network identity. Retrying the same method,
976
- * path, query, If-Match header, and JSON body replays the original response. Reusing the key with
977
- * changed intent returns 409. After expiry the key starts a new write.
978
- */
979
- idempotencyKey?: string;
980
- }
981
-
982
- /** Every error `republishRelease` can produce, as a discriminated union. */
983
- export type TargetsRepublishReleaseError =
984
- | BadRequestError
985
- | UnauthorizedError
986
- | ForbiddenError
987
- | NotFoundError
988
- | ConflictError
989
- | RateLimitedError
990
- | InternalServerError
991
- | BadGatewayError
992
- | UnexpectedApiError
993
- | ResponseParseError
994
- | TransportError
995
- | ValidationError;
996
-
997
- export interface TargetsListDraftFilesParams {
998
- /**
999
- * conflicted: conflicts only. customized: files that differ from the last accepted package.
1000
- * history: files affected by a default-branch history rewrite. Omit for conflicted and customized
1001
- * files.
1002
- */
1003
- filter?: "conflicted" | "customized" | "history";
1004
- /**
1005
- * Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
1006
- * representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
1007
- * invalid_request. List query parameters must appear only once; unrecognized parameters also
1008
- * return 400.
1009
- */
1010
- limit?: number;
1011
- /**
1012
- * Opaque cursor from the preceding page's next_cursor. Valid only for the same account,
1013
- * operation, filters, and ordering that issued it. Omit to start at the first page. Empty,
1014
- * malformed, or repeated cursors return 400 invalid_request. The page limit may change between
1015
- * requests.
1016
- */
1017
- cursor?: string;
1018
- }
1019
-
1020
- /** Every error `listDraftFiles` can produce, as a discriminated union. */
1021
- export type TargetsListDraftFilesError =
1022
- | BadRequestError
1023
- | UnauthorizedError
1024
- | ForbiddenError
1025
- | NotFoundError
1026
- | ConflictError
1027
- | RateLimitedError
1028
- | InternalServerError
1029
- | UnexpectedApiError
1030
- | ResponseParseError
1031
- | TransportError
1032
- | ValidationError;
1033
-
1034
- export interface TargetsRetrieveDraftFileContentParams {
1035
- /** File path from listDraftFiles. */
1036
- path: string;
1037
- /** A side listed for the file. */
1038
- side: DraftFileSide;
1039
- /** next_cursor from the preceding chunk of the same path and side. */
1040
- cursor?: string;
1041
- }
1042
-
1043
- /** Every error `retrieveDraftFileContent` can produce, as a discriminated union. */
1044
- export type TargetsRetrieveDraftFileContentError =
1045
- | BadRequestError
1046
- | UnauthorizedError
1047
- | ForbiddenError
1048
- | NotFoundError
1049
- | ConflictError
1050
- | RateLimitedError
1051
- | InternalServerError
1052
- | UnexpectedApiError
1053
- | ResponseParseError
1054
- | TransportError
1055
- | ValidationError;
1056
-
1057
- /** Every error `resolveDraftConflicts` can produce, as a discriminated union. */
1058
- export type TargetsResolveDraftConflictsError =
1059
- | BadRequestError
1060
- | UnauthorizedError
1061
- | ForbiddenError
1062
- | NotFoundError
1063
- | ConflictError
1064
- | RateLimitedError
1065
- | InternalServerError
1066
- | UnexpectedApiError
1067
- | ResponseParseError
1068
- | TransportError
1069
- | ValidationError;
1070
-
1071
- /** Every error `discardDraftCustomizations` can produce, as a discriminated union. */
1072
- export type TargetsDiscardDraftCustomizationsError =
1073
- | BadRequestError
1074
- | UnauthorizedError
1075
- | ForbiddenError
1076
- | NotFoundError
1077
- | ConflictError
1078
- | RateLimitedError
1079
- | InternalServerError
1080
- | UnexpectedApiError
1081
- | ResponseParseError
1082
- | TransportError
1083
- | ValidationError;
1084
-
1085
- /** Every error `recoverDraftHistory` can produce, as a discriminated union. */
1086
- export type TargetsRecoverDraftHistoryError =
1087
- | BadRequestError
1088
- | UnauthorizedError
1089
- | ForbiddenError
1090
- | NotFoundError
1091
- | ConflictError
1092
- | RateLimitedError
1093
- | InternalServerError
1094
- | UnexpectedApiError
1095
- | ResponseParseError
1096
- | TransportError
1097
- | ValidationError;
1098
-
1099
- /** Every error `retrieveDelivery` can produce, as a discriminated union. */
1100
- export type TargetsRetrieveDeliveryError =
1101
- | UnauthorizedError
1102
- | ForbiddenError
1103
- | NotFoundError
1104
- | RateLimitedError
1105
- | InternalServerError
1106
- | UnexpectedApiError
1107
- | ResponseParseError
1108
- | TransportError
1109
- | ValidationError;
1110
-
1111
- /** Every error `retrievePublication` can produce, as a discriminated union. */
1112
- export type TargetsRetrievePublicationError =
1113
- | UnauthorizedError
1114
- | ForbiddenError
1115
- | NotFoundError
1116
- | RateLimitedError
1117
- | InternalServerError
1118
- | UnexpectedApiError
1119
- | ResponseParseError
1120
- | TransportError
1121
- | ValidationError;