@typeship-ax/mcp 0.10.0 → 0.19.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 +10 -4
- package/README.md +16 -5
- package/api.json +4539 -616
- package/api.md +3827 -673
- package/dist/core/http.d.ts +3 -2
- package/dist/core/http.d.ts.map +1 -1
- package/dist/core/http.js +18 -6
- package/dist/errors.d.ts +17 -10
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +24 -15
- package/dist/index.d.ts +7 -3
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +9 -5
- package/dist/mcp-protocol.d.ts +10 -6
- package/dist/mcp-protocol.d.ts.map +1 -1
- package/dist/mcp-protocol.js +108 -37
- package/dist/mcp.d.ts.map +1 -1
- package/dist/mcp.js +36 -17
- package/dist/ops.d.ts +4 -0
- package/dist/ops.d.ts.map +1 -1
- package/dist/ops.js +45 -35
- package/dist/resources/account.d.ts +4 -4
- package/dist/resources/account.d.ts.map +1 -1
- package/dist/resources/account.js +10 -5
- package/dist/resources/api-keys.d.ts +40 -14
- package/dist/resources/api-keys.d.ts.map +1 -1
- package/dist/resources/api-keys.js +45 -13
- package/dist/resources/definition-revisions.d.ts +35 -18
- package/dist/resources/definition-revisions.d.ts.map +1 -1
- package/dist/resources/definition-revisions.js +43 -15
- package/dist/resources/definitions.d.ts +21 -6
- package/dist/resources/definitions.d.ts.map +1 -1
- package/dist/resources/definitions.js +16 -3
- package/dist/resources/generate.d.ts +44 -15
- package/dist/resources/generate.d.ts.map +1 -1
- package/dist/resources/generate.js +55 -13
- package/dist/resources/generations.d.ts +14 -6
- package/dist/resources/generations.d.ts.map +1 -1
- package/dist/resources/generations.js +26 -5
- package/dist/resources/projects.d.ts +106 -53
- package/dist/resources/projects.d.ts.map +1 -1
- package/dist/resources/projects.js +78 -31
- package/dist/resources/targets.d.ts +240 -40
- package/dist/resources/targets.d.ts.map +1 -1
- package/dist/resources/targets.js +307 -21
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +130 -78
- package/dist/types.d.ts +1969 -154
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +87 -3
- package/package.json +3 -3
- package/server.json +3 -3
- package/src/core/http.ts +17 -6
- package/src/errors.ts +25 -15
- package/src/index.ts +9 -5
- package/src/mcp-protocol.ts +93 -36
- package/src/mcp.ts +32 -15
- package/src/ops.ts +49 -35
- package/src/resources/account.ts +11 -4
- package/src/resources/api-keys.ts +84 -13
- package/src/resources/definition-revisions.ts +74 -16
- package/src/resources/definitions.ts +28 -4
- package/src/resources/generate.ts +78 -13
- package/src/resources/generations.ts +31 -4
- package/src/resources/projects.ts +141 -39
- package/src/resources/targets.ts +561 -27
- package/src/schemas.ts +130 -78
- package/src/types.ts +2105 -154
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
|
|
2
|
-
import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, ForbiddenError, RateLimitedError, UnauthorizedError } from "../errors.js";
|
|
2
|
+
import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, ForbiddenError, InternalServerError, RateLimitedError, UnauthorizedError } from "../errors.js";
|
|
3
3
|
import type { AccountRead } from "../types.js";
|
|
4
4
|
export declare class AccountResource {
|
|
5
5
|
private readonly _core;
|
|
@@ -7,12 +7,12 @@ export declare class AccountResource {
|
|
|
7
7
|
/**
|
|
8
8
|
* The account behind the presented credentials
|
|
9
9
|
*
|
|
10
|
-
* Returns the account
|
|
11
|
-
*
|
|
10
|
+
* Returns the account associated with your credential. The Typeship CLI uses this endpoint for
|
|
11
|
+
* `whoami`.
|
|
12
12
|
* `GET /me`
|
|
13
13
|
*/
|
|
14
14
|
retrieve(options?: RequestOptions): Promise<ApiResult<AccountRead, AccountRetrieveError>>;
|
|
15
15
|
}
|
|
16
16
|
/** Every error `retrieve` can produce, as a discriminated union. */
|
|
17
|
-
export type AccountRetrieveError = UnauthorizedError | ForbiddenError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
17
|
+
export type AccountRetrieveError = UnauthorizedError | ForbiddenError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
18
18
|
//# sourceMappingURL=account.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/resources/account.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAW,WAAW,EAAE,MAAM,aAAa,CAAC;AAExD,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;;OAMG;IACG,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,EAAE,oBAAoB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/resources/account.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAW,WAAW,EAAE,MAAM,aAAa,CAAC;AAExD,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;;OAMG;IACG,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,EAAE,oBAAoB,CAAC,CAAC;CAgBhG;AAED,oEAAoE;AACpE,MAAM,MAAM,oBAAoB,GAC5B,iBAAiB,GACjB,cAAc,GACd,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
// typeship — account resource.
|
|
2
|
-
// Generated by typeship — https://typeship.dev
|
|
3
|
-
import { ForbiddenError, RateLimitedError, UnauthorizedError, } from "../errors.js";
|
|
2
|
+
// Generated by typeship — https://typeship.dev
|
|
3
|
+
import { ForbiddenError, InternalServerError, RateLimitedError, UnauthorizedError, } from "../errors.js";
|
|
4
4
|
export class AccountResource {
|
|
5
5
|
_core;
|
|
6
6
|
constructor(_core) {
|
|
@@ -9,8 +9,8 @@ export class AccountResource {
|
|
|
9
9
|
/**
|
|
10
10
|
* The account behind the presented credentials
|
|
11
11
|
*
|
|
12
|
-
* Returns the account
|
|
13
|
-
*
|
|
12
|
+
* Returns the account associated with your credential. The Typeship CLI uses this endpoint for
|
|
13
|
+
* `whoami`.
|
|
14
14
|
* `GET /me`
|
|
15
15
|
*/
|
|
16
16
|
async retrieve(options) {
|
|
@@ -18,7 +18,12 @@ export class AccountResource {
|
|
|
18
18
|
method: "GET",
|
|
19
19
|
path: "/me",
|
|
20
20
|
security: [{ "apiKey": [] }],
|
|
21
|
-
errors: {
|
|
21
|
+
errors: {
|
|
22
|
+
"401": UnauthorizedError,
|
|
23
|
+
"403": ForbiddenError,
|
|
24
|
+
"429": RateLimitedError,
|
|
25
|
+
"500": InternalServerError,
|
|
26
|
+
},
|
|
22
27
|
idempotent: true,
|
|
23
28
|
schemaKey: "account.retrieve",
|
|
24
29
|
options,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
|
|
2
2
|
import { PagePromise } from "../core/pagination.js";
|
|
3
|
-
import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadRequestError, ForbiddenError, NotFoundError, RateLimitedError, UnauthorizedError } from "../errors.js";
|
|
3
|
+
import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadRequestError, ForbiddenError, InternalServerError, NotFoundError, PreconditionFailedError, RateLimitedError, UnauthorizedError } from "../errors.js";
|
|
4
4
|
import type { ApiKeyRead, ApiKeyResponseRead } from "../types.js";
|
|
5
5
|
export declare class ApiKeysResource {
|
|
6
6
|
private readonly _core;
|
|
@@ -8,35 +8,61 @@ export declare class ApiKeysResource {
|
|
|
8
8
|
/**
|
|
9
9
|
* List API keys
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
11
|
+
* Lists key metadata and the last four characters of each key. Full keys are not returned. Create
|
|
12
|
+
* keys in the Console.
|
|
13
13
|
*
|
|
14
14
|
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
15
|
-
* `GET /
|
|
15
|
+
* `GET /api-keys`
|
|
16
16
|
*/
|
|
17
17
|
list(params?: ApiKeysListParams, options?: RequestOptions): PagePromise<ApiKeyRead, ApiKeysListError>;
|
|
18
|
+
/**
|
|
19
|
+
* Retrieve an API key
|
|
20
|
+
*
|
|
21
|
+
* Returns the key summary and its ETag for conditional revocation.
|
|
22
|
+
* `GET /api-keys/{api_key_id}`
|
|
23
|
+
*/
|
|
24
|
+
retrieve(apiKeyId: string, options?: RequestOptions): Promise<ApiResult<ApiKeyResponseRead, ApiKeysRetrieveError>>;
|
|
18
25
|
/**
|
|
19
26
|
* Revoke an API key
|
|
20
27
|
*
|
|
21
|
-
*
|
|
22
|
-
*
|
|
23
|
-
*
|
|
24
|
-
* account
|
|
25
|
-
*
|
|
28
|
+
* Revokes a key. Repeating the request returns the same result.
|
|
29
|
+
*
|
|
30
|
+
* With OAuth, members can revoke their own keys; organization admins can revoke any key.
|
|
31
|
+
* Organization API keys can revoke any key in their account.
|
|
32
|
+
* See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
|
|
33
|
+
* and If-Match.
|
|
34
|
+
* `DELETE /api-keys/{api_key_id}`
|
|
26
35
|
*/
|
|
27
|
-
revoke(apiKeyId: string, options?: RequestOptions): Promise<ApiResult<ApiKeyResponseRead, ApiKeysRevokeError>>;
|
|
36
|
+
revoke(apiKeyId: string, params?: ApiKeysRevokeParams, options?: RequestOptions): Promise<ApiResult<ApiKeyResponseRead, ApiKeysRevokeError>>;
|
|
28
37
|
}
|
|
29
38
|
export interface ApiKeysListParams {
|
|
30
|
-
/**
|
|
39
|
+
/**
|
|
40
|
+
* Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
|
|
41
|
+
* representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
|
|
42
|
+
* invalid_request. List query parameters must appear only once; unrecognized parameters also
|
|
43
|
+
* return 400.
|
|
44
|
+
*/
|
|
31
45
|
limit?: number;
|
|
32
46
|
/**
|
|
33
47
|
* Opaque cursor from the preceding page's next_cursor. Valid only for the same account,
|
|
34
|
-
* operation, filters, and ordering that issued it.
|
|
48
|
+
* operation, filters, and ordering that issued it. Omit to start at the first page. Empty,
|
|
49
|
+
* malformed, or repeated cursors return 400 invalid_request. The page limit may change between
|
|
50
|
+
* requests.
|
|
35
51
|
*/
|
|
36
52
|
cursor?: string;
|
|
37
53
|
}
|
|
38
54
|
/** Every error `list` can produce, as a discriminated union. */
|
|
39
|
-
export type ApiKeysListError = BadRequestError | UnauthorizedError | ForbiddenError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
55
|
+
export type ApiKeysListError = BadRequestError | UnauthorizedError | ForbiddenError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
56
|
+
/** Every error `retrieve` can produce, as a discriminated union. */
|
|
57
|
+
export type ApiKeysRetrieveError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
58
|
+
export interface ApiKeysRevokeParams {
|
|
59
|
+
/**
|
|
60
|
+
* ETag from a preceding response. The write applies only if the resource still has that version;
|
|
61
|
+
* otherwise it returns 412 precondition_failed without changes. Omit to write the current
|
|
62
|
+
* version. See https://typeship.dev/docs/typeship-api#conditional-writes.
|
|
63
|
+
*/
|
|
64
|
+
ifMatch?: string;
|
|
65
|
+
}
|
|
40
66
|
/** Every error `revoke` can produce, as a discriminated union. */
|
|
41
|
-
export type ApiKeysRevokeError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
67
|
+
export type ApiKeysRevokeError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | PreconditionFailedError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
42
68
|
//# sourceMappingURL=api-keys.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-keys.d.ts","sourceRoot":"","sources":["../../src/resources/api-keys.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,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAIV,UAAU,EAEV,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAErB,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;;;;OAQG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAA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EAAgE;AAChE,MAAM,MAAM,gBAAgB,GACxB,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,oEAAoE;AACpE,MAAM,MAAM,oBAAoB,GAC5B,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,kEAAkE;AAClE,MAAM,MAAM,kBAAkB,GAC1B,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,uBAAuB,GACvB,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// typeship — apiKeys resource.
|
|
2
|
-
// Generated by typeship — https://typeship.dev
|
|
2
|
+
// Generated by typeship — https://typeship.dev
|
|
3
3
|
import { paginate } from "../core/pagination.js";
|
|
4
|
-
import { BadRequestError, ForbiddenError, NotFoundError, RateLimitedError, UnauthorizedError, } from "../errors.js";
|
|
4
|
+
import { BadRequestError, ForbiddenError, InternalServerError, NotFoundError, PreconditionFailedError, RateLimitedError, UnauthorizedError, } from "../errors.js";
|
|
5
5
|
export class ApiKeysResource {
|
|
6
6
|
_core;
|
|
7
7
|
constructor(_core) {
|
|
@@ -10,16 +10,16 @@ export class ApiKeysResource {
|
|
|
10
10
|
/**
|
|
11
11
|
* List API keys
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
13
|
+
* Lists key metadata and the last four characters of each key. Full keys are not returned. Create
|
|
14
|
+
* keys in the Console.
|
|
15
15
|
*
|
|
16
16
|
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
17
|
-
* `GET /
|
|
17
|
+
* `GET /api-keys`
|
|
18
18
|
*/
|
|
19
19
|
list(params, options) {
|
|
20
20
|
return paginate(this._core, {
|
|
21
21
|
method: "GET",
|
|
22
|
-
path: "/
|
|
22
|
+
path: "/api-keys",
|
|
23
23
|
security: [{ "apiKey": [] }],
|
|
24
24
|
query: {
|
|
25
25
|
limit: params?.limit,
|
|
@@ -30,6 +30,7 @@ export class ApiKeysResource {
|
|
|
30
30
|
"401": UnauthorizedError,
|
|
31
31
|
"403": ForbiddenError,
|
|
32
32
|
"429": RateLimitedError,
|
|
33
|
+
"500": InternalServerError,
|
|
33
34
|
},
|
|
34
35
|
idempotent: true,
|
|
35
36
|
schemaKey: "apiKeys.list",
|
|
@@ -43,25 +44,56 @@ export class ApiKeysResource {
|
|
|
43
44
|
limitParam: "limit",
|
|
44
45
|
});
|
|
45
46
|
}
|
|
47
|
+
/**
|
|
48
|
+
* Retrieve an API key
|
|
49
|
+
*
|
|
50
|
+
* Returns the key summary and its ETag for conditional revocation.
|
|
51
|
+
* `GET /api-keys/{api_key_id}`
|
|
52
|
+
*/
|
|
53
|
+
async retrieve(apiKeyId, options) {
|
|
54
|
+
return this._core.request({
|
|
55
|
+
method: "GET",
|
|
56
|
+
path: `/api-keys/${encodeURIComponent(String(apiKeyId))}`,
|
|
57
|
+
security: [{ "apiKey": [] }],
|
|
58
|
+
errors: {
|
|
59
|
+
"401": UnauthorizedError,
|
|
60
|
+
"403": ForbiddenError,
|
|
61
|
+
"404": NotFoundError,
|
|
62
|
+
"429": RateLimitedError,
|
|
63
|
+
"500": InternalServerError,
|
|
64
|
+
},
|
|
65
|
+
idempotent: true,
|
|
66
|
+
schemaKey: "apiKeys.retrieve",
|
|
67
|
+
options,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
46
70
|
/**
|
|
47
71
|
* Revoke an API key
|
|
48
72
|
*
|
|
49
|
-
*
|
|
50
|
-
*
|
|
51
|
-
*
|
|
52
|
-
* account
|
|
53
|
-
*
|
|
73
|
+
* Revokes a key. Repeating the request returns the same result.
|
|
74
|
+
*
|
|
75
|
+
* With OAuth, members can revoke their own keys; organization admins can revoke any key.
|
|
76
|
+
* Organization API keys can revoke any key in their account.
|
|
77
|
+
* See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
|
|
78
|
+
* and If-Match.
|
|
79
|
+
* `DELETE /api-keys/{api_key_id}`
|
|
54
80
|
*/
|
|
55
|
-
async revoke(apiKeyId, options) {
|
|
81
|
+
async revoke(apiKeyId, params, options) {
|
|
56
82
|
return this._core.request({
|
|
57
83
|
method: "DELETE",
|
|
58
|
-
path: `/
|
|
84
|
+
path: `/api-keys/${encodeURIComponent(String(apiKeyId))}`,
|
|
59
85
|
security: [{ "apiKey": [] }],
|
|
86
|
+
headers: {
|
|
87
|
+
"If-Match": params?.ifMatch === undefined ? undefined : String(params?.ifMatch),
|
|
88
|
+
},
|
|
60
89
|
errors: {
|
|
90
|
+
"400": BadRequestError,
|
|
61
91
|
"401": UnauthorizedError,
|
|
62
92
|
"403": ForbiddenError,
|
|
63
93
|
"404": NotFoundError,
|
|
94
|
+
"412": PreconditionFailedError,
|
|
64
95
|
"429": RateLimitedError,
|
|
96
|
+
"500": InternalServerError,
|
|
65
97
|
},
|
|
66
98
|
idempotent: true,
|
|
67
99
|
schemaKey: "apiKeys.revoke",
|
|
@@ -1,16 +1,15 @@
|
|
|
1
1
|
import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
|
|
2
2
|
import { PagePromise } from "../core/pagination.js";
|
|
3
|
-
import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadRequestError, ForbiddenError, NotFoundError, RateLimitedError, UnauthorizedError } from "../errors.js";
|
|
4
|
-
import type { DefinitionDocumentId, DefinitionId, DefinitionRevisionId, DefinitionRevisionRead, DefinitionRevisionResponseRead } from "../types.js";
|
|
3
|
+
import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadRequestError, ForbiddenError, InternalServerError, NotFoundError, RateLimitedError, UnauthorizedError } from "../errors.js";
|
|
4
|
+
import type { DefinitionDocumentId, DefinitionDocumentResponseRead, DefinitionId, DefinitionRevisionId, DefinitionRevisionRead, DefinitionRevisionResponseRead } from "../types.js";
|
|
5
5
|
export declare class DefinitionRevisionsResource {
|
|
6
6
|
private readonly _core;
|
|
7
7
|
constructor(_core: HttpCore);
|
|
8
8
|
/**
|
|
9
9
|
* List Definition Revisions
|
|
10
10
|
*
|
|
11
|
-
*
|
|
12
|
-
*
|
|
13
|
-
* list response.
|
|
11
|
+
* Lists the Definition's revisions, newest first. Source content is not included; retrieve the
|
|
12
|
+
* revision content or individual documents separately.
|
|
14
13
|
*
|
|
15
14
|
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
16
15
|
* `GET /definitions/{definition_id}/revisions`
|
|
@@ -19,40 +18,58 @@ export declare class DefinitionRevisionsResource {
|
|
|
19
18
|
/**
|
|
20
19
|
* Retrieve a Definition Revision
|
|
21
20
|
*
|
|
22
|
-
*
|
|
23
|
-
* source documents
|
|
24
|
-
* `GET /
|
|
21
|
+
* Returns metadata for a saved Definition Revision. Retrieve its resolved content or individual
|
|
22
|
+
* source documents separately.
|
|
23
|
+
* `GET /definition-revisions/{definition_revision_id}`
|
|
25
24
|
*/
|
|
26
25
|
retrieve(definitionRevisionId: DefinitionRevisionId, options?: RequestOptions): Promise<ApiResult<DefinitionRevisionResponseRead, DefinitionRevisionsRetrieveError>>;
|
|
27
26
|
/**
|
|
28
27
|
* Retrieve a Definition Revision's canonical content
|
|
29
28
|
*
|
|
30
|
-
* Returns the
|
|
31
|
-
*
|
|
32
|
-
* `GET /
|
|
29
|
+
* Returns the saved, resolved content for this revision. Save it locally or compare it with
|
|
30
|
+
* another revision.
|
|
31
|
+
* `GET /definition-revisions/{definition_revision_id}/content`
|
|
33
32
|
*/
|
|
34
33
|
retrieveContent(definitionRevisionId: DefinitionRevisionId, options?: RequestOptions): Promise<ApiResult<string, DefinitionRevisionsRetrieveContentError>>;
|
|
35
34
|
/**
|
|
36
35
|
* Retrieve one source document from a Definition Revision
|
|
37
|
-
* `GET /
|
|
36
|
+
* `GET /definition-revisions/{definition_revision_id}/documents/{document_id}/content`
|
|
38
37
|
*/
|
|
39
38
|
retrieveDocumentContent(definitionRevisionId: DefinitionRevisionId, documentId: DefinitionDocumentId, options?: RequestOptions): Promise<ApiResult<string, DefinitionRevisionsRetrieveDocumentContentError>>;
|
|
39
|
+
/**
|
|
40
|
+
* Retrieve a Definition Document
|
|
41
|
+
*
|
|
42
|
+
* Returns metadata for one source document captured in a Definition Revision. Retrieve its
|
|
43
|
+
* content through the revision's document content endpoint. A document in another organization
|
|
44
|
+
* returns 404 not_found.
|
|
45
|
+
* `GET /definition-documents/{definition_document_id}`
|
|
46
|
+
*/
|
|
47
|
+
retrieveDocument(definitionDocumentId: DefinitionDocumentId, options?: RequestOptions): Promise<ApiResult<DefinitionDocumentResponseRead, DefinitionRevisionsRetrieveDocumentError>>;
|
|
40
48
|
}
|
|
41
49
|
export interface DefinitionRevisionsListParams {
|
|
42
|
-
/**
|
|
50
|
+
/**
|
|
51
|
+
* Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
|
|
52
|
+
* representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
|
|
53
|
+
* invalid_request. List query parameters must appear only once; unrecognized parameters also
|
|
54
|
+
* return 400.
|
|
55
|
+
*/
|
|
43
56
|
limit?: number;
|
|
44
57
|
/**
|
|
45
58
|
* Opaque cursor from the preceding page's next_cursor. Valid only for the same account,
|
|
46
|
-
* operation, filters, and ordering that issued it.
|
|
59
|
+
* operation, filters, and ordering that issued it. Omit to start at the first page. Empty,
|
|
60
|
+
* malformed, or repeated cursors return 400 invalid_request. The page limit may change between
|
|
61
|
+
* requests.
|
|
47
62
|
*/
|
|
48
63
|
cursor?: string;
|
|
49
64
|
}
|
|
50
65
|
/** Every error `list` can produce, as a discriminated union. */
|
|
51
|
-
export type DefinitionRevisionsListError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
66
|
+
export type DefinitionRevisionsListError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
52
67
|
/** Every error `retrieve` can produce, as a discriminated union. */
|
|
53
|
-
export type DefinitionRevisionsRetrieveError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
68
|
+
export type DefinitionRevisionsRetrieveError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
54
69
|
/** Every error `retrieveContent` can produce, as a discriminated union. */
|
|
55
|
-
export type DefinitionRevisionsRetrieveContentError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
70
|
+
export type DefinitionRevisionsRetrieveContentError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
56
71
|
/** Every error `retrieveDocumentContent` can produce, as a discriminated union. */
|
|
57
|
-
export type DefinitionRevisionsRetrieveDocumentContentError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
72
|
+
export type DefinitionRevisionsRetrieveDocumentContentError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
73
|
+
/** Every error `retrieveDocument` can produce, as a discriminated union. */
|
|
74
|
+
export type DefinitionRevisionsRetrieveDocumentError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
58
75
|
//# sourceMappingURL=definition-revisions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definition-revisions.d.ts","sourceRoot":"","sources":["../../src/resources/definition-revisions.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,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACV,oBAAoB,
|
|
1
|
+
{"version":3,"file":"definition-revisions.d.ts","sourceRoot":"","sources":["../../src/resources/definition-revisions.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,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACV,oBAAoB,EAEpB,8BAA8B,EAC9B,YAAY,EAEZ,oBAAoB,EAGpB,sBAAsB,EAEtB,8BAA8B,EAC/B,MAAM,aAAa,CAAC;AAErB,qBAAa,2BAA2B;IAC1B,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;;;;OAQG;IACH,IAAI,CACF,YAAY,EAAE,YAAY,EAC1B,MAAM,CAAC,EAAE,6BAA6B,EACtC,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,sBAAsB,EAAE,4BAA4B,CAAC;IA8BpE;;;;;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nB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,mFAAmF;AACnF,MAAM,MAAM,+CAA+C,GACvD,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,4EAA4E;AAC5E,MAAM,MAAM,wCAAwC,GAChD,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// typeship — definitionRevisions resource.
|
|
2
|
-
// Generated by typeship — https://typeship.dev
|
|
2
|
+
// Generated by typeship — https://typeship.dev
|
|
3
3
|
import { paginate } from "../core/pagination.js";
|
|
4
|
-
import { BadRequestError, ForbiddenError, NotFoundError, RateLimitedError, UnauthorizedError, } from "../errors.js";
|
|
4
|
+
import { BadRequestError, ForbiddenError, InternalServerError, NotFoundError, RateLimitedError, UnauthorizedError, } from "../errors.js";
|
|
5
5
|
export class DefinitionRevisionsResource {
|
|
6
6
|
_core;
|
|
7
7
|
constructor(_core) {
|
|
@@ -10,9 +10,8 @@ export class DefinitionRevisionsResource {
|
|
|
10
10
|
/**
|
|
11
11
|
* List Definition Revisions
|
|
12
12
|
*
|
|
13
|
-
*
|
|
14
|
-
*
|
|
15
|
-
* list response.
|
|
13
|
+
* Lists the Definition's revisions, newest first. Source content is not included; retrieve the
|
|
14
|
+
* revision content or individual documents separately.
|
|
16
15
|
*
|
|
17
16
|
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
18
17
|
* `GET /definitions/{definition_id}/revisions`
|
|
@@ -32,6 +31,7 @@ export class DefinitionRevisionsResource {
|
|
|
32
31
|
"403": ForbiddenError,
|
|
33
32
|
"404": NotFoundError,
|
|
34
33
|
"429": RateLimitedError,
|
|
34
|
+
"500": InternalServerError,
|
|
35
35
|
},
|
|
36
36
|
idempotent: true,
|
|
37
37
|
schemaKey: "definitionRevisions.list",
|
|
@@ -48,20 +48,21 @@ export class DefinitionRevisionsResource {
|
|
|
48
48
|
/**
|
|
49
49
|
* Retrieve a Definition Revision
|
|
50
50
|
*
|
|
51
|
-
*
|
|
52
|
-
* source documents
|
|
53
|
-
* `GET /
|
|
51
|
+
* Returns metadata for a saved Definition Revision. Retrieve its resolved content or individual
|
|
52
|
+
* source documents separately.
|
|
53
|
+
* `GET /definition-revisions/{definition_revision_id}`
|
|
54
54
|
*/
|
|
55
55
|
async retrieve(definitionRevisionId, options) {
|
|
56
56
|
return this._core.request({
|
|
57
57
|
method: "GET",
|
|
58
|
-
path: `/
|
|
58
|
+
path: `/definition-revisions/${encodeURIComponent(String(definitionRevisionId))}`,
|
|
59
59
|
security: [{ "apiKey": [] }],
|
|
60
60
|
errors: {
|
|
61
61
|
"401": UnauthorizedError,
|
|
62
62
|
"403": ForbiddenError,
|
|
63
63
|
"404": NotFoundError,
|
|
64
64
|
"429": RateLimitedError,
|
|
65
|
+
"500": InternalServerError,
|
|
65
66
|
},
|
|
66
67
|
idempotent: true,
|
|
67
68
|
schemaKey: "definitionRevisions.retrieve",
|
|
@@ -71,20 +72,21 @@ export class DefinitionRevisionsResource {
|
|
|
71
72
|
/**
|
|
72
73
|
* Retrieve a Definition Revision's canonical content
|
|
73
74
|
*
|
|
74
|
-
* Returns the
|
|
75
|
-
*
|
|
76
|
-
* `GET /
|
|
75
|
+
* Returns the saved, resolved content for this revision. Save it locally or compare it with
|
|
76
|
+
* another revision.
|
|
77
|
+
* `GET /definition-revisions/{definition_revision_id}/content`
|
|
77
78
|
*/
|
|
78
79
|
async retrieveContent(definitionRevisionId, options) {
|
|
79
80
|
return this._core.request({
|
|
80
81
|
method: "GET",
|
|
81
|
-
path: `/
|
|
82
|
+
path: `/definition-revisions/${encodeURIComponent(String(definitionRevisionId))}/content`,
|
|
82
83
|
security: [{ "apiKey": [] }],
|
|
83
84
|
errors: {
|
|
84
85
|
"401": UnauthorizedError,
|
|
85
86
|
"403": ForbiddenError,
|
|
86
87
|
"404": NotFoundError,
|
|
87
88
|
"429": RateLimitedError,
|
|
89
|
+
"500": InternalServerError,
|
|
88
90
|
},
|
|
89
91
|
idempotent: true,
|
|
90
92
|
schemaKey: "definitionRevisions.retrieveContent",
|
|
@@ -93,22 +95,48 @@ export class DefinitionRevisionsResource {
|
|
|
93
95
|
}
|
|
94
96
|
/**
|
|
95
97
|
* Retrieve one source document from a Definition Revision
|
|
96
|
-
* `GET /
|
|
98
|
+
* `GET /definition-revisions/{definition_revision_id}/documents/{document_id}/content`
|
|
97
99
|
*/
|
|
98
100
|
async retrieveDocumentContent(definitionRevisionId, documentId, options) {
|
|
99
101
|
return this._core.request({
|
|
100
102
|
method: "GET",
|
|
101
|
-
path: `/
|
|
103
|
+
path: `/definition-revisions/${encodeURIComponent(String(definitionRevisionId))}/documents/${encodeURIComponent(String(documentId))}/content`,
|
|
102
104
|
security: [{ "apiKey": [] }],
|
|
103
105
|
errors: {
|
|
104
106
|
"401": UnauthorizedError,
|
|
105
107
|
"403": ForbiddenError,
|
|
106
108
|
"404": NotFoundError,
|
|
107
109
|
"429": RateLimitedError,
|
|
110
|
+
"500": InternalServerError,
|
|
108
111
|
},
|
|
109
112
|
idempotent: true,
|
|
110
113
|
schemaKey: "definitionRevisions.retrieveDocumentContent",
|
|
111
114
|
options,
|
|
112
115
|
});
|
|
113
116
|
}
|
|
117
|
+
/**
|
|
118
|
+
* Retrieve a Definition Document
|
|
119
|
+
*
|
|
120
|
+
* Returns metadata for one source document captured in a Definition Revision. Retrieve its
|
|
121
|
+
* content through the revision's document content endpoint. A document in another organization
|
|
122
|
+
* returns 404 not_found.
|
|
123
|
+
* `GET /definition-documents/{definition_document_id}`
|
|
124
|
+
*/
|
|
125
|
+
async retrieveDocument(definitionDocumentId, options) {
|
|
126
|
+
return this._core.request({
|
|
127
|
+
method: "GET",
|
|
128
|
+
path: `/definition-documents/${encodeURIComponent(String(definitionDocumentId))}`,
|
|
129
|
+
security: [{ "apiKey": [] }],
|
|
130
|
+
errors: {
|
|
131
|
+
"401": UnauthorizedError,
|
|
132
|
+
"403": ForbiddenError,
|
|
133
|
+
"404": NotFoundError,
|
|
134
|
+
"429": RateLimitedError,
|
|
135
|
+
"500": InternalServerError,
|
|
136
|
+
},
|
|
137
|
+
idempotent: true,
|
|
138
|
+
schemaKey: "definitionRevisions.retrieveDocument",
|
|
139
|
+
options,
|
|
140
|
+
});
|
|
141
|
+
}
|
|
114
142
|
}
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
|
|
2
|
-
import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadRequestError, ConflictError, ForbiddenError, NotFoundError, RateLimitedError, UnauthorizedError, UnprocessableEntityError } from "../errors.js";
|
|
2
|
+
import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadRequestError, ConflictError, ForbiddenError, InternalServerError, NotFoundError, PreconditionFailedError, RateLimitedError, UnauthorizedError, UnprocessableEntityError } from "../errors.js";
|
|
3
3
|
import type { DefinitionId, DefinitionRead, DefinitionUpdateRequest } from "../types.js";
|
|
4
4
|
export declare class DefinitionsResource {
|
|
5
5
|
private readonly _core;
|
|
@@ -12,7 +12,16 @@ export declare class DefinitionsResource {
|
|
|
12
12
|
/**
|
|
13
13
|
* Update and resolve a Definition
|
|
14
14
|
*
|
|
15
|
-
* Resolves the
|
|
15
|
+
* Resolves the source documents before saving the update and records a new Definition Revision
|
|
16
|
+
* when the source changes.
|
|
17
|
+
* Omitted fields remain unchanged; supplied objects and arrays replace the whole field.
|
|
18
|
+
* If the Definition or its Project configuration changes during validation, returns 409
|
|
19
|
+
* definition_changed without saving the rejected update. Retrieve the current Definition and
|
|
20
|
+
* Project, reconcile your changes,
|
|
21
|
+
* and submit a new request with a new Idempotency-Key if using one.
|
|
22
|
+
*
|
|
23
|
+
* See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
|
|
24
|
+
* and If-Match.
|
|
16
25
|
*
|
|
17
26
|
* A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
|
|
18
27
|
* `PATCH /definitions/{definition_id}`
|
|
@@ -20,16 +29,22 @@ export declare class DefinitionsResource {
|
|
|
20
29
|
update(definitionId: DefinitionId, body: DefinitionUpdateRequest, params?: DefinitionsUpdateParams, options?: RequestOptions): Promise<ApiResult<DefinitionRead, DefinitionsUpdateError>>;
|
|
21
30
|
}
|
|
22
31
|
/** Every error `retrieve` can produce, as a discriminated union. */
|
|
23
|
-
export type DefinitionsRetrieveError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
32
|
+
export type DefinitionsRetrieveError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
24
33
|
export interface DefinitionsUpdateParams {
|
|
34
|
+
/**
|
|
35
|
+
* ETag from a preceding response. The write applies only if the resource still has that version;
|
|
36
|
+
* otherwise it returns 412 precondition_failed without changes. Omit to write the current
|
|
37
|
+
* version. See https://typeship.dev/docs/typeship-api#conditional-writes.
|
|
38
|
+
*/
|
|
39
|
+
ifMatch?: string;
|
|
25
40
|
/**
|
|
26
41
|
* Identifies one logical write for 24 hours. The key is scoped to the authenticated account and
|
|
27
42
|
* operation; account-less generation uses a hashed network identity. Retrying the same method,
|
|
28
|
-
* path, query, and JSON body replays the original response. Reusing the key with
|
|
29
|
-
* returns 409. After expiry the key starts a new write.
|
|
43
|
+
* path, query, If-Match header, and JSON body replays the original response. Reusing the key with
|
|
44
|
+
* changed intent returns 409. After expiry the key starts a new write.
|
|
30
45
|
*/
|
|
31
46
|
idempotencyKey?: string;
|
|
32
47
|
}
|
|
33
48
|
/** Every error `update` can produce, as a discriminated union. */
|
|
34
|
-
export type DefinitionsUpdateError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | UnprocessableEntityError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
49
|
+
export type DefinitionsUpdateError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | PreconditionFailedError | UnprocessableEntityError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
35
50
|
//# sourceMappingURL=definitions.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/resources/definitions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,aAAa,EACb,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAEV,YAAY,EACZ,cAAc,EACd,uBAAuB,EACxB,MAAM,aAAa,CAAC;AAErB,qBAAa,mBAAmB;IAClB,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;OAGG;IACG,QAAQ,CACZ,YAAY,EAAE,YAAY,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,CAAC,cAAc,EAAE,wBAAwB,CAAC,CAAC;
|
|
1
|
+
{"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/resources/definitions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,aAAa,E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
-
// Generated by typeship — https://typeship.dev
|
|
3
|
-
import { BadRequestError, ConflictError, ForbiddenError, NotFoundError, RateLimitedError, UnauthorizedError, UnprocessableEntityError, } from "../errors.js";
|
|
2
|
+
// Generated by typeship — https://typeship.dev
|
|
3
|
+
import { BadRequestError, ConflictError, ForbiddenError, InternalServerError, NotFoundError, PreconditionFailedError, RateLimitedError, UnauthorizedError, UnprocessableEntityError, } from "../errors.js";
|
|
4
4
|
export class DefinitionsResource {
|
|
5
5
|
_core;
|
|
6
6
|
constructor(_core) {
|
|
@@ -20,6 +20,7 @@ export class DefinitionsResource {
|
|
|
20
20
|
"403": ForbiddenError,
|
|
21
21
|
"404": NotFoundError,
|
|
22
22
|
"429": RateLimitedError,
|
|
23
|
+
"500": InternalServerError,
|
|
23
24
|
},
|
|
24
25
|
idempotent: true,
|
|
25
26
|
schemaKey: "definitions.retrieve",
|
|
@@ -29,7 +30,16 @@ export class DefinitionsResource {
|
|
|
29
30
|
/**
|
|
30
31
|
* Update and resolve a Definition
|
|
31
32
|
*
|
|
32
|
-
* Resolves the
|
|
33
|
+
* Resolves the source documents before saving the update and records a new Definition Revision
|
|
34
|
+
* when the source changes.
|
|
35
|
+
* Omitted fields remain unchanged; supplied objects and arrays replace the whole field.
|
|
36
|
+
* If the Definition or its Project configuration changes during validation, returns 409
|
|
37
|
+
* definition_changed without saving the rejected update. Retrieve the current Definition and
|
|
38
|
+
* Project, reconcile your changes,
|
|
39
|
+
* and submit a new request with a new Idempotency-Key if using one.
|
|
40
|
+
*
|
|
41
|
+
* See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
|
|
42
|
+
* and If-Match.
|
|
33
43
|
*
|
|
34
44
|
* A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
|
|
35
45
|
* `PATCH /definitions/{definition_id}`
|
|
@@ -40,6 +50,7 @@ export class DefinitionsResource {
|
|
|
40
50
|
path: `/definitions/${encodeURIComponent(String(definitionId))}`,
|
|
41
51
|
security: [{ "apiKey": [] }],
|
|
42
52
|
headers: {
|
|
53
|
+
"If-Match": params?.ifMatch === undefined ? undefined : String(params?.ifMatch),
|
|
43
54
|
"Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
|
|
44
55
|
},
|
|
45
56
|
body,
|
|
@@ -49,8 +60,10 @@ export class DefinitionsResource {
|
|
|
49
60
|
"403": ForbiddenError,
|
|
50
61
|
"404": NotFoundError,
|
|
51
62
|
"409": ConflictError,
|
|
63
|
+
"412": PreconditionFailedError,
|
|
52
64
|
"422": UnprocessableEntityError,
|
|
53
65
|
"429": RateLimitedError,
|
|
66
|
+
"500": InternalServerError,
|
|
54
67
|
},
|
|
55
68
|
idempotencyKey: "Idempotency-Key",
|
|
56
69
|
schemaKey: "definitions.update",
|