@typeship-ax/cli 0.10.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 (109) hide show
  1. package/AGENTS.md +10 -5
  2. package/README.md +5 -5
  3. package/api.json +9773 -4501
  4. package/api.md +501 -271
  5. package/dist/api-identity.d.ts.map +1 -1
  6. package/dist/api-identity.js +6 -1
  7. package/dist/cli-agent.d.ts +5 -5
  8. package/dist/cli-agent.d.ts.map +1 -1
  9. package/dist/cli-agent.js +14 -10
  10. package/dist/cli.js +158 -82
  11. package/dist/core/http.d.ts +29 -16
  12. package/dist/core/http.d.ts.map +1 -1
  13. package/dist/core/http.js +108 -25
  14. package/dist/core/pagination.d.ts +8 -8
  15. package/dist/core/pagination.d.ts.map +1 -1
  16. package/dist/core/pagination.js +7 -16
  17. package/dist/errors.d.ts +20 -13
  18. package/dist/errors.d.ts.map +1 -1
  19. package/dist/errors.js +29 -20
  20. package/dist/index.d.ts +37 -19
  21. package/dist/index.d.ts.map +1 -1
  22. package/dist/index.js +42 -18
  23. package/dist/ops.d.ts +5 -1
  24. package/dist/ops.d.ts.map +1 -1
  25. package/dist/ops.js +42 -35
  26. package/dist/polling-login.d.ts.map +1 -1
  27. package/dist/polling-login.js +11 -1
  28. package/dist/resources/api-keys.d.ts +44 -18
  29. package/dist/resources/api-keys.d.ts.map +1 -1
  30. package/dist/resources/api-keys.js +46 -14
  31. package/dist/resources/deliveries.d.ts +46 -0
  32. package/dist/resources/deliveries.d.ts.map +1 -0
  33. package/dist/resources/deliveries.js +70 -0
  34. package/dist/resources/drafts.d.ts +155 -0
  35. package/dist/resources/drafts.d.ts.map +1 -0
  36. package/dist/resources/drafts.js +230 -0
  37. package/dist/resources/files.d.ts +23 -0
  38. package/dist/resources/files.d.ts.map +1 -0
  39. package/dist/resources/files.js +38 -0
  40. package/dist/resources/generate.d.ts +49 -20
  41. package/dist/resources/generate.d.ts.map +1 -1
  42. package/dist/resources/generate.js +56 -14
  43. package/dist/resources/generations.d.ts +70 -18
  44. package/dist/resources/generations.d.ts.map +1 -1
  45. package/dist/resources/generations.js +84 -16
  46. package/dist/resources/organization.d.ts +18 -0
  47. package/dist/resources/organization.d.ts.map +1 -0
  48. package/dist/resources/organization.js +32 -0
  49. package/dist/resources/projects.d.ts +87 -124
  50. package/dist/resources/projects.d.ts.map +1 -1
  51. package/dist/resources/projects.js +70 -173
  52. package/dist/resources/publications.d.ts +46 -0
  53. package/dist/resources/publications.d.ts.map +1 -0
  54. package/dist/resources/publications.js +70 -0
  55. package/dist/resources/releases.d.ts +66 -0
  56. package/dist/resources/releases.d.ts.map +1 -0
  57. package/dist/resources/releases.js +101 -0
  58. package/dist/resources/spec-revisions.d.ts +85 -0
  59. package/dist/resources/spec-revisions.d.ts.map +1 -0
  60. package/dist/resources/spec-revisions.js +116 -0
  61. package/dist/resources/specs.d.ts +72 -0
  62. package/dist/resources/specs.d.ts.map +1 -0
  63. package/dist/resources/specs.js +107 -0
  64. package/dist/resources/targets.d.ts +85 -105
  65. package/dist/resources/targets.d.ts.map +1 -1
  66. package/dist/resources/targets.js +70 -163
  67. package/dist/schemas.d.ts +1 -0
  68. package/dist/schemas.d.ts.map +1 -1
  69. package/dist/schemas.js +194 -139
  70. package/dist/types.d.ts +2626 -1141
  71. package/dist/types.d.ts.map +1 -1
  72. package/dist/types.js +90 -11
  73. package/package.json +3 -3
  74. package/src/api-identity.ts +6 -2
  75. package/src/cli-agent.ts +17 -13
  76. package/src/cli.ts +145 -77
  77. package/src/core/http.ts +106 -30
  78. package/src/core/pagination.ts +13 -23
  79. package/src/errors.ts +30 -20
  80. package/src/index.ts +46 -24
  81. package/src/ops.ts +47 -36
  82. package/src/polling-login.ts +10 -1
  83. package/src/resources/api-keys.ts +87 -19
  84. package/src/resources/deliveries.ts +139 -0
  85. package/src/resources/drafts.ts +422 -0
  86. package/src/resources/files.ts +68 -0
  87. package/src/resources/generate.ts +81 -19
  88. package/src/resources/generations.ts +167 -29
  89. package/src/resources/organization.ts +53 -0
  90. package/src/resources/projects.ts +129 -322
  91. package/src/resources/publications.ts +139 -0
  92. package/src/resources/releases.ts +199 -0
  93. package/src/resources/spec-revisions.ts +237 -0
  94. package/src/resources/specs.ts +200 -0
  95. package/src/resources/targets.ts +135 -304
  96. package/src/schemas.ts +195 -140
  97. package/src/types.ts +2793 -1177
  98. package/dist/resources/account.d.ts +0 -18
  99. package/dist/resources/account.d.ts.map +0 -1
  100. package/dist/resources/account.js +0 -27
  101. package/dist/resources/definition-revisions.d.ts +0 -58
  102. package/dist/resources/definition-revisions.d.ts.map +0 -1
  103. package/dist/resources/definition-revisions.js +0 -114
  104. package/dist/resources/definitions.d.ts +0 -35
  105. package/dist/resources/definitions.d.ts.map +0 -1
  106. package/dist/resources/definitions.js +0 -60
  107. package/src/resources/account.ts +0 -46
  108. package/src/resources/definition-revisions.ts +0 -207
  109. package/src/resources/definitions.ts +0 -122
