@typeship-ax/mcp 0.21.0 → 0.23.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 +15 -11
- package/README.md +22 -53
- package/api.json +9998 -10118
- package/api.md +8983 -9120
- package/dist/arguments.d.ts +54 -0
- package/dist/arguments.d.ts.map +1 -0
- package/dist/arguments.js +265 -0
- package/dist/core/http.d.ts +162 -19
- package/dist/core/http.d.ts.map +1 -1
- package/dist/core/http.js +381 -48
- package/dist/core/pagination.d.ts +42 -6
- package/dist/core/pagination.d.ts.map +1 -1
- package/dist/core/pagination.js +111 -17
- package/dist/credential-storage.d.ts +10 -3
- package/dist/credential-storage.d.ts.map +1 -1
- package/dist/credential-storage.js +15 -6
- package/dist/dates.d.ts +1 -1
- package/dist/dates.js +1 -1
- package/dist/errors.d.ts +20 -84
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +20 -108
- package/dist/fields.d.ts +36 -0
- package/dist/fields.d.ts.map +1 -0
- package/dist/fields.js +187 -0
- package/dist/index.d.ts +28 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +35 -25
- package/dist/mcp-authorization.d.ts.map +1 -1
- package/dist/mcp-authorization.js +34 -10
- package/dist/mcp-protocol.d.ts +108 -44
- package/dist/mcp-protocol.d.ts.map +1 -1
- package/dist/mcp-protocol.js +780 -484
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +129 -29
- package/dist/named-credentials.d.ts +19 -0
- package/dist/named-credentials.d.ts.map +1 -1
- package/dist/named-credentials.js +81 -1
- package/dist/oauth-request.d.ts +7 -1
- package/dist/oauth-request.d.ts.map +1 -1
- package/dist/oauth-request.js +26 -4
- package/dist/oauth-session.d.ts +13 -1
- package/dist/oauth-session.d.ts.map +1 -1
- package/dist/oauth-session.js +34 -18
- package/dist/ops.d.ts +58 -5
- package/dist/ops.d.ts.map +1 -1
- package/dist/ops.js +110 -41
- package/dist/resources/api-keys.d.ts +10 -7
- package/dist/resources/api-keys.d.ts.map +1 -1
- package/dist/resources/api-keys.js +10 -31
- package/dist/resources/deliveries.d.ts +89 -5
- package/dist/resources/deliveries.d.ts.map +1 -1
- package/dist/resources/deliveries.js +96 -19
- package/dist/resources/drafts.d.ts +16 -16
- package/dist/resources/drafts.d.ts.map +1 -1
- package/dist/resources/drafts.js +12 -65
- package/dist/resources/files.d.ts +4 -4
- package/dist/resources/files.d.ts.map +1 -1
- package/dist/resources/files.js +3 -12
- package/dist/resources/generations.d.ts +16 -16
- package/dist/resources/generations.d.ts.map +1 -1
- package/dist/resources/generations.js +23 -47
- package/dist/resources/organization.d.ts +4 -4
- package/dist/resources/organization.d.ts.map +1 -1
- package/dist/resources/organization.js +3 -10
- package/dist/resources/{generate.d.ts → packages.d.ts} +16 -16
- package/dist/resources/packages.d.ts.map +1 -0
- package/dist/resources/{generate.js → packages.js} +13 -29
- package/dist/resources/projects.d.ts +50 -50
- package/dist/resources/projects.d.ts.map +1 -1
- package/dist/resources/projects.js +60 -116
- package/dist/resources/releases.d.ts +22 -17
- package/dist/resources/releases.d.ts.map +1 -1
- package/dist/resources/releases.js +19 -40
- package/dist/resources/spec-revisions.d.ts +16 -7
- package/dist/resources/spec-revisions.d.ts.map +1 -1
- package/dist/resources/spec-revisions.js +7 -29
- package/dist/resources/specs.d.ts +7 -7
- package/dist/resources/specs.d.ts.map +1 -1
- package/dist/resources/specs.js +6 -34
- package/dist/resources/targets.d.ts +49 -49
- package/dist/resources/targets.d.ts.map +1 -1
- package/dist/resources/targets.js +59 -115
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +78 -76
- package/dist/search.d.ts +54 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +421 -0
- package/dist/type-docs.d.ts +61 -0
- package/dist/type-docs.d.ts.map +1 -0
- package/dist/type-docs.js +174 -0
- package/dist/types.d.ts +499 -339
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +18 -18
- package/dist/worker.js +2 -2
- package/package.json +5 -2
- package/server.json +5 -5
- package/src/arguments.ts +254 -0
- package/src/core/http.ts +457 -58
- package/src/core/pagination.ts +129 -18
- package/src/credential-storage.ts +16 -6
- package/src/dates.ts +1 -1
- package/src/errors.ts +46 -115
- package/src/fields.ts +167 -0
- package/src/index.ts +45 -28
- package/src/mcp-authorization.ts +29 -9
- package/src/mcp-protocol.ts +808 -435
- package/src/mcp.ts +115 -27
- package/src/named-credentials.ts +66 -1
- package/src/oauth-request.ts +32 -6
- package/src/oauth-session.ts +37 -19
- package/src/ops.ts +146 -45
- package/src/resources/api-keys.ts +34 -48
- package/src/resources/deliveries.ts +213 -32
- package/src/resources/drafts.ts +62 -109
- package/src/resources/files.ts +19 -20
- package/src/resources/generations.ts +61 -79
- package/src/resources/organization.ts +11 -16
- package/src/resources/{generate.ts → packages.ts} +43 -51
- package/src/resources/projects.ts +145 -200
- package/src/resources/releases.ts +50 -67
- package/src/resources/spec-revisions.ts +40 -49
- package/src/resources/specs.ts +39 -59
- package/src/resources/targets.ts +144 -194
- package/src/schemas.ts +78 -76
- package/src/search.ts +434 -0
- package/src/type-docs.ts +205 -0
- package/src/types.ts +538 -357
- package/src/worker.ts +2 -2
- package/dist/resources/generate.d.ts.map +0 -1
- package/dist/resources/publications.d.ts +0 -47
- package/dist/resources/publications.d.ts.map +0 -1
- package/dist/resources/publications.js +0 -70
- package/src/resources/publications.ts +0 -140
|
@@ -1,8 +1,9 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Generated by
|
|
1
|
+
// Typeship — packages resource.
|
|
2
|
+
// Generated by Typeship — https://typeship.dev
|
|
3
3
|
|
|
4
4
|
import { HttpCore, type RequestOptions } from "../core/http.js";
|
|
5
5
|
import {
|
|
6
|
+
RateLimitError,
|
|
6
7
|
ResponseParseError,
|
|
7
8
|
TransportError,
|
|
8
9
|
UnexpectedApiError,
|
|
@@ -11,19 +12,24 @@ import {
|
|
|
11
12
|
BadRequestError,
|
|
12
13
|
ConflictError,
|
|
13
14
|
ForbiddenError,
|
|
14
|
-
InternalServerError,
|
|
15
15
|
NotFoundError,
|
|
16
16
|
PayloadTooLargeError,
|
|
17
|
-
|
|
17
|
+
ServerError,
|
|
18
18
|
UnauthorizedError,
|
|
19
19
|
UnprocessableEntityError,
|
|
20
20
|
} from "../errors.js";
|
|
21
|
-
import type {
|
|
21
|
+
import type {
|
|
22
|
+
ErrorModel,
|
|
23
|
+
ErrorModelRead,
|
|
24
|
+
GenerateRequest,
|
|
25
|
+
GenerationResult,
|
|
26
|
+
GenerationResultRead,
|
|
27
|
+
} from "../types.js";
|
|
22
28
|
|
|
23
|
-
export class
|
|
29
|
+
export class PackagesResource {
|
|
24
30
|
constructor(private readonly _core: HttpCore) {}
|
|
25
31
|
/**
|
|
26
|
-
* Generate
|
|
32
|
+
* Generate a package
|
|
27
33
|
*
|
|
28
34
|
* Returns one generated package without creating a Project.
|
|
29
35
|
*
|
|
@@ -47,12 +53,12 @@ export class GenerateResource {
|
|
|
47
53
|
* A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
|
|
48
54
|
* `POST /generate`
|
|
49
55
|
*/
|
|
50
|
-
async
|
|
56
|
+
async generate(
|
|
51
57
|
body: GenerateRequest,
|
|
52
|
-
params?:
|
|
58
|
+
params?: PackagesGenerateParams,
|
|
53
59
|
options?: RequestOptions,
|
|
54
60
|
): Promise<GenerationResultRead> {
|
|
55
|
-
return this._core.requestData<GenerationResultRead,
|
|
61
|
+
return this._core.requestData<GenerationResultRead, PackagesGenerateError>({
|
|
56
62
|
method: "POST",
|
|
57
63
|
path: "/generate",
|
|
58
64
|
security: [{},{"apiKey":[]}],
|
|
@@ -60,19 +66,9 @@ export class GenerateResource {
|
|
|
60
66
|
"Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
|
|
61
67
|
},
|
|
62
68
|
body,
|
|
63
|
-
errors: {
|
|
64
|
-
"400": BadRequestError,
|
|
65
|
-
"401": UnauthorizedError,
|
|
66
|
-
"403": ForbiddenError,
|
|
67
|
-
"409": ConflictError,
|
|
68
|
-
"413": PayloadTooLargeError,
|
|
69
|
-
"422": UnprocessableEntityError,
|
|
70
|
-
"429": RateLimitedError,
|
|
71
|
-
"500": InternalServerError,
|
|
72
|
-
default: ApiResponseError,
|
|
73
|
-
},
|
|
69
|
+
errors: { "413": PayloadTooLargeError, default: ApiResponseError },
|
|
74
70
|
idempotencyKey: "Idempotency-Key",
|
|
75
|
-
schemaKey: "generate
|
|
71
|
+
schemaKey: "packages.generate",
|
|
76
72
|
options,
|
|
77
73
|
});
|
|
78
74
|
}
|
|
@@ -80,9 +76,9 @@ export class GenerateResource {
|
|
|
80
76
|
/**
|
|
81
77
|
* Download a generated package
|
|
82
78
|
*
|
|
83
|
-
* Download the complete ZIP referenced by `
|
|
84
|
-
* that URL. No API key is needed; the token grants access only to that exact package until
|
|
85
|
-
* replay window expires. Keep the token private.
|
|
79
|
+
* Download the complete ZIP referenced by `packages_generate`'s `download.url`. Pass the token
|
|
80
|
+
* from that URL. No API key is needed; the token grants access only to that exact package until
|
|
81
|
+
* its replay window expires. Keep the token private.
|
|
86
82
|
*
|
|
87
83
|
* The local MCP server saves this binary response to disk. On a hosted MCP connection, download
|
|
88
84
|
* the original URL directly to your workspace. Verify the ZIP against `download.sha256` before
|
|
@@ -90,28 +86,22 @@ export class GenerateResource {
|
|
|
90
86
|
* creates a new download.
|
|
91
87
|
* `GET /generate/download`
|
|
92
88
|
*/
|
|
93
|
-
async
|
|
94
|
-
return this._core.requestData<Blob,
|
|
89
|
+
async download(params: PackagesDownloadParams, options?: RequestOptions): Promise<Blob> {
|
|
90
|
+
return this._core.requestData<Blob, PackagesDownloadError>({
|
|
95
91
|
method: "GET",
|
|
96
92
|
path: "/generate/download",
|
|
97
93
|
security: [{}],
|
|
98
94
|
query: {
|
|
99
95
|
token: params.token,
|
|
100
96
|
},
|
|
101
|
-
errors: {
|
|
102
|
-
"400": BadRequestError,
|
|
103
|
-
"404": NotFoundError,
|
|
104
|
-
"429": RateLimitedError,
|
|
105
|
-
"500": InternalServerError,
|
|
106
|
-
},
|
|
107
97
|
idempotent: true,
|
|
108
|
-
schemaKey: "
|
|
98
|
+
schemaKey: "packages.download",
|
|
109
99
|
options,
|
|
110
100
|
});
|
|
111
101
|
}
|
|
112
102
|
}
|
|
113
103
|
|
|
114
|
-
export interface
|
|
104
|
+
export interface PackagesGenerateParams {
|
|
115
105
|
/**
|
|
116
106
|
* Identifies one logical write for 24 hours. The key is scoped to the authenticated organization
|
|
117
107
|
* and operation; generation without an organization uses a hashed network identity. Retrying the
|
|
@@ -121,33 +111,35 @@ export interface GenerateRunParams {
|
|
|
121
111
|
idempotencyKey?: string;
|
|
122
112
|
}
|
|
123
113
|
|
|
124
|
-
/** Typed errors `
|
|
125
|
-
export type
|
|
126
|
-
| BadRequestError
|
|
127
|
-
| UnauthorizedError
|
|
128
|
-
| ForbiddenError
|
|
129
|
-
| ConflictError
|
|
114
|
+
/** Typed errors `generate` can throw. */
|
|
115
|
+
export type PackagesGenerateError =
|
|
116
|
+
| BadRequestError<ErrorModelRead>
|
|
117
|
+
| UnauthorizedError<ErrorModelRead>
|
|
118
|
+
| ForbiddenError<ErrorModelRead>
|
|
119
|
+
| ConflictError<ErrorModelRead>
|
|
130
120
|
| PayloadTooLargeError
|
|
131
|
-
| UnprocessableEntityError
|
|
132
|
-
|
|
|
133
|
-
|
|
|
121
|
+
| UnprocessableEntityError<ErrorModelRead>
|
|
122
|
+
| RateLimitError<ErrorModelRead>
|
|
123
|
+
| ServerError<ErrorModelRead>
|
|
134
124
|
| ApiResponseError
|
|
125
|
+
| RateLimitError
|
|
135
126
|
| UnexpectedApiError
|
|
136
127
|
| ResponseParseError
|
|
137
128
|
| TransportError
|
|
138
129
|
| ValidationError;
|
|
139
130
|
|
|
140
|
-
export interface
|
|
131
|
+
export interface PackagesDownloadParams {
|
|
141
132
|
/** Private download token from download.url in the generation result. */
|
|
142
133
|
token: string;
|
|
143
134
|
}
|
|
144
135
|
|
|
145
|
-
/** Typed errors `
|
|
146
|
-
export type
|
|
147
|
-
| BadRequestError
|
|
148
|
-
| NotFoundError
|
|
149
|
-
|
|
|
150
|
-
|
|
|
136
|
+
/** Typed errors `download` can throw. */
|
|
137
|
+
export type PackagesDownloadError =
|
|
138
|
+
| BadRequestError<ErrorModelRead>
|
|
139
|
+
| NotFoundError<ErrorModelRead>
|
|
140
|
+
| RateLimitError<ErrorModelRead>
|
|
141
|
+
| ServerError<ErrorModelRead>
|
|
142
|
+
| RateLimitError
|
|
151
143
|
| UnexpectedApiError
|
|
152
144
|
| ResponseParseError
|
|
153
145
|
| TransportError
|
|
@@ -1,23 +1,22 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Generated by
|
|
1
|
+
// Typeship — projects resource.
|
|
2
|
+
// Generated by Typeship — https://typeship.dev
|
|
3
3
|
|
|
4
4
|
import { HttpCore, type RequestOptions } from "../core/http.js";
|
|
5
5
|
import { paginate, PagePromise } from "../core/pagination.js";
|
|
6
6
|
import {
|
|
7
|
+
RateLimitError,
|
|
7
8
|
ResponseParseError,
|
|
8
9
|
TransportError,
|
|
9
10
|
UnexpectedApiError,
|
|
10
11
|
ValidationError,
|
|
11
|
-
BadGatewayError,
|
|
12
12
|
BadRequestError,
|
|
13
13
|
ConflictError,
|
|
14
14
|
ForbiddenError,
|
|
15
|
-
InternalServerError,
|
|
16
15
|
NotFoundError,
|
|
17
16
|
PayloadTooLargeError,
|
|
18
17
|
PaymentRequiredError,
|
|
19
18
|
PreconditionFailedError,
|
|
20
|
-
|
|
19
|
+
ServerError,
|
|
21
20
|
UnauthorizedError,
|
|
22
21
|
UnprocessableEntityError,
|
|
23
22
|
} from "../errors.js";
|
|
@@ -25,6 +24,8 @@ import type {
|
|
|
25
24
|
CreateProjectRequest,
|
|
26
25
|
DeletedProject,
|
|
27
26
|
DeletedProjectRead,
|
|
27
|
+
ErrorModel,
|
|
28
|
+
ErrorModelRead,
|
|
28
29
|
GenerateProjectRequest,
|
|
29
30
|
GenerationBatch,
|
|
30
31
|
GenerationBatchRead,
|
|
@@ -33,53 +34,15 @@ import type {
|
|
|
33
34
|
ProjectList,
|
|
34
35
|
ProjectListRead,
|
|
35
36
|
ProjectRead,
|
|
36
|
-
|
|
37
|
-
|
|
37
|
+
ProjectResponse,
|
|
38
|
+
ProjectResponseRead,
|
|
38
39
|
UpdateProjectRequest,
|
|
39
40
|
} from "../types.js";
|
|
40
41
|
|
|
41
42
|
export class ProjectsResource {
|
|
42
43
|
constructor(private readonly _core: HttpCore) {}
|
|
43
44
|
/**
|
|
44
|
-
*
|
|
45
|
-
*
|
|
46
|
-
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
47
|
-
* `GET /projects`
|
|
48
|
-
*/
|
|
49
|
-
list(
|
|
50
|
-
params?: ProjectsListParams,
|
|
51
|
-
options?: RequestOptions,
|
|
52
|
-
): PagePromise<ProjectSummaryRead, ProjectsListError> {
|
|
53
|
-
return paginate<ProjectSummaryRead, ProjectsListError>(this._core, {
|
|
54
|
-
method: "GET",
|
|
55
|
-
path: "/projects",
|
|
56
|
-
security: [{"apiKey":[]}],
|
|
57
|
-
query: {
|
|
58
|
-
limit: params?.limit,
|
|
59
|
-
cursor: params?.cursor,
|
|
60
|
-
},
|
|
61
|
-
errors: {
|
|
62
|
-
"400": BadRequestError,
|
|
63
|
-
"401": UnauthorizedError,
|
|
64
|
-
"403": ForbiddenError,
|
|
65
|
-
"429": RateLimitedError,
|
|
66
|
-
"500": InternalServerError,
|
|
67
|
-
},
|
|
68
|
-
idempotent: true,
|
|
69
|
-
schemaKey: "projects.list",
|
|
70
|
-
options,
|
|
71
|
-
}, {
|
|
72
|
-
style: "cursor",
|
|
73
|
-
itemsField: "data",
|
|
74
|
-
cursorParam: "cursor",
|
|
75
|
-
nextCursorField: "next_cursor",
|
|
76
|
-
hasMoreField: "has_more",
|
|
77
|
-
limitParam: "limit",
|
|
78
|
-
});
|
|
79
|
-
}
|
|
80
|
-
|
|
81
|
-
/**
|
|
82
|
-
* Create a project
|
|
45
|
+
* Create a Project
|
|
83
46
|
*
|
|
84
47
|
* Creates a Project from a URL or GitHub Spec.
|
|
85
48
|
* Automatic generation is enabled by default for a saved Project.
|
|
@@ -95,8 +58,8 @@ export class ProjectsResource {
|
|
|
95
58
|
body: CreateProjectRequest,
|
|
96
59
|
params?: ProjectsCreateParams,
|
|
97
60
|
options?: RequestOptions,
|
|
98
|
-
): Promise<
|
|
99
|
-
return this._core.requestData<
|
|
61
|
+
): Promise<ProjectResponseRead> {
|
|
62
|
+
return this._core.requestData<ProjectResponseRead, ProjectsCreateError>({
|
|
100
63
|
method: "POST",
|
|
101
64
|
path: "/projects",
|
|
102
65
|
security: [{"apiKey":[]}],
|
|
@@ -104,16 +67,7 @@ export class ProjectsResource {
|
|
|
104
67
|
"Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
|
|
105
68
|
},
|
|
106
69
|
body,
|
|
107
|
-
errors: {
|
|
108
|
-
"400": BadRequestError,
|
|
109
|
-
"401": UnauthorizedError,
|
|
110
|
-
"402": PaymentRequiredError,
|
|
111
|
-
"403": ForbiddenError,
|
|
112
|
-
"409": ConflictError,
|
|
113
|
-
"422": UnprocessableEntityError,
|
|
114
|
-
"429": RateLimitedError,
|
|
115
|
-
"500": InternalServerError,
|
|
116
|
-
},
|
|
70
|
+
errors: { "402": PaymentRequiredError },
|
|
117
71
|
idempotencyKey: "Idempotency-Key",
|
|
118
72
|
schemaKey: "projects.create",
|
|
119
73
|
options,
|
|
@@ -121,70 +75,53 @@ export class ProjectsResource {
|
|
|
121
75
|
}
|
|
122
76
|
|
|
123
77
|
/**
|
|
124
|
-
*
|
|
78
|
+
* List Projects
|
|
125
79
|
*
|
|
126
|
-
*
|
|
127
|
-
*
|
|
128
|
-
* `GET /projects/{project_id}`
|
|
80
|
+
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
81
|
+
* `GET /projects`
|
|
129
82
|
*/
|
|
130
|
-
|
|
131
|
-
return
|
|
83
|
+
list(params?: ProjectsListParams, options?: RequestOptions): PagePromise<ProjectRead, ProjectsListError> {
|
|
84
|
+
return paginate<ProjectRead, ProjectsListError>(this._core, {
|
|
132
85
|
method: "GET",
|
|
133
|
-
path:
|
|
86
|
+
path: "/projects",
|
|
134
87
|
security: [{"apiKey":[]}],
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
"404": NotFoundError,
|
|
139
|
-
"429": RateLimitedError,
|
|
140
|
-
"500": InternalServerError,
|
|
88
|
+
query: {
|
|
89
|
+
limit: params?.limit,
|
|
90
|
+
cursor: params?.cursor,
|
|
141
91
|
},
|
|
142
92
|
idempotent: true,
|
|
143
|
-
schemaKey: "projects.
|
|
93
|
+
schemaKey: "projects.list",
|
|
144
94
|
options,
|
|
95
|
+
}, {
|
|
96
|
+
style: "cursor",
|
|
97
|
+
itemsField: "data",
|
|
98
|
+
cursorParam: "cursor",
|
|
99
|
+
nextCursorField: "next_cursor",
|
|
100
|
+
hasMoreField: "has_more",
|
|
101
|
+
limitParam: "limit",
|
|
145
102
|
});
|
|
146
103
|
}
|
|
147
104
|
|
|
148
105
|
/**
|
|
149
|
-
*
|
|
106
|
+
* Get a Project
|
|
150
107
|
*
|
|
151
|
-
*
|
|
152
|
-
*
|
|
153
|
-
*
|
|
154
|
-
* See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
|
|
155
|
-
* and If-Match.
|
|
156
|
-
* `DELETE /projects/{project_id}`
|
|
108
|
+
* Returns the Project's settings and Spec ID. List its Targets separately to retrieve Target
|
|
109
|
+
* configuration and Deliveries.
|
|
110
|
+
* `GET /projects/{project_id}`
|
|
157
111
|
*/
|
|
158
|
-
async
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
options?: RequestOptions,
|
|
162
|
-
): Promise<DeletedProjectRead> {
|
|
163
|
-
return this._core.requestData<DeletedProjectRead, ProjectsDeleteError>({
|
|
164
|
-
method: "DELETE",
|
|
112
|
+
async get(projectId: ProjectId, options?: RequestOptions): Promise<ProjectResponseRead> {
|
|
113
|
+
return this._core.requestData<ProjectResponseRead, ProjectsGetError>({
|
|
114
|
+
method: "GET",
|
|
165
115
|
path: `/projects/${encodeURIComponent(String(projectId))}`,
|
|
166
116
|
security: [{"apiKey":[]}],
|
|
167
|
-
headers: {
|
|
168
|
-
"If-Match": params?.ifMatch === undefined ? undefined : String(params?.ifMatch),
|
|
169
|
-
},
|
|
170
|
-
errors: {
|
|
171
|
-
"400": BadRequestError,
|
|
172
|
-
"401": UnauthorizedError,
|
|
173
|
-
"403": ForbiddenError,
|
|
174
|
-
"404": NotFoundError,
|
|
175
|
-
"412": PreconditionFailedError,
|
|
176
|
-
"429": RateLimitedError,
|
|
177
|
-
"500": InternalServerError,
|
|
178
|
-
"502": BadGatewayError,
|
|
179
|
-
},
|
|
180
117
|
idempotent: true,
|
|
181
|
-
schemaKey: "projects.
|
|
118
|
+
schemaKey: "projects.get",
|
|
182
119
|
options,
|
|
183
120
|
});
|
|
184
121
|
}
|
|
185
122
|
|
|
186
123
|
/**
|
|
187
|
-
* Update a
|
|
124
|
+
* Update a Project
|
|
188
125
|
*
|
|
189
126
|
* Omitted fields keep their current values. A supplied config replaces the entire stored object;
|
|
190
127
|
* null or an empty object clears it.
|
|
@@ -195,9 +132,9 @@ export class ProjectsResource {
|
|
|
195
132
|
*
|
|
196
133
|
* A `409 target_busy` means a Target is publishing. Retrieve the Project, wait for publishing to
|
|
197
134
|
* finish, reconcile your update, and retry.
|
|
198
|
-
* A `502 follow_up_failed` means the Project was saved, but an obsolete
|
|
199
|
-
*
|
|
200
|
-
*
|
|
135
|
+
* A `502 follow_up_failed` means the Project was saved, but an obsolete Draft pull request could
|
|
136
|
+
* not be retired. Retrieve the Project and retry the same update to finish retiring reviews if
|
|
137
|
+
* that update is still desired.
|
|
201
138
|
* See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
|
|
202
139
|
* and If-Match.
|
|
203
140
|
* `PATCH /projects/{project_id}`
|
|
@@ -207,8 +144,8 @@ export class ProjectsResource {
|
|
|
207
144
|
body: UpdateProjectRequest,
|
|
208
145
|
params?: ProjectsUpdateParams,
|
|
209
146
|
options?: RequestOptions,
|
|
210
|
-
): Promise<
|
|
211
|
-
return this._core.requestData<
|
|
147
|
+
): Promise<ProjectResponseRead> {
|
|
148
|
+
return this._core.requestData<ProjectResponseRead, ProjectsUpdateError>({
|
|
212
149
|
method: "PATCH",
|
|
213
150
|
path: `/projects/${encodeURIComponent(String(projectId))}`,
|
|
214
151
|
security: [{"apiKey":[]}],
|
|
@@ -216,26 +153,43 @@ export class ProjectsResource {
|
|
|
216
153
|
"If-Match": params?.ifMatch === undefined ? undefined : String(params?.ifMatch),
|
|
217
154
|
},
|
|
218
155
|
body,
|
|
219
|
-
errors: {
|
|
220
|
-
"400": BadRequestError,
|
|
221
|
-
"401": UnauthorizedError,
|
|
222
|
-
"402": PaymentRequiredError,
|
|
223
|
-
"403": ForbiddenError,
|
|
224
|
-
"404": NotFoundError,
|
|
225
|
-
"409": ConflictError,
|
|
226
|
-
"412": PreconditionFailedError,
|
|
227
|
-
"422": UnprocessableEntityError,
|
|
228
|
-
"429": RateLimitedError,
|
|
229
|
-
"500": InternalServerError,
|
|
230
|
-
"502": BadGatewayError,
|
|
231
|
-
},
|
|
156
|
+
errors: { "402": PaymentRequiredError, "412": PreconditionFailedError },
|
|
232
157
|
schemaKey: "projects.update",
|
|
233
158
|
options,
|
|
234
159
|
});
|
|
235
160
|
}
|
|
236
161
|
|
|
237
162
|
/**
|
|
238
|
-
*
|
|
163
|
+
* Delete a Project
|
|
164
|
+
*
|
|
165
|
+
* A `502 repository_unavailable` means the Project was not deleted because its Draft pull
|
|
166
|
+
* requests could not be retired. Retry deletion to finish retiring the remaining reviews.
|
|
167
|
+
* Repeating a completed deletion returns `404`.
|
|
168
|
+
* See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
|
|
169
|
+
* and If-Match.
|
|
170
|
+
* `DELETE /projects/{project_id}`
|
|
171
|
+
*/
|
|
172
|
+
async delete(
|
|
173
|
+
projectId: ProjectId,
|
|
174
|
+
params?: ProjectsDeleteParams,
|
|
175
|
+
options?: RequestOptions,
|
|
176
|
+
): Promise<DeletedProjectRead> {
|
|
177
|
+
return this._core.requestData<DeletedProjectRead, ProjectsDeleteError>({
|
|
178
|
+
method: "DELETE",
|
|
179
|
+
path: `/projects/${encodeURIComponent(String(projectId))}`,
|
|
180
|
+
security: [{"apiKey":[]}],
|
|
181
|
+
headers: {
|
|
182
|
+
"If-Match": params?.ifMatch === undefined ? undefined : String(params?.ifMatch),
|
|
183
|
+
},
|
|
184
|
+
errors: { "412": PreconditionFailedError },
|
|
185
|
+
idempotent: true,
|
|
186
|
+
schemaKey: "projects.delete",
|
|
187
|
+
options,
|
|
188
|
+
});
|
|
189
|
+
}
|
|
190
|
+
|
|
191
|
+
/**
|
|
192
|
+
* Generate a Project's Targets
|
|
239
193
|
*
|
|
240
194
|
* Queues one Generation per active Target and returns their IDs. Retrieve each Generation until
|
|
241
195
|
* its status moves from `queued` to `running` and then `completed` or `failed`. `completed` means
|
|
@@ -265,19 +219,7 @@ export class ProjectsResource {
|
|
|
265
219
|
"Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
|
|
266
220
|
},
|
|
267
221
|
body,
|
|
268
|
-
errors: {
|
|
269
|
-
"400": BadRequestError,
|
|
270
|
-
"401": UnauthorizedError,
|
|
271
|
-
"402": PaymentRequiredError,
|
|
272
|
-
"403": ForbiddenError,
|
|
273
|
-
"404": NotFoundError,
|
|
274
|
-
"409": ConflictError,
|
|
275
|
-
"413": PayloadTooLargeError,
|
|
276
|
-
"422": UnprocessableEntityError,
|
|
277
|
-
"429": RateLimitedError,
|
|
278
|
-
"500": InternalServerError,
|
|
279
|
-
"502": BadGatewayError,
|
|
280
|
-
},
|
|
222
|
+
errors: { "402": PaymentRequiredError, "413": PayloadTooLargeError },
|
|
281
223
|
idempotencyKey: "Idempotency-Key",
|
|
282
224
|
schemaKey: "projects.generate",
|
|
283
225
|
options,
|
|
@@ -285,6 +227,32 @@ export class ProjectsResource {
|
|
|
285
227
|
}
|
|
286
228
|
}
|
|
287
229
|
|
|
230
|
+
export interface ProjectsCreateParams {
|
|
231
|
+
/**
|
|
232
|
+
* Identifies one logical write for 24 hours. The key is scoped to the authenticated organization
|
|
233
|
+
* and operation; generation without an organization uses a hashed network identity. Retrying the
|
|
234
|
+
* same method, path, query, If-Match header, and JSON body replays the original response. Reusing
|
|
235
|
+
* the key with changed intent returns 409. After expiry the key starts a new write.
|
|
236
|
+
*/
|
|
237
|
+
idempotencyKey?: string;
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/** Typed errors `create` can throw. */
|
|
241
|
+
export type ProjectsCreateError =
|
|
242
|
+
| BadRequestError<ErrorModelRead>
|
|
243
|
+
| UnauthorizedError<ErrorModelRead>
|
|
244
|
+
| PaymentRequiredError
|
|
245
|
+
| ForbiddenError<ErrorModelRead>
|
|
246
|
+
| ConflictError<ErrorModelRead>
|
|
247
|
+
| UnprocessableEntityError<ErrorModelRead>
|
|
248
|
+
| RateLimitError<ErrorModelRead>
|
|
249
|
+
| ServerError<ErrorModelRead>
|
|
250
|
+
| RateLimitError
|
|
251
|
+
| UnexpectedApiError
|
|
252
|
+
| ResponseParseError
|
|
253
|
+
| TransportError
|
|
254
|
+
| ValidationError;
|
|
255
|
+
|
|
288
256
|
export interface ProjectsListParams {
|
|
289
257
|
/**
|
|
290
258
|
* Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
|
|
@@ -305,36 +273,12 @@ export interface ProjectsListParams {
|
|
|
305
273
|
|
|
306
274
|
/** Typed errors `list` can throw. */
|
|
307
275
|
export type ProjectsListError =
|
|
308
|
-
| BadRequestError
|
|
309
|
-
| UnauthorizedError
|
|
310
|
-
| ForbiddenError
|
|
311
|
-
|
|
|
312
|
-
|
|
|
313
|
-
|
|
|
314
|
-
| ResponseParseError
|
|
315
|
-
| TransportError
|
|
316
|
-
| ValidationError;
|
|
317
|
-
|
|
318
|
-
export interface ProjectsCreateParams {
|
|
319
|
-
/**
|
|
320
|
-
* Identifies one logical write for 24 hours. The key is scoped to the authenticated organization
|
|
321
|
-
* and operation; generation without an organization uses a hashed network identity. Retrying the
|
|
322
|
-
* same method, path, query, If-Match header, and JSON body replays the original response. Reusing
|
|
323
|
-
* the key with changed intent returns 409. After expiry the key starts a new write.
|
|
324
|
-
*/
|
|
325
|
-
idempotencyKey?: string;
|
|
326
|
-
}
|
|
327
|
-
|
|
328
|
-
/** Typed errors `create` can throw. */
|
|
329
|
-
export type ProjectsCreateError =
|
|
330
|
-
| BadRequestError
|
|
331
|
-
| UnauthorizedError
|
|
332
|
-
| PaymentRequiredError
|
|
333
|
-
| ForbiddenError
|
|
334
|
-
| ConflictError
|
|
335
|
-
| UnprocessableEntityError
|
|
336
|
-
| RateLimitedError
|
|
337
|
-
| InternalServerError
|
|
276
|
+
| BadRequestError<ErrorModelRead>
|
|
277
|
+
| UnauthorizedError<ErrorModelRead>
|
|
278
|
+
| ForbiddenError<ErrorModelRead>
|
|
279
|
+
| RateLimitError<ErrorModelRead>
|
|
280
|
+
| ServerError<ErrorModelRead>
|
|
281
|
+
| RateLimitError
|
|
338
282
|
| UnexpectedApiError
|
|
339
283
|
| ResponseParseError
|
|
340
284
|
| TransportError
|
|
@@ -342,17 +286,18 @@ export type ProjectsCreateError =
|
|
|
342
286
|
|
|
343
287
|
/** Typed errors `get` can throw. */
|
|
344
288
|
export type ProjectsGetError =
|
|
345
|
-
| UnauthorizedError
|
|
346
|
-
| ForbiddenError
|
|
347
|
-
| NotFoundError
|
|
348
|
-
|
|
|
349
|
-
|
|
|
289
|
+
| UnauthorizedError<ErrorModelRead>
|
|
290
|
+
| ForbiddenError<ErrorModelRead>
|
|
291
|
+
| NotFoundError<ErrorModelRead>
|
|
292
|
+
| RateLimitError<ErrorModelRead>
|
|
293
|
+
| ServerError<ErrorModelRead>
|
|
294
|
+
| RateLimitError
|
|
350
295
|
| UnexpectedApiError
|
|
351
296
|
| ResponseParseError
|
|
352
297
|
| TransportError
|
|
353
298
|
| ValidationError;
|
|
354
299
|
|
|
355
|
-
export interface
|
|
300
|
+
export interface ProjectsUpdateParams {
|
|
356
301
|
/**
|
|
357
302
|
* ETag from a preceding response. The write applies only if the resource still has that version;
|
|
358
303
|
* otherwise it returns 412 precondition_failed without changes. Omit to write the current
|
|
@@ -361,22 +306,25 @@ export interface ProjectsDeleteParams {
|
|
|
361
306
|
ifMatch?: string;
|
|
362
307
|
}
|
|
363
308
|
|
|
364
|
-
/** Typed errors `
|
|
365
|
-
export type
|
|
366
|
-
| BadRequestError
|
|
367
|
-
| UnauthorizedError
|
|
368
|
-
|
|
|
369
|
-
|
|
|
309
|
+
/** Typed errors `update` can throw. */
|
|
310
|
+
export type ProjectsUpdateError =
|
|
311
|
+
| BadRequestError<ErrorModelRead>
|
|
312
|
+
| UnauthorizedError<ErrorModelRead>
|
|
313
|
+
| PaymentRequiredError
|
|
314
|
+
| ForbiddenError<ErrorModelRead>
|
|
315
|
+
| NotFoundError<ErrorModelRead>
|
|
316
|
+
| ConflictError<ErrorModelRead>
|
|
370
317
|
| PreconditionFailedError
|
|
371
|
-
|
|
|
372
|
-
|
|
|
373
|
-
|
|
|
318
|
+
| UnprocessableEntityError<ErrorModelRead>
|
|
319
|
+
| RateLimitError<ErrorModelRead>
|
|
320
|
+
| ServerError<ErrorModelRead>
|
|
321
|
+
| RateLimitError
|
|
374
322
|
| UnexpectedApiError
|
|
375
323
|
| ResponseParseError
|
|
376
324
|
| TransportError
|
|
377
325
|
| ValidationError;
|
|
378
326
|
|
|
379
|
-
export interface
|
|
327
|
+
export interface ProjectsDeleteParams {
|
|
380
328
|
/**
|
|
381
329
|
* ETag from a preceding response. The write applies only if the resource still has that version;
|
|
382
330
|
* otherwise it returns 412 precondition_failed without changes. Omit to write the current
|
|
@@ -385,19 +333,16 @@ export interface ProjectsUpdateParams {
|
|
|
385
333
|
ifMatch?: string;
|
|
386
334
|
}
|
|
387
335
|
|
|
388
|
-
/** Typed errors `
|
|
389
|
-
export type
|
|
390
|
-
| BadRequestError
|
|
391
|
-
| UnauthorizedError
|
|
392
|
-
|
|
|
393
|
-
|
|
|
394
|
-
| NotFoundError
|
|
395
|
-
| ConflictError
|
|
336
|
+
/** Typed errors `delete` can throw. */
|
|
337
|
+
export type ProjectsDeleteError =
|
|
338
|
+
| BadRequestError<ErrorModelRead>
|
|
339
|
+
| UnauthorizedError<ErrorModelRead>
|
|
340
|
+
| ForbiddenError<ErrorModelRead>
|
|
341
|
+
| NotFoundError<ErrorModelRead>
|
|
396
342
|
| PreconditionFailedError
|
|
397
|
-
|
|
|
398
|
-
|
|
|
399
|
-
|
|
|
400
|
-
| BadGatewayError
|
|
343
|
+
| RateLimitError<ErrorModelRead>
|
|
344
|
+
| ServerError<ErrorModelRead>
|
|
345
|
+
| RateLimitError
|
|
401
346
|
| UnexpectedApiError
|
|
402
347
|
| ResponseParseError
|
|
403
348
|
| TransportError
|
|
@@ -415,17 +360,17 @@ export interface ProjectsGenerateParams {
|
|
|
415
360
|
|
|
416
361
|
/** Typed errors `generate` can throw. */
|
|
417
362
|
export type ProjectsGenerateError =
|
|
418
|
-
| BadRequestError
|
|
419
|
-
| UnauthorizedError
|
|
363
|
+
| BadRequestError<ErrorModelRead>
|
|
364
|
+
| UnauthorizedError<ErrorModelRead>
|
|
420
365
|
| PaymentRequiredError
|
|
421
|
-
| ForbiddenError
|
|
422
|
-
| NotFoundError
|
|
423
|
-
| ConflictError
|
|
366
|
+
| ForbiddenError<ErrorModelRead>
|
|
367
|
+
| NotFoundError<ErrorModelRead>
|
|
368
|
+
| ConflictError<ErrorModelRead>
|
|
424
369
|
| PayloadTooLargeError
|
|
425
|
-
| UnprocessableEntityError
|
|
426
|
-
|
|
|
427
|
-
|
|
|
428
|
-
|
|
|
370
|
+
| UnprocessableEntityError<ErrorModelRead>
|
|
371
|
+
| RateLimitError<ErrorModelRead>
|
|
372
|
+
| ServerError<ErrorModelRead>
|
|
373
|
+
| RateLimitError
|
|
429
374
|
| UnexpectedApiError
|
|
430
375
|
| ResponseParseError
|
|
431
376
|
| TransportError
|