@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
- import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
1
+ import { HttpCore, type RequestOptions } from "../core/http.js";
2
2
  import { PagePromise } from "../core/pagination.js";
3
3
  import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadGatewayError, BadRequestError, ConflictError, ForbiddenError, InternalServerError, NotFoundError, PayloadTooLargeError, PaymentRequiredError, PreconditionFailedError, RateLimitedError, UnauthorizedError, UnprocessableEntityError } from "../errors.js";
4
- import type { CreateProjectRequest, DeletedProjectRead, DiagnosticRemediationRead, DiagnosticRemediationRequest, DiagnosticReportRead, GenerateProjectRequest, GenerationBatchRead, GenerationSummaryRead, ProjectId, ProjectRead, ProjectSummaryRead, RepositoryIntegrationHealthRead, TargetId, UpdateProjectRequest } from "../types.js";
4
+ import type { CreateProjectRequest, DeletedProjectRead, GenerateProjectRequest, GenerationBatchRead, ProjectId, ProjectRead, ProjectSummaryRead, UpdateProjectRequest } from "../types.js";
5
5
  export declare class ProjectsResource {
6
6
  private readonly _core;
7
7
  constructor(_core: HttpCore);
@@ -15,7 +15,8 @@ export declare class ProjectsResource {
15
15
  /**
16
16
  * Create a project
17
17
  *
18
- * Creates a Project from a URL or GitHub Definition.
18
+ * Creates a Project from a URL or GitHub Spec.
19
+ * Automatic generation is enabled by default for a saved Project.
19
20
  *
20
21
  * Free includes one saved Project, all selected Targets, and the first 25 operations per Target,
21
22
  * with regeneration, history, delivery pull requests, and previews. Pro supports additional
@@ -24,141 +25,97 @@ export declare class ProjectsResource {
24
25
  * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
25
26
  * `POST /projects`
26
27
  */
27
- create(body: CreateProjectRequest, params?: ProjectsCreateParams, options?: RequestOptions): Promise<ApiResult<ProjectRead, ProjectsCreateError>>;
28
+ create(body: CreateProjectRequest, params?: ProjectsCreateParams, options?: RequestOptions): Promise<ProjectRead>;
28
29
  /**
29
- * Retrieve a project
30
+ * Get a project
30
31
  *
31
- * Returns the Project's settings and Definition ID. List its Targets separately to retrieve
32
- * Target configuration and Deliveries.
32
+ * Returns the Project's settings and Spec ID. List its Targets separately to retrieve Target
33
+ * configuration and Deliveries.
33
34
  * `GET /projects/{project_id}`
34
35
  */
35
- retrieve(projectId: ProjectId, options?: RequestOptions): Promise<ApiResult<ProjectRead, ProjectsRetrieveError>>;
36
+ get(projectId: ProjectId, options?: RequestOptions): Promise<ProjectRead>;
36
37
  /**
37
38
  * Delete a project
38
39
  *
39
- * A `502` response means the Project was not deleted because its release pull requests could not
40
- * be retired. Retry deletion to finish retiring the remaining reviews. Repeating a completed
41
- * deletion returns `404`.
40
+ * A `502 repository_unavailable` means the Project was not deleted because its release pull
41
+ * requests could not be retired. Retry deletion to finish retiring the remaining reviews.
42
+ * Repeating a completed deletion returns `404`.
42
43
  * See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
43
44
  * and If-Match.
44
45
  * `DELETE /projects/{project_id}`
45
46
  */
46
- delete(projectId: ProjectId, params?: ProjectsDeleteParams, options?: RequestOptions): Promise<ApiResult<DeletedProjectRead, ProjectsDeleteError>>;
47
+ delete(projectId: ProjectId, params?: ProjectsDeleteParams, options?: RequestOptions): Promise<DeletedProjectRead>;
47
48
  /**
48
49
  * Update a project
49
50
  *
50
51
  * Omitted fields keep their current values. A supplied config replaces the entire stored object;
51
52
  * null or an empty object clears it.
53
+ * With auto_generate enabled, changing shared config queues a Generation for each Target whose
54
+ * effective config changes. A queued or running Target reuses that Generation.
52
55
  * Omitting If-Match applies the update to the current resource; with If-Match, a stale ETag
53
56
  * returns 412 precondition_failed without saving.
54
57
  *
55
- * A `409 target_busy` means a Target is publishing. Retrieve the Project, wait for publication to
58
+ * A `409 target_busy` means a Target is publishing. Retrieve the Project, wait for publishing to
56
59
  * finish, reconcile your update, and retry.
57
- * A `502` response means the Project was saved, but an obsolete release pull request could not be
58
- * retired. Retrieve the Project and retry the same update to finish retiring reviews if that
59
- * update is still desired.
60
+ * A `502 follow_up_failed` means the Project was saved, but an obsolete release pull request
61
+ * could not be retired. Retrieve the Project and retry the same update to finish retiring reviews
62
+ * if that update is still desired.
60
63
  * See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
61
64
  * and If-Match.
62
65
  * `PATCH /projects/{project_id}`
63
66
  */
64
- update(projectId: ProjectId, body: UpdateProjectRequest, params?: ProjectsUpdateParams, options?: RequestOptions): Promise<ApiResult<ProjectRead, ProjectsUpdateError>>;
65
- /**
66
- * Analyze a project's latest Definition Revision
67
- *
68
- * Checks the latest Definition Revision after applying its saved patches. Each finding groups
69
- * affected locations under a stable rule ID. A suggested patch is included only when the
70
- * Definition provides enough information to determine the correction.
71
- * `GET /projects/{project_id}/diagnostics`
72
- */
73
- retrieveDiagnostics(projectId: ProjectId, options?: RequestOptions): Promise<ApiResult<DiagnosticReportRead, ProjectsRetrieveDiagnosticsError>>;
74
- /**
75
- * Refresh a project's Diagnostics from its configured source
76
- *
77
- * Fetches the configured source and returns updated Diagnostics. Creates a Definition Revision
78
- * only when the content changes. Does not generate Targets or use a metered generation.
79
- *
80
- * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
81
- * `POST /projects/{project_id}/diagnostics`
82
- */
83
- refreshDiagnostics(projectId: ProjectId, params?: ProjectsRefreshDiagnosticsParams, options?: RequestOptions): Promise<ApiResult<DiagnosticReportRead, ProjectsRefreshDiagnosticsError>>;
84
- /**
85
- * Apply exact, reviewed diagnostic remediations
86
- *
87
- * Applies reviewed patches from Diagnostics. For a repository source, opens or updates a source
88
- * pull request. For a URL source, saves Definition patches.
89
- *
90
- * Findings that need an API-owner decision return `422`. Read the finding's `authoring_brief` and
91
- * update the source instead.
92
- *
93
- * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
94
- * `POST /projects/{project_id}/diagnostics/remediations`
95
- */
96
- remediateDiagnostics(projectId: ProjectId, body: DiagnosticRemediationRequest, params?: ProjectsRemediateDiagnosticsParams, options?: RequestOptions): Promise<ApiResult<DiagnosticRemediationRead, ProjectsRemediateDiagnosticsError>>;
97
- /**
98
- * Diagnose a project's repository integrations
99
- *
100
- * Checks repository access, Definition readability, source-approval labels, and required checks.
101
- * Includes the latest webhook delivery so you can investigate missing updates.
102
- * `GET /projects/{project_id}/integration-health`
103
- */
104
- retrieveIntegrationHealth(projectId: ProjectId, options?: RequestOptions): Promise<ApiResult<RepositoryIntegrationHealthRead, ProjectsRetrieveIntegrationHealthError>>;
105
- /**
106
- * List a project's generations
107
- *
108
- * Auto-paginates: `for await (const item of …)` walks every page.
109
- * `GET /projects/{project_id}/generations`
110
- */
111
- listGenerations(projectId: ProjectId, params?: ProjectsListGenerationsParams, options?: RequestOptions): PagePromise<GenerationSummaryRead, ProjectsListGenerationsError>;
67
+ update(projectId: ProjectId, body: UpdateProjectRequest, params?: ProjectsUpdateParams, options?: RequestOptions): Promise<ProjectRead>;
112
68
  /**
113
69
  * Start generation for active Targets
114
70
  *
115
71
  * Queues one Generation per active Target and returns their IDs. Retrieve each Generation until
116
- * its status moves from `queued` to `running` and then `succeeded` or `failed`. `succeeded` means
72
+ * its status moves from `queued` to `running` and then `completed` or `failed`. `completed` means
117
73
  * generated files are saved; check Delivery and Draft status separately for repository delivery
118
74
  * and pull requests. A Target already queued or running is returned without starting another
119
- * Generation. A matching Idempotency-Key replay returns the same Generations with their current
120
- * statuses.
75
+ * Generation. A `409 targets_inactive` means the Project has no active Target to generate. A
76
+ * matching Idempotency-Key replay returns the same Generations with their current statuses.
121
77
  *
122
- * If the package already matches a destination and no Draft is open, delivery reports `pr_status:
123
- * no_changes` without creating a commit, branch, or pull request. An existing Draft stays open.
124
- * Automatic generation uses the same workflow.
78
+ * If the package already matches a destination and no Draft is open, delivery creates no commit,
79
+ * branch, or pull request. An existing Draft stays open. Automatic generation uses the same
80
+ * workflow.
125
81
  *
126
82
  * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
127
- * `POST /projects/{project_id}/generations`
83
+ * `POST /projects/{project_id}/generate`
128
84
  */
129
- generate(projectId: ProjectId, body?: GenerateProjectRequest, params?: ProjectsGenerateParams, options?: RequestOptions): Promise<ApiResult<GenerationBatchRead, ProjectsGenerateError>>;
85
+ generate(projectId: ProjectId, body?: GenerateProjectRequest, params?: ProjectsGenerateParams, options?: RequestOptions): Promise<GenerationBatchRead>;
130
86
  }
131
87
  export interface ProjectsListParams {
132
88
  /**
133
89
  * Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
134
90
  * representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
135
- * invalid_request. List query parameters must appear only once; unrecognized parameters also
136
- * return 400.
91
+ * input_invalid. List query parameters must appear only once; repeated or unrecognized parameters
92
+ * return 400 query_param_invalid.
137
93
  */
138
94
  limit?: number;
139
95
  /**
140
- * Opaque cursor from the preceding page's next_cursor. Valid only for the same account,
141
- * operation, filters, and ordering that issued it. Omit to start at the first page. Empty,
142
- * malformed, or repeated cursors return 400 invalid_request. The page limit may change between
143
- * requests.
96
+ * Opaque cursor from the preceding page's next_cursor. Valid only for the same organization,
97
+ * operation, filters, and ordering that issued it. Omit to start at the first page. Empty or
98
+ * malformed cursors, and cursors issued for different filters, return 400 cursor_invalid; start
99
+ * again from the first page. Repeated cursors return 400 query_param_invalid. The page limit may
100
+ * change between requests.
144
101
  */
145
102
  cursor?: string;
146
103
  }
147
- /** Every error `list` can produce, as a discriminated union. */
104
+ /** Typed errors `list` can throw. */
148
105
  export type ProjectsListError = BadRequestError | UnauthorizedError | ForbiddenError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
149
106
  export interface ProjectsCreateParams {
150
107
  /**
151
- * Identifies one logical write for 24 hours. The key is scoped to the authenticated account and
152
- * operation; account-less generation uses a hashed network identity. Retrying the same method,
153
- * path, query, If-Match header, and JSON body replays the original response. Reusing the key with
154
- * changed intent returns 409. After expiry the key starts a new write.
108
+ * Identifies one logical write for 24 hours. The key is scoped to the authenticated organization
109
+ * and operation; generation without an organization uses a hashed network identity. Retrying the
110
+ * same method, path, query, If-Match header, and JSON body replays the original response. Reusing
111
+ * the key with changed intent returns 409. After expiry the key starts a new write.
155
112
  */
156
113
  idempotencyKey?: string;
157
114
  }
158
- /** Every error `create` can produce, as a discriminated union. */
115
+ /** Typed errors `create` can throw. */
159
116
  export type ProjectsCreateError = BadRequestError | UnauthorizedError | PaymentRequiredError | ForbiddenError | ConflictError | UnprocessableEntityError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
160
- /** Every error `retrieve` can produce, as a discriminated union. */
161
- export type ProjectsRetrieveError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
117
+ /** Typed errors `get` can throw. */
118
+ export type ProjectsGetError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
162
119
  export interface ProjectsDeleteParams {
163
120
  /**
164
121
  * ETag from a preceding response. The write applies only if the resource still has that version;
@@ -167,7 +124,7 @@ export interface ProjectsDeleteParams {
167
124
  */
168
125
  ifMatch?: string;
169
126
  }
170
- /** Every error `delete` can produce, as a discriminated union. */
127
+ /** Typed errors `delete` can throw. */
171
128
  export type ProjectsDeleteError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | PreconditionFailedError | RateLimitedError | InternalServerError | BadGatewayError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
172
129
  export interface ProjectsUpdateParams {
173
130
  /**
@@ -177,63 +134,17 @@ export interface ProjectsUpdateParams {
177
134
  */
178
135
  ifMatch?: string;
179
136
  }
180
- /** Every error `update` can produce, as a discriminated union. */
137
+ /** Typed errors `update` can throw. */
181
138
  export type ProjectsUpdateError = BadRequestError | UnauthorizedError | PaymentRequiredError | ForbiddenError | NotFoundError | ConflictError | PreconditionFailedError | UnprocessableEntityError | RateLimitedError | InternalServerError | BadGatewayError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
182
- /** Every error `retrieveDiagnostics` can produce, as a discriminated union. */
183
- export type ProjectsRetrieveDiagnosticsError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
184
- export interface ProjectsRefreshDiagnosticsParams {
185
- /**
186
- * Identifies one logical write for 24 hours. The key is scoped to the authenticated account and
187
- * operation; account-less generation uses a hashed network identity. Retrying the same method,
188
- * path, query, If-Match header, and JSON body replays the original response. Reusing the key with
189
- * changed intent returns 409. After expiry the key starts a new write.
190
- */
191
- idempotencyKey?: string;
192
- }
193
- /** Every error `refreshDiagnostics` can produce, as a discriminated union. */
194
- export type ProjectsRefreshDiagnosticsError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | UnprocessableEntityError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
195
- export interface ProjectsRemediateDiagnosticsParams {
196
- /**
197
- * Identifies one logical write for 24 hours. The key is scoped to the authenticated account and
198
- * operation; account-less generation uses a hashed network identity. Retrying the same method,
199
- * path, query, If-Match header, and JSON body replays the original response. Reusing the key with
200
- * changed intent returns 409. After expiry the key starts a new write.
201
- */
202
- idempotencyKey?: string;
203
- }
204
- /** Every error `remediateDiagnostics` can produce, as a discriminated union. */
205
- export type ProjectsRemediateDiagnosticsError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | UnprocessableEntityError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
206
- /** Every error `retrieveIntegrationHealth` can produce, as a discriminated union. */
207
- export type ProjectsRetrieveIntegrationHealthError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
208
- export interface ProjectsListGenerationsParams {
209
- /**
210
- * Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
211
- * representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
212
- * invalid_request. List query parameters must appear only once; unrecognized parameters also
213
- * return 400.
214
- */
215
- limit?: number;
216
- /**
217
- * Opaque cursor from the preceding page's next_cursor. Valid only for the same account,
218
- * operation, filters, and ordering that issued it. Omit to start at the first page. Empty,
219
- * malformed, or repeated cursors return 400 invalid_request. The page limit may change between
220
- * requests.
221
- */
222
- cursor?: string;
223
- /** Only generations for this persisted Target. */
224
- targetId?: TargetId;
225
- }
226
- /** Every error `listGenerations` can produce, as a discriminated union. */
227
- export type ProjectsListGenerationsError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
228
139
  export interface ProjectsGenerateParams {
229
140
  /**
230
- * Identifies one logical write for 24 hours. The key is scoped to the authenticated account and
231
- * operation; account-less generation uses a hashed network identity. Retrying the same method,
232
- * path, query, If-Match header, and JSON body replays the original response. Reusing the key with
233
- * changed intent returns 409. After expiry the key starts a new write.
141
+ * Identifies one logical write for 24 hours. The key is scoped to the authenticated organization
142
+ * and operation; generation without an organization uses a hashed network identity. Retrying the
143
+ * same method, path, query, If-Match header, and JSON body replays the original response. Reusing
144
+ * the key with changed intent returns 409. After expiry the key starts a new write.
234
145
  */
235
146
  idempotencyKey?: string;
236
147
  }
237
- /** Every error `generate` can produce, as a discriminated union. */
148
+ /** Typed errors `generate` can throw. */
238
149
  export type ProjectsGenerateError = BadRequestError | UnauthorizedError | PaymentRequiredError | ForbiddenError | NotFoundError | ConflictError | PayloadTooLargeError | UnprocessableEntityError | RateLimitedError | InternalServerError | BadGatewayError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
239
150
  //# sourceMappingURL=projects.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/resources/projects.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,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,oBAAoB,EACpB,oBAAoB,EACpB,uBAAuB,EACvB,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACV,oBAAoB,EAEpB,kBAAkB,EAElB,yBAAyB,EACzB,4BAA4B,EAE5B,oBAAoB,EACpB,sBAAsB,EAEtB,mBAAmB,EAInB,qBAAqB,EAErB,SAAS,EAGT,WAAW,EAEX,kBAAkB,EAElB,+BAA+B,EAC/B,QAAQ,EACR,oBAAoB,EACrB,MAAM,aAAa,CAAC;AAErB,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;OAKG;IACH,IAAI,CACF,MAAM,CAAC,EAAE,kBAAkB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,kBAAkB,EAAE,iBAAiB,CAAC;IA6BrD;;;;;;;;;;;OAWG;IACG,MAA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AAC,EAAE,MAAM,CAAC;CACzB;AAED,gFAAgF;AAChF,MAAM,MAAM,iCAAiC,GACzC,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,aAAa,GACb,wBAAwB,GACxB,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,qFAAqF;AACrF,MAAM,MAAM,sCAAsC,GAC9C,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,MAAM,WAAW,6BAA6B;IAC5C;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,2EAA2E;AAC3E,MAAM,MAAM,4BAA4B,GACpC,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;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,oEAAoE;AACpE,MAAM,MAAM,qBAAqB,GAC7B,eAAe,GACf,iBAAiB,GACjB,oBAAoB,GACpB,cAAc,GACd,aAAa,GACb,aAAa,GACb,oBAAoB,GACpB,wBAAwB,GACxB,gBAAgB,GAChB,mBAAmB,GACnB,eAAe,GACf,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
1
+ {"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/resources/projects.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChE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eAAe,GACf,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,MAAM,WAAW,oBAAoB;IACnC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,uCAAuC;AACvC,MAAM,MAAM,mBAAmB,GAC3B,eAAe,GACf,iBAAiB,GACjB,oBAAoB,GACpB,cAAc,GACd,aAAa,GACb,aAAa,GACb,uBAAuB,GACvB,wBAAwB,GACxB,gBAAgB,GAChB,mBAAmB,GACnB,eAAe,GACf,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,yCAAyC;AACzC,MAAM,MAAM,qBAAqB,GAC7B,eAAe,GACf,iBAAiB,GACjB,oBAAoB,GACpB,cAAc,GACd,aAAa,GACb,aAAa,GACb,oBAAoB,GACpB,wBAAwB,GACxB,gBAAgB,GAChB,mBAAmB,GACnB,eAAe,GACf,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
@@ -44,7 +44,8 @@ export class ProjectsResource {
44
44
  /**
45
45
  * Create a project
46
46
  *
47
- * Creates a Project from a URL or GitHub Definition.
47
+ * Creates a Project from a URL or GitHub Spec.
48
+ * Automatic generation is enabled by default for a saved Project.
48
49
  *
49
50
  * Free includes one saved Project, all selected Targets, and the first 25 operations per Target,
50
51
  * with regeneration, history, delivery pull requests, and previews. Pro supports additional
@@ -54,7 +55,7 @@ export class ProjectsResource {
54
55
  * `POST /projects`
55
56
  */
56
57
  async create(body, params, options) {
57
- return this._core.request({
58
+ return this._core.requestData({
58
59
  method: "POST",
59
60
  path: "/projects",
60
61
  security: [{ "apiKey": [] }],
@@ -78,14 +79,14 @@ export class ProjectsResource {
78
79
  });
79
80
  }
80
81
  /**
81
- * Retrieve a project
82
+ * Get a project
82
83
  *
83
- * Returns the Project's settings and Definition ID. List its Targets separately to retrieve
84
- * Target configuration and Deliveries.
84
+ * Returns the Project's settings and Spec ID. List its Targets separately to retrieve Target
85
+ * configuration and Deliveries.
85
86
  * `GET /projects/{project_id}`
86
87
  */
87
- async retrieve(projectId, options) {
88
- return this._core.request({
88
+ async get(projectId, options) {
89
+ return this._core.requestData({
89
90
  method: "GET",
90
91
  path: `/projects/${encodeURIComponent(String(projectId))}`,
91
92
  security: [{ "apiKey": [] }],
@@ -97,22 +98,22 @@ export class ProjectsResource {
97
98
  "500": InternalServerError,
98
99
  },
99
100
  idempotent: true,
100
- schemaKey: "projects.retrieve",
101
+ schemaKey: "projects.get",
101
102
  options,
102
103
  });
103
104
  }
104
105
  /**
105
106
  * Delete a project
106
107
  *
107
- * A `502` response means the Project was not deleted because its release pull requests could not
108
- * be retired. Retry deletion to finish retiring the remaining reviews. Repeating a completed
109
- * deletion returns `404`.
108
+ * A `502 repository_unavailable` means the Project was not deleted because its release pull
109
+ * requests could not be retired. Retry deletion to finish retiring the remaining reviews.
110
+ * Repeating a completed deletion returns `404`.
110
111
  * See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
111
112
  * and If-Match.
112
113
  * `DELETE /projects/{project_id}`
113
114
  */
114
115
  async delete(projectId, params, options) {
115
- return this._core.request({
116
+ return this._core.requestData({
116
117
  method: "DELETE",
117
118
  path: `/projects/${encodeURIComponent(String(projectId))}`,
118
119
  security: [{ "apiKey": [] }],
@@ -139,20 +140,22 @@ export class ProjectsResource {
139
140
  *
140
141
  * Omitted fields keep their current values. A supplied config replaces the entire stored object;
141
142
  * null or an empty object clears it.
143
+ * With auto_generate enabled, changing shared config queues a Generation for each Target whose
144
+ * effective config changes. A queued or running Target reuses that Generation.
142
145
  * Omitting If-Match applies the update to the current resource; with If-Match, a stale ETag
143
146
  * returns 412 precondition_failed without saving.
144
147
  *
145
- * A `409 target_busy` means a Target is publishing. Retrieve the Project, wait for publication to
148
+ * A `409 target_busy` means a Target is publishing. Retrieve the Project, wait for publishing to
146
149
  * finish, reconcile your update, and retry.
147
- * A `502` response means the Project was saved, but an obsolete release pull request could not be
148
- * retired. Retrieve the Project and retry the same update to finish retiring reviews if that
149
- * update is still desired.
150
+ * A `502 follow_up_failed` means the Project was saved, but an obsolete release pull request
151
+ * could not be retired. Retrieve the Project and retry the same update to finish retiring reviews
152
+ * if that update is still desired.
150
153
  * See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
151
154
  * and If-Match.
152
155
  * `PATCH /projects/{project_id}`
153
156
  */
154
157
  async update(projectId, body, params, options) {
155
- return this._core.request({
158
+ return this._core.requestData({
156
159
  method: "PATCH",
157
160
  path: `/projects/${encodeURIComponent(String(projectId))}`,
158
161
  security: [{ "apiKey": [] }],
@@ -177,180 +180,27 @@ export class ProjectsResource {
177
180
  options,
178
181
  });
179
182
  }
180
- /**
181
- * Analyze a project's latest Definition Revision
182
- *
183
- * Checks the latest Definition Revision after applying its saved patches. Each finding groups
184
- * affected locations under a stable rule ID. A suggested patch is included only when the
185
- * Definition provides enough information to determine the correction.
186
- * `GET /projects/{project_id}/diagnostics`
187
- */
188
- async retrieveDiagnostics(projectId, options) {
189
- return this._core.request({
190
- method: "GET",
191
- path: `/projects/${encodeURIComponent(String(projectId))}/diagnostics`,
192
- security: [{ "apiKey": [] }],
193
- errors: {
194
- "401": UnauthorizedError,
195
- "403": ForbiddenError,
196
- "404": NotFoundError,
197
- "429": RateLimitedError,
198
- "500": InternalServerError,
199
- },
200
- idempotent: true,
201
- schemaKey: "projects.retrieveDiagnostics",
202
- options,
203
- });
204
- }
205
- /**
206
- * Refresh a project's Diagnostics from its configured source
207
- *
208
- * Fetches the configured source and returns updated Diagnostics. Creates a Definition Revision
209
- * only when the content changes. Does not generate Targets or use a metered generation.
210
- *
211
- * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
212
- * `POST /projects/{project_id}/diagnostics`
213
- */
214
- async refreshDiagnostics(projectId, params, options) {
215
- return this._core.request({
216
- method: "POST",
217
- path: `/projects/${encodeURIComponent(String(projectId))}/diagnostics`,
218
- security: [{ "apiKey": [] }],
219
- headers: {
220
- "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
221
- },
222
- errors: {
223
- "400": BadRequestError,
224
- "401": UnauthorizedError,
225
- "403": ForbiddenError,
226
- "404": NotFoundError,
227
- "409": ConflictError,
228
- "422": UnprocessableEntityError,
229
- "429": RateLimitedError,
230
- "500": InternalServerError,
231
- },
232
- idempotencyKey: "Idempotency-Key",
233
- schemaKey: "projects.refreshDiagnostics",
234
- options,
235
- });
236
- }
237
- /**
238
- * Apply exact, reviewed diagnostic remediations
239
- *
240
- * Applies reviewed patches from Diagnostics. For a repository source, opens or updates a source
241
- * pull request. For a URL source, saves Definition patches.
242
- *
243
- * Findings that need an API-owner decision return `422`. Read the finding's `authoring_brief` and
244
- * update the source instead.
245
- *
246
- * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
247
- * `POST /projects/{project_id}/diagnostics/remediations`
248
- */
249
- async remediateDiagnostics(projectId, body, params, options) {
250
- return this._core.request({
251
- method: "POST",
252
- path: `/projects/${encodeURIComponent(String(projectId))}/diagnostics/remediations`,
253
- security: [{ "apiKey": [] }],
254
- headers: {
255
- "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
256
- },
257
- body,
258
- errors: {
259
- "400": BadRequestError,
260
- "401": UnauthorizedError,
261
- "403": ForbiddenError,
262
- "404": NotFoundError,
263
- "409": ConflictError,
264
- "422": UnprocessableEntityError,
265
- "429": RateLimitedError,
266
- "500": InternalServerError,
267
- },
268
- idempotencyKey: "Idempotency-Key",
269
- schemaKey: "projects.remediateDiagnostics",
270
- options,
271
- });
272
- }
273
- /**
274
- * Diagnose a project's repository integrations
275
- *
276
- * Checks repository access, Definition readability, source-approval labels, and required checks.
277
- * Includes the latest webhook delivery so you can investigate missing updates.
278
- * `GET /projects/{project_id}/integration-health`
279
- */
280
- async retrieveIntegrationHealth(projectId, options) {
281
- return this._core.request({
282
- method: "GET",
283
- path: `/projects/${encodeURIComponent(String(projectId))}/integration-health`,
284
- security: [{ "apiKey": [] }],
285
- errors: {
286
- "401": UnauthorizedError,
287
- "403": ForbiddenError,
288
- "404": NotFoundError,
289
- "429": RateLimitedError,
290
- "500": InternalServerError,
291
- },
292
- idempotent: true,
293
- schemaKey: "projects.retrieveIntegrationHealth",
294
- options,
295
- });
296
- }
297
- /**
298
- * List a project's generations
299
- *
300
- * Auto-paginates: `for await (const item of …)` walks every page.
301
- * `GET /projects/{project_id}/generations`
302
- */
303
- listGenerations(projectId, params, options) {
304
- return paginate(this._core, {
305
- method: "GET",
306
- path: `/projects/${encodeURIComponent(String(projectId))}/generations`,
307
- security: [{ "apiKey": [] }],
308
- query: {
309
- limit: params?.limit,
310
- cursor: params?.cursor,
311
- target_id: params?.targetId,
312
- },
313
- errors: {
314
- "400": BadRequestError,
315
- "401": UnauthorizedError,
316
- "403": ForbiddenError,
317
- "404": NotFoundError,
318
- "429": RateLimitedError,
319
- "500": InternalServerError,
320
- },
321
- idempotent: true,
322
- schemaKey: "projects.listGenerations",
323
- options,
324
- }, {
325
- style: "cursor",
326
- itemsField: "data",
327
- cursorParam: "cursor",
328
- nextCursorField: "next_cursor",
329
- hasMoreField: "has_more",
330
- limitParam: "limit",
331
- });
332
- }
333
183
  /**
334
184
  * Start generation for active Targets
335
185
  *
336
186
  * Queues one Generation per active Target and returns their IDs. Retrieve each Generation until
337
- * its status moves from `queued` to `running` and then `succeeded` or `failed`. `succeeded` means
187
+ * its status moves from `queued` to `running` and then `completed` or `failed`. `completed` means
338
188
  * generated files are saved; check Delivery and Draft status separately for repository delivery
339
189
  * and pull requests. A Target already queued or running is returned without starting another
340
- * Generation. A matching Idempotency-Key replay returns the same Generations with their current
341
- * statuses.
190
+ * Generation. A `409 targets_inactive` means the Project has no active Target to generate. A
191
+ * matching Idempotency-Key replay returns the same Generations with their current statuses.
342
192
  *
343
- * If the package already matches a destination and no Draft is open, delivery reports `pr_status:
344
- * no_changes` without creating a commit, branch, or pull request. An existing Draft stays open.
345
- * Automatic generation uses the same workflow.
193
+ * If the package already matches a destination and no Draft is open, delivery creates no commit,
194
+ * branch, or pull request. An existing Draft stays open. Automatic generation uses the same
195
+ * workflow.
346
196
  *
347
197
  * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
348
- * `POST /projects/{project_id}/generations`
198
+ * `POST /projects/{project_id}/generate`
349
199
  */
350
200
  async generate(projectId, body, params, options) {
351
- return this._core.request({
201
+ return this._core.requestData({
352
202
  method: "POST",
353
- path: `/projects/${encodeURIComponent(String(projectId))}/generations`,
203
+ path: `/projects/${encodeURIComponent(String(projectId))}/generate`,
354
204
  security: [{ "apiKey": [] }],
355
205
  headers: {
356
206
  "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
@@ -0,0 +1,47 @@
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 { PublicationId, PublicationRead, PublicationResponseRead, ReleaseId } from "../types.js";
5
+ export declare class PublicationsResource {
6
+ private readonly _core;
7
+ constructor(_core: HttpCore);
8
+ /**
9
+ * List publications
10
+ *
11
+ * Auto-paginates: `for await (const item of …)` walks every page.
12
+ * `GET /publications`
13
+ */
14
+ list(params?: PublicationsListParams, options?: RequestOptions): PagePromise<PublicationRead, PublicationsListError>;
15
+ /**
16
+ * Get publishing status
17
+ *
18
+ * Returns the registry publishing status for a release. A status in another organization returns
19
+ * 404 resource_not_found.
20
+ * `GET /publications/{publication_id}`
21
+ */
22
+ get(publicationId: PublicationId, options?: RequestOptions): Promise<PublicationResponseRead>;
23
+ }
24
+ export interface PublicationsListParams {
25
+ /**
26
+ * Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
27
+ * representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
28
+ * input_invalid. List query parameters must appear only once; repeated or unrecognized parameters
29
+ * return 400 query_param_invalid.
30
+ */
31
+ limit?: number;
32
+ /**
33
+ * Opaque cursor from the preceding page's next_cursor. Valid only for the same organization,
34
+ * operation, filters, and ordering that issued it. Omit to start at the first page. Empty or
35
+ * malformed cursors, and cursors issued for different filters, return 400 cursor_invalid; start
36
+ * again from the first page. Repeated cursors return 400 query_param_invalid. The page limit may
37
+ * change between requests.
38
+ */
39
+ cursor?: string;
40
+ /** Only publications of this release. */
41
+ releaseId?: ReleaseId;
42
+ }
43
+ /** Typed errors `list` can throw. */
44
+ export type PublicationsListError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
45
+ /** Typed errors `get` can throw. */
46
+ export type PublicationsGetError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
47
+ //# sourceMappingURL=publications.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"publications.d.ts","sourceRoot":"","sources":["../../src/resources/publications.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,EAEV,aAAa,EAGb,eAAe,EAEf,uBAAuB,EACvB,SAAS,EACV,MAAM,aAAa,CAAC;AAErB,qBAAa,oBAAoB;IACnB,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAA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