@typeship-ax/cli 0.6.0 → 0.9.1

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 (121) hide show
  1. package/AGENTS.md +31 -0
  2. package/README.md +26 -9
  3. package/api.json +6861 -3083
  4. package/api.md +508 -277
  5. package/dist/api-identity.d.ts +40 -0
  6. package/dist/api-identity.d.ts.map +1 -0
  7. package/dist/api-identity.js +128 -0
  8. package/dist/auth-profiles.d.ts +30 -0
  9. package/dist/auth-profiles.d.ts.map +1 -0
  10. package/dist/auth-profiles.js +138 -0
  11. package/dist/cli-agent.d.ts +9 -1
  12. package/dist/cli-agent.d.ts.map +1 -1
  13. package/dist/cli-agent.js +26 -9
  14. package/dist/cli.js +600 -582
  15. package/dist/console-login-check.d.ts +21 -0
  16. package/dist/console-login-check.d.ts.map +1 -0
  17. package/dist/console-login-check.js +107 -0
  18. package/dist/console-login-contract.d.ts +45 -0
  19. package/dist/console-login-contract.d.ts.map +1 -0
  20. package/dist/console-login-contract.js +40 -0
  21. package/dist/core/http.d.ts +21 -92
  22. package/dist/core/http.d.ts.map +1 -1
  23. package/dist/core/http.js +143 -221
  24. package/dist/core/pagination.d.ts.map +1 -1
  25. package/dist/core/pagination.js +6 -34
  26. package/dist/credential-storage.d.ts +24 -0
  27. package/dist/credential-storage.d.ts.map +1 -0
  28. package/dist/credential-storage.js +207 -0
  29. package/dist/dates.d.ts +0 -2
  30. package/dist/dates.d.ts.map +1 -1
  31. package/dist/dates.js +0 -1
  32. package/dist/docs.d.ts +36 -0
  33. package/dist/docs.d.ts.map +1 -0
  34. package/dist/docs.js +258 -0
  35. package/dist/errors.d.ts +42 -34
  36. package/dist/errors.d.ts.map +1 -1
  37. package/dist/errors.js +30 -20
  38. package/dist/index.d.ts +27 -12
  39. package/dist/index.d.ts.map +1 -1
  40. package/dist/index.js +40 -14
  41. package/dist/named-credentials.d.ts +21 -0
  42. package/dist/named-credentials.d.ts.map +1 -0
  43. package/dist/named-credentials.js +86 -0
  44. package/dist/oauth-login.d.ts +39 -0
  45. package/dist/oauth-login.d.ts.map +1 -0
  46. package/dist/oauth-login.js +171 -0
  47. package/dist/oauth-request.d.ts +21 -0
  48. package/dist/oauth-request.d.ts.map +1 -0
  49. package/dist/oauth-request.js +119 -0
  50. package/dist/oauth-session.d.ts +106 -0
  51. package/dist/oauth-session.d.ts.map +1 -0
  52. package/dist/oauth-session.js +244 -0
  53. package/dist/ops.d.ts +18 -0
  54. package/dist/ops.d.ts.map +1 -1
  55. package/dist/ops.js +31 -17
  56. package/dist/polling-login.d.ts +57 -0
  57. package/dist/polling-login.d.ts.map +1 -0
  58. package/dist/polling-login.js +204 -0
  59. package/dist/resources/account.d.ts +4 -4
  60. package/dist/resources/account.d.ts.map +1 -1
  61. package/dist/resources/account.js +1 -0
  62. package/dist/resources/api-keys.d.ts +13 -8
  63. package/dist/resources/api-keys.d.ts.map +1 -1
  64. package/dist/resources/api-keys.js +5 -1
  65. package/dist/resources/definition-revisions.d.ts +58 -0
  66. package/dist/resources/definition-revisions.d.ts.map +1 -0
  67. package/dist/resources/definition-revisions.js +114 -0
  68. package/dist/resources/definitions.d.ts +35 -0
  69. package/dist/resources/definitions.d.ts.map +1 -0
  70. package/dist/resources/definitions.js +60 -0
  71. package/dist/resources/generate.d.ts +18 -7
  72. package/dist/resources/generate.d.ts.map +1 -1
  73. package/dist/resources/generate.js +13 -5
  74. package/dist/resources/generations.d.ts +6 -6
  75. package/dist/resources/generations.d.ts.map +1 -1
  76. package/dist/resources/generations.js +3 -1
  77. package/dist/resources/projects.d.ts +111 -35
  78. package/dist/resources/projects.d.ts.map +1 -1
  79. package/dist/resources/projects.js +125 -15
  80. package/dist/resources/targets.d.ts +97 -0
  81. package/dist/resources/targets.d.ts.map +1 -0
  82. package/dist/resources/targets.js +197 -0
  83. package/dist/schemas.d.ts.map +1 -1
  84. package/dist/schemas.js +135 -62
  85. package/dist/types.d.ts +2072 -267
  86. package/dist/types.d.ts.map +1 -1
  87. package/dist/types.js +20 -3
  88. package/package.json +2 -1
  89. package/src/api-identity.ts +98 -0
  90. package/src/auth-profiles.ts +114 -0
  91. package/src/cli-agent.ts +28 -11
  92. package/src/cli.ts +528 -560
  93. package/src/console-login-check.ts +88 -0
  94. package/src/console-login-contract.ts +65 -0
  95. package/src/core/http.ts +156 -305
  96. package/src/core/pagination.ts +6 -30
  97. package/src/credential-storage.ts +183 -0
  98. package/src/dates.ts +0 -1
  99. package/src/docs.ts +239 -0
  100. package/src/errors.ts +52 -41
  101. package/src/index.ts +49 -14
  102. package/src/named-credentials.ts +74 -0
  103. package/src/oauth-login.ts +184 -0
  104. package/src/oauth-request.ts +90 -0
  105. package/src/oauth-session.ts +258 -0
  106. package/src/ops.ts +56 -17
  107. package/src/polling-login.ts +165 -0
  108. package/src/resources/account.ts +6 -3
  109. package/src/resources/api-keys.ts +27 -7
  110. package/src/resources/definition-revisions.ts +207 -0
  111. package/src/resources/definitions.ts +122 -0
  112. package/src/resources/generate.ts +29 -6
  113. package/src/resources/generations.ts +9 -4
  114. package/src/resources/projects.ts +274 -41
  115. package/src/resources/targets.ts +378 -0
  116. package/src/schemas.ts +135 -62
  117. package/src/types.ts +2273 -322
  118. package/dist/resources/spec-revisions.d.ts +0 -47
  119. package/dist/resources/spec-revisions.d.ts.map +0 -1
  120. package/dist/resources/spec-revisions.js +0 -90
  121. package/src/resources/spec-revisions.ts +0 -150
