@typeship-ax/mcp 0.10.0 → 0.20.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.
- package/AGENTS.md +11 -5
- package/README.md +16 -5
- package/api.json +8824 -3777
- package/api.md +8359 -3987
- package/dist/api-identity.d.ts.map +1 -1
- package/dist/api-identity.js +6 -1
- package/dist/core/http.d.ts +29 -16
- package/dist/core/http.d.ts.map +1 -1
- package/dist/core/http.js +108 -25
- package/dist/core/pagination.d.ts +8 -8
- package/dist/core/pagination.d.ts.map +1 -1
- package/dist/core/pagination.js +7 -16
- package/dist/errors.d.ts +20 -13
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +29 -20
- package/dist/index.d.ts +37 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +42 -18
- package/dist/mcp-protocol.d.ts +10 -6
- package/dist/mcp-protocol.d.ts.map +1 -1
- package/dist/mcp-protocol.js +110 -39
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +38 -18
- package/dist/ops.d.ts +5 -1
- package/dist/ops.d.ts.map +1 -1
- package/dist/ops.js +42 -35
- package/dist/resources/api-keys.d.ts +44 -18
- package/dist/resources/api-keys.d.ts.map +1 -1
- package/dist/resources/api-keys.js +46 -14
- package/dist/resources/deliveries.d.ts +46 -0
- package/dist/resources/deliveries.d.ts.map +1 -0
- package/dist/resources/deliveries.js +70 -0
- package/dist/resources/drafts.d.ts +155 -0
- package/dist/resources/drafts.d.ts.map +1 -0
- package/dist/resources/drafts.js +230 -0
- package/dist/resources/files.d.ts +23 -0
- package/dist/resources/files.d.ts.map +1 -0
- package/dist/resources/files.js +38 -0
- package/dist/resources/generate.d.ts +49 -20
- package/dist/resources/generate.d.ts.map +1 -1
- package/dist/resources/generate.js +56 -14
- package/dist/resources/generations.d.ts +70 -18
- package/dist/resources/generations.d.ts.map +1 -1
- package/dist/resources/generations.js +84 -16
- package/dist/resources/organization.d.ts +18 -0
- package/dist/resources/organization.d.ts.map +1 -0
- package/dist/resources/organization.js +32 -0
- package/dist/resources/projects.d.ts +87 -124
- package/dist/resources/projects.d.ts.map +1 -1
- package/dist/resources/projects.js +70 -173
- package/dist/resources/publications.d.ts +46 -0
- package/dist/resources/publications.d.ts.map +1 -0
- package/dist/resources/publications.js +70 -0
- package/dist/resources/releases.d.ts +66 -0
- package/dist/resources/releases.d.ts.map +1 -0
- package/dist/resources/releases.js +101 -0
- package/dist/resources/spec-revisions.d.ts +85 -0
- package/dist/resources/spec-revisions.d.ts.map +1 -0
- package/dist/resources/spec-revisions.js +116 -0
- package/dist/resources/specs.d.ts +72 -0
- package/dist/resources/specs.d.ts.map +1 -0
- package/dist/resources/specs.js +107 -0
- package/dist/resources/targets.d.ts +85 -105
- package/dist/resources/targets.d.ts.map +1 -1
- package/dist/resources/targets.js +70 -163
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +175 -129
- package/dist/types.d.ts +2626 -1141
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +90 -11
- package/package.json +3 -3
- package/server.json +3 -3
- package/src/api-identity.ts +6 -2
- package/src/core/http.ts +106 -30
- package/src/core/pagination.ts +13 -23
- package/src/errors.ts +30 -20
- package/src/index.ts +46 -24
- package/src/mcp-protocol.ts +95 -38
- package/src/mcp.ts +34 -16
- package/src/ops.ts +47 -36
- package/src/resources/api-keys.ts +87 -19
- package/src/resources/deliveries.ts +139 -0
- package/src/resources/drafts.ts +422 -0
- package/src/resources/files.ts +68 -0
- package/src/resources/generate.ts +81 -19
- package/src/resources/generations.ts +167 -29
- package/src/resources/organization.ts +53 -0
- package/src/resources/projects.ts +129 -322
- package/src/resources/publications.ts +139 -0
- package/src/resources/releases.ts +199 -0
- package/src/resources/spec-revisions.ts +237 -0
- package/src/resources/specs.ts +200 -0
- package/src/resources/targets.ts +135 -304
- package/src/schemas.ts +175 -129
- package/src/types.ts +2793 -1177
- package/dist/resources/account.d.ts +0 -18
- package/dist/resources/account.d.ts.map +0 -1
- package/dist/resources/account.js +0 -27
- package/dist/resources/definition-revisions.d.ts +0 -58
- package/dist/resources/definition-revisions.d.ts.map +0 -1
- package/dist/resources/definition-revisions.js +0 -114
- package/dist/resources/definitions.d.ts +0 -35
- package/dist/resources/definitions.d.ts.map +0 -1
- package/dist/resources/definitions.js +0 -60
- package/src/resources/account.ts +0 -46
- package/src/resources/definition-revisions.ts +0 -207
- package/src/resources/definitions.ts +0 -122
package/src/resources/targets.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// typeship — targets resource.
|
|
2
|
-
// Generated by typeship — https://typeship.dev
|
|
2
|
+
// Generated by typeship — https://typeship.dev
|
|
3
3
|
|
|
4
|
-
import { HttpCore, type
|
|
4
|
+
import { HttpCore, type RequestOptions } from "../core/http.js";
|
|
5
5
|
import { paginate, PagePromise } from "../core/pagination.js";
|
|
6
6
|
import {
|
|
7
7
|
ResponseParseError,
|
|
@@ -12,7 +12,10 @@ import {
|
|
|
12
12
|
BadRequestError,
|
|
13
13
|
ConflictError,
|
|
14
14
|
ForbiddenError,
|
|
15
|
+
InternalServerError,
|
|
15
16
|
NotFoundError,
|
|
17
|
+
PaymentRequiredError,
|
|
18
|
+
PreconditionFailedError,
|
|
16
19
|
RateLimitedError,
|
|
17
20
|
UnauthorizedError,
|
|
18
21
|
UnprocessableEntityError,
|
|
@@ -21,23 +24,15 @@ import type {
|
|
|
21
24
|
DeletedTarget,
|
|
22
25
|
DeletedTargetRead,
|
|
23
26
|
ProjectId,
|
|
27
|
+
ReleaseResponse,
|
|
28
|
+
ReleaseResponseRead,
|
|
24
29
|
Target,
|
|
25
30
|
TargetAdoption,
|
|
26
|
-
|
|
27
|
-
TargetDraftResponseRead,
|
|
28
|
-
TargetDraftUpdate,
|
|
29
|
-
TargetFields,
|
|
31
|
+
TargetCreateRequest,
|
|
30
32
|
TargetId,
|
|
31
33
|
TargetList,
|
|
32
34
|
TargetListRead,
|
|
33
35
|
TargetRead,
|
|
34
|
-
TargetRelease,
|
|
35
|
-
TargetReleaseId,
|
|
36
|
-
TargetReleaseList,
|
|
37
|
-
TargetReleaseListRead,
|
|
38
|
-
TargetReleaseRead,
|
|
39
|
-
TargetReleaseResponse,
|
|
40
|
-
TargetReleaseResponseRead,
|
|
41
36
|
TargetResponse,
|
|
42
37
|
TargetResponseRead,
|
|
43
38
|
TargetUpdateRequest,
|
|
@@ -46,23 +41,20 @@ import type {
|
|
|
46
41
|
export class TargetsResource {
|
|
47
42
|
constructor(private readonly _core: HttpCore) {}
|
|
48
43
|
/**
|
|
49
|
-
* List
|
|
44
|
+
* List Targets
|
|
50
45
|
*
|
|
51
46
|
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
52
|
-
* `GET /
|
|
47
|
+
* `GET /targets`
|
|
53
48
|
*/
|
|
54
|
-
list(
|
|
55
|
-
projectId: ProjectId,
|
|
56
|
-
params?: TargetsListParams,
|
|
57
|
-
options?: RequestOptions,
|
|
58
|
-
): PagePromise<TargetRead, TargetsListError> {
|
|
49
|
+
list(params?: TargetsListParams, options?: RequestOptions): PagePromise<TargetRead, TargetsListError> {
|
|
59
50
|
return paginate<TargetRead, TargetsListError>(this._core, {
|
|
60
51
|
method: "GET",
|
|
61
|
-
path:
|
|
52
|
+
path: "/targets",
|
|
62
53
|
security: [{"apiKey":[]}],
|
|
63
54
|
query: {
|
|
64
55
|
limit: params?.limit,
|
|
65
56
|
cursor: params?.cursor,
|
|
57
|
+
project_id: params?.projectId,
|
|
66
58
|
},
|
|
67
59
|
errors: {
|
|
68
60
|
"400": BadRequestError,
|
|
@@ -70,6 +62,7 @@ export class TargetsResource {
|
|
|
70
62
|
"403": ForbiddenError,
|
|
71
63
|
"404": NotFoundError,
|
|
72
64
|
"429": RateLimitedError,
|
|
65
|
+
"500": InternalServerError,
|
|
73
66
|
},
|
|
74
67
|
idempotent: true,
|
|
75
68
|
schemaKey: "targets.list",
|
|
@@ -87,21 +80,20 @@ export class TargetsResource {
|
|
|
87
80
|
/**
|
|
88
81
|
* Create an independently configured Target
|
|
89
82
|
*
|
|
90
|
-
*
|
|
91
|
-
*
|
|
83
|
+
* Creates a Target with its own configuration, Deliveries, and release history. Multiple Targets
|
|
84
|
+
* can use the same generator.
|
|
92
85
|
*
|
|
93
86
|
* A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
|
|
94
|
-
* `POST /
|
|
87
|
+
* `POST /targets`
|
|
95
88
|
*/
|
|
96
89
|
async create(
|
|
97
|
-
|
|
98
|
-
body: TargetFields,
|
|
90
|
+
body: TargetCreateRequest,
|
|
99
91
|
params?: TargetsCreateParams,
|
|
100
92
|
options?: RequestOptions,
|
|
101
|
-
): Promise<
|
|
102
|
-
return this._core.
|
|
93
|
+
): Promise<TargetResponseRead> {
|
|
94
|
+
return this._core.requestData<TargetResponseRead, TargetsCreateError>({
|
|
103
95
|
method: "POST",
|
|
104
|
-
path:
|
|
96
|
+
path: "/targets",
|
|
105
97
|
security: [{"apiKey":[]}],
|
|
106
98
|
headers: {
|
|
107
99
|
"Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
|
|
@@ -110,11 +102,13 @@ export class TargetsResource {
|
|
|
110
102
|
errors: {
|
|
111
103
|
"400": BadRequestError,
|
|
112
104
|
"401": UnauthorizedError,
|
|
105
|
+
"402": PaymentRequiredError,
|
|
113
106
|
"403": ForbiddenError,
|
|
114
107
|
"404": NotFoundError,
|
|
115
108
|
"409": ConflictError,
|
|
116
109
|
"422": UnprocessableEntityError,
|
|
117
110
|
"429": RateLimitedError,
|
|
111
|
+
"500": InternalServerError,
|
|
118
112
|
},
|
|
119
113
|
idempotencyKey: "Idempotency-Key",
|
|
120
114
|
schemaKey: "targets.create",
|
|
@@ -123,14 +117,11 @@ export class TargetsResource {
|
|
|
123
117
|
}
|
|
124
118
|
|
|
125
119
|
/**
|
|
126
|
-
*
|
|
120
|
+
* Get a Target
|
|
127
121
|
* `GET /targets/{target_id}`
|
|
128
122
|
*/
|
|
129
|
-
async
|
|
130
|
-
|
|
131
|
-
options?: RequestOptions,
|
|
132
|
-
): Promise<ApiResult<TargetResponseRead, TargetsRetrieveError>> {
|
|
133
|
-
return this._core.request<TargetResponseRead, TargetsRetrieveError>({
|
|
123
|
+
async get(targetId: TargetId, options?: RequestOptions): Promise<TargetResponseRead> {
|
|
124
|
+
return this._core.requestData<TargetResponseRead, TargetsGetError>({
|
|
134
125
|
method: "GET",
|
|
135
126
|
path: `/targets/${encodeURIComponent(String(targetId))}`,
|
|
136
127
|
security: [{"apiKey":[]}],
|
|
@@ -139,9 +130,10 @@ export class TargetsResource {
|
|
|
139
130
|
"403": ForbiddenError,
|
|
140
131
|
"404": NotFoundError,
|
|
141
132
|
"429": RateLimitedError,
|
|
133
|
+
"500": InternalServerError,
|
|
142
134
|
},
|
|
143
135
|
idempotent: true,
|
|
144
|
-
schemaKey: "targets.
|
|
136
|
+
schemaKey: "targets.get",
|
|
145
137
|
options,
|
|
146
138
|
});
|
|
147
139
|
}
|
|
@@ -149,24 +141,35 @@ export class TargetsResource {
|
|
|
149
141
|
/**
|
|
150
142
|
* Delete an unused Target
|
|
151
143
|
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
144
|
+
* Deletes a Target with no Generation history, release history, or active Draft. A `409
|
|
145
|
+
* resource_has_dependencies` means one of those resources still depends on it. Retrieve the
|
|
146
|
+
* Target, disable it instead, or resolve the dependency before retrying.
|
|
147
|
+
*
|
|
148
|
+
* See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
|
|
149
|
+
* and If-Match.
|
|
154
150
|
* `DELETE /targets/{target_id}`
|
|
155
151
|
*/
|
|
156
152
|
async delete(
|
|
157
153
|
targetId: TargetId,
|
|
154
|
+
params?: TargetsDeleteParams,
|
|
158
155
|
options?: RequestOptions,
|
|
159
|
-
): Promise<
|
|
160
|
-
return this._core.
|
|
156
|
+
): Promise<DeletedTargetRead> {
|
|
157
|
+
return this._core.requestData<DeletedTargetRead, TargetsDeleteError>({
|
|
161
158
|
method: "DELETE",
|
|
162
159
|
path: `/targets/${encodeURIComponent(String(targetId))}`,
|
|
163
160
|
security: [{"apiKey":[]}],
|
|
161
|
+
headers: {
|
|
162
|
+
"If-Match": params?.ifMatch === undefined ? undefined : String(params?.ifMatch),
|
|
163
|
+
},
|
|
164
164
|
errors: {
|
|
165
|
+
"400": BadRequestError,
|
|
165
166
|
"401": UnauthorizedError,
|
|
166
167
|
"403": ForbiddenError,
|
|
167
168
|
"404": NotFoundError,
|
|
168
169
|
"409": ConflictError,
|
|
170
|
+
"412": PreconditionFailedError,
|
|
169
171
|
"429": RateLimitedError,
|
|
172
|
+
"500": InternalServerError,
|
|
170
173
|
},
|
|
171
174
|
idempotent: true,
|
|
172
175
|
schemaKey: "targets.delete",
|
|
@@ -175,147 +178,75 @@ export class TargetsResource {
|
|
|
175
178
|
}
|
|
176
179
|
|
|
177
180
|
/**
|
|
178
|
-
* Update a Target
|
|
181
|
+
* Update a Target or its Deliveries
|
|
182
|
+
*
|
|
183
|
+
* Omitted fields keep their current values. Supplied config, checks, and deliveries replace their
|
|
184
|
+
* complete stored values.
|
|
185
|
+
* With Project auto_generate enabled, changing Target config, checks, or Deliveries queues that
|
|
186
|
+
* Target's Generation. A queued or running Target reuses that Generation.
|
|
187
|
+
* Omitting If-Match applies the update to the current resource; with If-Match, a stale ETag
|
|
188
|
+
* returns 412 precondition_failed without saving.
|
|
189
|
+
* Select the next version through PATCH /drafts/{draft_id} on the Target's draft_id.
|
|
190
|
+
*
|
|
191
|
+
* A `409 target_busy` means the Target is publishing; wait for it to finish. A `409
|
|
192
|
+
* delivery_conflict` means another Target owns the requested repository tree; retrieve both
|
|
193
|
+
* Targets, choose a free destination, and retry.
|
|
194
|
+
* A `502` response means the update was saved, but retiring an obsolete review or regenerating
|
|
195
|
+
* the Target failed. Retrieve the Target and follow the error's retryable and suggested_action
|
|
196
|
+
* fields.
|
|
197
|
+
* See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
|
|
198
|
+
* and If-Match.
|
|
179
199
|
* `PATCH /targets/{target_id}`
|
|
180
200
|
*/
|
|
181
201
|
async update(
|
|
182
202
|
targetId: TargetId,
|
|
183
203
|
body: TargetUpdateRequest,
|
|
204
|
+
params?: TargetsUpdateParams,
|
|
184
205
|
options?: RequestOptions,
|
|
185
|
-
): Promise<
|
|
186
|
-
return this._core.
|
|
206
|
+
): Promise<TargetResponseRead> {
|
|
207
|
+
return this._core.requestData<TargetResponseRead, TargetsUpdateError>({
|
|
187
208
|
method: "PATCH",
|
|
188
209
|
path: `/targets/${encodeURIComponent(String(targetId))}`,
|
|
189
210
|
security: [{"apiKey":[]}],
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
"400": BadRequestError,
|
|
193
|
-
"401": UnauthorizedError,
|
|
194
|
-
"403": ForbiddenError,
|
|
195
|
-
"404": NotFoundError,
|
|
196
|
-
"409": ConflictError,
|
|
197
|
-
"422": UnprocessableEntityError,
|
|
198
|
-
"429": RateLimitedError,
|
|
199
|
-
},
|
|
200
|
-
schemaKey: "targets.update",
|
|
201
|
-
options,
|
|
202
|
-
});
|
|
203
|
-
}
|
|
204
|
-
|
|
205
|
-
/**
|
|
206
|
-
* List immutable releases for a Target
|
|
207
|
-
*
|
|
208
|
-
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
209
|
-
* `GET /targets/{target_id}/releases`
|
|
210
|
-
*/
|
|
211
|
-
listReleases(
|
|
212
|
-
targetId: TargetId,
|
|
213
|
-
params?: TargetsListReleasesParams,
|
|
214
|
-
options?: RequestOptions,
|
|
215
|
-
): PagePromise<TargetReleaseRead, TargetsListReleasesError> {
|
|
216
|
-
return paginate<TargetReleaseRead, TargetsListReleasesError>(this._core, {
|
|
217
|
-
method: "GET",
|
|
218
|
-
path: `/targets/${encodeURIComponent(String(targetId))}/releases`,
|
|
219
|
-
security: [{"apiKey":[]}],
|
|
220
|
-
query: {
|
|
221
|
-
limit: params?.limit,
|
|
222
|
-
cursor: params?.cursor,
|
|
223
|
-
},
|
|
224
|
-
errors: {
|
|
225
|
-
"400": BadRequestError,
|
|
226
|
-
"401": UnauthorizedError,
|
|
227
|
-
"403": ForbiddenError,
|
|
228
|
-
"404": NotFoundError,
|
|
229
|
-
"429": RateLimitedError,
|
|
230
|
-
},
|
|
231
|
-
idempotent: true,
|
|
232
|
-
schemaKey: "targets.listReleases",
|
|
233
|
-
options,
|
|
234
|
-
}, {
|
|
235
|
-
style: "cursor",
|
|
236
|
-
itemsField: "data",
|
|
237
|
-
cursorParam: "cursor",
|
|
238
|
-
nextCursorField: "next_cursor",
|
|
239
|
-
hasMoreField: "has_more",
|
|
240
|
-
limitParam: "limit",
|
|
241
|
-
});
|
|
242
|
-
}
|
|
243
|
-
|
|
244
|
-
/**
|
|
245
|
-
* Retrieve a Target's rolling Draft release
|
|
246
|
-
*
|
|
247
|
-
* Returns Current, the cumulative Draft version and readiness, its exact head, and the optimistic
|
|
248
|
-
* release revision.
|
|
249
|
-
* `GET /targets/{target_id}/draft`
|
|
250
|
-
*/
|
|
251
|
-
async retrieveDraft(
|
|
252
|
-
targetId: TargetId,
|
|
253
|
-
options?: RequestOptions,
|
|
254
|
-
): Promise<ApiResult<TargetDraftResponseRead, TargetsRetrieveDraftError>> {
|
|
255
|
-
return this._core.request<TargetDraftResponseRead, TargetsRetrieveDraftError>({
|
|
256
|
-
method: "GET",
|
|
257
|
-
path: `/targets/${encodeURIComponent(String(targetId))}/draft`,
|
|
258
|
-
security: [{"apiKey":[]}],
|
|
259
|
-
errors: {
|
|
260
|
-
"401": UnauthorizedError,
|
|
261
|
-
"403": ForbiddenError,
|
|
262
|
-
"404": NotFoundError,
|
|
263
|
-
"429": RateLimitedError,
|
|
211
|
+
headers: {
|
|
212
|
+
"If-Match": params?.ifMatch === undefined ? undefined : String(params?.ifMatch),
|
|
264
213
|
},
|
|
265
|
-
idempotent: true,
|
|
266
|
-
schemaKey: "targets.retrieveDraft",
|
|
267
|
-
options,
|
|
268
|
-
});
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* Select an exact Draft version or return to automatic versioning
|
|
273
|
-
*
|
|
274
|
-
* Validates the selection against the cumulative required bump and regenerates the same rolling
|
|
275
|
-
* Draft pull request.
|
|
276
|
-
* `PATCH /targets/{target_id}/draft`
|
|
277
|
-
*/
|
|
278
|
-
async updateDraft(
|
|
279
|
-
targetId: TargetId,
|
|
280
|
-
body: TargetDraftUpdate,
|
|
281
|
-
options?: RequestOptions,
|
|
282
|
-
): Promise<ApiResult<TargetDraftResponseRead, TargetsUpdateDraftError>> {
|
|
283
|
-
return this._core.request<TargetDraftResponseRead, TargetsUpdateDraftError>({
|
|
284
|
-
method: "PATCH",
|
|
285
|
-
path: `/targets/${encodeURIComponent(String(targetId))}/draft`,
|
|
286
|
-
security: [{"apiKey":[]}],
|
|
287
214
|
body,
|
|
288
215
|
errors: {
|
|
289
216
|
"400": BadRequestError,
|
|
290
217
|
"401": UnauthorizedError,
|
|
218
|
+
"402": PaymentRequiredError,
|
|
291
219
|
"403": ForbiddenError,
|
|
292
220
|
"404": NotFoundError,
|
|
293
221
|
"409": ConflictError,
|
|
222
|
+
"412": PreconditionFailedError,
|
|
294
223
|
"422": UnprocessableEntityError,
|
|
295
224
|
"429": RateLimitedError,
|
|
225
|
+
"500": InternalServerError,
|
|
226
|
+
"502": BadGatewayError,
|
|
296
227
|
},
|
|
297
|
-
schemaKey: "targets.
|
|
228
|
+
schemaKey: "targets.update",
|
|
298
229
|
options,
|
|
299
230
|
});
|
|
300
231
|
}
|
|
301
232
|
|
|
302
233
|
/**
|
|
303
|
-
* Adopt a verified existing package as
|
|
234
|
+
* Adopt a verified existing package as the latest release
|
|
304
235
|
*
|
|
305
|
-
*
|
|
306
|
-
*
|
|
307
|
-
*
|
|
236
|
+
* Checks the repository tag, package metadata, and registry artifact, then records the package as
|
|
237
|
+
* an Imported latest release. Opens the first Typeship Draft at the next major version; review it
|
|
238
|
+
* to establish the baseline for preserving existing code.
|
|
308
239
|
*
|
|
309
240
|
* A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
|
|
310
241
|
* `POST /targets/{target_id}/adopt`
|
|
311
242
|
*/
|
|
312
|
-
async
|
|
243
|
+
async adopt(
|
|
313
244
|
targetId: TargetId,
|
|
314
245
|
body: TargetAdoption,
|
|
315
|
-
params?:
|
|
246
|
+
params?: TargetsAdoptParams,
|
|
316
247
|
options?: RequestOptions,
|
|
317
|
-
): Promise<
|
|
318
|
-
return this._core.
|
|
248
|
+
): Promise<ReleaseResponseRead> {
|
|
249
|
+
return this._core.requestData<ReleaseResponseRead, TargetsAdoptError>({
|
|
319
250
|
method: "POST",
|
|
320
251
|
path: `/targets/${encodeURIComponent(String(targetId))}/adopt`,
|
|
321
252
|
security: [{"apiKey":[]}],
|
|
@@ -331,90 +262,42 @@ export class TargetsResource {
|
|
|
331
262
|
"409": ConflictError,
|
|
332
263
|
"422": UnprocessableEntityError,
|
|
333
264
|
"429": RateLimitedError,
|
|
265
|
+
"500": InternalServerError,
|
|
334
266
|
},
|
|
335
267
|
idempotencyKey: "Idempotency-Key",
|
|
336
|
-
schemaKey: "targets.
|
|
337
|
-
options,
|
|
338
|
-
});
|
|
339
|
-
}
|
|
340
|
-
|
|
341
|
-
/**
|
|
342
|
-
* Retrieve an immutable Target release
|
|
343
|
-
* `GET /target_releases/{target_release_id}`
|
|
344
|
-
*/
|
|
345
|
-
async retrieveRelease(
|
|
346
|
-
targetReleaseId: TargetReleaseId,
|
|
347
|
-
options?: RequestOptions,
|
|
348
|
-
): Promise<ApiResult<TargetReleaseResponseRead, TargetsRetrieveReleaseError>> {
|
|
349
|
-
return this._core.request<TargetReleaseResponseRead, TargetsRetrieveReleaseError>({
|
|
350
|
-
method: "GET",
|
|
351
|
-
path: `/target_releases/${encodeURIComponent(String(targetReleaseId))}`,
|
|
352
|
-
security: [{"apiKey":[]}],
|
|
353
|
-
errors: {
|
|
354
|
-
"401": UnauthorizedError,
|
|
355
|
-
"403": ForbiddenError,
|
|
356
|
-
"404": NotFoundError,
|
|
357
|
-
"429": RateLimitedError,
|
|
358
|
-
},
|
|
359
|
-
idempotent: true,
|
|
360
|
-
schemaKey: "targets.retrieveRelease",
|
|
361
|
-
options,
|
|
362
|
-
});
|
|
363
|
-
}
|
|
364
|
-
|
|
365
|
-
/**
|
|
366
|
-
* Retry publication of an exact Target release
|
|
367
|
-
*
|
|
368
|
-
* Dispatches the repository-owned republish workflow for this immutable version and accepted
|
|
369
|
-
* commit. It never selects the latest Draft or release.
|
|
370
|
-
*
|
|
371
|
-
* A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
|
|
372
|
-
* `POST /target_releases/{target_release_id}/republish`
|
|
373
|
-
*/
|
|
374
|
-
async republishRelease(
|
|
375
|
-
targetReleaseId: TargetReleaseId,
|
|
376
|
-
params?: TargetsRepublishReleaseParams,
|
|
377
|
-
options?: RequestOptions,
|
|
378
|
-
): Promise<ApiResult<TargetReleaseResponseRead, TargetsRepublishReleaseError>> {
|
|
379
|
-
return this._core.request<TargetReleaseResponseRead, TargetsRepublishReleaseError>({
|
|
380
|
-
method: "POST",
|
|
381
|
-
path: `/target_releases/${encodeURIComponent(String(targetReleaseId))}/republish`,
|
|
382
|
-
security: [{"apiKey":[]}],
|
|
383
|
-
headers: {
|
|
384
|
-
"Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
|
|
385
|
-
},
|
|
386
|
-
errors: {
|
|
387
|
-
"401": UnauthorizedError,
|
|
388
|
-
"403": ForbiddenError,
|
|
389
|
-
"404": NotFoundError,
|
|
390
|
-
"409": ConflictError,
|
|
391
|
-
"429": RateLimitedError,
|
|
392
|
-
"502": BadGatewayError,
|
|
393
|
-
},
|
|
394
|
-
idempotencyKey: "Idempotency-Key",
|
|
395
|
-
schemaKey: "targets.republishRelease",
|
|
268
|
+
schemaKey: "targets.adopt",
|
|
396
269
|
options,
|
|
397
270
|
});
|
|
398
271
|
}
|
|
399
272
|
}
|
|
400
273
|
|
|
401
274
|
export interface TargetsListParams {
|
|
402
|
-
/**
|
|
275
|
+
/**
|
|
276
|
+
* Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
|
|
277
|
+
* representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
|
|
278
|
+
* invalid_request. List query parameters must appear only once; unrecognized parameters also
|
|
279
|
+
* return 400.
|
|
280
|
+
*/
|
|
403
281
|
limit?: number;
|
|
404
282
|
/**
|
|
405
|
-
* Opaque cursor from the preceding page's next_cursor. Valid only for the same
|
|
406
|
-
* operation, filters, and ordering that issued it.
|
|
283
|
+
* Opaque cursor from the preceding page's next_cursor. Valid only for the same organization,
|
|
284
|
+
* operation, filters, and ordering that issued it. Omit to start at the first page. Empty,
|
|
285
|
+
* malformed, or repeated cursors return 400 invalid_request. The page limit may change between
|
|
286
|
+
* requests.
|
|
407
287
|
*/
|
|
408
288
|
cursor?: string;
|
|
289
|
+
/** Only Targets in this Project. */
|
|
290
|
+
projectId?: ProjectId;
|
|
409
291
|
}
|
|
410
292
|
|
|
411
|
-
/**
|
|
293
|
+
/** Typed errors `list` can throw. */
|
|
412
294
|
export type TargetsListError =
|
|
413
295
|
| BadRequestError
|
|
414
296
|
| UnauthorizedError
|
|
415
297
|
| ForbiddenError
|
|
416
298
|
| NotFoundError
|
|
417
299
|
| RateLimitedError
|
|
300
|
+
| InternalServerError
|
|
418
301
|
| UnexpectedApiError
|
|
419
302
|
| ResponseParseError
|
|
420
303
|
| TransportError
|
|
@@ -422,165 +305,113 @@ export type TargetsListError =
|
|
|
422
305
|
|
|
423
306
|
export interface TargetsCreateParams {
|
|
424
307
|
/**
|
|
425
|
-
* Identifies one logical write for 24 hours. The key is scoped to the authenticated
|
|
426
|
-
* operation;
|
|
427
|
-
* path, query, and JSON body replays the original response. Reusing
|
|
428
|
-
* returns 409. After expiry the key starts a new write.
|
|
308
|
+
* Identifies one logical write for 24 hours. The key is scoped to the authenticated organization
|
|
309
|
+
* and operation; generation without an organization uses a hashed network identity. Retrying the
|
|
310
|
+
* same method, path, query, If-Match header, and JSON body replays the original response. Reusing
|
|
311
|
+
* the key with changed intent returns 409. After expiry the key starts a new write.
|
|
429
312
|
*/
|
|
430
313
|
idempotencyKey?: string;
|
|
431
314
|
}
|
|
432
315
|
|
|
433
|
-
/**
|
|
316
|
+
/** Typed errors `create` can throw. */
|
|
434
317
|
export type TargetsCreateError =
|
|
435
318
|
| BadRequestError
|
|
436
319
|
| UnauthorizedError
|
|
320
|
+
| PaymentRequiredError
|
|
437
321
|
| ForbiddenError
|
|
438
322
|
| NotFoundError
|
|
439
323
|
| ConflictError
|
|
440
324
|
| UnprocessableEntityError
|
|
441
325
|
| RateLimitedError
|
|
326
|
+
| InternalServerError
|
|
442
327
|
| UnexpectedApiError
|
|
443
328
|
| ResponseParseError
|
|
444
329
|
| TransportError
|
|
445
330
|
| ValidationError;
|
|
446
331
|
|
|
447
|
-
/**
|
|
448
|
-
export type
|
|
332
|
+
/** Typed errors `get` can throw. */
|
|
333
|
+
export type TargetsGetError =
|
|
449
334
|
| UnauthorizedError
|
|
450
335
|
| ForbiddenError
|
|
451
336
|
| NotFoundError
|
|
452
337
|
| RateLimitedError
|
|
338
|
+
| InternalServerError
|
|
453
339
|
| UnexpectedApiError
|
|
454
340
|
| ResponseParseError
|
|
455
341
|
| TransportError
|
|
456
342
|
| ValidationError;
|
|
457
343
|
|
|
458
|
-
|
|
459
|
-
export type TargetsDeleteError =
|
|
460
|
-
| UnauthorizedError
|
|
461
|
-
| ForbiddenError
|
|
462
|
-
| NotFoundError
|
|
463
|
-
| ConflictError
|
|
464
|
-
| RateLimitedError
|
|
465
|
-
| UnexpectedApiError
|
|
466
|
-
| ResponseParseError
|
|
467
|
-
| TransportError
|
|
468
|
-
| ValidationError;
|
|
469
|
-
|
|
470
|
-
/** Every error `update` can produce, as a discriminated union. */
|
|
471
|
-
export type TargetsUpdateError =
|
|
472
|
-
| BadRequestError
|
|
473
|
-
| UnauthorizedError
|
|
474
|
-
| ForbiddenError
|
|
475
|
-
| NotFoundError
|
|
476
|
-
| ConflictError
|
|
477
|
-
| UnprocessableEntityError
|
|
478
|
-
| RateLimitedError
|
|
479
|
-
| UnexpectedApiError
|
|
480
|
-
| ResponseParseError
|
|
481
|
-
| TransportError
|
|
482
|
-
| ValidationError;
|
|
483
|
-
|
|
484
|
-
export interface TargetsListReleasesParams {
|
|
485
|
-
/** Maximum number of resources to return. */
|
|
486
|
-
limit?: number;
|
|
344
|
+
export interface TargetsDeleteParams {
|
|
487
345
|
/**
|
|
488
|
-
*
|
|
489
|
-
*
|
|
346
|
+
* ETag from a preceding response. The write applies only if the resource still has that version;
|
|
347
|
+
* otherwise it returns 412 precondition_failed without changes. Omit to write the current
|
|
348
|
+
* version. See https://typeship.dev/docs/typeship-api#conditional-writes.
|
|
490
349
|
*/
|
|
491
|
-
|
|
350
|
+
ifMatch?: string;
|
|
492
351
|
}
|
|
493
352
|
|
|
494
|
-
/**
|
|
495
|
-
export type
|
|
496
|
-
| BadRequestError
|
|
497
|
-
| UnauthorizedError
|
|
498
|
-
| ForbiddenError
|
|
499
|
-
| NotFoundError
|
|
500
|
-
| RateLimitedError
|
|
501
|
-
| UnexpectedApiError
|
|
502
|
-
| ResponseParseError
|
|
503
|
-
| TransportError
|
|
504
|
-
| ValidationError;
|
|
505
|
-
|
|
506
|
-
/** Every error `retrieveDraft` can produce, as a discriminated union. */
|
|
507
|
-
export type TargetsRetrieveDraftError =
|
|
508
|
-
| UnauthorizedError
|
|
509
|
-
| ForbiddenError
|
|
510
|
-
| NotFoundError
|
|
511
|
-
| RateLimitedError
|
|
512
|
-
| UnexpectedApiError
|
|
513
|
-
| ResponseParseError
|
|
514
|
-
| TransportError
|
|
515
|
-
| ValidationError;
|
|
516
|
-
|
|
517
|
-
/** Every error `updateDraft` can produce, as a discriminated union. */
|
|
518
|
-
export type TargetsUpdateDraftError =
|
|
353
|
+
/** Typed errors `delete` can throw. */
|
|
354
|
+
export type TargetsDeleteError =
|
|
519
355
|
| BadRequestError
|
|
520
356
|
| UnauthorizedError
|
|
521
357
|
| ForbiddenError
|
|
522
358
|
| NotFoundError
|
|
523
359
|
| ConflictError
|
|
524
|
-
|
|
|
360
|
+
| PreconditionFailedError
|
|
525
361
|
| RateLimitedError
|
|
362
|
+
| InternalServerError
|
|
526
363
|
| UnexpectedApiError
|
|
527
364
|
| ResponseParseError
|
|
528
365
|
| TransportError
|
|
529
366
|
| ValidationError;
|
|
530
367
|
|
|
531
|
-
export interface
|
|
368
|
+
export interface TargetsUpdateParams {
|
|
532
369
|
/**
|
|
533
|
-
*
|
|
534
|
-
*
|
|
535
|
-
*
|
|
536
|
-
* returns 409. After expiry the key starts a new write.
|
|
370
|
+
* ETag from a preceding response. The write applies only if the resource still has that version;
|
|
371
|
+
* otherwise it returns 412 precondition_failed without changes. Omit to write the current
|
|
372
|
+
* version. See https://typeship.dev/docs/typeship-api#conditional-writes.
|
|
537
373
|
*/
|
|
538
|
-
|
|
374
|
+
ifMatch?: string;
|
|
539
375
|
}
|
|
540
376
|
|
|
541
|
-
/**
|
|
542
|
-
export type
|
|
377
|
+
/** Typed errors `update` can throw. */
|
|
378
|
+
export type TargetsUpdateError =
|
|
543
379
|
| BadRequestError
|
|
544
380
|
| UnauthorizedError
|
|
381
|
+
| PaymentRequiredError
|
|
545
382
|
| ForbiddenError
|
|
546
383
|
| NotFoundError
|
|
547
384
|
| ConflictError
|
|
385
|
+
| PreconditionFailedError
|
|
548
386
|
| UnprocessableEntityError
|
|
549
387
|
| RateLimitedError
|
|
388
|
+
| InternalServerError
|
|
389
|
+
| BadGatewayError
|
|
550
390
|
| UnexpectedApiError
|
|
551
391
|
| ResponseParseError
|
|
552
392
|
| TransportError
|
|
553
393
|
| ValidationError;
|
|
554
394
|
|
|
555
|
-
|
|
556
|
-
export type TargetsRetrieveReleaseError =
|
|
557
|
-
| UnauthorizedError
|
|
558
|
-
| ForbiddenError
|
|
559
|
-
| NotFoundError
|
|
560
|
-
| RateLimitedError
|
|
561
|
-
| UnexpectedApiError
|
|
562
|
-
| ResponseParseError
|
|
563
|
-
| TransportError
|
|
564
|
-
| ValidationError;
|
|
565
|
-
|
|
566
|
-
export interface TargetsRepublishReleaseParams {
|
|
395
|
+
export interface TargetsAdoptParams {
|
|
567
396
|
/**
|
|
568
|
-
* Identifies one logical write for 24 hours. The key is scoped to the authenticated
|
|
569
|
-
* operation;
|
|
570
|
-
* path, query, and JSON body replays the original response. Reusing
|
|
571
|
-
* returns 409. After expiry the key starts a new write.
|
|
397
|
+
* Identifies one logical write for 24 hours. The key is scoped to the authenticated organization
|
|
398
|
+
* and operation; generation without an organization uses a hashed network identity. Retrying the
|
|
399
|
+
* same method, path, query, If-Match header, and JSON body replays the original response. Reusing
|
|
400
|
+
* the key with changed intent returns 409. After expiry the key starts a new write.
|
|
572
401
|
*/
|
|
573
402
|
idempotencyKey?: string;
|
|
574
403
|
}
|
|
575
404
|
|
|
576
|
-
/**
|
|
577
|
-
export type
|
|
405
|
+
/** Typed errors `adopt` can throw. */
|
|
406
|
+
export type TargetsAdoptError =
|
|
407
|
+
| BadRequestError
|
|
578
408
|
| UnauthorizedError
|
|
579
409
|
| ForbiddenError
|
|
580
410
|
| NotFoundError
|
|
581
411
|
| ConflictError
|
|
412
|
+
| UnprocessableEntityError
|
|
582
413
|
| RateLimitedError
|
|
583
|
-
|
|
|
414
|
+
| InternalServerError
|
|
584
415
|
| UnexpectedApiError
|
|
585
416
|
| ResponseParseError
|
|
586
417
|
| TransportError
|