@typeship-ax/cli 0.6.0 → 0.9.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/AGENTS.md +31 -0
- package/README.md +26 -9
- package/api.json +6861 -3083
- package/api.md +508 -277
- package/dist/api-identity.d.ts +40 -0
- package/dist/api-identity.d.ts.map +1 -0
- package/dist/api-identity.js +128 -0
- package/dist/auth-profiles.d.ts +30 -0
- package/dist/auth-profiles.d.ts.map +1 -0
- package/dist/auth-profiles.js +138 -0
- package/dist/cli-agent.d.ts +9 -1
- package/dist/cli-agent.d.ts.map +1 -1
- package/dist/cli-agent.js +26 -9
- package/dist/cli.js +600 -582
- package/dist/console-login-check.d.ts +21 -0
- package/dist/console-login-check.d.ts.map +1 -0
- package/dist/console-login-check.js +107 -0
- package/dist/console-login-contract.d.ts +45 -0
- package/dist/console-login-contract.d.ts.map +1 -0
- package/dist/console-login-contract.js +40 -0
- package/dist/core/http.d.ts +21 -92
- package/dist/core/http.d.ts.map +1 -1
- package/dist/core/http.js +143 -221
- package/dist/core/pagination.d.ts.map +1 -1
- package/dist/core/pagination.js +6 -34
- package/dist/credential-storage.d.ts +24 -0
- package/dist/credential-storage.d.ts.map +1 -0
- package/dist/credential-storage.js +207 -0
- package/dist/dates.d.ts +0 -2
- package/dist/dates.d.ts.map +1 -1
- package/dist/dates.js +0 -1
- package/dist/docs.d.ts +36 -0
- package/dist/docs.d.ts.map +1 -0
- package/dist/docs.js +258 -0
- package/dist/errors.d.ts +42 -34
- package/dist/errors.d.ts.map +1 -1
- package/dist/errors.js +30 -20
- package/dist/index.d.ts +27 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +40 -14
- package/dist/named-credentials.d.ts +21 -0
- package/dist/named-credentials.d.ts.map +1 -0
- package/dist/named-credentials.js +86 -0
- package/dist/oauth-login.d.ts +39 -0
- package/dist/oauth-login.d.ts.map +1 -0
- package/dist/oauth-login.js +171 -0
- package/dist/oauth-request.d.ts +21 -0
- package/dist/oauth-request.d.ts.map +1 -0
- package/dist/oauth-request.js +119 -0
- package/dist/oauth-session.d.ts +106 -0
- package/dist/oauth-session.d.ts.map +1 -0
- package/dist/oauth-session.js +244 -0
- package/dist/ops.d.ts +18 -0
- package/dist/ops.d.ts.map +1 -1
- package/dist/ops.js +31 -17
- package/dist/polling-login.d.ts +57 -0
- package/dist/polling-login.d.ts.map +1 -0
- package/dist/polling-login.js +204 -0
- package/dist/resources/account.d.ts +4 -4
- package/dist/resources/account.d.ts.map +1 -1
- package/dist/resources/account.js +1 -0
- package/dist/resources/api-keys.d.ts +13 -8
- package/dist/resources/api-keys.d.ts.map +1 -1
- package/dist/resources/api-keys.js +5 -1
- package/dist/resources/definition-revisions.d.ts +58 -0
- package/dist/resources/definition-revisions.d.ts.map +1 -0
- package/dist/resources/definition-revisions.js +114 -0
- package/dist/resources/definitions.d.ts +35 -0
- package/dist/resources/definitions.d.ts.map +1 -0
- package/dist/resources/definitions.js +60 -0
- package/dist/resources/generate.d.ts +18 -7
- package/dist/resources/generate.d.ts.map +1 -1
- package/dist/resources/generate.js +13 -5
- package/dist/resources/generations.d.ts +6 -6
- package/dist/resources/generations.d.ts.map +1 -1
- package/dist/resources/generations.js +3 -1
- package/dist/resources/projects.d.ts +111 -35
- package/dist/resources/projects.d.ts.map +1 -1
- package/dist/resources/projects.js +125 -15
- package/dist/resources/targets.d.ts +97 -0
- package/dist/resources/targets.d.ts.map +1 -0
- package/dist/resources/targets.js +197 -0
- package/dist/schemas.d.ts.map +1 -1
- package/dist/schemas.js +135 -62
- package/dist/types.d.ts +2072 -267
- package/dist/types.d.ts.map +1 -1
- package/dist/types.js +20 -3
- package/package.json +2 -1
- package/src/api-identity.ts +98 -0
- package/src/auth-profiles.ts +114 -0
- package/src/cli-agent.ts +28 -11
- package/src/cli.ts +528 -560
- package/src/console-login-check.ts +88 -0
- package/src/console-login-contract.ts +65 -0
- package/src/core/http.ts +156 -305
- package/src/core/pagination.ts +6 -30
- package/src/credential-storage.ts +183 -0
- package/src/dates.ts +0 -1
- package/src/docs.ts +239 -0
- package/src/errors.ts +52 -41
- package/src/index.ts +49 -14
- package/src/named-credentials.ts +74 -0
- package/src/oauth-login.ts +184 -0
- package/src/oauth-request.ts +90 -0
- package/src/oauth-session.ts +258 -0
- package/src/ops.ts +56 -17
- package/src/polling-login.ts +165 -0
- package/src/resources/account.ts +6 -3
- package/src/resources/api-keys.ts +27 -7
- package/src/resources/definition-revisions.ts +207 -0
- package/src/resources/definitions.ts +122 -0
- package/src/resources/generate.ts +29 -6
- package/src/resources/generations.ts +9 -4
- package/src/resources/projects.ts +274 -41
- package/src/resources/targets.ts +378 -0
- package/src/schemas.ts +135 -62
- package/src/types.ts +2273 -322
- package/dist/resources/spec-revisions.d.ts +0 -47
- package/dist/resources/spec-revisions.d.ts.map +0 -1
- package/dist/resources/spec-revisions.js +0 -90
- package/src/resources/spec-revisions.ts +0 -150
|
@@ -3,67 +3,90 @@
|
|
|
3
3
|
|
|
4
4
|
import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
|
|
5
5
|
import {
|
|
6
|
+
ResponseParseError,
|
|
6
7
|
TransportError,
|
|
7
8
|
UnexpectedApiError,
|
|
8
9
|
ValidationError,
|
|
9
10
|
ApiResponseError,
|
|
10
11
|
BadRequestError,
|
|
12
|
+
ConflictError,
|
|
11
13
|
ForbiddenError,
|
|
12
14
|
PayloadTooLargeError,
|
|
13
15
|
RateLimitedError,
|
|
14
16
|
UnauthorizedError,
|
|
15
17
|
UnprocessableEntityError,
|
|
16
18
|
} from "../errors.js";
|
|
17
|
-
import type { GenerateRequest, GenerationResult } from "../types.js";
|
|
19
|
+
import type { GenerateRequest, GenerationResult, GenerationResultRead } from "../types.js";
|
|
18
20
|
|
|
19
21
|
export class GenerateResource {
|
|
20
22
|
constructor(private readonly _core: HttpCore) {}
|
|
21
23
|
/**
|
|
22
|
-
* Generate
|
|
24
|
+
* Generate one Target from a Definition
|
|
23
25
|
*
|
|
24
26
|
* Stateless generation: nothing is stored. Returns the full generated
|
|
25
27
|
* package as files. Works without an API key: anonymous calls generate
|
|
26
28
|
* the first 25 operations, rate limited per IP address, and the
|
|
27
29
|
* response's `limits` object says what was held back and where to lift
|
|
28
|
-
* it; anonymous calls from a
|
|
30
|
+
* it; anonymous calls from a Definition URL also carry `claim.url`, a link
|
|
29
31
|
* that turns the run into a project once a person signs in. With a key, the free plan generates
|
|
30
32
|
* the first 25 operations and
|
|
31
|
-
* paid plans generate the
|
|
33
|
+
* paid plans generate the complete Definition. A present but invalid key is a
|
|
32
34
|
* 401, not a downgrade to anonymous.
|
|
35
|
+
*
|
|
36
|
+
* A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
|
|
33
37
|
* `POST /generate`
|
|
34
38
|
*/
|
|
35
39
|
async run(
|
|
36
40
|
body: GenerateRequest,
|
|
41
|
+
params?: GenerateRunParams,
|
|
37
42
|
options?: RequestOptions,
|
|
38
|
-
): Promise<ApiResult<
|
|
39
|
-
return this._core.request<
|
|
43
|
+
): Promise<ApiResult<GenerationResultRead, GenerateRunError>> {
|
|
44
|
+
return this._core.request<GenerationResultRead, GenerateRunError>({
|
|
40
45
|
method: "POST",
|
|
41
46
|
path: "/generate",
|
|
47
|
+
security: [{},{"apiKey":[]}],
|
|
48
|
+
headers: {
|
|
49
|
+
"Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
|
|
50
|
+
},
|
|
42
51
|
body,
|
|
43
52
|
errors: {
|
|
44
53
|
"400": BadRequestError,
|
|
45
54
|
"401": UnauthorizedError,
|
|
46
55
|
"403": ForbiddenError,
|
|
56
|
+
"409": ConflictError,
|
|
47
57
|
"413": PayloadTooLargeError,
|
|
48
58
|
"422": UnprocessableEntityError,
|
|
49
59
|
"429": RateLimitedError,
|
|
50
60
|
default: ApiResponseError,
|
|
51
61
|
},
|
|
62
|
+
idempotencyKey: "Idempotency-Key",
|
|
52
63
|
schemaKey: "generate.run",
|
|
53
64
|
options,
|
|
54
65
|
});
|
|
55
66
|
}
|
|
56
67
|
}
|
|
57
68
|
|
|
69
|
+
export interface GenerateRunParams {
|
|
70
|
+
/**
|
|
71
|
+
* Identifies one logical write for 24 hours. The key is scoped to the authenticated account and
|
|
72
|
+
* operation; account-less generation uses a hashed network identity. Retrying the same method,
|
|
73
|
+
* path, query, and JSON body replays the original response. Reusing the key with changed intent
|
|
74
|
+
* returns 409. After expiry the key starts a new write.
|
|
75
|
+
*/
|
|
76
|
+
idempotencyKey?: string;
|
|
77
|
+
}
|
|
78
|
+
|
|
58
79
|
/** Every error `run` can produce, as a discriminated union. */
|
|
59
80
|
export type GenerateRunError =
|
|
60
81
|
| BadRequestError
|
|
61
82
|
| UnauthorizedError
|
|
62
83
|
| ForbiddenError
|
|
84
|
+
| ConflictError
|
|
63
85
|
| PayloadTooLargeError
|
|
64
86
|
| UnprocessableEntityError
|
|
65
87
|
| RateLimitedError
|
|
66
88
|
| ApiResponseError
|
|
67
89
|
| UnexpectedApiError
|
|
90
|
+
| ResponseParseError
|
|
68
91
|
| TransportError
|
|
69
92
|
| ValidationError;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
|
|
4
4
|
import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
|
|
5
5
|
import {
|
|
6
|
+
ResponseParseError,
|
|
6
7
|
TransportError,
|
|
7
8
|
UnexpectedApiError,
|
|
8
9
|
ValidationError,
|
|
@@ -12,7 +13,7 @@ import {
|
|
|
12
13
|
RateLimitedError,
|
|
13
14
|
UnauthorizedError,
|
|
14
15
|
} from "../errors.js";
|
|
15
|
-
import type {
|
|
16
|
+
import type { GenerationId, GenerationResponse, GenerationResponseRead } from "../types.js";
|
|
16
17
|
|
|
17
18
|
export class GenerationsResource {
|
|
18
19
|
constructor(private readonly _core: HttpCore) {}
|
|
@@ -25,10 +26,11 @@ export class GenerationsResource {
|
|
|
25
26
|
async retrieve(
|
|
26
27
|
generationId: GenerationId,
|
|
27
28
|
options?: RequestOptions,
|
|
28
|
-
): Promise<ApiResult<
|
|
29
|
-
return this._core.request<
|
|
29
|
+
): Promise<ApiResult<GenerationResponseRead, GenerationsRetrieveError>> {
|
|
30
|
+
return this._core.request<GenerationResponseRead, GenerationsRetrieveError>({
|
|
30
31
|
method: "GET",
|
|
31
32
|
path: `/generations/${encodeURIComponent(String(generationId))}`,
|
|
33
|
+
security: [{"apiKey":[]}],
|
|
32
34
|
errors: {
|
|
33
35
|
"401": UnauthorizedError,
|
|
34
36
|
"403": ForbiddenError,
|
|
@@ -44,7 +46,7 @@ export class GenerationsResource {
|
|
|
44
46
|
/**
|
|
45
47
|
* Fetch one file from a generation
|
|
46
48
|
*
|
|
47
|
-
* Raw file content, for generations whose
|
|
49
|
+
* Raw file content, for generations whose target was too large to inline (files_omitted true).
|
|
48
50
|
* The generation's files_index lists valid paths.
|
|
49
51
|
* `GET /generations/{generation_id}/file`
|
|
50
52
|
*/
|
|
@@ -56,6 +58,7 @@ export class GenerationsResource {
|
|
|
56
58
|
return this._core.request<string, GenerationsRetrieveFileError>({
|
|
57
59
|
method: "GET",
|
|
58
60
|
path: `/generations/${encodeURIComponent(String(generationId))}/file`,
|
|
61
|
+
security: [{"apiKey":[]}],
|
|
59
62
|
query: {
|
|
60
63
|
path: params.path,
|
|
61
64
|
},
|
|
@@ -80,6 +83,7 @@ export type GenerationsRetrieveError =
|
|
|
80
83
|
| NotFoundError
|
|
81
84
|
| RateLimitedError
|
|
82
85
|
| UnexpectedApiError
|
|
86
|
+
| ResponseParseError
|
|
83
87
|
| TransportError
|
|
84
88
|
| ValidationError;
|
|
85
89
|
|
|
@@ -96,5 +100,6 @@ export type GenerationsRetrieveFileError =
|
|
|
96
100
|
| NotFoundError
|
|
97
101
|
| RateLimitedError
|
|
98
102
|
| UnexpectedApiError
|
|
103
|
+
| ResponseParseError
|
|
99
104
|
| TransportError
|
|
100
105
|
| ValidationError;
|