@@ -1,7 +1,7 @@
1
1
  // typeship — projects resource.
2
2
  // Generated by typeship — https://typeship.dev — do not edit by hand.
3
3
  import { paginate } from "../core/pagination.js";
4
- import { BadRequestError, ConflictError, ForbiddenError, InternalServerError, NotFoundError, PaymentRequiredError, RateLimitedError, UnauthorizedError, UnprocessableEntityError, } from "../errors.js";
4
+ import { BadGatewayError, BadRequestError, ConflictError, ForbiddenError, InternalServerError, NotFoundError, PaymentRequiredError, RateLimitedError, UnauthorizedError, UnprocessableEntityError, } from "../errors.js";
5
5
  export class ProjectsResource {
6
6
  _core;
7
7
  constructor(_core) {
@@ -17,6 +17,7 @@ export class ProjectsResource {
17
17
  return paginate(this._core, {
18
18
  method: "GET",
19
19
  path: "/projects",
20
+ security: [{ "apiKey": [] }],
20
21
  query: {
21
22
  limit: params?.limit,
22
23
  cursor: params?.cursor,
@@ -43,9 +44,9 @@ export class ProjectsResource {
43
44
  * Create a project
44
45
  *
45
46
  * Stores a URL- or GitHub-sourced project. Free includes one stored project, every selected
46
- * output, and the first 25 operations, while keeping manual and automatic regeneration, history,
47
+ * target, and the first 25 operations, while keeping manual and automatic regeneration, history,
47
48
  * destination pull requests, and preview checks. Stateless POST /generate does not consume this
48
- * slot. Pro adds projects and the whole spec.
49
+ * slot. Pro adds projects and generates every operation in the Definition.
49
50
  *
50
51
  * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
51
52
  * `POST /projects`
@@ -54,6 +55,7 @@ export class ProjectsResource {
54
55
  return this._core.request({
55
56
  method: "POST",
56
57
  path: "/projects",
58
+ security: [{ "apiKey": [] }],
57
59
  headers: {
58
60
  "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
59
61
  },
@@ -64,6 +66,7 @@ export class ProjectsResource {
64
66
  "402": PaymentRequiredError,
65
67
  "403": ForbiddenError,
66
68
  "409": ConflictError,
69
+ "422": UnprocessableEntityError,
67
70
  "429": RateLimitedError,
68
71
  "500": InternalServerError,
69
72
  },
@@ -74,12 +77,15 @@ export class ProjectsResource {
74
77
  }
75
78
  /**
76
79
  * Retrieve a project
80
+ *
81
+ * Returns Project-owned fields only. List Targets separately for Target and Delivery data.
77
82
  * `GET /projects/{project_id}`
78
83
  */
79
84
  async retrieve(projectId, options) {
80
85
  return this._core.request({
81
86
  method: "GET",
82
87
  path: `/projects/${encodeURIComponent(String(projectId))}`,
88
+ security: [{ "apiKey": [] }],
83
89
  errors: {
84
90
  "401": UnauthorizedError,
85
91
  "403": ForbiddenError,
@@ -99,6 +105,7 @@ export class ProjectsResource {
99
105
  return this._core.request({
100
106
  method: "DELETE",
101
107
  path: `/projects/${encodeURIComponent(String(projectId))}`,
108
+ security: [{ "apiKey": [] }],
102
109
  errors: {
103
110
  "401": UnauthorizedError,
104
111
  "403": ForbiddenError,
@@ -118,6 +125,7 @@ export class ProjectsResource {
118
125
  return this._core.request({
119
126
  method: "PATCH",
120
127
  path: `/projects/${encodeURIComponent(String(projectId))}`,
128
+ security: [{ "apiKey": [] }],
121
129
  body,
122
130
  errors: {
123
131
  "400": BadRequestError,
@@ -125,24 +133,117 @@ export class ProjectsResource {
125
133
  "402": PaymentRequiredError,
126
134
  "403": ForbiddenError,
127
135
  "404": NotFoundError,
136
+ "409": ConflictError,
137
+ "422": UnprocessableEntityError,
128
138
  "429": RateLimitedError,
139
+ "502": BadGatewayError,
129
140
  },
130
141
  schemaKey: "projects.update",
131
142
  options,
132
143
  });
133
144
  }
134
145
  /**
135
- * Diagnose a project's GitHub integration
146
+ * Analyze a project's latest Definition Revision
147
+ *
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
172
+ *
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.
176
+ *
177
+ * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
178
+ * `POST /projects/{project_id}/diagnostics`
179
+ */
180
+ async refreshDiagnostics(projectId, params, options) {
181
+ return this._core.request({
182
+ 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`,
215
+ security: [{ "apiKey": [] }],
216
+ headers: {
217
+ "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
218
+ },
219
+ body,
220
+ errors: {
221
+ "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
136
236
  *
137
- * Returns machine-actionable source and destination access, spec readability, optional label
138
- * setup, required status names, and the latest durable webhook delivery. The console renders this
139
- * same result.
140
- * `GET /projects/{project_id}/github`
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`
141
241
  */
142
- async retrieveGithubHealth(projectId, options) {
242
+ async retrieveIntegrationHealth(projectId, options) {
143
243
  return this._core.request({
144
244
  method: "GET",
145
- path: `/projects/${encodeURIComponent(String(projectId))}/github`,
245
+ path: `/projects/${encodeURIComponent(String(projectId))}/integration-health`,
246
+ security: [{ "apiKey": [] }],
146
247
  errors: {
147
248
  "401": UnauthorizedError,
148
249
  "403": ForbiddenError,
@@ -150,7 +251,7 @@ export class ProjectsResource {
150
251
  "429": RateLimitedError,
151
252
  },
152
253
  idempotent: true,
153
- schemaKey: "projects.retrieveGithubHealth",
254
+ schemaKey: "projects.retrieveIntegrationHealth",
154
255
  options,
155
256
  });
156
257
  }
@@ -164,10 +265,11 @@ export class ProjectsResource {
164
265
  return paginate(this._core, {
165
266
  method: "GET",
166
267
  path: `/projects/${encodeURIComponent(String(projectId))}/generations`,
268
+ security: [{ "apiKey": [] }],
167
269
  query: {
168
270
  limit: params?.limit,
169
271
  cursor: params?.cursor,
170
- output: params?.output,
272
+ target_id: params?.targetId,
171
273
  },
172
274
  errors: {
173
275
  "400": BadRequestError,
@@ -189,30 +291,38 @@ export class ProjectsResource {
189
291
  });
190
292
  }
191
293
  /**
192
- * Generate outputs and open pull requests
294
+ * Generate targets and open pull requests
193
295
  *
194
- * Resolves the project's URL or repository source, generates every
296
+ * Resolves the project's URL or GitHub source, generates every
195
297
  * configured delivery package, stores each result in the project's history,
196
298
  * and attempts to open a pull request in every configured destination.
197
299
  * When the complete generated tree already matches a destination, no
198
300
  * commit, branch, or pull request is created and that generation reports
199
301
  * `pr_status: no_changes`. This is the same pipeline automatic
200
302
  * regeneration runs after a source change.
303
+ *
304
+ * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
201
305
  * `POST /projects/{project_id}/generations`
202
306
  */
203
- async generate(projectId, options) {
307
+ async generate(projectId, params, options) {
204
308
  return this._core.request({
205
309
  method: "POST",
206
310
  path: `/projects/${encodeURIComponent(String(projectId))}/generations`,
311
+ security: [{ "apiKey": [] }],
312
+ headers: {
313
+ "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
314
+ },
207
315
  errors: {
208
316
  "401": UnauthorizedError,
209
317
  "402": PaymentRequiredError,
210
318
  "403": ForbiddenError,
211
319
  "404": NotFoundError,
320
+ "409": ConflictError,
212
321
  "422": UnprocessableEntityError,
213
322
  "429": RateLimitedError,
214
323
  "500": InternalServerError,
215
324
  },
325
+ idempotencyKey: "Idempotency-Key",
216
326
  schemaKey: "projects.generate",
217
327
  options,
218
328
  });
@@ -0,0 +1,97 @@
1
+ import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
2
+ import { PagePromise } from "../core/pagination.js";
3
+ import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadRequestError, ConflictError, ForbiddenError, NotFoundError, RateLimitedError, UnauthorizedError, UnprocessableEntityError } from "../errors.js";
4
+ import type { DeletedTargetRead, ProjectId, TargetFields, TargetId, TargetRead, TargetReleaseId, TargetReleaseRead, TargetReleaseResponseRead, TargetResponseRead, TargetUpdateRequest } from "../types.js";
5
+ export declare class TargetsResource {
6
+ private readonly _core;
7
+ constructor(_core: HttpCore);
8
+ /**
9
+ * List a project's Targets
10
+ *
11
+ * Auto-paginates: `for await (const item of …)` walks every page.
12
+ * `GET /projects/{project_id}/targets`
13
+ */
14
+ list(projectId: ProjectId, params?: TargetsListParams, options?: RequestOptions): PagePromise<TargetRead, TargetsListError>;
15
+ /**
16
+ * Create an independently configured Target
17
+ *
18
+ * Several Targets may use the same generator with distinct configuration, Deliveries, and release
19
+ * streams.
20
+ *
21
+ * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
22
+ * `POST /projects/{project_id}/targets`
23
+ */
24
+ create(projectId: ProjectId, body: TargetFields, params?: TargetsCreateParams, options?: RequestOptions): Promise<ApiResult<TargetResponseRead, TargetsCreateError>>;
25
+ /**
26
+ * Retrieve a Target
27
+ * `GET /targets/{target_id}`
28
+ */
29
+ retrieve(targetId: TargetId, options?: RequestOptions): Promise<ApiResult<TargetResponseRead, TargetsRetrieveError>>;
30
+ /**
31
+ * Delete an unused Target
32
+ *
33
+ * Targets with Generation or release history, or an active release candidate, must be disabled
34
+ * instead.
35
+ * `DELETE /targets/{target_id}`
36
+ */
37
+ delete(targetId: TargetId, options?: RequestOptions): Promise<ApiResult<DeletedTargetRead, TargetsDeleteError>>;
38
+ /**
39
+ * Update a Target, its Deliveries, or its next reviewed version
40
+ * `PATCH /targets/{target_id}`
41
+ */
42
+ update(targetId: TargetId, body: TargetUpdateRequest, options?: RequestOptions): Promise<ApiResult<TargetResponseRead, TargetsUpdateError>>;
43
+ /**
44
+ * List immutable releases for a Target
45
+ *
46
+ * Auto-paginates: `for await (const item of …)` walks every page.
47
+ * `GET /targets/{target_id}/releases`
48
+ */
49
+ listReleases(targetId: TargetId, params?: TargetsListReleasesParams, options?: RequestOptions): PagePromise<TargetReleaseRead, TargetsListReleasesError>;
50
+ /**
51
+ * Retrieve an immutable Target release
52
+ * `GET /target_releases/{target_release_id}`
53
+ */
54
+ retrieveRelease(targetReleaseId: TargetReleaseId, options?: RequestOptions): Promise<ApiResult<TargetReleaseResponseRead, TargetsRetrieveReleaseError>>;
55
+ }
56
+ export interface TargetsListParams {
57
+ /** Maximum number of resources to return. */
58
+ limit?: number;
59
+ /**
60
+ * Opaque cursor from the preceding page's next_cursor. Valid only for the same account,
61
+ * operation, filters, and ordering that issued it.
62
+ */
63
+ cursor?: string;
64
+ }
65
+ /** Every error `list` can produce, as a discriminated union. */
66
+ export type TargetsListError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
67
+ export interface TargetsCreateParams {
68
+ /**
69
+ * Identifies one logical write for 24 hours. The key is scoped to the authenticated account and
70
+ * operation; account-less generation uses a hashed network identity. Retrying the same method,
71
+ * path, query, and JSON body replays the original response. Reusing the key with changed intent
72
+ * returns 409. After expiry the key starts a new write.
73
+ */
74
+ idempotencyKey?: string;
75
+ }
76
+ /** Every error `create` can produce, as a discriminated union. */
77
+ export type TargetsCreateError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | UnprocessableEntityError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
78
+ /** Every error `retrieve` can produce, as a discriminated union. */
79
+ export type TargetsRetrieveError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
80
+ /** Every error `delete` can produce, as a discriminated union. */
81
+ export type TargetsDeleteError = UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
82
+ /** Every error `update` can produce, as a discriminated union. */
83
+ export type TargetsUpdateError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | UnprocessableEntityError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
84
+ export interface TargetsListReleasesParams {
85
+ /** Maximum number of resources to return. */
86
+ limit?: number;
87
+ /**
88
+ * Opaque cursor from the preceding page's next_cursor. Valid only for the same account,
89
+ * operation, filters, and ordering that issued it.
90
+ */
91
+ cursor?: string;
92
+ }
93
+ /** Every error `listReleases` can produce, as a discriminated union. */
94
+ export type TargetsListReleasesError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
95
+ /** Every error `retrieveRelease` can produce, as a discriminated union. */
96
+ export type TargetsRetrieveReleaseError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
97
+ //# sourceMappingURL=targets.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"targets.d.ts","sourceRoot":"","sources":["../../src/resources/targets.ts"],"names":[],"mappings":"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"}
@@ -0,0 +1,197 @@
1
+ // typeship — targets resource.
2
+ // Generated by typeship — https://typeship.dev — do not edit by hand.
3
+ import { paginate } from "../core/pagination.js";
4
+ import { BadRequestError, ConflictError, ForbiddenError, NotFoundError, RateLimitedError, UnauthorizedError, UnprocessableEntityError, } from "../errors.js";
5
+ export class TargetsResource {
6
+ _core;
7
+ constructor(_core) {
8
+ this._core = _core;
9
+ }
10
+ /**
11
+ * List a project's Targets
12
+ *
13
+ * Auto-paginates: `for await (const item of …)` walks every page.
14
+ * `GET /projects/{project_id}/targets`
15
+ */
16
+ list(projectId, params, options) {
17
+ return paginate(this._core, {
18
+ method: "GET",
19
+ path: `/projects/${encodeURIComponent(String(projectId))}/targets`,
20
+ security: [{ "apiKey": [] }],
21
+ query: {
22
+ limit: params?.limit,
23
+ cursor: params?.cursor,
24
+ },
25
+ errors: {
26
+ "400": BadRequestError,
27
+ "401": UnauthorizedError,
28
+ "403": ForbiddenError,
29
+ "404": NotFoundError,
30
+ "429": RateLimitedError,
31
+ },
32
+ idempotent: true,
33
+ schemaKey: "targets.list",
34
+ options,
35
+ }, {
36
+ style: "cursor",
37
+ itemsField: "data",
38
+ cursorParam: "cursor",
39
+ nextCursorField: "next_cursor",
40
+ hasMoreField: "has_more",
41
+ limitParam: "limit",
42
+ });
43
+ }
44
+ /**
45
+ * Create an independently configured Target
46
+ *
47
+ * Several Targets may use the same generator with distinct configuration, Deliveries, and release
48
+ * streams.
49
+ *
50
+ * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
51
+ * `POST /projects/{project_id}/targets`
52
+ */
53
+ async create(projectId, body, params, options) {
54
+ return this._core.request({
55
+ method: "POST",
56
+ path: `/projects/${encodeURIComponent(String(projectId))}/targets`,
57
+ security: [{ "apiKey": [] }],
58
+ headers: {
59
+ "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
60
+ },
61
+ body,
62
+ errors: {
63
+ "400": BadRequestError,
64
+ "401": UnauthorizedError,
65
+ "403": ForbiddenError,
66
+ "404": NotFoundError,
67
+ "409": ConflictError,
68
+ "422": UnprocessableEntityError,
69
+ "429": RateLimitedError,
70
+ },
71
+ idempotencyKey: "Idempotency-Key",
72
+ schemaKey: "targets.create",
73
+ options,
74
+ });
75
+ }
76
+ /**
77
+ * Retrieve a Target
78
+ * `GET /targets/{target_id}`
79
+ */
80
+ async retrieve(targetId, options) {
81
+ return this._core.request({
82
+ method: "GET",
83
+ path: `/targets/${encodeURIComponent(String(targetId))}`,
84
+ security: [{ "apiKey": [] }],
85
+ errors: {
86
+ "401": UnauthorizedError,
87
+ "403": ForbiddenError,
88
+ "404": NotFoundError,
89
+ "429": RateLimitedError,
90
+ },
91
+ idempotent: true,
92
+ schemaKey: "targets.retrieve",
93
+ options,
94
+ });
95
+ }
96
+ /**
97
+ * Delete an unused Target
98
+ *
99
+ * Targets with Generation or release history, or an active release candidate, must be disabled
100
+ * instead.
101
+ * `DELETE /targets/{target_id}`
102
+ */
103
+ async delete(targetId, options) {
104
+ return this._core.request({
105
+ method: "DELETE",
106
+ path: `/targets/${encodeURIComponent(String(targetId))}`,
107
+ security: [{ "apiKey": [] }],
108
+ errors: {
109
+ "401": UnauthorizedError,
110
+ "403": ForbiddenError,
111
+ "404": NotFoundError,
112
+ "409": ConflictError,
113
+ "429": RateLimitedError,
114
+ },
115
+ idempotent: true,
116
+ schemaKey: "targets.delete",
117
+ options,
118
+ });
119
+ }
120
+ /**
121
+ * Update a Target, its Deliveries, or its next reviewed version
122
+ * `PATCH /targets/{target_id}`
123
+ */
124
+ async update(targetId, body, options) {
125
+ return this._core.request({
126
+ method: "PATCH",
127
+ path: `/targets/${encodeURIComponent(String(targetId))}`,
128
+ security: [{ "apiKey": [] }],
129
+ body,
130
+ errors: {
131
+ "400": BadRequestError,
132
+ "401": UnauthorizedError,
133
+ "403": ForbiddenError,
134
+ "404": NotFoundError,
135
+ "409": ConflictError,
136
+ "422": UnprocessableEntityError,
137
+ "429": RateLimitedError,
138
+ },
139
+ schemaKey: "targets.update",
140
+ options,
141
+ });
142
+ }
143
+ /**
144
+ * List immutable releases for a Target
145
+ *
146
+ * Auto-paginates: `for await (const item of …)` walks every page.
147
+ * `GET /targets/{target_id}/releases`
148
+ */
149
+ listReleases(targetId, params, options) {
150
+ return paginate(this._core, {
151
+ method: "GET",
152
+ path: `/targets/${encodeURIComponent(String(targetId))}/releases`,
153
+ security: [{ "apiKey": [] }],
154
+ query: {
155
+ limit: params?.limit,
156
+ cursor: params?.cursor,
157
+ },
158
+ errors: {
159
+ "400": BadRequestError,
160
+ "401": UnauthorizedError,
161
+ "403": ForbiddenError,
162
+ "404": NotFoundError,
163
+ "429": RateLimitedError,
164
+ },
165
+ idempotent: true,
166
+ schemaKey: "targets.listReleases",
167
+ options,
168
+ }, {
169
+ style: "cursor",
170
+ itemsField: "data",
171
+ cursorParam: "cursor",
172
+ nextCursorField: "next_cursor",
173
+ hasMoreField: "has_more",
174
+ limitParam: "limit",
175
+ });
176
+ }
177
+ /**
178
+ * Retrieve an immutable Target release
179
+ * `GET /target_releases/{target_release_id}`
180
+ */
181
+ async retrieveRelease(targetReleaseId, options) {
182
+ return this._core.request({
183
+ method: "GET",
184
+ path: `/target_releases/${encodeURIComponent(String(targetReleaseId))}`,
185
+ security: [{ "apiKey": [] }],
186
+ errors: {
187
+ "401": UnauthorizedError,
188
+ "403": ForbiddenError,
189
+ "404": NotFoundError,
190
+ "429": RateLimitedError,
191
+ },
192
+ idempotent: true,
193
+ schemaKey: "targets.retrieveRelease",
194
+ options,
195
+ });
196
+ }
197
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAMA,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,CAkBpE,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CA+DxC,CAAC"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,CA+BpE,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CA0HxC,CAAC"}