@typeship-ax/cli 0.20.0 → 0.21.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 +3 -3
- package/README.md +2 -2
- package/api.json +7355 -6233
- package/api.md +332 -398
- package/dist/api-identity.d.ts.map +1 -1
- package/dist/api-identity.js +6 -1
- package/dist/cli.js +15 -15
- package/dist/core/http.d.ts +26 -14
- package/dist/core/http.d.ts.map +1 -1
- package/dist/core/http.js +90 -19
- package/dist/core/pagination.d.ts +8 -8
- package/dist/core/pagination.d.ts.map +1 -1
- package/dist/core/pagination.js +7 -16
- package/dist/errors.d.ts +4 -4
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +7 -7
- package/dist/index.d.ts +33 -19
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +37 -17
- package/dist/ops.d.ts +1 -1
- package/dist/ops.d.ts.map +1 -1
- package/dist/ops.js +39 -42
- package/dist/resources/api-keys.d.ts +10 -10
- package/dist/resources/api-keys.d.ts.map +1 -1
- package/dist/resources/api-keys.js +6 -6
- package/dist/resources/deliveries.d.ts +46 -0
- package/dist/resources/deliveries.d.ts.map +1 -0
- package/dist/resources/deliveries.js +70 -0
- package/dist/resources/drafts.d.ts +155 -0
- package/dist/resources/drafts.d.ts.map +1 -0
- package/dist/resources/drafts.js +230 -0
- package/dist/resources/files.d.ts +23 -0
- package/dist/resources/files.d.ts.map +1 -0
- package/dist/resources/files.js +38 -0
- package/dist/resources/generate.d.ts +14 -14
- package/dist/resources/generate.d.ts.map +1 -1
- package/dist/resources/generate.js +7 -7
- package/dist/resources/generations.d.ts +65 -21
- package/dist/resources/generations.d.ts.map +1 -1
- package/dist/resources/generations.js +67 -20
- package/dist/resources/organization.d.ts +18 -0
- package/dist/resources/organization.d.ts.map +1 -0
- package/dist/resources/{account.js → organization.js} +10 -10
- package/dist/resources/projects.d.ts +36 -126
- package/dist/resources/projects.d.ts.map +1 -1
- package/dist/resources/projects.js +21 -171
- package/dist/resources/publications.d.ts +46 -0
- package/dist/resources/publications.d.ts.map +1 -0
- package/dist/resources/publications.js +70 -0
- package/dist/resources/releases.d.ts +66 -0
- package/dist/resources/releases.d.ts.map +1 -0
- package/dist/resources/releases.js +101 -0
- package/dist/resources/spec-revisions.d.ts +85 -0
- package/dist/resources/spec-revisions.d.ts.map +1 -0
- package/dist/resources/spec-revisions.js +116 -0
- package/dist/resources/specs.d.ts +72 -0
- package/dist/resources/specs.d.ts.map +1 -0
- package/dist/resources/specs.js +107 -0
- package/dist/resources/targets.d.ts +42 -262
- package/dist/resources/targets.d.ts.map +1 -1
- package/dist/resources/targets.js +28 -407
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +149 -154
- package/dist/types.d.ts +1281 -1611
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +44 -49
- package/package.json +1 -1
- package/src/api-identity.ts +6 -2
- package/src/cli.ts +16 -16
- package/src/core/http.ts +89 -24
- package/src/core/pagination.ts +13 -23
- package/src/errors.ts +7 -7
- package/src/index.ts +41 -23
- package/src/ops.ts +40 -43
- package/src/resources/api-keys.ts +13 -16
- package/src/resources/deliveries.ts +139 -0
- package/src/resources/drafts.ts +422 -0
- package/src/resources/files.ts +68 -0
- package/src/resources/generate.ts +16 -19
- package/src/resources/generations.ts +146 -35
- package/src/resources/{account.ts → organization.ts} +14 -14
- package/src/resources/projects.ts +42 -337
- package/src/resources/publications.ts +139 -0
- package/src/resources/releases.ts +199 -0
- package/src/resources/spec-revisions.ts +237 -0
- package/src/resources/specs.ts +200 -0
- package/src/resources/targets.ts +57 -760
- package/src/schemas.ts +149 -154
- package/src/types.ts +1357 -1692
- package/dist/resources/account.d.ts +0 -18
- package/dist/resources/account.d.ts.map +0 -1
- package/dist/resources/definition-revisions.d.ts +0 -75
- package/dist/resources/definition-revisions.d.ts.map +0 -1
- package/dist/resources/definition-revisions.js +0 -142
- package/dist/resources/definitions.d.ts +0 -50
- package/dist/resources/definitions.d.ts.map +0 -1
- package/dist/resources/definitions.js +0 -73
- package/src/resources/definition-revisions.ts +0 -265
- package/src/resources/definitions.ts +0 -146
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { HttpCore, type
|
|
1
|
+
import { HttpCore, type RequestOptions } from "../core/http.js";
|
|
2
2
|
import { PagePromise } from "../core/pagination.js";
|
|
3
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";
|
|
@@ -16,24 +16,24 @@ export declare class ApiKeysResource {
|
|
|
16
16
|
*/
|
|
17
17
|
list(params?: ApiKeysListParams, options?: RequestOptions): PagePromise<ApiKeyRead, ApiKeysListError>;
|
|
18
18
|
/**
|
|
19
|
-
*
|
|
19
|
+
* Get an API key
|
|
20
20
|
*
|
|
21
21
|
* Returns the key summary and its ETag for conditional revocation.
|
|
22
22
|
* `GET /api-keys/{api_key_id}`
|
|
23
23
|
*/
|
|
24
|
-
|
|
24
|
+
get(apiKeyId: string, options?: RequestOptions): Promise<ApiKeyResponseRead>;
|
|
25
25
|
/**
|
|
26
26
|
* Revoke an API key
|
|
27
27
|
*
|
|
28
28
|
* Revokes a key. Repeating the request returns the same result.
|
|
29
29
|
*
|
|
30
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
|
|
31
|
+
* Organization API keys can revoke any key in their organization.
|
|
32
32
|
* See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
|
|
33
33
|
* and If-Match.
|
|
34
34
|
* `DELETE /api-keys/{api_key_id}`
|
|
35
35
|
*/
|
|
36
|
-
revoke(apiKeyId: string, params?: ApiKeysRevokeParams, options?: RequestOptions): Promise<
|
|
36
|
+
revoke(apiKeyId: string, params?: ApiKeysRevokeParams, options?: RequestOptions): Promise<ApiKeyResponseRead>;
|
|
37
37
|
}
|
|
38
38
|
export interface ApiKeysListParams {
|
|
39
39
|
/**
|
|
@@ -44,17 +44,17 @@ export interface ApiKeysListParams {
|
|
|
44
44
|
*/
|
|
45
45
|
limit?: number;
|
|
46
46
|
/**
|
|
47
|
-
* Opaque cursor from the preceding page's next_cursor. Valid only for the same
|
|
47
|
+
* Opaque cursor from the preceding page's next_cursor. Valid only for the same organization,
|
|
48
48
|
* operation, filters, and ordering that issued it. Omit to start at the first page. Empty,
|
|
49
49
|
* malformed, or repeated cursors return 400 invalid_request. The page limit may change between
|
|
50
50
|
* requests.
|
|
51
51
|
*/
|
|
52
52
|
cursor?: string;
|
|
53
53
|
}
|
|
54
|
-
/**
|
|
54
|
+
/** Typed errors `list` can throw. */
|
|
55
55
|
export type ApiKeysListError = BadRequestError | UnauthorizedError | ForbiddenError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
56
|
-
/**
|
|
57
|
-
export type
|
|
56
|
+
/** Typed errors `get` can throw. */
|
|
57
|
+
export type ApiKeysGetError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
58
58
|
export interface ApiKeysRevokeParams {
|
|
59
59
|
/**
|
|
60
60
|
* ETag from a preceding response. The write applies only if the resource still has that version;
|
|
@@ -63,6 +63,6 @@ export interface ApiKeysRevokeParams {
|
|
|
63
63
|
*/
|
|
64
64
|
ifMatch?: string;
|
|
65
65
|
}
|
|
66
|
-
/**
|
|
66
|
+
/** Typed errors `revoke` can throw. */
|
|
67
67
|
export type ApiKeysRevokeError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | PreconditionFailedError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
68
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,
|
|
1
|
+
{"version":3,"file":"api-keys.d.ts","sourceRoot":"","sources":["../../src/resources/api-keys.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChE,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,uBAAuB,EACvB,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,EAAE,cAAc,GAAG,WAAW,CAAC,UAAU,EAAE,gBAAgB,CAAC;IA6BrG;;;;;OAKG;IACG,GAAG,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,kBAAkB,CAAC;IAkBlF;;;;;;;;;;OAUG;IACG,MAAM,CACV,QAAQ,EAAE,MAAM,EAChB,MAAM,CAAC,EAAE,mBAAmB,EAC5B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,kBAAkB,CAAC;CAsB/B;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,qCAAqC;AACrC,MAAM,MAAM,gBAAgB,GACxB,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,oCAAoC;AACpC,MAAM,MAAM,eAAe,GACvB,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,uCAAuC;AACvC,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"}
|
|
@@ -45,13 +45,13 @@ export class ApiKeysResource {
|
|
|
45
45
|
});
|
|
46
46
|
}
|
|
47
47
|
/**
|
|
48
|
-
*
|
|
48
|
+
* Get an API key
|
|
49
49
|
*
|
|
50
50
|
* Returns the key summary and its ETag for conditional revocation.
|
|
51
51
|
* `GET /api-keys/{api_key_id}`
|
|
52
52
|
*/
|
|
53
|
-
async
|
|
54
|
-
return this._core.
|
|
53
|
+
async get(apiKeyId, options) {
|
|
54
|
+
return this._core.requestData({
|
|
55
55
|
method: "GET",
|
|
56
56
|
path: `/api-keys/${encodeURIComponent(String(apiKeyId))}`,
|
|
57
57
|
security: [{ "apiKey": [] }],
|
|
@@ -63,7 +63,7 @@ export class ApiKeysResource {
|
|
|
63
63
|
"500": InternalServerError,
|
|
64
64
|
},
|
|
65
65
|
idempotent: true,
|
|
66
|
-
schemaKey: "apiKeys.
|
|
66
|
+
schemaKey: "apiKeys.get",
|
|
67
67
|
options,
|
|
68
68
|
});
|
|
69
69
|
}
|
|
@@ -73,13 +73,13 @@ export class ApiKeysResource {
|
|
|
73
73
|
* Revokes a key. Repeating the request returns the same result.
|
|
74
74
|
*
|
|
75
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
|
|
76
|
+
* Organization API keys can revoke any key in their organization.
|
|
77
77
|
* See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
|
|
78
78
|
* and If-Match.
|
|
79
79
|
* `DELETE /api-keys/{api_key_id}`
|
|
80
80
|
*/
|
|
81
81
|
async revoke(apiKeyId, params, options) {
|
|
82
|
-
return this._core.
|
|
82
|
+
return this._core.requestData({
|
|
83
83
|
method: "DELETE",
|
|
84
84
|
path: `/api-keys/${encodeURIComponent(String(apiKeyId))}`,
|
|
85
85
|
security: [{ "apiKey": [] }],
|
|
@@ -0,0 +1,46 @@
|
|
|
1
|
+
import { HttpCore, type RequestOptions } from "../core/http.js";
|
|
2
|
+
import { PagePromise } from "../core/pagination.js";
|
|
3
|
+
import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadRequestError, ForbiddenError, InternalServerError, NotFoundError, RateLimitedError, UnauthorizedError } from "../errors.js";
|
|
4
|
+
import type { DeliveryId, DeliveryRead, DeliveryResponseRead, TargetId } from "../types.js";
|
|
5
|
+
export declare class DeliveriesResource {
|
|
6
|
+
private readonly _core;
|
|
7
|
+
constructor(_core: HttpCore);
|
|
8
|
+
/**
|
|
9
|
+
* List Deliveries
|
|
10
|
+
*
|
|
11
|
+
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
12
|
+
* `GET /deliveries`
|
|
13
|
+
*/
|
|
14
|
+
list(params?: DeliveriesListParams, options?: RequestOptions): PagePromise<DeliveryRead, DeliveriesListError>;
|
|
15
|
+
/**
|
|
16
|
+
* Get a Delivery
|
|
17
|
+
*
|
|
18
|
+
* Returns the configured repository or hosted MCP Delivery for a Target. A Delivery in another
|
|
19
|
+
* organization returns 404 not_found.
|
|
20
|
+
* `GET /deliveries/{delivery_id}`
|
|
21
|
+
*/
|
|
22
|
+
get(deliveryId: DeliveryId, options?: RequestOptions): Promise<DeliveryResponseRead>;
|
|
23
|
+
}
|
|
24
|
+
export interface DeliveriesListParams {
|
|
25
|
+
/**
|
|
26
|
+
* Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
|
|
27
|
+
* representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
|
|
28
|
+
* invalid_request. List query parameters must appear only once; unrecognized parameters also
|
|
29
|
+
* return 400.
|
|
30
|
+
*/
|
|
31
|
+
limit?: number;
|
|
32
|
+
/**
|
|
33
|
+
* Opaque cursor from the preceding page's next_cursor. Valid only for the same organization,
|
|
34
|
+
* operation, filters, and ordering that issued it. Omit to start at the first page. Empty,
|
|
35
|
+
* malformed, or repeated cursors return 400 invalid_request. The page limit may change between
|
|
36
|
+
* requests.
|
|
37
|
+
*/
|
|
38
|
+
cursor?: string;
|
|
39
|
+
/** Only Deliveries of this Target. */
|
|
40
|
+
targetId?: TargetId;
|
|
41
|
+
}
|
|
42
|
+
/** Typed errors `list` can throw. */
|
|
43
|
+
export type DeliveriesListError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
44
|
+
/** Typed errors `get` can throw. */
|
|
45
|
+
export type DeliveriesGetError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
46
|
+
//# sourceMappingURL=deliveries.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"deliveries.d.ts","sourceRoot":"","sources":["../../src/resources/deliveries.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChE,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,EAEV,UAAU,EAGV,YAAY,EAEZ,oBAAoB,EACpB,QAAQ,EACT,MAAM,aAAa,CAAC;AAErB,qBAAa,kBAAkB;IACjB,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;OAKG;IACH,IAAI,CACF,MAAM,CAAC,EAAE,oBAAoB,EAC7B,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,YAAY,EAAE,mBAAmB,CAAC;IA+BjD;;;;;;OAMG;IACG,GAAG,CAAC,UAAU,EAAE,UAAU,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,oBAAoB,CAAC;CAiB3F;AAED,MAAM,WAAW,oBAAoB;IACnC;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;OAKG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,sCAAsC;IACtC,QAAQ,CAAC,EAAE,QAAQ,CAAC;CACrB;AAED,qCAAqC;AACrC,MAAM,MAAM,mBAAmB,GAC3B,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,oCAAoC;AACpC,MAAM,MAAM,kBAAkB,GAC1B,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
// typeship — deliveries resource.
|
|
2
|
+
// Generated by typeship — https://typeship.dev
|
|
3
|
+
import { paginate } from "../core/pagination.js";
|
|
4
|
+
import { BadRequestError, ForbiddenError, InternalServerError, NotFoundError, RateLimitedError, UnauthorizedError, } from "../errors.js";
|
|
5
|
+
export class DeliveriesResource {
|
|
6
|
+
_core;
|
|
7
|
+
constructor(_core) {
|
|
8
|
+
this._core = _core;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* List Deliveries
|
|
12
|
+
*
|
|
13
|
+
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
14
|
+
* `GET /deliveries`
|
|
15
|
+
*/
|
|
16
|
+
list(params, options) {
|
|
17
|
+
return paginate(this._core, {
|
|
18
|
+
method: "GET",
|
|
19
|
+
path: "/deliveries",
|
|
20
|
+
security: [{ "apiKey": [] }],
|
|
21
|
+
query: {
|
|
22
|
+
limit: params?.limit,
|
|
23
|
+
cursor: params?.cursor,
|
|
24
|
+
target_id: params?.targetId,
|
|
25
|
+
},
|
|
26
|
+
errors: {
|
|
27
|
+
"400": BadRequestError,
|
|
28
|
+
"401": UnauthorizedError,
|
|
29
|
+
"403": ForbiddenError,
|
|
30
|
+
"404": NotFoundError,
|
|
31
|
+
"429": RateLimitedError,
|
|
32
|
+
"500": InternalServerError,
|
|
33
|
+
},
|
|
34
|
+
idempotent: true,
|
|
35
|
+
schemaKey: "deliveries.list",
|
|
36
|
+
options,
|
|
37
|
+
}, {
|
|
38
|
+
style: "cursor",
|
|
39
|
+
itemsField: "data",
|
|
40
|
+
cursorParam: "cursor",
|
|
41
|
+
nextCursorField: "next_cursor",
|
|
42
|
+
hasMoreField: "has_more",
|
|
43
|
+
limitParam: "limit",
|
|
44
|
+
});
|
|
45
|
+
}
|
|
46
|
+
/**
|
|
47
|
+
* Get a Delivery
|
|
48
|
+
*
|
|
49
|
+
* Returns the configured repository or hosted MCP Delivery for a Target. A Delivery in another
|
|
50
|
+
* organization returns 404 not_found.
|
|
51
|
+
* `GET /deliveries/{delivery_id}`
|
|
52
|
+
*/
|
|
53
|
+
async get(deliveryId, options) {
|
|
54
|
+
return this._core.requestData({
|
|
55
|
+
method: "GET",
|
|
56
|
+
path: `/deliveries/${encodeURIComponent(String(deliveryId))}`,
|
|
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: "deliveries.get",
|
|
67
|
+
options,
|
|
68
|
+
});
|
|
69
|
+
}
|
|
70
|
+
}
|
|
@@ -0,0 +1,155 @@
|
|
|
1
|
+
import { HttpCore, type RequestOptions } from "../core/http.js";
|
|
2
|
+
import { PagePromise } from "../core/pagination.js";
|
|
3
|
+
import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadGatewayError, BadRequestError, ConflictError, ForbiddenError, InternalServerError, NotFoundError, PreconditionFailedError, RateLimitedError, UnauthorizedError, UnprocessableEntityError } from "../errors.js";
|
|
4
|
+
import type { DraftFileRead, DraftId, DraftRead, DraftRecoverRequest, DraftResolveRequest, DraftResponseRead, DraftStatus, DraftUpdateRequest, TargetId } from "../types.js";
|
|
5
|
+
export declare class DraftsResource {
|
|
6
|
+
private readonly _core;
|
|
7
|
+
constructor(_core: HttpCore);
|
|
8
|
+
/**
|
|
9
|
+
* List Drafts
|
|
10
|
+
*
|
|
11
|
+
* Lists open and merged Drafts, newest first. Each Target has one open Draft; each merge adds a
|
|
12
|
+
* merged Draft.
|
|
13
|
+
*
|
|
14
|
+
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
15
|
+
* `GET /drafts`
|
|
16
|
+
*/
|
|
17
|
+
list(params?: DraftsListParams, options?: RequestOptions): PagePromise<DraftRead, DraftsListError>;
|
|
18
|
+
/**
|
|
19
|
+
* Get a Draft
|
|
20
|
+
*
|
|
21
|
+
* Returns the Draft's status. An open Draft also reports its typed reason when action is
|
|
22
|
+
* required, next version and its source, readiness, checks, and conflict counts. The response
|
|
23
|
+
* carries an `ETag`; send it in `If-Match` when updating the Draft to avoid changing a newer
|
|
24
|
+
* version selection.
|
|
25
|
+
* `GET /drafts/{draft_id}`
|
|
26
|
+
*/
|
|
27
|
+
get(draftId: DraftId, options?: RequestOptions): Promise<DraftResponseRead>;
|
|
28
|
+
/**
|
|
29
|
+
* Select an exact Draft version or return to automatic versioning
|
|
30
|
+
*
|
|
31
|
+
* Checks your version choice against the required version bump, then regenerates the existing
|
|
32
|
+
* Draft pull request.
|
|
33
|
+
*
|
|
34
|
+
* Send the Draft's `ETag` in `If-Match` to reject an intervening change with 412
|
|
35
|
+
* precondition_failed before saving or regenerating. Omitting `If-Match` applies the selection to
|
|
36
|
+
* the current Draft. version_next is required; null restores automatic selection.
|
|
37
|
+
*
|
|
38
|
+
* A `502` response means the selected version was saved, but regeneration failed. Follow the
|
|
39
|
+
* error's retryable and suggested_action fields. Repeating an unfinished selection resumes
|
|
40
|
+
* generation; repeating a completed selection starts no new work. If using If-Match, retrieve the
|
|
41
|
+
* Draft and confirm the saved selection before retrying with its current ETag.
|
|
42
|
+
* A `409 draft_merged` means the Draft merged; retrieve the Target and select a version on its
|
|
43
|
+
* `draft_id`. A `409 target_busy` means the Target is publishing; wait and retry. A `409
|
|
44
|
+
* version_occupied` means the version is already released; retrieve the Draft and releases,
|
|
45
|
+
* choose a new version, and retry.
|
|
46
|
+
* See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
|
|
47
|
+
* and If-Match.
|
|
48
|
+
* `PATCH /drafts/{draft_id}`
|
|
49
|
+
*/
|
|
50
|
+
update(draftId: DraftId, body: DraftUpdateRequest, params?: DraftsUpdateParams, options?: RequestOptions): Promise<DraftResponseRead>;
|
|
51
|
+
/**
|
|
52
|
+
* List customized and conflicted files on a Draft
|
|
53
|
+
*
|
|
54
|
+
* Lists the Draft's files that differ from the last merged package or need a conflict decision,
|
|
55
|
+
* ordered by path, without file content. Each conflict names its kind, the saved decision, and
|
|
56
|
+
* the sides you can read with getFile. With `filter=history`, lists files affected by a
|
|
57
|
+
* default-branch history rewrite; the list is empty when none is pending.
|
|
58
|
+
*
|
|
59
|
+
* Returns `409 resource_changed` while Typeship is carrying the Draft's latest commit forward
|
|
60
|
+
* (status working), or when the Draft changes between pages.
|
|
61
|
+
*
|
|
62
|
+
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
63
|
+
* `GET /drafts/{draft_id}/files`
|
|
64
|
+
*/
|
|
65
|
+
listFiles(draftId: DraftId, params?: DraftsListFilesParams, options?: RequestOptions): PagePromise<DraftFileRead, DraftsListFilesError>;
|
|
66
|
+
/**
|
|
67
|
+
* Resolve selected Draft files
|
|
68
|
+
*
|
|
69
|
+
* Resolves conflicts on the Draft's head_sha: keep yours or generated, or supply final content as
|
|
70
|
+
* text or, for binary files, base64. Choosing generated for a customized path replaces it with
|
|
71
|
+
* the generated file, or deletes a Draft-only file.
|
|
72
|
+
*
|
|
73
|
+
* Conflict decisions are saved together and can be replaced until applied. Choosing generated for
|
|
74
|
+
* customized paths commits those changes together on the Draft branch. Returns the Draft. When
|
|
75
|
+
* every conflict has a decision, `conflicts.decided` equals `conflicts.total` and Typeship
|
|
76
|
+
* continues the Draft and runs checks. Paths that already match the Draft change nothing.
|
|
77
|
+
* `POST /drafts/{draft_id}/resolve`
|
|
78
|
+
*/
|
|
79
|
+
resolve(draftId: DraftId, body: DraftResolveRequest, options?: RequestOptions): Promise<DraftResponseRead>;
|
|
80
|
+
/**
|
|
81
|
+
* Approve recovery from rewritten default-branch history
|
|
82
|
+
*
|
|
83
|
+
* When the Draft has status `action_required` and reason `history_rewritten`, review affected
|
|
84
|
+
* files with `listDraftFiles` and `filter=history`, then approve with the Draft's
|
|
85
|
+
* `history_recovery` revisions. Approval saves the recovery without changing Git and returns the
|
|
86
|
+
* Draft; the next generation rebuilds it from the rewritten default branch. The previous Draft
|
|
87
|
+
* branch stays available, and overlapping code comes back as conflicts to resolve. A rewritten
|
|
88
|
+
* Draft branch alone needs no approval.
|
|
89
|
+
* `POST /drafts/{draft_id}/recover`
|
|
90
|
+
*/
|
|
91
|
+
recover(draftId: DraftId, body: DraftRecoverRequest, options?: RequestOptions): Promise<DraftResponseRead>;
|
|
92
|
+
}
|
|
93
|
+
export interface DraftsListParams {
|
|
94
|
+
/**
|
|
95
|
+
* Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
|
|
96
|
+
* representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
|
|
97
|
+
* invalid_request. List query parameters must appear only once; unrecognized parameters also
|
|
98
|
+
* return 400.
|
|
99
|
+
*/
|
|
100
|
+
limit?: number;
|
|
101
|
+
/**
|
|
102
|
+
* Opaque cursor from the preceding page's next_cursor. Valid only for the same organization,
|
|
103
|
+
* operation, filters, and ordering that issued it. Omit to start at the first page. Empty,
|
|
104
|
+
* malformed, or repeated cursors return 400 invalid_request. The page limit may change between
|
|
105
|
+
* requests.
|
|
106
|
+
*/
|
|
107
|
+
cursor?: string;
|
|
108
|
+
/** Only Drafts of this Target. */
|
|
109
|
+
targetId?: TargetId;
|
|
110
|
+
/** Only Drafts with this status. */
|
|
111
|
+
status?: DraftStatus;
|
|
112
|
+
}
|
|
113
|
+
/** Typed errors `list` can throw. */
|
|
114
|
+
export type DraftsListError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
115
|
+
/** Typed errors `get` can throw. */
|
|
116
|
+
export type DraftsGetError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
117
|
+
export interface DraftsUpdateParams {
|
|
118
|
+
/**
|
|
119
|
+
* ETag from a preceding response. The write applies only if the resource still has that version;
|
|
120
|
+
* otherwise it returns 412 precondition_failed without changes. Omit to write the current
|
|
121
|
+
* version. See https://typeship.dev/docs/typeship-api#conditional-writes.
|
|
122
|
+
*/
|
|
123
|
+
ifMatch?: string;
|
|
124
|
+
}
|
|
125
|
+
/** Typed errors `update` can throw. */
|
|
126
|
+
export type DraftsUpdateError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | PreconditionFailedError | UnprocessableEntityError | RateLimitedError | InternalServerError | BadGatewayError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
127
|
+
export interface DraftsListFilesParams {
|
|
128
|
+
/**
|
|
129
|
+
* conflicted: conflicts only. customized: files that differ from the last merged package.
|
|
130
|
+
* history: files affected by a default-branch history rewrite. Omit for conflicted and customized
|
|
131
|
+
* files.
|
|
132
|
+
*/
|
|
133
|
+
filter?: "conflicted" | "customized" | "history";
|
|
134
|
+
/**
|
|
135
|
+
* Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
|
|
136
|
+
* representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
|
|
137
|
+
* invalid_request. List query parameters must appear only once; unrecognized parameters also
|
|
138
|
+
* return 400.
|
|
139
|
+
*/
|
|
140
|
+
limit?: number;
|
|
141
|
+
/**
|
|
142
|
+
* Opaque cursor from the preceding page's next_cursor. Valid only for the same organization,
|
|
143
|
+
* operation, filters, and ordering that issued it. Omit to start at the first page. Empty,
|
|
144
|
+
* malformed, or repeated cursors return 400 invalid_request. The page limit may change between
|
|
145
|
+
* requests.
|
|
146
|
+
*/
|
|
147
|
+
cursor?: string;
|
|
148
|
+
}
|
|
149
|
+
/** Typed errors `listFiles` can throw. */
|
|
150
|
+
export type DraftsListFilesError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
151
|
+
/** Typed errors `resolve` can throw. */
|
|
152
|
+
export type DraftsResolveError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
153
|
+
/** Typed errors `recover` can throw. */
|
|
154
|
+
export type DraftsRecoverError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
155
|
+
//# sourceMappingURL=drafts.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"drafts.d.ts","sourceRoot":"","sources":["../../src/resources/drafts.ts"],"names":[],"mappings":"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"}
|
|
@@ -0,0 +1,230 @@
|
|
|
1
|
+
// typeship — drafts resource.
|
|
2
|
+
// Generated by typeship — https://typeship.dev
|
|
3
|
+
import { paginate } from "../core/pagination.js";
|
|
4
|
+
import { BadGatewayError, BadRequestError, ConflictError, ForbiddenError, InternalServerError, NotFoundError, PreconditionFailedError, RateLimitedError, UnauthorizedError, UnprocessableEntityError, } from "../errors.js";
|
|
5
|
+
export class DraftsResource {
|
|
6
|
+
_core;
|
|
7
|
+
constructor(_core) {
|
|
8
|
+
this._core = _core;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* List Drafts
|
|
12
|
+
*
|
|
13
|
+
* Lists open and merged Drafts, newest first. Each Target has one open Draft; each merge adds a
|
|
14
|
+
* merged Draft.
|
|
15
|
+
*
|
|
16
|
+
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
17
|
+
* `GET /drafts`
|
|
18
|
+
*/
|
|
19
|
+
list(params, options) {
|
|
20
|
+
return paginate(this._core, {
|
|
21
|
+
method: "GET",
|
|
22
|
+
path: "/drafts",
|
|
23
|
+
security: [{ "apiKey": [] }],
|
|
24
|
+
query: {
|
|
25
|
+
limit: params?.limit,
|
|
26
|
+
cursor: params?.cursor,
|
|
27
|
+
target_id: params?.targetId,
|
|
28
|
+
status: params?.status,
|
|
29
|
+
},
|
|
30
|
+
errors: {
|
|
31
|
+
"400": BadRequestError,
|
|
32
|
+
"401": UnauthorizedError,
|
|
33
|
+
"403": ForbiddenError,
|
|
34
|
+
"404": NotFoundError,
|
|
35
|
+
"429": RateLimitedError,
|
|
36
|
+
"500": InternalServerError,
|
|
37
|
+
},
|
|
38
|
+
idempotent: true,
|
|
39
|
+
schemaKey: "drafts.list",
|
|
40
|
+
options,
|
|
41
|
+
}, {
|
|
42
|
+
style: "cursor",
|
|
43
|
+
itemsField: "data",
|
|
44
|
+
cursorParam: "cursor",
|
|
45
|
+
nextCursorField: "next_cursor",
|
|
46
|
+
hasMoreField: "has_more",
|
|
47
|
+
limitParam: "limit",
|
|
48
|
+
});
|
|
49
|
+
}
|
|
50
|
+
/**
|
|
51
|
+
* Get a Draft
|
|
52
|
+
*
|
|
53
|
+
* Returns the Draft's status. An open Draft also reports its typed reason when action is
|
|
54
|
+
* required, next version and its source, readiness, checks, and conflict counts. The response
|
|
55
|
+
* carries an `ETag`; send it in `If-Match` when updating the Draft to avoid changing a newer
|
|
56
|
+
* version selection.
|
|
57
|
+
* `GET /drafts/{draft_id}`
|
|
58
|
+
*/
|
|
59
|
+
async get(draftId, options) {
|
|
60
|
+
return this._core.requestData({
|
|
61
|
+
method: "GET",
|
|
62
|
+
path: `/drafts/${encodeURIComponent(String(draftId))}`,
|
|
63
|
+
security: [{ "apiKey": [] }],
|
|
64
|
+
errors: {
|
|
65
|
+
"401": UnauthorizedError,
|
|
66
|
+
"403": ForbiddenError,
|
|
67
|
+
"404": NotFoundError,
|
|
68
|
+
"429": RateLimitedError,
|
|
69
|
+
"500": InternalServerError,
|
|
70
|
+
},
|
|
71
|
+
idempotent: true,
|
|
72
|
+
schemaKey: "drafts.get",
|
|
73
|
+
options,
|
|
74
|
+
});
|
|
75
|
+
}
|
|
76
|
+
/**
|
|
77
|
+
* Select an exact Draft version or return to automatic versioning
|
|
78
|
+
*
|
|
79
|
+
* Checks your version choice against the required version bump, then regenerates the existing
|
|
80
|
+
* Draft pull request.
|
|
81
|
+
*
|
|
82
|
+
* Send the Draft's `ETag` in `If-Match` to reject an intervening change with 412
|
|
83
|
+
* precondition_failed before saving or regenerating. Omitting `If-Match` applies the selection to
|
|
84
|
+
* the current Draft. version_next is required; null restores automatic selection.
|
|
85
|
+
*
|
|
86
|
+
* A `502` response means the selected version was saved, but regeneration failed. Follow the
|
|
87
|
+
* error's retryable and suggested_action fields. Repeating an unfinished selection resumes
|
|
88
|
+
* generation; repeating a completed selection starts no new work. If using If-Match, retrieve the
|
|
89
|
+
* Draft and confirm the saved selection before retrying with its current ETag.
|
|
90
|
+
* A `409 draft_merged` means the Draft merged; retrieve the Target and select a version on its
|
|
91
|
+
* `draft_id`. A `409 target_busy` means the Target is publishing; wait and retry. A `409
|
|
92
|
+
* version_occupied` means the version is already released; retrieve the Draft and releases,
|
|
93
|
+
* choose a new version, and retry.
|
|
94
|
+
* See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
|
|
95
|
+
* and If-Match.
|
|
96
|
+
* `PATCH /drafts/{draft_id}`
|
|
97
|
+
*/
|
|
98
|
+
async update(draftId, body, params, options) {
|
|
99
|
+
return this._core.requestData({
|
|
100
|
+
method: "PATCH",
|
|
101
|
+
path: `/drafts/${encodeURIComponent(String(draftId))}`,
|
|
102
|
+
security: [{ "apiKey": [] }],
|
|
103
|
+
headers: {
|
|
104
|
+
"If-Match": params?.ifMatch === undefined ? undefined : String(params?.ifMatch),
|
|
105
|
+
},
|
|
106
|
+
body,
|
|
107
|
+
errors: {
|
|
108
|
+
"400": BadRequestError,
|
|
109
|
+
"401": UnauthorizedError,
|
|
110
|
+
"403": ForbiddenError,
|
|
111
|
+
"404": NotFoundError,
|
|
112
|
+
"409": ConflictError,
|
|
113
|
+
"412": PreconditionFailedError,
|
|
114
|
+
"422": UnprocessableEntityError,
|
|
115
|
+
"429": RateLimitedError,
|
|
116
|
+
"500": InternalServerError,
|
|
117
|
+
"502": BadGatewayError,
|
|
118
|
+
},
|
|
119
|
+
schemaKey: "drafts.update",
|
|
120
|
+
options,
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
/**
|
|
124
|
+
* List customized and conflicted files on a Draft
|
|
125
|
+
*
|
|
126
|
+
* Lists the Draft's files that differ from the last merged package or need a conflict decision,
|
|
127
|
+
* ordered by path, without file content. Each conflict names its kind, the saved decision, and
|
|
128
|
+
* the sides you can read with getFile. With `filter=history`, lists files affected by a
|
|
129
|
+
* default-branch history rewrite; the list is empty when none is pending.
|
|
130
|
+
*
|
|
131
|
+
* Returns `409 resource_changed` while Typeship is carrying the Draft's latest commit forward
|
|
132
|
+
* (status working), or when the Draft changes between pages.
|
|
133
|
+
*
|
|
134
|
+
* Auto-paginates: `for await (const item of …)` walks every page.
|
|
135
|
+
* `GET /drafts/{draft_id}/files`
|
|
136
|
+
*/
|
|
137
|
+
listFiles(draftId, params, options) {
|
|
138
|
+
return paginate(this._core, {
|
|
139
|
+
method: "GET",
|
|
140
|
+
path: `/drafts/${encodeURIComponent(String(draftId))}/files`,
|
|
141
|
+
security: [{ "apiKey": [] }],
|
|
142
|
+
query: {
|
|
143
|
+
filter: params?.filter,
|
|
144
|
+
limit: params?.limit,
|
|
145
|
+
cursor: params?.cursor,
|
|
146
|
+
},
|
|
147
|
+
errors: {
|
|
148
|
+
"400": BadRequestError,
|
|
149
|
+
"401": UnauthorizedError,
|
|
150
|
+
"403": ForbiddenError,
|
|
151
|
+
"404": NotFoundError,
|
|
152
|
+
"409": ConflictError,
|
|
153
|
+
"429": RateLimitedError,
|
|
154
|
+
"500": InternalServerError,
|
|
155
|
+
},
|
|
156
|
+
idempotent: true,
|
|
157
|
+
schemaKey: "drafts.listFiles",
|
|
158
|
+
options,
|
|
159
|
+
}, {
|
|
160
|
+
style: "cursor",
|
|
161
|
+
itemsField: "data",
|
|
162
|
+
cursorParam: "cursor",
|
|
163
|
+
nextCursorField: "next_cursor",
|
|
164
|
+
hasMoreField: "has_more",
|
|
165
|
+
limitParam: "limit",
|
|
166
|
+
});
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Resolve selected Draft files
|
|
170
|
+
*
|
|
171
|
+
* Resolves conflicts on the Draft's head_sha: keep yours or generated, or supply final content as
|
|
172
|
+
* text or, for binary files, base64. Choosing generated for a customized path replaces it with
|
|
173
|
+
* the generated file, or deletes a Draft-only file.
|
|
174
|
+
*
|
|
175
|
+
* Conflict decisions are saved together and can be replaced until applied. Choosing generated for
|
|
176
|
+
* customized paths commits those changes together on the Draft branch. Returns the Draft. When
|
|
177
|
+
* every conflict has a decision, `conflicts.decided` equals `conflicts.total` and Typeship
|
|
178
|
+
* continues the Draft and runs checks. Paths that already match the Draft change nothing.
|
|
179
|
+
* `POST /drafts/{draft_id}/resolve`
|
|
180
|
+
*/
|
|
181
|
+
async resolve(draftId, body, options) {
|
|
182
|
+
return this._core.requestData({
|
|
183
|
+
method: "POST",
|
|
184
|
+
path: `/drafts/${encodeURIComponent(String(draftId))}/resolve`,
|
|
185
|
+
security: [{ "apiKey": [] }],
|
|
186
|
+
body,
|
|
187
|
+
errors: {
|
|
188
|
+
"400": BadRequestError,
|
|
189
|
+
"401": UnauthorizedError,
|
|
190
|
+
"403": ForbiddenError,
|
|
191
|
+
"404": NotFoundError,
|
|
192
|
+
"409": ConflictError,
|
|
193
|
+
"429": RateLimitedError,
|
|
194
|
+
"500": InternalServerError,
|
|
195
|
+
},
|
|
196
|
+
schemaKey: "drafts.resolve",
|
|
197
|
+
options,
|
|
198
|
+
});
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* Approve recovery from rewritten default-branch history
|
|
202
|
+
*
|
|
203
|
+
* When the Draft has status `action_required` and reason `history_rewritten`, review affected
|
|
204
|
+
* files with `listDraftFiles` and `filter=history`, then approve with the Draft's
|
|
205
|
+
* `history_recovery` revisions. Approval saves the recovery without changing Git and returns the
|
|
206
|
+
* Draft; the next generation rebuilds it from the rewritten default branch. The previous Draft
|
|
207
|
+
* branch stays available, and overlapping code comes back as conflicts to resolve. A rewritten
|
|
208
|
+
* Draft branch alone needs no approval.
|
|
209
|
+
* `POST /drafts/{draft_id}/recover`
|
|
210
|
+
*/
|
|
211
|
+
async recover(draftId, body, options) {
|
|
212
|
+
return this._core.requestData({
|
|
213
|
+
method: "POST",
|
|
214
|
+
path: `/drafts/${encodeURIComponent(String(draftId))}/recover`,
|
|
215
|
+
security: [{ "apiKey": [] }],
|
|
216
|
+
body,
|
|
217
|
+
errors: {
|
|
218
|
+
"400": BadRequestError,
|
|
219
|
+
"401": UnauthorizedError,
|
|
220
|
+
"403": ForbiddenError,
|
|
221
|
+
"404": NotFoundError,
|
|
222
|
+
"409": ConflictError,
|
|
223
|
+
"429": RateLimitedError,
|
|
224
|
+
"500": InternalServerError,
|
|
225
|
+
},
|
|
226
|
+
schemaKey: "drafts.recover",
|
|
227
|
+
options,
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { HttpCore, type RequestOptions } from "../core/http.js";
|
|
2
|
+
import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadRequestError, ForbiddenError, InternalServerError, NotFoundError, RateLimitedError, UnauthorizedError } from "../errors.js";
|
|
3
|
+
import type { FileId, FileResponseRead } from "../types.js";
|
|
4
|
+
export declare class FilesResource {
|
|
5
|
+
private readonly _core;
|
|
6
|
+
constructor(_core: HttpCore);
|
|
7
|
+
/**
|
|
8
|
+
* Get a file
|
|
9
|
+
*
|
|
10
|
+
* Returns one bounded chunk of an immutable file: at most 24 KiB, as UTF-8 text or, for binary
|
|
11
|
+
* bytes, base64. When next_cursor is not null, repeat the request with cursor and concatenate the
|
|
12
|
+
* chunks in order. A file ID always returns the same bytes.
|
|
13
|
+
* `GET /files/{file_id}`
|
|
14
|
+
*/
|
|
15
|
+
get(fileId: FileId, params?: FilesGetParams, options?: RequestOptions): Promise<FileResponseRead>;
|
|
16
|
+
}
|
|
17
|
+
export interface FilesGetParams {
|
|
18
|
+
/** next_cursor from the preceding chunk of this file. */
|
|
19
|
+
cursor?: string;
|
|
20
|
+
}
|
|
21
|
+
/** Typed errors `get` can throw. */
|
|
22
|
+
export type FilesGetError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
|
|
23
|
+
//# sourceMappingURL=files.d.ts.map
|