@typeship-ax/mcp 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.
- package/AGENTS.md +31 -0
- package/README.md +67 -10
- package/api.json +6735 -3243
- package/api.md +8537 -248
- package/dist/api-identity.d.ts +40 -0
- package/dist/api-identity.d.ts.map +1 -0
- package/dist/api-identity.js +128 -0
- package/dist/auth-profiles.d.ts +30 -0
- package/dist/auth-profiles.d.ts.map +1 -0
- package/dist/auth-profiles.js +138 -0
- package/dist/core/http.d.ts +21 -92
- package/dist/core/http.d.ts.map +1 -1
- package/dist/core/http.js +143 -221
- package/dist/core/pagination.d.ts.map +1 -1
- package/dist/core/pagination.js +6 -34
- package/dist/credential-storage.d.ts +24 -0
- package/dist/credential-storage.d.ts.map +1 -0
- package/dist/credential-storage.js +207 -0
- package/dist/dates.d.ts +0 -2
- package/dist/dates.d.ts.map +1 -1
- package/dist/dates.js +0 -1
- package/dist/docs.d.ts +36 -0
- package/dist/docs.d.ts.map +1 -0
- package/dist/docs.js +258 -0
- package/dist/errors.d.ts +42 -34
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +30 -20
- package/dist/index.d.ts +27 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +40 -14
- package/dist/mcp-authorization.d.ts +52 -0
- package/dist/mcp-authorization.d.ts.map +1 -0
- package/dist/mcp-authorization.js +232 -0
- package/dist/mcp-protocol.d.ts +69 -25
- package/dist/mcp-protocol.d.ts.map +1 -1
- package/dist/mcp-protocol.js +386 -138
- package/dist/mcp.d.ts +21 -3
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +199 -85
- package/dist/named-credentials.d.ts +21 -0
- package/dist/named-credentials.d.ts.map +1 -0
- package/dist/named-credentials.js +86 -0
- package/dist/oauth-request.d.ts +21 -0
- package/dist/oauth-request.d.ts.map +1 -0
- package/dist/oauth-request.js +119 -0
- package/dist/oauth-session.d.ts +106 -0
- package/dist/oauth-session.d.ts.map +1 -0
- package/dist/oauth-session.js +244 -0
- package/dist/ops.d.ts +18 -0
- package/dist/ops.d.ts.map +1 -1
- package/dist/ops.js +31 -17
- package/dist/resources/account.d.ts +4 -4
- package/dist/resources/account.d.ts.map +1 -1
- package/dist/resources/account.js +1 -0
- package/dist/resources/api-keys.d.ts +13 -8
- package/dist/resources/api-keys.d.ts.map +1 -1
- package/dist/resources/api-keys.js +5 -1
- package/dist/resources/definition-revisions.d.ts +58 -0
- package/dist/resources/definition-revisions.d.ts.map +1 -0
- package/dist/resources/definition-revisions.js +114 -0
- package/dist/resources/definitions.d.ts +35 -0
- package/dist/resources/definitions.d.ts.map +1 -0
- package/dist/resources/definitions.js +60 -0
- package/dist/resources/generate.d.ts +18 -7
- package/dist/resources/generate.d.ts.map +1 -1
- package/dist/resources/generate.js +13 -5
- package/dist/resources/generations.d.ts +6 -6
- package/dist/resources/generations.d.ts.map +1 -1
- package/dist/resources/generations.js +3 -1
- package/dist/resources/projects.d.ts +111 -35
- package/dist/resources/projects.d.ts.map +1 -1
- package/dist/resources/projects.js +125 -15
- package/dist/resources/targets.d.ts +97 -0
- package/dist/resources/targets.d.ts.map +1 -0
- package/dist/resources/targets.js +197 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +135 -62
- package/dist/types.d.ts +2072 -267
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +20 -3
- package/dist/worker.js +4 -4
- package/package.json +11 -1
- package/server.json +42 -0
- package/src/api-identity.ts +98 -0
- package/src/auth-profiles.ts +114 -0
- package/src/core/http.ts +156 -305
- package/src/core/pagination.ts +6 -30
- package/src/credential-storage.ts +183 -0
- package/src/dates.ts +0 -1
- package/src/docs.ts +239 -0
- package/src/errors.ts +52 -41
- package/src/index.ts +49 -14
- package/src/mcp-authorization.ts +211 -0
- package/src/mcp-protocol.ts +432 -133
- package/src/mcp.ts +204 -90
- package/src/named-credentials.ts +74 -0
- package/src/oauth-request.ts +90 -0
- package/src/oauth-session.ts +258 -0
- package/src/ops.ts +56 -17
- package/src/resources/account.ts +6 -3
- package/src/resources/api-keys.ts +27 -7
- package/src/resources/definition-revisions.ts +207 -0
- package/src/resources/definitions.ts +122 -0
- package/src/resources/generate.ts +29 -6
- package/src/resources/generations.ts +9 -4
- package/src/resources/projects.ts +274 -41
- package/src/resources/targets.ts +378 -0
- package/src/schemas.ts +135 -62
- package/src/types.ts +2273 -322
- package/src/worker.ts +4 -4
- package/dist/resources/spec-revisions.d.ts +0 -47
- package/dist/resources/spec-revisions.d.ts.map +0 -1
- package/dist/resources/spec-revisions.js +0 -90
- package/src/resources/spec-revisions.ts +0 -150
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
|
|
2
2
|
import { PagePromise } from "../core/pagination.js";
|
|
3
|
-
import { TransportError, UnexpectedApiError, ValidationError, BadRequestError, ConflictError, ForbiddenError, InternalServerError, NotFoundError, PaymentRequiredError, RateLimitedError, UnauthorizedError, UnprocessableEntityError } from "../errors.js";
|
|
4
|
-
import type { CreateProjectRequest,
|
|
3
|
+
import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadGatewayError, BadRequestError, ConflictError, ForbiddenError, InternalServerError, NotFoundError, PaymentRequiredError, RateLimitedError, UnauthorizedError, UnprocessableEntityError } from "../errors.js";
|
|
4
|
+
import type { CreateProjectRequest, DeletedProjectRead, DiagnosticRemediationRead, DiagnosticRemediationRequest, DiagnosticReportRead, GenerationBatchRead, GenerationSummaryRead, ProjectId, ProjectRead, ProjectSummaryRead, RepositoryIntegrationHealthRead, TargetId, UpdateProjectRequest } from "../types.js";
|
|
5
5
|
export declare class ProjectsResource {
|
|
6
6
|
private readonly _core;
|
|
7
7
|
constructor(_core: HttpCore);
|
|
@@ -11,100 +11,176 @@ export declare class ProjectsResource {
|
|
|
11
11
|
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
12
12
|
* `GET /projects`
|
|
13
13
|
*/
|
|
14
|
-
list(params?: ProjectsListParams, options?: RequestOptions): PagePromise<
|
|
14
|
+
list(params?: ProjectsListParams, options?: RequestOptions): PagePromise<ProjectSummaryRead, ProjectsListError>;
|
|
15
15
|
/**
|
|
16
16
|
* Create a project
|
|
17
17
|
*
|
|
18
18
|
* Stores a URL- or GitHub-sourced project. Free includes one stored project, every selected
|
|
19
|
-
*
|
|
19
|
+
* target, and the first 25 operations, while keeping manual and automatic regeneration, history,
|
|
20
20
|
* destination pull requests, and preview checks. Stateless POST /generate does not consume this
|
|
21
|
-
* slot. Pro adds projects and the
|
|
21
|
+
* slot. Pro adds projects and generates every operation in the Definition.
|
|
22
22
|
*
|
|
23
23
|
* A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
|
|
24
24
|
* `POST /projects`
|
|
25
25
|
*/
|
|
26
|
-
create(body: CreateProjectRequest, params?: ProjectsCreateParams, options?: RequestOptions): Promise<ApiResult<
|
|
26
|
+
create(body: CreateProjectRequest, params?: ProjectsCreateParams, options?: RequestOptions): Promise<ApiResult<ProjectRead, ProjectsCreateError>>;
|
|
27
27
|
/**
|
|
28
28
|
* Retrieve a project
|
|
29
|
+
*
|
|
30
|
+
* Returns Project-owned fields only. List Targets separately for Target and Delivery data.
|
|
29
31
|
* `GET /projects/{project_id}`
|
|
30
32
|
*/
|
|
31
|
-
retrieve(projectId: ProjectId, options?: RequestOptions): Promise<ApiResult<
|
|
33
|
+
retrieve(projectId: ProjectId, options?: RequestOptions): Promise<ApiResult<ProjectRead, ProjectsRetrieveError>>;
|
|
32
34
|
/**
|
|
33
35
|
* Delete a project
|
|
34
36
|
* `DELETE /projects/{project_id}`
|
|
35
37
|
*/
|
|
36
|
-
delete(projectId: ProjectId, options?: RequestOptions): Promise<ApiResult<
|
|
38
|
+
delete(projectId: ProjectId, options?: RequestOptions): Promise<ApiResult<DeletedProjectRead, ProjectsDeleteError>>;
|
|
37
39
|
/**
|
|
38
40
|
* Update a project
|
|
39
41
|
* `PATCH /projects/{project_id}`
|
|
40
42
|
*/
|
|
41
|
-
update(projectId: ProjectId, body: UpdateProjectRequest, options?: RequestOptions): Promise<ApiResult<
|
|
43
|
+
update(projectId: ProjectId, body: UpdateProjectRequest, options?: RequestOptions): Promise<ApiResult<ProjectRead, ProjectsUpdateError>>;
|
|
44
|
+
/**
|
|
45
|
+
* Analyze a project's latest Definition Revision
|
|
46
|
+
*
|
|
47
|
+
* Runs deterministic OpenAPI or GraphQL authorship checks against the latest observed immutable
|
|
48
|
+
* Definition Revision after applying the Definition's existing patches. Diagnostics group every
|
|
49
|
+
* affected location under a stable rule. Exact patches are included only when Typeship can derive
|
|
50
|
+
* the change without inventing API behavior.
|
|
51
|
+
* `GET /projects/{project_id}/diagnostics`
|
|
52
|
+
*/
|
|
53
|
+
retrieveDiagnostics(projectId: ProjectId, options?: RequestOptions): Promise<ApiResult<DiagnosticReportRead, ProjectsRetrieveDiagnosticsError>>;
|
|
54
|
+
/**
|
|
55
|
+
* Refresh a project's Diagnostics from its configured source
|
|
56
|
+
*
|
|
57
|
+
* Fetches the complete configured source, records a new immutable revision only when content
|
|
58
|
+
* changed, and returns its Diagnostics. This does not generate targets or consume a metered
|
|
59
|
+
* generation.
|
|
60
|
+
*
|
|
61
|
+
* A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
|
|
62
|
+
* `POST /projects/{project_id}/diagnostics`
|
|
63
|
+
*/
|
|
64
|
+
refreshDiagnostics(projectId: ProjectId, params?: ProjectsRefreshDiagnosticsParams, options?: RequestOptions): Promise<ApiResult<DiagnosticReportRead, ProjectsRefreshDiagnosticsError>>;
|
|
65
|
+
/**
|
|
66
|
+
* Apply exact, reviewed diagnostic remediations
|
|
67
|
+
*
|
|
68
|
+
* Applies only deterministic patches. Repository sources receive an updateable source pull
|
|
69
|
+
* request; URL sources receive project overlays. Diagnostics that require API-owner intent return
|
|
70
|
+
* 422 and include an authoring_brief in the Diagnostic instead.
|
|
71
|
+
*
|
|
72
|
+
* A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
|
|
73
|
+
* `POST /projects/{project_id}/diagnostics/remediations`
|
|
74
|
+
*/
|
|
75
|
+
remediateDiagnostics(projectId: ProjectId, body: DiagnosticRemediationRequest, params?: ProjectsRemediateDiagnosticsParams, options?: RequestOptions): Promise<ApiResult<DiagnosticRemediationRead, ProjectsRemediateDiagnosticsError>>;
|
|
42
76
|
/**
|
|
43
|
-
* Diagnose a project's
|
|
77
|
+
* Diagnose a project's repository integrations
|
|
44
78
|
*
|
|
45
|
-
* Returns machine-actionable source and destination access,
|
|
46
|
-
* setup, required status names, and the latest durable webhook
|
|
47
|
-
* same result.
|
|
48
|
-
* `GET /projects/{project_id}/
|
|
79
|
+
* Returns provider-neutral, machine-actionable source and destination access, Definition
|
|
80
|
+
* readability, source-approval label setup, required status names, and the latest durable webhook
|
|
81
|
+
* delivery. The Console renders this same result.
|
|
82
|
+
* `GET /projects/{project_id}/integration-health`
|
|
49
83
|
*/
|
|
50
|
-
|
|
84
|
+
retrieveIntegrationHealth(projectId: ProjectId, options?: RequestOptions): Promise<ApiResult<RepositoryIntegrationHealthRead, ProjectsRetrieveIntegrationHealthError>>;
|
|
51
85
|
/**
|
|
52
86
|
* List a project's generations
|
|
53
87
|
*
|
|
54
88
|
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
55
89
|
* `GET /projects/{project_id}/generations`
|
|
56
90
|
*/
|
|
57
|
-
listGenerations(projectId: ProjectId, params?: ProjectsListGenerationsParams, options?: RequestOptions): PagePromise<
|
|
91
|
+
listGenerations(projectId: ProjectId, params?: ProjectsListGenerationsParams, options?: RequestOptions): PagePromise<GenerationSummaryRead, ProjectsListGenerationsError>;
|
|
58
92
|
/**
|
|
59
|
-
* Generate
|
|
93
|
+
* Generate targets and open pull requests
|
|
60
94
|
*
|
|
61
|
-
* Resolves the project's URL or
|
|
95
|
+
* Resolves the project's URL or GitHub source, generates every
|
|
62
96
|
* configured delivery package, stores each result in the project's history,
|
|
63
97
|
* and attempts to open a pull request in every configured destination.
|
|
64
98
|
* When the complete generated tree already matches a destination, no
|
|
65
99
|
* commit, branch, or pull request is created and that generation reports
|
|
66
100
|
* `pr_status: no_changes`. This is the same pipeline automatic
|
|
67
101
|
* regeneration runs after a source change.
|
|
102
|
+
*
|
|
103
|
+
* A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
|
|
68
104
|
* `POST /projects/{project_id}/generations`
|
|
69
105
|
*/
|
|
70
|
-
generate(projectId: ProjectId, options?: RequestOptions): Promise<ApiResult<
|
|
106
|
+
generate(projectId: ProjectId, params?: ProjectsGenerateParams, options?: RequestOptions): Promise<ApiResult<GenerationBatchRead, ProjectsGenerateError>>;
|
|
71
107
|
}
|
|
72
108
|
export interface ProjectsListParams {
|
|
73
109
|
/** Maximum number of resources to return. */
|
|
74
110
|
limit?: number;
|
|
75
|
-
/**
|
|
111
|
+
/**
|
|
112
|
+
* Opaque cursor from the preceding page's next_cursor. Valid only for the same account,
|
|
113
|
+
* operation, filters, and ordering that issued it.
|
|
114
|
+
*/
|
|
76
115
|
cursor?: string;
|
|
77
116
|
}
|
|
78
117
|
/** Every error `list` can produce, as a discriminated union. */
|
|
79
|
-
export type ProjectsListError = BadRequestError | UnauthorizedError | ForbiddenError | RateLimitedError | UnexpectedApiError | TransportError | ValidationError;
|
|
118
|
+
export type ProjectsListError = BadRequestError | UnauthorizedError | ForbiddenError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
80
119
|
export interface ProjectsCreateParams {
|
|
81
120
|
/**
|
|
82
|
-
*
|
|
83
|
-
*
|
|
84
|
-
*
|
|
121
|
+
* Identifies one logical write for 24 hours. The key is scoped to the authenticated account and
|
|
122
|
+
* operation; account-less generation uses a hashed network identity. Retrying the same method,
|
|
123
|
+
* path, query, and JSON body replays the original response. Reusing the key with changed intent
|
|
124
|
+
* returns 409. After expiry the key starts a new write.
|
|
85
125
|
*/
|
|
86
126
|
idempotencyKey?: string;
|
|
87
127
|
}
|
|
88
128
|
/** Every error `create` can produce, as a discriminated union. */
|
|
89
|
-
export type ProjectsCreateError = BadRequestError | UnauthorizedError | PaymentRequiredError | ForbiddenError | ConflictError | RateLimitedError | InternalServerError | UnexpectedApiError | TransportError | ValidationError;
|
|
129
|
+
export type ProjectsCreateError = BadRequestError | UnauthorizedError | PaymentRequiredError | ForbiddenError | ConflictError | UnprocessableEntityError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
90
130
|
/** Every error `retrieve` can produce, as a discriminated union. */
|
|
91
|
-
export type ProjectsRetrieveError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | TransportError | ValidationError;
|
|
131
|
+
export type ProjectsRetrieveError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
92
132
|
/** Every error `delete` can produce, as a discriminated union. */
|
|
93
|
-
export type ProjectsDeleteError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | TransportError | ValidationError;
|
|
133
|
+
export type ProjectsDeleteError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
94
134
|
/** Every error `update` can produce, as a discriminated union. */
|
|
95
|
-
export type ProjectsUpdateError = BadRequestError | UnauthorizedError | PaymentRequiredError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | TransportError | ValidationError;
|
|
96
|
-
/** Every error `
|
|
97
|
-
export type
|
|
135
|
+
export type ProjectsUpdateError = BadRequestError | UnauthorizedError | PaymentRequiredError | ForbiddenError | NotFoundError | ConflictError | UnprocessableEntityError | RateLimitedError | BadGatewayError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
136
|
+
/** Every error `retrieveDiagnostics` can produce, as a discriminated union. */
|
|
137
|
+
export type ProjectsRetrieveDiagnosticsError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
138
|
+
export interface ProjectsRefreshDiagnosticsParams {
|
|
139
|
+
/**
|
|
140
|
+
* Identifies one logical write for 24 hours. The key is scoped to the authenticated account and
|
|
141
|
+
* operation; account-less generation uses a hashed network identity. Retrying the same method,
|
|
142
|
+
* path, query, and JSON body replays the original response. Reusing the key with changed intent
|
|
143
|
+
* returns 409. After expiry the key starts a new write.
|
|
144
|
+
*/
|
|
145
|
+
idempotencyKey?: string;
|
|
146
|
+
}
|
|
147
|
+
/** Every error `refreshDiagnostics` can produce, as a discriminated union. */
|
|
148
|
+
export type ProjectsRefreshDiagnosticsError = UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | UnprocessableEntityError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
149
|
+
export interface ProjectsRemediateDiagnosticsParams {
|
|
150
|
+
/**
|
|
151
|
+
* Identifies one logical write for 24 hours. The key is scoped to the authenticated account and
|
|
152
|
+
* operation; account-less generation uses a hashed network identity. Retrying the same method,
|
|
153
|
+
* path, query, and JSON body replays the original response. Reusing the key with changed intent
|
|
154
|
+
* returns 409. After expiry the key starts a new write.
|
|
155
|
+
*/
|
|
156
|
+
idempotencyKey?: string;
|
|
157
|
+
}
|
|
158
|
+
/** Every error `remediateDiagnostics` can produce, as a discriminated union. */
|
|
159
|
+
export type ProjectsRemediateDiagnosticsError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | UnprocessableEntityError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
160
|
+
/** Every error `retrieveIntegrationHealth` can produce, as a discriminated union. */
|
|
161
|
+
export type ProjectsRetrieveIntegrationHealthError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
98
162
|
export interface ProjectsListGenerationsParams {
|
|
99
163
|
/** Maximum number of resources to return. */
|
|
100
164
|
limit?: number;
|
|
101
|
-
/**
|
|
165
|
+
/**
|
|
166
|
+
* Opaque cursor from the preceding page's next_cursor. Valid only for the same account,
|
|
167
|
+
* operation, filters, and ordering that issued it.
|
|
168
|
+
*/
|
|
102
169
|
cursor?: string;
|
|
103
|
-
/** Only generations for this
|
|
104
|
-
|
|
170
|
+
/** Only generations for this persisted Target. */
|
|
171
|
+
targetId?: TargetId;
|
|
105
172
|
}
|
|
106
173
|
/** Every error `listGenerations` can produce, as a discriminated union. */
|
|
107
|
-
export type ProjectsListGenerationsError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | TransportError | ValidationError;
|
|
174
|
+
export type ProjectsListGenerationsError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
175
|
+
export interface ProjectsGenerateParams {
|
|
176
|
+
/**
|
|
177
|
+
* Identifies one logical write for 24 hours. The key is scoped to the authenticated account and
|
|
178
|
+
* operation; account-less generation uses a hashed network identity. Retrying the same method,
|
|
179
|
+
* path, query, and JSON body replays the original response. Reusing the key with changed intent
|
|
180
|
+
* returns 409. After expiry the key starts a new write.
|
|
181
|
+
*/
|
|
182
|
+
idempotencyKey?: string;
|
|
183
|
+
}
|
|
108
184
|
/** Every error `generate` can produce, as a discriminated union. */
|
|
109
|
-
export type ProjectsGenerateError = UnauthorizedError | PaymentRequiredError | ForbiddenError | NotFoundError | UnprocessableEntityError | RateLimitedError | InternalServerError | UnexpectedApiError | TransportError | ValidationError;
|
|
185
|
+
export type ProjectsGenerateError = UnauthorizedError | PaymentRequiredError | ForbiddenError | NotFoundError | ConflictError | UnprocessableEntityError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
110
186
|
//# sourceMappingURL=projects.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/resources/projects.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAY,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACV,oBAAoB,
|
|
1
|
+
{"version":3,"file":"projects.d.ts","sourceRoot":"","sources":["../../src/resources/projects.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAY,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,eAAe,EACf,aAAa,EACb,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACV,oBAAoB,EAEpB,kBAAkB,EAElB,yBAAyB,EACzB,4BAA4B,EAE5B,oBAAoB,EAEpB,mBAAmB,EAInB,qBAAqB,EAErB,SAAS,EAGT,WAAW,EAEX,kBAAkB,EAElB,+BAA+B,EAC/B,QAAQ,EACR,oBAAoB,EACrB,MAAM,aAAa,CAAC;AAErB,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;OAKG;IACH,IAAI,CACF,MAAM,CAAC,EAAE,kBAAkB,EAC3B,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,kBAAk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6B;IAC5C,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,kDAAkD;IAClD,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,2EAA2E;AAC3E,MAAM,MAAM,4BAA4B,GACpC,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,MAAM,WAAW,sBAAsB;IACrC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,oEAAoE;AACpE,MAAM,MAAM,qBAAqB,GAC7B,iBAAiB,GACjB,oBAAoB,GACpB,cAAc,GACd,aAAa,GACb,aAAa,GACb,wBAAwB,GACxB,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
|
|
@@ -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
|
-
*
|
|
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
|
|
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
|
-
*
|
|
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,
|
|
138
|
-
* setup, required status names, and the latest durable webhook
|
|
139
|
-
* same result.
|
|
140
|
-
* `GET /projects/{project_id}/
|
|
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
|
|
242
|
+
async retrieveIntegrationHealth(projectId, options) {
|
|
143
243
|
return this._core.request({
|
|
144
244
|
method: "GET",
|
|
145
|
-
path: `/projects/${encodeURIComponent(String(projectId))}/
|
|
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.
|
|
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
|
-
|
|
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
|
|
294
|
+
* Generate targets and open pull requests
|
|
193
295
|
*
|
|
194
|
-
* Resolves the project's URL or
|
|
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":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAY,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EACL,kBAAkB,EAClB,cAAc,E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