@typeship-ax/cli 0.22.0 → 0.24.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 +13 -9
- package/README.md +14 -27
- package/api.json +8898 -9026
- package/api.md +370 -328
- package/dist/arguments.d.ts +54 -0
- package/dist/arguments.d.ts.map +1 -0
- package/dist/arguments.js +265 -0
- package/dist/cli-agent.d.ts +73 -9
- package/dist/cli-agent.d.ts.map +1 -1
- package/dist/cli-agent.js +331 -44
- package/dist/cli.js +802 -291
- package/dist/core/http.d.ts +162 -19
- package/dist/core/http.d.ts.map +1 -1
- package/dist/core/http.js +381 -48
- package/dist/core/pagination.d.ts +42 -6
- package/dist/core/pagination.d.ts.map +1 -1
- package/dist/core/pagination.js +111 -17
- package/dist/credential-storage.d.ts +10 -3
- package/dist/credential-storage.d.ts.map +1 -1
- package/dist/credential-storage.js +15 -6
- package/dist/dates.d.ts +1 -1
- package/dist/dates.js +1 -1
- package/dist/errors.d.ts +20 -84
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +20 -108
- package/dist/fields.d.ts +36 -0
- package/dist/fields.d.ts.map +1 -0
- package/dist/fields.js +187 -0
- package/dist/index.d.ts +28 -18
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +35 -25
- package/dist/named-credentials.d.ts +19 -0
- package/dist/named-credentials.d.ts.map +1 -1
- package/dist/named-credentials.js +81 -1
- package/dist/oauth-login.d.ts +8 -2
- package/dist/oauth-login.d.ts.map +1 -1
- package/dist/oauth-login.js +31 -19
- package/dist/oauth-request.d.ts +7 -1
- package/dist/oauth-request.d.ts.map +1 -1
- package/dist/oauth-request.js +26 -4
- package/dist/oauth-session.d.ts +13 -1
- package/dist/oauth-session.d.ts.map +1 -1
- package/dist/oauth-session.js +34 -18
- package/dist/ops.d.ts +58 -5
- package/dist/ops.d.ts.map +1 -1
- package/dist/ops.js +110 -41
- package/dist/polling-login.d.ts +8 -2
- package/dist/polling-login.d.ts.map +1 -1
- package/dist/polling-login.js +25 -11
- package/dist/resources/api-keys.d.ts +10 -7
- package/dist/resources/api-keys.d.ts.map +1 -1
- package/dist/resources/api-keys.js +10 -31
- package/dist/resources/deliveries.d.ts +89 -5
- package/dist/resources/deliveries.d.ts.map +1 -1
- package/dist/resources/deliveries.js +96 -19
- package/dist/resources/drafts.d.ts +16 -16
- package/dist/resources/drafts.d.ts.map +1 -1
- package/dist/resources/drafts.js +12 -65
- package/dist/resources/files.d.ts +4 -4
- package/dist/resources/files.d.ts.map +1 -1
- package/dist/resources/files.js +3 -12
- package/dist/resources/generations.d.ts +16 -16
- package/dist/resources/generations.d.ts.map +1 -1
- package/dist/resources/generations.js +23 -47
- package/dist/resources/organization.d.ts +4 -4
- package/dist/resources/organization.d.ts.map +1 -1
- package/dist/resources/organization.js +3 -10
- package/dist/resources/{generate.d.ts → packages.d.ts} +16 -16
- package/dist/resources/packages.d.ts.map +1 -0
- package/dist/resources/{generate.js → packages.js} +13 -29
- package/dist/resources/projects.d.ts +50 -50
- package/dist/resources/projects.d.ts.map +1 -1
- package/dist/resources/projects.js +60 -116
- package/dist/resources/releases.d.ts +22 -17
- package/dist/resources/releases.d.ts.map +1 -1
- package/dist/resources/releases.js +19 -40
- package/dist/resources/spec-revisions.d.ts +16 -7
- package/dist/resources/spec-revisions.d.ts.map +1 -1
- package/dist/resources/spec-revisions.js +7 -29
- package/dist/resources/specs.d.ts +7 -7
- package/dist/resources/specs.d.ts.map +1 -1
- package/dist/resources/specs.js +6 -34
- package/dist/resources/targets.d.ts +49 -49
- package/dist/resources/targets.d.ts.map +1 -1
- package/dist/resources/targets.js +59 -115
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +83 -81
- package/dist/search.d.ts +54 -0
- package/dist/search.d.ts.map +1 -0
- package/dist/search.js +421 -0
- package/dist/table.d.ts +28 -0
- package/dist/table.d.ts.map +1 -0
- package/dist/table.js +167 -0
- package/dist/type-docs.d.ts +61 -0
- package/dist/type-docs.d.ts.map +1 -0
- package/dist/type-docs.js +174 -0
- package/dist/types.d.ts +499 -339
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +18 -18
- package/package.json +5 -2
- package/src/arguments.ts +254 -0
- package/src/cli-agent.ts +351 -46
- package/src/cli.ts +753 -266
- package/src/core/http.ts +457 -58
- package/src/core/pagination.ts +129 -18
- package/src/credential-storage.ts +16 -6
- package/src/dates.ts +1 -1
- package/src/errors.ts +46 -115
- package/src/fields.ts +167 -0
- package/src/index.ts +45 -28
- package/src/named-credentials.ts +66 -1
- package/src/oauth-login.ts +36 -21
- package/src/oauth-request.ts +32 -6
- package/src/oauth-session.ts +37 -19
- package/src/ops.ts +146 -45
- package/src/polling-login.ts +24 -11
- package/src/resources/api-keys.ts +34 -48
- package/src/resources/deliveries.ts +213 -32
- package/src/resources/drafts.ts +62 -109
- package/src/resources/files.ts +19 -20
- package/src/resources/generations.ts +61 -79
- package/src/resources/organization.ts +11 -16
- package/src/resources/{generate.ts → packages.ts} +43 -51
- package/src/resources/projects.ts +145 -200
- package/src/resources/releases.ts +50 -67
- package/src/resources/spec-revisions.ts +40 -49
- package/src/resources/specs.ts +39 -59
- package/src/resources/targets.ts +144 -194
- package/src/schemas.ts +83 -81
- package/src/search.ts +434 -0
- package/src/table.ts +167 -0
- package/src/type-docs.ts +205 -0
- package/src/types.ts +538 -357
- package/dist/console-login-check.d.ts +0 -21
- package/dist/console-login-check.d.ts.map +0 -1
- package/dist/console-login-check.js +0 -107
- package/dist/console-login-contract.d.ts +0 -45
- package/dist/console-login-contract.d.ts.map +0 -1
- package/dist/console-login-contract.js +0 -40
- package/dist/resources/generate.d.ts.map +0 -1
- package/dist/resources/publications.d.ts +0 -47
- package/dist/resources/publications.d.ts.map +0 -1
- package/dist/resources/publications.js +0 -70
- package/src/console-login-check.ts +0 -88
- package/src/console-login-contract.ts +0 -65
- package/src/resources/publications.ts +0 -140
package/dist/errors.js
CHANGED
|
@@ -1,122 +1,34 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Generated by
|
|
3
|
-
import { ApiError } from "./core/http.js";
|
|
4
|
-
export { ApiError, SdkError, ResponseParseError, TransportError, UnexpectedApiError, ValidationError } from "./core/http.js";
|
|
5
|
-
/**
|
|
6
|
-
|
|
7
|
-
* Raised for HTTP 400 responses.
|
|
8
|
-
*/
|
|
9
|
-
export class BadRequestError extends ApiError {
|
|
10
|
-
constructor(body, response) {
|
|
11
|
-
super("The request body, Spec source, target selection, or package name is invalid.", 400, body, response);
|
|
12
|
-
}
|
|
13
|
-
}
|
|
14
|
-
/**
|
|
15
|
-
* Missing, invalid, expired, or revoked credentials.
|
|
16
|
-
* Raised for HTTP 401 responses.
|
|
17
|
-
*/
|
|
18
|
-
export class UnauthorizedError extends ApiError {
|
|
19
|
-
constructor(body, response) {
|
|
20
|
-
super("Missing, invalid, expired, or revoked credentials.", 401, body, response);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
/**
|
|
24
|
-
* The credentials are valid but cannot act on the requested organization.
|
|
25
|
-
* Raised for HTTP 403 responses.
|
|
26
|
-
*/
|
|
27
|
-
export class ForbiddenError extends ApiError {
|
|
1
|
+
// Typeship — typed error classes.
|
|
2
|
+
// Generated by Typeship — https://typeship.dev
|
|
3
|
+
import { ApiError, RateLimitError, ServerError } from "./core/http.js";
|
|
4
|
+
export { ApiError, SdkError, PayloadError, ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadRequestError, ConflictError, ForbiddenError, NotFoundError, NotModifiedError, RateLimitError, ServerError, UnauthorizedError, UnprocessableEntityError, } from "./core/http.js";
|
|
5
|
+
/** Raised for HTTP 402 responses. */
|
|
6
|
+
export class PaymentRequiredError extends ApiError {
|
|
28
7
|
constructor(body, response) {
|
|
29
|
-
super("
|
|
8
|
+
super("HTTP 402", 402, body, response);
|
|
30
9
|
}
|
|
31
10
|
}
|
|
32
|
-
/**
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
11
|
+
/** @deprecated Use RateLimitError, raised for every 429 response. */
|
|
12
|
+
export const RateLimitedError = RateLimitError;
|
|
13
|
+
/** @deprecated Use ServerError, raised for every 5xx response. */
|
|
14
|
+
export const InternalServerError = ServerError;
|
|
15
|
+
/** Raised for HTTP 412 responses. */
|
|
16
|
+
export class PreconditionFailedError extends ApiError {
|
|
37
17
|
constructor(body, response) {
|
|
38
|
-
super("
|
|
18
|
+
super("HTTP 412", 412, body, response);
|
|
39
19
|
}
|
|
40
20
|
}
|
|
41
|
-
/**
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
*/
|
|
21
|
+
/** @deprecated Use ServerError, raised for every 5xx response. */
|
|
22
|
+
export const BadGatewayError = ServerError;
|
|
23
|
+
/** Raised for HTTP 413 responses. */
|
|
45
24
|
export class PayloadTooLargeError extends ApiError {
|
|
46
25
|
constructor(body, response) {
|
|
47
|
-
super("
|
|
26
|
+
super("HTTP 413", 413, body, response);
|
|
48
27
|
}
|
|
49
28
|
}
|
|
50
|
-
/**
|
|
51
|
-
* The Spec could not be resolved or understood.
|
|
52
|
-
* Raised for HTTP 422 responses.
|
|
53
|
-
*/
|
|
54
|
-
export class UnprocessableEntityError extends ApiError {
|
|
55
|
-
constructor(body, response) {
|
|
56
|
-
super("The Spec could not be resolved or understood.", 422, body, response);
|
|
57
|
-
}
|
|
58
|
-
}
|
|
59
|
-
/**
|
|
60
|
-
* Too many requests, or an identical write is still in progress. Wait for Retry-After before
|
|
61
|
-
* retrying.
|
|
62
|
-
* Raised for HTTP 429 responses.
|
|
63
|
-
*/
|
|
64
|
-
export class RateLimitedError extends ApiError {
|
|
65
|
-
constructor(body, response) {
|
|
66
|
-
super("Too many requests, or an identical write is still in progress. Wait for Retry-After before retrying.", 429, body, response);
|
|
67
|
-
}
|
|
68
|
-
}
|
|
69
|
-
/**
|
|
70
|
-
* An unexpected error prevented the request from completing.
|
|
71
|
-
* Raised for HTTP 500 responses.
|
|
72
|
-
*/
|
|
73
|
-
export class InternalServerError extends ApiError {
|
|
74
|
-
constructor(body, response) {
|
|
75
|
-
super("An unexpected error prevented the request from completing.", 500, body, response);
|
|
76
|
-
}
|
|
77
|
-
}
|
|
78
|
-
/**
|
|
79
|
-
* Unexpected error.
|
|
80
|
-
* Raised for "default" responses.
|
|
81
|
-
*/
|
|
29
|
+
/** Raised for "default" responses. */
|
|
82
30
|
export class ApiResponseError extends ApiError {
|
|
83
31
|
constructor(body, response) {
|
|
84
|
-
super("
|
|
85
|
-
}
|
|
86
|
-
}
|
|
87
|
-
/**
|
|
88
|
-
* No such resource in this organization.
|
|
89
|
-
* Raised for HTTP 404 responses.
|
|
90
|
-
*/
|
|
91
|
-
export class NotFoundError extends ApiError {
|
|
92
|
-
constructor(body, response) {
|
|
93
|
-
super("No such resource in this organization.", 404, body, response);
|
|
94
|
-
}
|
|
95
|
-
}
|
|
96
|
-
/**
|
|
97
|
-
* The plan does not include another project or the requested target configuration.
|
|
98
|
-
* Raised for HTTP 402 responses.
|
|
99
|
-
*/
|
|
100
|
-
export class PaymentRequiredError extends ApiError {
|
|
101
|
-
constructor(body, response) {
|
|
102
|
-
super("The plan does not include another project or the requested target configuration.", 402, body, response);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
/**
|
|
106
|
-
* The resource changed since the ETag supplied in If-Match. No write was applied.
|
|
107
|
-
* Raised for HTTP 412 responses.
|
|
108
|
-
*/
|
|
109
|
-
export class PreconditionFailedError extends ApiError {
|
|
110
|
-
constructor(body, response) {
|
|
111
|
-
super("The resource changed since the ETag supplied in If-Match. No write was applied.", 412, body, response);
|
|
112
|
-
}
|
|
113
|
-
}
|
|
114
|
-
/**
|
|
115
|
-
* Dependent work failed while completing the request.
|
|
116
|
-
* Raised for HTTP 502 responses.
|
|
117
|
-
*/
|
|
118
|
-
export class BadGatewayError extends ApiError {
|
|
119
|
-
constructor(body, response) {
|
|
120
|
-
super("Dependent work failed while completing the request.", 502, body, response);
|
|
32
|
+
super("HTTP " + response.status, response.status, body, response);
|
|
121
33
|
}
|
|
122
34
|
}
|
package/dist/fields.d.ts
ADDED
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result projection shared by the generated CLI (--fields) and MCP server
|
|
3
|
+
* (the fields argument). Generated by Typeship — https://typeship.dev
|
|
4
|
+
*/
|
|
5
|
+
/** Keep only `paths` of a value: arrays item by item, objects by dotted
|
|
6
|
+
* path, including paths through arrays (`items.id` keeps each item's id);
|
|
7
|
+
* scalars untouched. */
|
|
8
|
+
export declare function projectFields(value: unknown, paths: string[][] | null): unknown;
|
|
9
|
+
/** A requested path that selected nothing, with the keys that exist where
|
|
10
|
+
* it stopped matching. */
|
|
11
|
+
export interface UnmatchedField {
|
|
12
|
+
path: string;
|
|
13
|
+
/** Keys present at the level where the path failed, first 40. */
|
|
14
|
+
available: string[];
|
|
15
|
+
/** The path segment that is not a key there, or null when the path runs
|
|
16
|
+
* into a scalar or the result is not an object. */
|
|
17
|
+
missing: string | null;
|
|
18
|
+
}
|
|
19
|
+
/**
|
|
20
|
+
* The paths that match nothing in any item of `value`. A path matches when
|
|
21
|
+
* at least one item has it; reaching null or an empty array counts as a
|
|
22
|
+
* match, because the path may be right and the values merely empty. An
|
|
23
|
+
* empty result matches everything.
|
|
24
|
+
*
|
|
25
|
+
* `schema` is the JSON Schema of `value` (the operation's declared
|
|
26
|
+
* response, or its item schema for a list). A key the schema declares may
|
|
27
|
+
* be absent from every item, as optional fields are: the path matches, and
|
|
28
|
+
* projects to nothing. What the schema cannot vouch for (no schema, an
|
|
29
|
+
* object without properties, a key it does not list) still has to be in
|
|
30
|
+
* the data.
|
|
31
|
+
*/
|
|
32
|
+
export declare function unmatchedFields(value: unknown, paths: string[][], schema?: unknown): UnmatchedField[];
|
|
33
|
+
/** The error message: the call went through, and for each unmatched path,
|
|
34
|
+
* what exists instead. */
|
|
35
|
+
export declare function unmatchedFieldsMessage(unmatched: UnmatchedField[], perItem: boolean): string;
|
|
36
|
+
//# sourceMappingURL=fields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"fields.d.ts","sourceRoot":"","sources":["../src/fields.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH;;wBAEwB;AACxB,wBAAgB,aAAa,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,GAAG,IAAI,GAAG,OAAO,CAkB/E;AAED;0BAC0B;AAC1B,MAAM,WAAW,cAAc;IAC7B,IAAI,EAAE,MAAM,CAAC;IACb,iEAAiE;IACjE,SAAS,EAAE,MAAM,EAAE,CAAC;IACpB;uDACmD;IACnD,OAAO,EAAE,MAAM,GAAG,IAAI,CAAC;CACxB;AAED;;;;;;;;;;;;GAYG;AACH,wBAAgB,eAAe,CAAC,KAAK,EAAE,OAAO,EAAE,KAAK,EAAE,MAAM,EAAE,EAAE,EAAE,MAAM,CAAC,EAAE,OAAO,GAAG,cAAc,EAAE,CASrG;AA8FD;0BAC0B;AAC1B,wBAAgB,sBAAsB,CAAC,SAAS,EAAE,cAAc,EAAE,EAAE,OAAO,EAAE,OAAO,GAAG,MAAM,CAS5F"}
|
package/dist/fields.js
ADDED
|
@@ -0,0 +1,187 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Result projection shared by the generated CLI (--fields) and MCP server
|
|
3
|
+
* (the fields argument). Generated by Typeship — https://typeship.dev
|
|
4
|
+
*/
|
|
5
|
+
/** Keep only `paths` of a value: arrays item by item, objects by dotted
|
|
6
|
+
* path, including paths through arrays (`items.id` keeps each item's id);
|
|
7
|
+
* scalars untouched. */
|
|
8
|
+
export function projectFields(value, paths) {
|
|
9
|
+
if (paths === null)
|
|
10
|
+
return value;
|
|
11
|
+
if (Array.isArray(value))
|
|
12
|
+
return value.map((v) => projectFields(v, paths));
|
|
13
|
+
if (value === null || typeof value !== "object")
|
|
14
|
+
return value;
|
|
15
|
+
const groups = new Map();
|
|
16
|
+
for (const [key, ...rest] of paths) {
|
|
17
|
+
if (key === undefined)
|
|
18
|
+
continue;
|
|
19
|
+
const group = groups.get(key);
|
|
20
|
+
if (group)
|
|
21
|
+
group.push(rest);
|
|
22
|
+
else
|
|
23
|
+
groups.set(key, [rest]);
|
|
24
|
+
}
|
|
25
|
+
const out = {};
|
|
26
|
+
for (const [key, rests] of groups) {
|
|
27
|
+
const child = value[key];
|
|
28
|
+
if (child === undefined)
|
|
29
|
+
continue;
|
|
30
|
+
if (rests.some((rest) => rest.length === 0))
|
|
31
|
+
out[key] = child;
|
|
32
|
+
else if (child !== null && typeof child === "object")
|
|
33
|
+
out[key] = projectFields(child, rests);
|
|
34
|
+
}
|
|
35
|
+
return out;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* The paths that match nothing in any item of `value`. A path matches when
|
|
39
|
+
* at least one item has it; reaching null or an empty array counts as a
|
|
40
|
+
* match, because the path may be right and the values merely empty. An
|
|
41
|
+
* empty result matches everything.
|
|
42
|
+
*
|
|
43
|
+
* `schema` is the JSON Schema of `value` (the operation's declared
|
|
44
|
+
* response, or its item schema for a list). A key the schema declares may
|
|
45
|
+
* be absent from every item, as optional fields are: the path matches, and
|
|
46
|
+
* projects to nothing. What the schema cannot vouch for (no schema, an
|
|
47
|
+
* object without properties, a key it does not list) still has to be in
|
|
48
|
+
* the data.
|
|
49
|
+
*/
|
|
50
|
+
export function unmatchedFields(value, paths, schema) {
|
|
51
|
+
const out = [];
|
|
52
|
+
for (const path of paths) {
|
|
53
|
+
const miss = { depth: -1, keys: new Set(), segment: null };
|
|
54
|
+
if (!pathMatches(value, path, 0, miss, schema)) {
|
|
55
|
+
out.push({ path: path.join("."), available: [...miss.keys].slice(0, 40), missing: miss.segment });
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return out;
|
|
59
|
+
}
|
|
60
|
+
function pathMatches(value, path, index, miss, schema) {
|
|
61
|
+
if (value === null || value === undefined)
|
|
62
|
+
return true;
|
|
63
|
+
if (Array.isArray(value)) {
|
|
64
|
+
if (value.length === 0)
|
|
65
|
+
return true;
|
|
66
|
+
const items = arrayItems(schema);
|
|
67
|
+
let any = false;
|
|
68
|
+
for (const item of value)
|
|
69
|
+
if (pathMatches(item, path, index, miss, items))
|
|
70
|
+
any = true;
|
|
71
|
+
return any;
|
|
72
|
+
}
|
|
73
|
+
if (index === path.length)
|
|
74
|
+
return true;
|
|
75
|
+
if (typeof value !== "object") {
|
|
76
|
+
if (miss.depth < index) {
|
|
77
|
+
miss.depth = index;
|
|
78
|
+
miss.keys = new Set();
|
|
79
|
+
miss.segment = null;
|
|
80
|
+
}
|
|
81
|
+
return false;
|
|
82
|
+
}
|
|
83
|
+
const key = path[index];
|
|
84
|
+
const record = value;
|
|
85
|
+
if (!Object.hasOwn(record, key)) {
|
|
86
|
+
const declared = declaredProperty(schema, key);
|
|
87
|
+
if (declared !== undefined)
|
|
88
|
+
return declaredPath(declared, path, index + 1, miss);
|
|
89
|
+
if (miss.depth < index) {
|
|
90
|
+
miss.depth = index;
|
|
91
|
+
miss.keys = new Set();
|
|
92
|
+
miss.segment = key;
|
|
93
|
+
}
|
|
94
|
+
if (miss.depth === index)
|
|
95
|
+
for (const k of Object.keys(record))
|
|
96
|
+
miss.keys.add(k);
|
|
97
|
+
return false;
|
|
98
|
+
}
|
|
99
|
+
return pathMatches(record[key], path, index + 1, miss, declaredProperty(schema, key));
|
|
100
|
+
}
|
|
101
|
+
/** The rest of a path below a declared key no item has: nothing in the data
|
|
102
|
+
* can contradict it, so it matches unless the schema lists that level's
|
|
103
|
+
* keys and the next segment is not one of them. */
|
|
104
|
+
function declaredPath(schema, path, index, miss) {
|
|
105
|
+
if (index === path.length)
|
|
106
|
+
return true;
|
|
107
|
+
const key = path[index];
|
|
108
|
+
const declared = declaredProperty(schema, key);
|
|
109
|
+
if (declared !== undefined)
|
|
110
|
+
return declaredPath(declared, path, index + 1, miss);
|
|
111
|
+
const listed = listedProperties(schema);
|
|
112
|
+
if (listed === null)
|
|
113
|
+
return true;
|
|
114
|
+
if (miss.depth < index) {
|
|
115
|
+
miss.depth = index;
|
|
116
|
+
miss.keys = new Set();
|
|
117
|
+
miss.segment = key;
|
|
118
|
+
}
|
|
119
|
+
if (miss.depth === index)
|
|
120
|
+
for (const k of listed)
|
|
121
|
+
miss.keys.add(k);
|
|
122
|
+
return false;
|
|
123
|
+
}
|
|
124
|
+
/** A schema with its allOf, anyOf and oneOf branches flattened, arrays
|
|
125
|
+
* seen through to their items. */
|
|
126
|
+
function variants(schema, out = []) {
|
|
127
|
+
if (schema === null || typeof schema !== "object" || Array.isArray(schema))
|
|
128
|
+
return out;
|
|
129
|
+
const node = schema;
|
|
130
|
+
out.push(node);
|
|
131
|
+
for (const key of ["allOf", "anyOf", "oneOf"]) {
|
|
132
|
+
const branches = node[key];
|
|
133
|
+
if (Array.isArray(branches))
|
|
134
|
+
for (const branch of branches)
|
|
135
|
+
variants(branch, out);
|
|
136
|
+
}
|
|
137
|
+
return out;
|
|
138
|
+
}
|
|
139
|
+
function arrayItems(schema) {
|
|
140
|
+
const items = variants(schema).map((node) => node.items).filter((item) => item !== undefined && item !== null);
|
|
141
|
+
return items.length === 0 ? undefined : items.length === 1 ? items[0] : { anyOf: items };
|
|
142
|
+
}
|
|
143
|
+
/** The schema of `key` when some branch declares it, else undefined. */
|
|
144
|
+
function declaredProperty(schema, key) {
|
|
145
|
+
const found = variants(schema).flatMap((node) => {
|
|
146
|
+
const properties = node.properties;
|
|
147
|
+
return properties && typeof properties === "object" && Object.hasOwn(properties, key) ? [properties[key] ?? {}] : [];
|
|
148
|
+
});
|
|
149
|
+
return found.length === 0 ? undefined : found.length === 1 ? found[0] : { anyOf: found };
|
|
150
|
+
}
|
|
151
|
+
/** Every key the schema declares, or null when it cannot say which keys
|
|
152
|
+
* exist: no schema, an object without properties, or one that admits more. */
|
|
153
|
+
function listedProperties(schema) {
|
|
154
|
+
const nodes = variants(schema);
|
|
155
|
+
const keys = [];
|
|
156
|
+
let closed = false;
|
|
157
|
+
for (const node of nodes) {
|
|
158
|
+
const properties = node.properties;
|
|
159
|
+
if (properties && typeof properties === "object") {
|
|
160
|
+
closed = true;
|
|
161
|
+
keys.push(...Object.keys(properties));
|
|
162
|
+
}
|
|
163
|
+
if (node.additionalProperties !== undefined && node.additionalProperties !== false)
|
|
164
|
+
return null;
|
|
165
|
+
if (node.patternProperties !== undefined)
|
|
166
|
+
return null;
|
|
167
|
+
// Tool schemas keep the first eight variants of a union; more may exist.
|
|
168
|
+
if (Array.isArray(node.anyOf) && node.anyOf.length >= 8)
|
|
169
|
+
return null;
|
|
170
|
+
}
|
|
171
|
+
// A branch that is an object without listed properties is open.
|
|
172
|
+
if (nodes.some((node) => node.properties === undefined && (node.type === "object" || (Array.isArray(node.type) && node.type.includes("object")))))
|
|
173
|
+
return null;
|
|
174
|
+
return closed ? [...new Set(keys)] : null;
|
|
175
|
+
}
|
|
176
|
+
/** The error message: the call went through, and for each unmatched path,
|
|
177
|
+
* what exists instead. */
|
|
178
|
+
export function unmatchedFieldsMessage(unmatched, perItem) {
|
|
179
|
+
return "The API call succeeded, but " + unmatched.map((u, index) => {
|
|
180
|
+
const where = perItem ? " in any item" : " in the result";
|
|
181
|
+
const why = u.missing !== null
|
|
182
|
+
? " (\"" + u.missing + "\" is not a key there)"
|
|
183
|
+
: " (it runs into a value that is not an object)";
|
|
184
|
+
const keys = u.available.length > 0 ? " Available keys: " + u.available.join(", ") + "." : "";
|
|
185
|
+
return (index === 0 ? "the" : "The") + " field path \"" + u.path + "\" matched nothing" + where + why + "." + keys;
|
|
186
|
+
}).join(" ");
|
|
187
|
+
}
|
package/dist/index.d.ts
CHANGED
|
@@ -1,27 +1,27 @@
|
|
|
1
1
|
import { type AuthValue, type DebugEvent, type RequestContext } from "./core/http.js";
|
|
2
|
-
import { GenerateResource } from "./resources/generate.js";
|
|
3
2
|
import { ProjectsResource } from "./resources/projects.js";
|
|
4
3
|
import { SpecsResource } from "./resources/specs.js";
|
|
5
4
|
import { SpecRevisionsResource } from "./resources/spec-revisions.js";
|
|
6
5
|
import { TargetsResource } from "./resources/targets.js";
|
|
7
|
-
import { DraftsResource } from "./resources/drafts.js";
|
|
8
|
-
import { ReleasesResource } from "./resources/releases.js";
|
|
9
6
|
import { DeliveriesResource } from "./resources/deliveries.js";
|
|
10
|
-
import { PublicationsResource } from "./resources/publications.js";
|
|
11
7
|
import { GenerationsResource } from "./resources/generations.js";
|
|
8
|
+
import { DraftsResource } from "./resources/drafts.js";
|
|
9
|
+
import { ReleasesResource } from "./resources/releases.js";
|
|
12
10
|
import { FilesResource } from "./resources/files.js";
|
|
11
|
+
import { PackagesResource } from "./resources/packages.js";
|
|
13
12
|
import { OrganizationResource } from "./resources/organization.js";
|
|
14
13
|
import { ApiKeysResource } from "./resources/api-keys.js";
|
|
15
14
|
/** This package's version, also sent as the `User-Agent`. */
|
|
16
|
-
export declare const VERSION = "0.
|
|
15
|
+
export declare const VERSION = "0.24.0";
|
|
17
16
|
export interface ClientOptions {
|
|
18
17
|
/** Override the server URL. Default: `https://typeship.dev/api/v1` */
|
|
19
18
|
baseUrl?: string;
|
|
20
19
|
/**
|
|
21
20
|
* Sent as `Authorization: Bearer <token>`. Pass a callback for tokens that expire; it is resolved
|
|
22
|
-
* before every attempt
|
|
21
|
+
* before every attempt, and after a 401 it is called once more with `{ rejected: true }` so it
|
|
22
|
+
* can refresh instead of returning the rejected token.
|
|
23
23
|
*/
|
|
24
|
-
bearerToken?:
|
|
24
|
+
bearerToken?: AuthValue;
|
|
25
25
|
/**
|
|
26
26
|
* Credentials keyed by the Spec's security scheme names. Only one complete alternative is sent
|
|
27
27
|
* for each operation. Named values take precedence over convenience options.
|
|
@@ -29,10 +29,15 @@ export interface ClientOptions {
|
|
|
29
29
|
credentials?: {
|
|
30
30
|
"apiKey"?: AuthValue;
|
|
31
31
|
};
|
|
32
|
-
/** Per-attempt timeout in milliseconds. Default:
|
|
32
|
+
/** Per-attempt timeout in milliseconds. Default: 60000. */
|
|
33
33
|
timeoutMs?: number;
|
|
34
34
|
/** Retries after the first attempt (retryable failures only). Default: 2. */
|
|
35
35
|
maxRetries?: number;
|
|
36
|
+
/**
|
|
37
|
+
* The longest wait a server may request (Retry-After, x-ratelimit-reset) that a retry honors; a
|
|
38
|
+
* longer one fails the call with the reset time. Default: 60000.
|
|
39
|
+
*/
|
|
40
|
+
maxRetryWaitMs?: number;
|
|
36
41
|
/** Custom fetch implementation (proxies, testing, instrumentation). */
|
|
37
42
|
fetch?: typeof fetch;
|
|
38
43
|
/** Headers sent with every request. */
|
|
@@ -73,7 +78,7 @@ export interface ClientOptions {
|
|
|
73
78
|
};
|
|
74
79
|
}
|
|
75
80
|
/**
|
|
76
|
-
*
|
|
81
|
+
* Typeship — v0.24.0
|
|
77
82
|
*
|
|
78
83
|
* Resolve an OpenAPI or GraphQL Spec, diagnose it, and keep every
|
|
79
84
|
* selected CLI, MCP, and SDK Target current.
|
|
@@ -90,36 +95,41 @@ export interface ClientOptions {
|
|
|
90
95
|
* petstore Spec is a runnable sample.
|
|
91
96
|
*/
|
|
92
97
|
export declare class TypeshipClient {
|
|
93
|
-
readonly generate: GenerateResource;
|
|
94
98
|
readonly projects: ProjectsResource;
|
|
95
99
|
readonly specs: SpecsResource;
|
|
96
100
|
readonly specRevisions: SpecRevisionsResource;
|
|
97
101
|
readonly targets: TargetsResource;
|
|
98
|
-
readonly drafts: DraftsResource;
|
|
99
|
-
readonly releases: ReleasesResource;
|
|
100
102
|
readonly deliveries: DeliveriesResource;
|
|
101
|
-
readonly publications: PublicationsResource;
|
|
102
103
|
readonly generations: GenerationsResource;
|
|
104
|
+
readonly drafts: DraftsResource;
|
|
105
|
+
readonly releases: ReleasesResource;
|
|
103
106
|
readonly files: FilesResource;
|
|
107
|
+
readonly packages: PackagesResource;
|
|
104
108
|
readonly organization: OrganizationResource;
|
|
105
109
|
readonly apiKeys: ApiKeysResource;
|
|
110
|
+
private readonly _options;
|
|
106
111
|
constructor(options?: ClientOptions);
|
|
112
|
+
/**
|
|
113
|
+
* A client with this client's configuration and only these credentials,
|
|
114
|
+
* for a server acting on behalf of many users. Nothing is inherited from
|
|
115
|
+
* this client's credentials. The copy shares the configured fetch.
|
|
116
|
+
*/
|
|
117
|
+
withCredentials(credentials: Pick<ClientOptions, "bearerToken" | "credentials">): TypeshipClient;
|
|
107
118
|
}
|
|
108
119
|
export * from "./types.js";
|
|
109
120
|
export * from "./errors.js";
|
|
110
|
-
export { formatDebugEvent, type AuthValue, type DebugEvent, type RequestContext, type RequestOptions, type ResponseMeta, } from "./core/http.js";
|
|
121
|
+
export { formatDebugEvent, type AuthValue, type CredentialContext, type DebugEvent, type RequestContext, type RequestOptions, type ResponseMeta, } from "./core/http.js";
|
|
111
122
|
export { Page, PagePromise } from "./core/pagination.js";
|
|
112
|
-
export * from "./resources/generate.js";
|
|
113
123
|
export * from "./resources/projects.js";
|
|
114
124
|
export * from "./resources/specs.js";
|
|
115
125
|
export * from "./resources/spec-revisions.js";
|
|
116
126
|
export * from "./resources/targets.js";
|
|
117
|
-
export * from "./resources/drafts.js";
|
|
118
|
-
export * from "./resources/releases.js";
|
|
119
127
|
export * from "./resources/deliveries.js";
|
|
120
|
-
export * from "./resources/publications.js";
|
|
121
128
|
export * from "./resources/generations.js";
|
|
129
|
+
export * from "./resources/drafts.js";
|
|
130
|
+
export * from "./resources/releases.js";
|
|
122
131
|
export * from "./resources/files.js";
|
|
132
|
+
export * from "./resources/packages.js";
|
|
123
133
|
export * from "./resources/organization.js";
|
|
124
134
|
export * from "./resources/api-keys.js";
|
|
125
135
|
//# sourceMappingURL=index.d.ts.map
|
package/dist/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,OAAO,EAGL,KAAK,SAAS,EAEd,KAAK,UAAU,EACf,KAAK,cAAc,EAEpB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],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K,EAAE,aAAa,CAAC;IAC9B,QAAQ,CAAC,QAAQ,EAAE,gBAAgB,CAAC;IACpC,QAAQ,CAAC,YAAY,EAAE,oBAAoB,CAAC;IAC5C,QAAQ,CAAC,OAAO,EAAE,eAAe,CAAC;IAClC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAgB;gBAE7B,OAAO,GAAE,aAAkB;IAsEvC;;;;OAIG;IACH,eAAe,CAAC,WAAW,EAAE,IAAI,CAAC,aAAa,EAAE,aAAa,GAAG,aAAa,CAAC,GAAG,cAAc;CAKjG;AAED,cAAc,YAAY,CAAC;AAC3B,cAAc,aAAa,CAAC;AAC5B,OAAO,EACL,gBAAgB,EAChB,KAAK,SAAS,EACd,KAAK,iBAAiB,EACtB,KAAK,UAAU,EACf,KAAK,cAAc,EACnB,KAAK,cAAc,EACnB,KAAK,YAAY,GAClB,MAAM,gBAAgB,CAAC;AACxB,OAAO,EAAE,IAAI,EAAE,WAAW,EAAE,MAAM,sBAAsB,CAAC;AAEzD,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,+BAA+B,CAAC;AAC9C,cAAc,wBAAwB,CAAC;AACvC,cAAc,2BAA2B,CAAC;AAC1C,cAAc,4BAA4B,CAAC;AAC3C,cAAc,uBAAuB,CAAC;AACtC,cAAc,yBAAyB,CAAC;AACxC,cAAc,sBAAsB,CAAC;AACrC,cAAc,yBAAyB,CAAC;AACxC,cAAc,6BAA6B,CAAC;AAC5C,cAAc,yBAAyB,CAAC"}
|
package/dist/index.js
CHANGED
|
@@ -1,25 +1,23 @@
|
|
|
1
|
-
//
|
|
2
|
-
// Generated by
|
|
1
|
+
// Typeship — client entry point.
|
|
2
|
+
// Generated by Typeship — https://typeship.dev
|
|
3
3
|
import { HttpCore, formatDebugEvent, bearerAuth, } from "./core/http.js";
|
|
4
|
-
import { DEFS, SCHEMAS } from "./schemas.js";
|
|
5
|
-
import { GenerateResource } from "./resources/generate.js";
|
|
6
4
|
import { ProjectsResource } from "./resources/projects.js";
|
|
7
5
|
import { SpecsResource } from "./resources/specs.js";
|
|
8
6
|
import { SpecRevisionsResource } from "./resources/spec-revisions.js";
|
|
9
7
|
import { TargetsResource } from "./resources/targets.js";
|
|
10
|
-
import { DraftsResource } from "./resources/drafts.js";
|
|
11
|
-
import { ReleasesResource } from "./resources/releases.js";
|
|
12
8
|
import { DeliveriesResource } from "./resources/deliveries.js";
|
|
13
|
-
import { PublicationsResource } from "./resources/publications.js";
|
|
14
9
|
import { GenerationsResource } from "./resources/generations.js";
|
|
10
|
+
import { DraftsResource } from "./resources/drafts.js";
|
|
11
|
+
import { ReleasesResource } from "./resources/releases.js";
|
|
15
12
|
import { FilesResource } from "./resources/files.js";
|
|
13
|
+
import { PackagesResource } from "./resources/packages.js";
|
|
16
14
|
import { OrganizationResource } from "./resources/organization.js";
|
|
17
15
|
import { ApiKeysResource } from "./resources/api-keys.js";
|
|
18
16
|
/** This package's version, also sent as the `User-Agent`. */
|
|
19
|
-
export const VERSION = "0.
|
|
20
|
-
const USER_AGENT = "@typeship-ax/cli/0.
|
|
17
|
+
export const VERSION = "0.24.0";
|
|
18
|
+
const USER_AGENT = "@typeship-ax/cli/0.24.0";
|
|
21
19
|
/**
|
|
22
|
-
*
|
|
20
|
+
* Typeship — v0.24.0
|
|
23
21
|
*
|
|
24
22
|
* Resolve an OpenAPI or GraphQL Spec, diagnose it, and keep every
|
|
25
23
|
* selected CLI, MCP, and SDK Target current.
|
|
@@ -36,20 +34,21 @@ const USER_AGENT = "@typeship-ax/cli/0.22.0";
|
|
|
36
34
|
* petstore Spec is a runnable sample.
|
|
37
35
|
*/
|
|
38
36
|
export class TypeshipClient {
|
|
39
|
-
generate;
|
|
40
37
|
projects;
|
|
41
38
|
specs;
|
|
42
39
|
specRevisions;
|
|
43
40
|
targets;
|
|
44
|
-
drafts;
|
|
45
|
-
releases;
|
|
46
41
|
deliveries;
|
|
47
|
-
publications;
|
|
48
42
|
generations;
|
|
43
|
+
drafts;
|
|
44
|
+
releases;
|
|
49
45
|
files;
|
|
46
|
+
packages;
|
|
50
47
|
organization;
|
|
51
48
|
apiKeys;
|
|
49
|
+
_options;
|
|
52
50
|
constructor(options = {}) {
|
|
51
|
+
this._options = options;
|
|
53
52
|
// Identifies this package to the API (ignored by browsers, which
|
|
54
53
|
// control their own User-Agent); override via defaultHeaders.
|
|
55
54
|
const headers = { "User-Agent": USER_AGENT, ...options.defaultHeaders };
|
|
@@ -92,45 +91,56 @@ export class TypeshipClient {
|
|
|
92
91
|
query,
|
|
93
92
|
credentials,
|
|
94
93
|
fetch: options.fetch ?? fetch,
|
|
95
|
-
timeoutMs: options.timeoutMs ??
|
|
94
|
+
timeoutMs: options.timeoutMs ?? 60_000,
|
|
96
95
|
maxRetries: options.maxRetries ?? 2,
|
|
96
|
+
maxRetryWaitMs: options.maxRetryWaitMs,
|
|
97
97
|
onRequest: options.onRequest,
|
|
98
98
|
onResponse: options.onResponse,
|
|
99
99
|
onError: options.onError,
|
|
100
100
|
debug,
|
|
101
101
|
validate,
|
|
102
|
-
|
|
103
|
-
|
|
102
|
+
// Loaded on the first validated request, so the schema table costs
|
|
103
|
+
// nothing when validation is off.
|
|
104
|
+
loadSchemas: validate ? () => import("./schemas.js") : undefined,
|
|
104
105
|
});
|
|
105
|
-
this.generate = new GenerateResource(core);
|
|
106
106
|
this.projects = new ProjectsResource(core);
|
|
107
107
|
this.specs = new SpecsResource(core);
|
|
108
108
|
this.specRevisions = new SpecRevisionsResource(core);
|
|
109
109
|
this.targets = new TargetsResource(core);
|
|
110
|
-
this.drafts = new DraftsResource(core);
|
|
111
|
-
this.releases = new ReleasesResource(core);
|
|
112
110
|
this.deliveries = new DeliveriesResource(core);
|
|
113
|
-
this.publications = new PublicationsResource(core);
|
|
114
111
|
this.generations = new GenerationsResource(core);
|
|
112
|
+
this.drafts = new DraftsResource(core);
|
|
113
|
+
this.releases = new ReleasesResource(core);
|
|
115
114
|
this.files = new FilesResource(core);
|
|
115
|
+
this.packages = new PackagesResource(core);
|
|
116
116
|
this.organization = new OrganizationResource(core);
|
|
117
117
|
this.apiKeys = new ApiKeysResource(core);
|
|
118
118
|
}
|
|
119
|
+
/**
|
|
120
|
+
* A client with this client's configuration and only these credentials,
|
|
121
|
+
* for a server acting on behalf of many users. Nothing is inherited from
|
|
122
|
+
* this client's credentials. The copy shares the configured fetch.
|
|
123
|
+
*/
|
|
124
|
+
withCredentials(credentials) {
|
|
125
|
+
const options = { ...this._options };
|
|
126
|
+
for (const key of ["bearerToken", "credentials"])
|
|
127
|
+
delete options[key];
|
|
128
|
+
return new TypeshipClient({ ...options, ...credentials });
|
|
129
|
+
}
|
|
119
130
|
}
|
|
120
131
|
export * from "./types.js";
|
|
121
132
|
export * from "./errors.js";
|
|
122
133
|
export { formatDebugEvent, } from "./core/http.js";
|
|
123
134
|
export { Page, PagePromise } from "./core/pagination.js";
|
|
124
|
-
export * from "./resources/generate.js";
|
|
125
135
|
export * from "./resources/projects.js";
|
|
126
136
|
export * from "./resources/specs.js";
|
|
127
137
|
export * from "./resources/spec-revisions.js";
|
|
128
138
|
export * from "./resources/targets.js";
|
|
129
|
-
export * from "./resources/drafts.js";
|
|
130
|
-
export * from "./resources/releases.js";
|
|
131
139
|
export * from "./resources/deliveries.js";
|
|
132
|
-
export * from "./resources/publications.js";
|
|
133
140
|
export * from "./resources/generations.js";
|
|
141
|
+
export * from "./resources/drafts.js";
|
|
142
|
+
export * from "./resources/releases.js";
|
|
134
143
|
export * from "./resources/files.js";
|
|
144
|
+
export * from "./resources/packages.js";
|
|
135
145
|
export * from "./resources/organization.js";
|
|
136
146
|
export * from "./resources/api-keys.js";
|
|
@@ -16,6 +16,25 @@ export declare function resolveNamedCredentials(schemes: CredentialSchemes, laye
|
|
|
16
16
|
}[]): NamedCredentials;
|
|
17
17
|
/** Make convenience and named inputs comparable without expanding combinations. */
|
|
18
18
|
export declare function namedCredentialAvailability(schemes: CredentialSchemes, options: Set<string>, named: NamedCredentials): Set<string>;
|
|
19
|
+
/** The schemes an interactive OAuth login session authenticates by name. When
|
|
20
|
+
* the API also declares a separate non-OAuth bearer scheme, the convenience
|
|
21
|
+
* bearer token belongs to that scheme, so the session must be passed to each
|
|
22
|
+
* OAuth scheme by name. Empty: the session is the convenience bearer token. */
|
|
23
|
+
export declare function oauthSessionSchemes(schemes: CredentialSchemes): string[];
|
|
24
|
+
/** Whether resolved client options satisfy one complete credential alternative
|
|
25
|
+
* of an operation. Returns null when satisfied (or when no credential is
|
|
26
|
+
* required); otherwise the named alternatives and the schemes each lacks. */
|
|
27
|
+
export declare function missingCredentials(schemes: CredentialSchemes, credentialOptions: string[][] | undefined, options: Record<string, unknown>): {
|
|
28
|
+
alternatives: string[][];
|
|
29
|
+
missing: string[][];
|
|
30
|
+
} | null;
|
|
19
31
|
/** Bound file/stdin reads before allocating a full credential document. */
|
|
20
32
|
export declare function readNamedCredentialsFile(input: string, schemes: CredentialSchemes): NamedCredentials;
|
|
33
|
+
/** Extra request headers from repeated `--header "Name: value"` flags and a
|
|
34
|
+
* `<PREFIX>_HEADERS` variable (a JSON object, or one `Name: value` per line).
|
|
35
|
+
* The escape hatch for credentials a spec does not declare. Flags win over
|
|
36
|
+
* the environment; values never appear in errors. */
|
|
37
|
+
export declare function parseExtraHeaders(environment: string | undefined, flags: readonly string[], variable: string): Record<string, string>;
|
|
38
|
+
/** Apply extra headers last, replacing any header of the same name. */
|
|
39
|
+
export declare function applyExtraHeaders(target: Record<string, string>, extra: Record<string, string>): void;
|
|
21
40
|
//# sourceMappingURL=named-credentials.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"named-credentials.d.ts","sourceRoot":"","sources":["../src/named-credentials.ts"],"names":[],"mappings":"AAEA,0EAA0E;AAC1E,MAAM,MAAM,eAAe,GAAG,MAAM,GAAG;IAAE,QAAQ,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAAC;AAC9E,MAAM,MAAM,gBA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