@@ -1,7 +1,7 @@
1
1
  // typeship — projects resource.
2
- // Generated by typeship — https://typeship.dev — do not edit by hand.
2
+ // Generated by typeship — https://typeship.dev
3
3
  import { paginate } from "../core/pagination.js";
4
- import { BadGatewayError, BadRequestError, ConflictError, ForbiddenError, InternalServerError, NotFoundError, PaymentRequiredError, RateLimitedError, UnauthorizedError, UnprocessableEntityError, } from "../errors.js";
4
+ import { BadGatewayError, BadRequestError, ConflictError, ForbiddenError, InternalServerError, NotFoundError, PayloadTooLargeError, PaymentRequiredError, PreconditionFailedError, RateLimitedError, UnauthorizedError, UnprocessableEntityError, } from "../errors.js";
5
5
  export class ProjectsResource {
6
6
  _core;
7
7
  constructor(_core) {
@@ -27,6 +27,7 @@ export class ProjectsResource {
27
27
  "401": UnauthorizedError,
28
28
  "403": ForbiddenError,
29
29
  "429": RateLimitedError,
30
+ "500": InternalServerError,
30
31
  },
31
32
  idempotent: true,
32
33
  schemaKey: "projects.list",
@@ -43,16 +44,18 @@ export class ProjectsResource {
43
44
  /**
44
45
  * Create a project
45
46
  *
46
- * Stores a URL- or GitHub-sourced project. Free includes one stored project, every selected
47
- * target, and the first 25 operations, while keeping manual and automatic regeneration, history,
48
- * destination pull requests, and preview checks. Stateless POST /generate does not consume this
49
- * slot. Pro adds projects and generates every operation in the Definition.
47
+ * Creates a Project from a URL or GitHub Spec.
48
+ * Automatic generation is enabled by default for a saved Project.
49
+ *
50
+ * Free includes one saved Project, all selected Targets, and the first 25 operations per Target,
51
+ * with regeneration, history, delivery pull requests, and previews. Pro supports additional
52
+ * Projects and all operations. One-shot generation does not use a Project slot.
50
53
  *
51
54
  * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
52
55
  * `POST /projects`
53
56
  */
54
57
  async create(body, params, options) {
55
- return this._core.request({
58
+ return this._core.requestData({
56
59
  method: "POST",
57
60
  path: "/projects",
58
61
  security: [{ "apiKey": [] }],
@@ -76,13 +79,14 @@ export class ProjectsResource {
76
79
  });
77
80
  }
78
81
  /**
79
- * Retrieve a project
82
+ * Get a project
80
83
  *
81
- * Returns Project-owned fields only. List Targets separately for Target and Delivery data.
84
+ * Returns the Project's settings and Spec ID. List its Targets separately to retrieve Target
85
+ * configuration and Deliveries.
82
86
  * `GET /projects/{project_id}`
83
87
  */
84
- async retrieve(projectId, options) {
85
- return this._core.request({
88
+ async get(projectId, options) {
89
+ return this._core.requestData({
86
90
  method: "GET",
87
91
  path: `/projects/${encodeURIComponent(String(projectId))}`,
88
92
  security: [{ "apiKey": [] }],
@@ -91,26 +95,40 @@ export class ProjectsResource {
91
95
  "403": ForbiddenError,
92
96
  "404": NotFoundError,
93
97
  "429": RateLimitedError,
98
+ "500": InternalServerError,
94
99
  },
95
100
  idempotent: true,
96
- schemaKey: "projects.retrieve",
101
+ schemaKey: "projects.get",
97
102
  options,
98
103
  });
99
104
  }
100
105
  /**
101
106
  * Delete a project
107
+ *
108
+ * A `502` response means the Project was not deleted because its release pull requests could not
109
+ * be retired. Retry deletion to finish retiring the remaining reviews. Repeating a completed
110
+ * deletion returns `404`.
111
+ * See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
112
+ * and If-Match.
102
113
  * `DELETE /projects/{project_id}`
103
114
  */
104
- async delete(projectId, options) {
105
- return this._core.request({
115
+ async delete(projectId, params, options) {
116
+ return this._core.requestData({
106
117
  method: "DELETE",
107
118
  path: `/projects/${encodeURIComponent(String(projectId))}`,
108
119
  security: [{ "apiKey": [] }],
120
+ headers: {
121
+ "If-Match": params?.ifMatch === undefined ? undefined : String(params?.ifMatch),
122
+ },
109
123
  errors: {
124
+ "400": BadRequestError,
110
125
  "401": UnauthorizedError,
111
126
  "403": ForbiddenError,
112
127
  "404": NotFoundError,
128
+ "412": PreconditionFailedError,
113
129
  "429": RateLimitedError,
130
+ "500": InternalServerError,
131
+ "502": BadGatewayError,
114
132
  },
115
133
  idempotent: true,
116
134
  schemaKey: "projects.delete",
@@ -119,13 +137,31 @@ export class ProjectsResource {
119
137
  }
120
138
  /**
121
139
  * Update a project
140
+ *
141
+ * Omitted fields keep their current values. A supplied config replaces the entire stored object;
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.
145
+ * Omitting If-Match applies the update to the current resource; with If-Match, a stale ETag
146
+ * returns 412 precondition_failed without saving.
147
+ *
148
+ * A `409 target_busy` means a Target is publishing. Retrieve the Project, wait for publishing to
149
+ * finish, reconcile your update, and retry.
150
+ * A `502` response means the Project was saved, but an obsolete release pull request could not be
151
+ * retired. Retrieve the Project and retry the same update to finish retiring reviews if that
152
+ * update is still desired.
153
+ * See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
154
+ * and If-Match.
122
155
  * `PATCH /projects/{project_id}`
123
156
  */
124
- async update(projectId, body, options) {
125
- return this._core.request({
157
+ async update(projectId, body, params, options) {
158
+ return this._core.requestData({
126
159
  method: "PATCH",
127
160
  path: `/projects/${encodeURIComponent(String(projectId))}`,
128
161
  security: [{ "apiKey": [] }],
162
+ headers: {
163
+ "If-Match": params?.ifMatch === undefined ? undefined : String(params?.ifMatch),
164
+ },
129
165
  body,
130
166
  errors: {
131
167
  "400": BadRequestError,
@@ -134,8 +170,10 @@ export class ProjectsResource {
134
170
  "403": ForbiddenError,
135
171
  "404": NotFoundError,
136
172
  "409": ConflictError,
173
+ "412": PreconditionFailedError,
137
174
  "422": UnprocessableEntityError,
138
175
  "429": RateLimitedError,
176
+ "500": InternalServerError,
139
177
  "502": BadGatewayError,
140
178
  },
141
179
  schemaKey: "projects.update",
@@ -143,75 +181,26 @@ export class ProjectsResource {
143
181
  });
144
182
  }
145
183
  /**
146
- * Analyze a project's latest Definition Revision
184
+ * Start generation for active Targets
147
185
  *
148
- * Runs deterministic OpenAPI or GraphQL authorship checks against the latest observed immutable
149
- * Definition Revision after applying the Definition's existing patches. Diagnostics group every
150
- * affected location under a stable rule. Exact patches are included only when Typeship can derive
151
- * the change without inventing API behavior.
152
- * `GET /projects/{project_id}/diagnostics`
153
- */
154
- async retrieveDiagnostics(projectId, options) {
155
- return this._core.request({
156
- method: "GET",
157
- path: `/projects/${encodeURIComponent(String(projectId))}/diagnostics`,
158
- security: [{ "apiKey": [] }],
159
- errors: {
160
- "401": UnauthorizedError,
161
- "403": ForbiddenError,
162
- "404": NotFoundError,
163
- "429": RateLimitedError,
164
- },
165
- idempotent: true,
166
- schemaKey: "projects.retrieveDiagnostics",
167
- options,
168
- });
169
- }
170
- /**
171
- * Refresh a project's Diagnostics from its configured source
186
+ * Queues one Generation per active Target and returns their IDs. Retrieve each Generation until
187
+ * its status moves from `queued` to `running` and then `completed` or `failed`. `completed` means
188
+ * generated files are saved; check Delivery and Draft status separately for repository delivery
189
+ * and pull requests. A Target already queued or running is returned without starting another
190
+ * Generation. A matching Idempotency-Key replay returns the same Generations with their current
191
+ * statuses.
172
192
  *
173
- * Fetches the complete configured source, records a new immutable revision only when content
174
- * changed, and returns its Diagnostics. This does not generate targets or consume a metered
175
- * generation.
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.
176
196
  *
177
197
  * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
178
- * `POST /projects/{project_id}/diagnostics`
198
+ * `POST /projects/{project_id}/generate`
179
199
  */
180
- async refreshDiagnostics(projectId, params, options) {
181
- return this._core.request({
200
+ async generate(projectId, body, params, options) {
201
+ return this._core.requestData({
182
202
  method: "POST",
183
- path: `/projects/${encodeURIComponent(String(projectId))}/diagnostics`,
184
- security: [{ "apiKey": [] }],
185
- headers: {
186
- "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
187
- },
188
- errors: {
189
- "401": UnauthorizedError,
190
- "403": ForbiddenError,
191
- "404": NotFoundError,
192
- "409": ConflictError,
193
- "422": UnprocessableEntityError,
194
- "429": RateLimitedError,
195
- },
196
- idempotencyKey: "Idempotency-Key",
197
- schemaKey: "projects.refreshDiagnostics",
198
- options,
199
- });
200
- }
201
- /**
202
- * Apply exact, reviewed diagnostic remediations
203
- *
204
- * Applies only deterministic patches. Repository sources receive an updateable source pull
205
- * request; URL sources receive project overlays. Diagnostics that require API-owner intent return
206
- * 422 and include an authoring_brief in the Diagnostic instead.
207
- *
208
- * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
209
- * `POST /projects/{project_id}/diagnostics/remediations`
210
- */
211
- async remediateDiagnostics(projectId, body, params, options) {
212
- return this._core.request({
213
- method: "POST",
214
- path: `/projects/${encodeURIComponent(String(projectId))}/diagnostics/remediations`,
203
+ path: `/projects/${encodeURIComponent(String(projectId))}/generate`,
215
204
  security: [{ "apiKey": [] }],
216
205
  headers: {
217
206
  "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
@@ -219,108 +208,16 @@ export class ProjectsResource {
219
208
  body,
220
209
  errors: {
221
210
  "400": BadRequestError,
222
- "401": UnauthorizedError,
223
- "403": ForbiddenError,
224
- "404": NotFoundError,
225
- "409": ConflictError,
226
- "422": UnprocessableEntityError,
227
- "429": RateLimitedError,
228
- },
229
- idempotencyKey: "Idempotency-Key",
230
- schemaKey: "projects.remediateDiagnostics",
231
- options,
232
- });
233
- }
234
- /**
235
- * Diagnose a project's repository integrations
236
- *
237
- * Returns provider-neutral, machine-actionable source and destination access, Definition
238
- * readability, source-approval label setup, required status names, and the latest durable webhook
239
- * delivery. The Console renders this same result.
240
- * `GET /projects/{project_id}/integration-health`
241
- */
242
- async retrieveIntegrationHealth(projectId, options) {
243
- return this._core.request({
244
- method: "GET",
245
- path: `/projects/${encodeURIComponent(String(projectId))}/integration-health`,
246
- security: [{ "apiKey": [] }],
247
- errors: {
248
- "401": UnauthorizedError,
249
- "403": ForbiddenError,
250
- "404": NotFoundError,
251
- "429": RateLimitedError,
252
- },
253
- idempotent: true,
254
- schemaKey: "projects.retrieveIntegrationHealth",
255
- options,
256
- });
257
- }
258
- /**
259
- * List a project's generations
260
- *
261
- * Auto-paginates: `for await (const item of …)` walks every page.
262
- * `GET /projects/{project_id}/generations`
263
- */
264
- listGenerations(projectId, params, options) {
265
- return paginate(this._core, {
266
- method: "GET",
267
- path: `/projects/${encodeURIComponent(String(projectId))}/generations`,
268
- security: [{ "apiKey": [] }],
269
- query: {
270
- limit: params?.limit,
271
- cursor: params?.cursor,
272
- target_id: params?.targetId,
273
- },
274
- errors: {
275
- "400": BadRequestError,
276
- "401": UnauthorizedError,
277
- "403": ForbiddenError,
278
- "404": NotFoundError,
279
- "429": RateLimitedError,
280
- },
281
- idempotent: true,
282
- schemaKey: "projects.listGenerations",
283
- options,
284
- }, {
285
- style: "cursor",
286
- itemsField: "data",
287
- cursorParam: "cursor",
288
- nextCursorField: "next_cursor",
289
- hasMoreField: "has_more",
290
- limitParam: "limit",
291
- });
292
- }
293
- /**
294
- * Generate targets and open pull requests
295
- *
296
- * Resolves the project's URL or GitHub source, generates every
297
- * configured delivery package, stores each result in the project's history,
298
- * and attempts to open a pull request in every configured destination.
299
- * When the complete generated tree already matches a destination, no
300
- * commit, branch, or pull request is created and that generation reports
301
- * `pr_status: no_changes`. This is the same pipeline automatic
302
- * regeneration runs after a source change.
303
- *
304
- * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
305
- * `POST /projects/{project_id}/generations`
306
- */
307
- async generate(projectId, params, options) {
308
- return this._core.request({
309
- method: "POST",
310
- path: `/projects/${encodeURIComponent(String(projectId))}/generations`,
311
- security: [{ "apiKey": [] }],
312
- headers: {
313
- "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
314
- },
315
- errors: {
316
211
  "401": UnauthorizedError,
317
212
  "402": PaymentRequiredError,
318
213
  "403": ForbiddenError,
319
214
  "404": NotFoundError,
320
215
  "409": ConflictError,
216
+ "413": PayloadTooLargeError,
321
217
  "422": UnprocessableEntityError,
322
218
  "429": RateLimitedError,
323
219
  "500": InternalServerError,
220
+ "502": BadGatewayError,
324
221
  },
325
222
  idempotencyKey: "Idempotency-Key",
326
223
  schemaKey: "projects.generate",
@@ -0,0 +1,46 @@
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 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
+ * invalid_request. List query parameters must appear only once; unrecognized parameters also
29
+ * return 400.
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,
35
+ * malformed, or repeated cursors return 400 invalid_request. The page limit may change between
36
+ * requests.
37
+ */
38
+ cursor?: string;
39
+ /** Only publications of this release. */
40
+ releaseId?: ReleaseId;
41
+ }
42
+ /** Typed errors `list` can throw. */
43
+ export type PublicationsListError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
44
+ /** Typed errors `get` can throw. */
45
+ export type PublicationsGetError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
46
+ //# 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,KAAK,EAAE,QAAQ;IAC5C;;;;;OAKG;IACH,IAAI,CACF,MAAM,CAAC,EAAE,sBAAsB,EAC/B,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,eAAe,EAAE,qBAAqB,CAAC;IA+BtD;;;;;;OAMG;IACG,GAAG,CAAC,aAAa,EAAE,aAAa,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,uBAAuB,CAAC;CAiBpG;AAED,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,yCAAyC;IACzC,SAAS,CAAC,EAAE,SAAS,CAAC;CACvB;AAED,qCAAqC;AACrC,MAAM,MAAM,qBAAqB,GAC7B,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,oCAAoC;AACpC,MAAM,MAAM,oBAAoB,GAC5B,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
@@ -0,0 +1,70 @@
1
+ // typeship — publications resource.
2
+ // Generated by typeship — https://typeship.dev
3
+ import { paginate } from "../core/pagination.js";
4
+ import { BadRequestError, ForbiddenError, InternalServerError, NotFoundError, RateLimitedError, UnauthorizedError, } from "../errors.js";
5
+ export class PublicationsResource {
6
+ _core;
7
+ constructor(_core) {
8
+ this._core = _core;
9
+ }
10
+ /**
11
+ * List publications
12
+ *
13
+ * Auto-paginates: `for await (const item of …)` walks every page.
14
+ * `GET /publications`
15
+ */
16
+ list(params, options) {
17
+ return paginate(this._core, {
18
+ method: "GET",
19
+ path: "/publications",
20
+ security: [{ "apiKey": [] }],
21
+ query: {
22
+ limit: params?.limit,
23
+ cursor: params?.cursor,
24
+ release_id: params?.releaseId,
25
+ },
26
+ errors: {
27
+ "400": BadRequestError,
28
+ "401": UnauthorizedError,
29
+ "403": ForbiddenError,
30
+ "404": NotFoundError,
31
+ "429": RateLimitedError,
32
+ "500": InternalServerError,
33
+ },
34
+ idempotent: true,
35
+ schemaKey: "publications.list",
36
+ options,
37
+ }, {
38
+ style: "cursor",
39
+ itemsField: "data",
40
+ cursorParam: "cursor",
41
+ nextCursorField: "next_cursor",
42
+ hasMoreField: "has_more",
43
+ limitParam: "limit",
44
+ });
45
+ }
46
+ /**
47
+ * Get publishing status
48
+ *
49
+ * Returns the registry publishing status for a release. A status in another organization returns
50
+ * 404 not_found.
51
+ * `GET /publications/{publication_id}`
52
+ */
53
+ async get(publicationId, options) {
54
+ return this._core.requestData({
55
+ method: "GET",
56
+ path: `/publications/${encodeURIComponent(String(publicationId))}`,
57
+ security: [{ "apiKey": [] }],
58
+ errors: {
59
+ "401": UnauthorizedError,
60
+ "403": ForbiddenError,
61
+ "404": NotFoundError,
62
+ "429": RateLimitedError,
63
+ "500": InternalServerError,
64
+ },
65
+ idempotent: true,
66
+ schemaKey: "publications.get",
67
+ options,
68
+ });
69
+ }
70
+ }
@@ -0,0 +1,66 @@
1
+ import { HttpCore, type RequestOptions } from "../core/http.js";
2
+ import { PagePromise } from "../core/pagination.js";
3
+ import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadGatewayError, BadRequestError, ConflictError, ForbiddenError, InternalServerError, NotFoundError, RateLimitedError, UnauthorizedError } from "../errors.js";
4
+ import type { ReleaseId, ReleaseRead, ReleaseResponseRead, TargetId } from "../types.js";
5
+ export declare class ReleasesResource {
6
+ private readonly _core;
7
+ constructor(_core: HttpCore);
8
+ /**
9
+ * List releases
10
+ *
11
+ * Auto-paginates: `for await (const item of …)` walks every page.
12
+ * `GET /releases`
13
+ */
14
+ list(params?: ReleasesListParams, options?: RequestOptions): PagePromise<ReleaseRead, ReleasesListError>;
15
+ /**
16
+ * Get an immutable release
17
+ * `GET /releases/{release_id}`
18
+ */
19
+ get(releaseId: ReleaseId, options?: RequestOptions): Promise<ReleaseResponseRead>;
20
+ /**
21
+ * Retry publishing an exact release
22
+ *
23
+ * Retries publishing the specified release through its repository workflow. Uses that release's
24
+ * version and accepted commit, even if a newer Draft or release exists.
25
+ *
26
+ * A `502` response means the repository publishing workflow could not be dispatched.
27
+ *
28
+ * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
29
+ * `POST /releases/{release_id}/republish`
30
+ */
31
+ republish(releaseId: ReleaseId, params?: ReleasesRepublishParams, options?: RequestOptions): Promise<ReleaseResponseRead>;
32
+ }
33
+ export interface ReleasesListParams {
34
+ /**
35
+ * Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
36
+ * representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
37
+ * invalid_request. List query parameters must appear only once; unrecognized parameters also
38
+ * return 400.
39
+ */
40
+ limit?: number;
41
+ /**
42
+ * Opaque cursor from the preceding page's next_cursor. Valid only for the same organization,
43
+ * operation, filters, and ordering that issued it. Omit to start at the first page. Empty,
44
+ * malformed, or repeated cursors return 400 invalid_request. The page limit may change between
45
+ * requests.
46
+ */
47
+ cursor?: string;
48
+ /** Only releases of this Target. */
49
+ targetId?: TargetId;
50
+ }
51
+ /** Typed errors `list` can throw. */
52
+ export type ReleasesListError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
53
+ /** Typed errors `get` can throw. */
54
+ export type ReleasesGetError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
55
+ export interface ReleasesRepublishParams {
56
+ /**
57
+ * Identifies one logical write for 24 hours. The key is scoped to the authenticated organization
58
+ * and operation; generation without an organization uses a hashed network identity. Retrying the
59
+ * same method, path, query, If-Match header, and JSON body replays the original response. Reusing
60
+ * the key with changed intent returns 409. After expiry the key starts a new write.
61
+ */
62
+ idempotencyKey?: string;
63
+ }
64
+ /** Typed errors `republish` can throw. */
65
+ export type ReleasesRepublishError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | RateLimitedError | InternalServerError | BadGatewayError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
66
+ //# sourceMappingURL=releases.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"releases.d.ts","sourceRoot":"","sources":["../../src/resources/releases.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAY,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,eAAe,EACf,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAEV,SAAS,EAGT,WAAW,EAEX,mBAAmB,EACnB,QAAQ,EACT,MAAM,aAAa,CAAC;AAErB,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;OAKG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,kBAAkB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC,WAAW,EAAE,iBAAiB,CAAC;IA+BxG;;;OAGG;IACG,GAAG,CAAC,SAAS,EAAE,SAAS,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,mBAAmB,CAAC;IAkBvF;;;;;;;;;;OAUG;IACG,SAAS,CACb,SAAS,EAAE,SAAS,EACpB,MAAM,CAAC,EAAE,uBAAuB,EAChC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,mBAAmB,CAAC;CAuBhC;AAED,MAAM,WAAW,kBAAkB;IACjC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,oCAAoC;IACpC,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,qCAAqC;AACrC,MAAM,MAAM,iBAAiB,GACzB,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,oCAAoC;AACpC,MAAM,MAAM,gBAAgB,GACxB,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,MAAM,WAAW,uBAAuB;IACtC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,0CAA0C;AAC1C,MAAM,MAAM,sBAAsB,GAC9B,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,eAAe,GACf,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
@@ -0,0 +1,101 @@
1
+ // typeship — releases resource.
2
+ // Generated by typeship — https://typeship.dev
3
+ import { paginate } from "../core/pagination.js";
4
+ import { BadGatewayError, BadRequestError, ConflictError, ForbiddenError, InternalServerError, NotFoundError, RateLimitedError, UnauthorizedError, } from "../errors.js";
5
+ export class ReleasesResource {
6
+ _core;
7
+ constructor(_core) {
8
+ this._core = _core;
9
+ }
10
+ /**
11
+ * List releases
12
+ *
13
+ * Auto-paginates: `for await (const item of …)` walks every page.
14
+ * `GET /releases`
15
+ */
16
+ list(params, options) {
17
+ return paginate(this._core, {
18
+ method: "GET",
19
+ path: "/releases",
20
+ security: [{ "apiKey": [] }],
21
+ query: {
22
+ limit: params?.limit,
23
+ cursor: params?.cursor,
24
+ target_id: params?.targetId,
25
+ },
26
+ errors: {
27
+ "400": BadRequestError,
28
+ "401": UnauthorizedError,
29
+ "403": ForbiddenError,
30
+ "404": NotFoundError,
31
+ "429": RateLimitedError,
32
+ "500": InternalServerError,
33
+ },
34
+ idempotent: true,
35
+ schemaKey: "releases.list",
36
+ options,
37
+ }, {
38
+ style: "cursor",
39
+ itemsField: "data",
40
+ cursorParam: "cursor",
41
+ nextCursorField: "next_cursor",
42
+ hasMoreField: "has_more",
43
+ limitParam: "limit",
44
+ });
45
+ }
46
+ /**
47
+ * Get an immutable release
48
+ * `GET /releases/{release_id}`
49
+ */
50
+ async get(releaseId, options) {
51
+ return this._core.requestData({
52
+ method: "GET",
53
+ path: `/releases/${encodeURIComponent(String(releaseId))}`,
54
+ security: [{ "apiKey": [] }],
55
+ errors: {
56
+ "401": UnauthorizedError,
57
+ "403": ForbiddenError,
58
+ "404": NotFoundError,
59
+ "429": RateLimitedError,
60
+ "500": InternalServerError,
61
+ },
62
+ idempotent: true,
63
+ schemaKey: "releases.get",
64
+ options,
65
+ });
66
+ }
67
+ /**
68
+ * Retry publishing an exact release
69
+ *
70
+ * Retries publishing the specified release through its repository workflow. Uses that release's
71
+ * version and accepted commit, even if a newer Draft or release exists.
72
+ *
73
+ * A `502` response means the repository publishing workflow could not be dispatched.
74
+ *
75
+ * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
76
+ * `POST /releases/{release_id}/republish`
77
+ */
78
+ async republish(releaseId, params, options) {
79
+ return this._core.requestData({
80
+ method: "POST",
81
+ path: `/releases/${encodeURIComponent(String(releaseId))}/republish`,
82
+ security: [{ "apiKey": [] }],
83
+ headers: {
84
+ "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
85
+ },
86
+ errors: {
87
+ "400": BadRequestError,
88
+ "401": UnauthorizedError,
89
+ "403": ForbiddenError,
90
+ "404": NotFoundError,
91
+ "409": ConflictError,
92
+ "429": RateLimitedError,
93
+ "500": InternalServerError,
94
+ "502": BadGatewayError,
95
+ },
96
+ idempotencyKey: "Idempotency-Key",
97
+ schemaKey: "releases.republish",
98
+ options,
99
+ });
100
+ }
101
+ }