@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.
Files changed (99) hide show
  1. package/AGENTS.md +3 -3
  2. package/README.md +2 -2
  3. package/api.json +7355 -6233
  4. package/api.md +332 -398
  5. package/dist/api-identity.d.ts.map +1 -1
  6. package/dist/api-identity.js +6 -1
  7. package/dist/cli.js +15 -15
  8. package/dist/core/http.d.ts +26 -14
  9. package/dist/core/http.d.ts.map +1 -1
  10. package/dist/core/http.js +90 -19
  11. package/dist/core/pagination.d.ts +8 -8
  12. package/dist/core/pagination.d.ts.map +1 -1
  13. package/dist/core/pagination.js +7 -16
  14. package/dist/errors.d.ts +4 -4
  15. package/dist/errors.d.ts.map +1 -1
  16. package/dist/errors.js +7 -7
  17. package/dist/index.d.ts +33 -19
  18. package/dist/index.d.ts.map +1 -1
  19. package/dist/index.js +37 -17
  20. package/dist/ops.d.ts +1 -1
  21. package/dist/ops.d.ts.map +1 -1
  22. package/dist/ops.js +39 -42
  23. package/dist/resources/api-keys.d.ts +10 -10
  24. package/dist/resources/api-keys.d.ts.map +1 -1
  25. package/dist/resources/api-keys.js +6 -6
  26. package/dist/resources/deliveries.d.ts +46 -0
  27. package/dist/resources/deliveries.d.ts.map +1 -0
  28. package/dist/resources/deliveries.js +70 -0
  29. package/dist/resources/drafts.d.ts +155 -0
  30. package/dist/resources/drafts.d.ts.map +1 -0
  31. package/dist/resources/drafts.js +230 -0
  32. package/dist/resources/files.d.ts +23 -0
  33. package/dist/resources/files.d.ts.map +1 -0
  34. package/dist/resources/files.js +38 -0
  35. package/dist/resources/generate.d.ts +14 -14
  36. package/dist/resources/generate.d.ts.map +1 -1
  37. package/dist/resources/generate.js +7 -7
  38. package/dist/resources/generations.d.ts +65 -21
  39. package/dist/resources/generations.d.ts.map +1 -1
  40. package/dist/resources/generations.js +67 -20
  41. package/dist/resources/organization.d.ts +18 -0
  42. package/dist/resources/organization.d.ts.map +1 -0
  43. package/dist/resources/{account.js → organization.js} +10 -10
  44. package/dist/resources/projects.d.ts +36 -126
  45. package/dist/resources/projects.d.ts.map +1 -1
  46. package/dist/resources/projects.js +21 -171
  47. package/dist/resources/publications.d.ts +46 -0
  48. package/dist/resources/publications.d.ts.map +1 -0
  49. package/dist/resources/publications.js +70 -0
  50. package/dist/resources/releases.d.ts +66 -0
  51. package/dist/resources/releases.d.ts.map +1 -0
  52. package/dist/resources/releases.js +101 -0
  53. package/dist/resources/spec-revisions.d.ts +85 -0
  54. package/dist/resources/spec-revisions.d.ts.map +1 -0
  55. package/dist/resources/spec-revisions.js +116 -0
  56. package/dist/resources/specs.d.ts +72 -0
  57. package/dist/resources/specs.d.ts.map +1 -0
  58. package/dist/resources/specs.js +107 -0
  59. package/dist/resources/targets.d.ts +42 -262
  60. package/dist/resources/targets.d.ts.map +1 -1
  61. package/dist/resources/targets.js +28 -407
  62. package/dist/schemas.d.ts.map +1 -1
  63. package/dist/schemas.js +149 -154
  64. package/dist/types.d.ts +1281 -1611
  65. package/dist/types.d.ts.map +1 -1
  66. package/dist/types.js +44 -49
  67. package/package.json +1 -1
  68. package/src/api-identity.ts +6 -2
  69. package/src/cli.ts +16 -16
  70. package/src/core/http.ts +89 -24
  71. package/src/core/pagination.ts +13 -23
  72. package/src/errors.ts +7 -7
  73. package/src/index.ts +41 -23
  74. package/src/ops.ts +40 -43
  75. package/src/resources/api-keys.ts +13 -16
  76. package/src/resources/deliveries.ts +139 -0
  77. package/src/resources/drafts.ts +422 -0
  78. package/src/resources/files.ts +68 -0
  79. package/src/resources/generate.ts +16 -19
  80. package/src/resources/generations.ts +146 -35
  81. package/src/resources/{account.ts → organization.ts} +14 -14
  82. package/src/resources/projects.ts +42 -337
  83. package/src/resources/publications.ts +139 -0
  84. package/src/resources/releases.ts +199 -0
  85. package/src/resources/spec-revisions.ts +237 -0
  86. package/src/resources/specs.ts +200 -0
  87. package/src/resources/targets.ts +57 -760
  88. package/src/schemas.ts +149 -154
  89. package/src/types.ts +1357 -1692
  90. package/dist/resources/account.d.ts +0 -18
  91. package/dist/resources/account.d.ts.map +0 -1
  92. package/dist/resources/definition-revisions.d.ts +0 -75
  93. package/dist/resources/definition-revisions.d.ts.map +0 -1
  94. package/dist/resources/definition-revisions.js +0 -142
  95. package/dist/resources/definitions.d.ts +0 -50
  96. package/dist/resources/definitions.d.ts.map +0 -1
  97. package/dist/resources/definitions.js +0 -73
  98. package/src/resources/definition-revisions.ts +0 -265
  99. package/src/resources/definitions.ts +0 -146
@@ -1,18 +0,0 @@
1
- import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
2
- import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, ForbiddenError, InternalServerError, RateLimitedError, UnauthorizedError } from "../errors.js";
3
- import type { AccountRead } from "../types.js";
4
- export declare class AccountResource {
5
- private readonly _core;
6
- constructor(_core: HttpCore);
7
- /**
8
- * The account behind the presented credentials
9
- *
10
- * Returns the account associated with your credential. The Typeship CLI uses this endpoint for
11
- * `whoami`.
12
- * `GET /me`
13
- */
14
- retrieve(options?: RequestOptions): Promise<ApiResult<AccountRead, AccountRetrieveError>>;
15
- }
16
- /** Every error `retrieve` can produce, as a discriminated union. */
17
- export type AccountRetrieveError = UnauthorizedError | ForbiddenError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
18
- //# sourceMappingURL=account.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"account.d.ts","sourceRoot":"","sources":["../../src/resources/account.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAW,WAAW,EAAE,MAAM,aAAa,CAAC;AAExD,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;;OAMG;IACG,QAAQ,CAAC,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,SAAS,CAAC,WAAW,EAAE,oBAAoB,CAAC,CAAC;CAgBhG;AAED,oEAAoE;AACpE,MAAM,MAAM,oBAAoB,GAC5B,iBAAiB,GACjB,cAAc,GACd,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
@@ -1,75 +0,0 @@
1
- import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
2
- import { PagePromise } from "../core/pagination.js";
3
- import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadRequestError, ForbiddenError, InternalServerError, NotFoundError, RateLimitedError, UnauthorizedError } from "../errors.js";
4
- import type { DefinitionDocumentId, DefinitionDocumentResponseRead, DefinitionId, DefinitionRevisionId, DefinitionRevisionRead, DefinitionRevisionResponseRead } from "../types.js";
5
- export declare class DefinitionRevisionsResource {
6
- private readonly _core;
7
- constructor(_core: HttpCore);
8
- /**
9
- * List Definition Revisions
10
- *
11
- * Lists the Definition's revisions, newest first. Source content is not included; retrieve the
12
- * revision content or individual documents separately.
13
- *
14
- * Auto-paginates: `for await (const item of …)` walks every page.
15
- * `GET /definitions/{definition_id}/revisions`
16
- */
17
- list(definitionId: DefinitionId, params?: DefinitionRevisionsListParams, options?: RequestOptions): PagePromise<DefinitionRevisionRead, DefinitionRevisionsListError>;
18
- /**
19
- * Retrieve a Definition Revision
20
- *
21
- * Returns metadata for a saved Definition Revision. Retrieve its resolved content or individual
22
- * source documents separately.
23
- * `GET /definition-revisions/{definition_revision_id}`
24
- */
25
- retrieve(definitionRevisionId: DefinitionRevisionId, options?: RequestOptions): Promise<ApiResult<DefinitionRevisionResponseRead, DefinitionRevisionsRetrieveError>>;
26
- /**
27
- * Retrieve a Definition Revision's canonical content
28
- *
29
- * Returns the saved, resolved content for this revision. Save it locally or compare it with
30
- * another revision.
31
- * `GET /definition-revisions/{definition_revision_id}/content`
32
- */
33
- retrieveContent(definitionRevisionId: DefinitionRevisionId, options?: RequestOptions): Promise<ApiResult<string, DefinitionRevisionsRetrieveContentError>>;
34
- /**
35
- * Retrieve one source document from a Definition Revision
36
- * `GET /definition-revisions/{definition_revision_id}/documents/{document_id}/content`
37
- */
38
- retrieveDocumentContent(definitionRevisionId: DefinitionRevisionId, documentId: DefinitionDocumentId, options?: RequestOptions): Promise<ApiResult<string, DefinitionRevisionsRetrieveDocumentContentError>>;
39
- /**
40
- * Retrieve a Definition Document
41
- *
42
- * Returns metadata for one source document captured in a Definition Revision. Retrieve its
43
- * content through the revision's document content endpoint. A document in another organization
44
- * returns 404 not_found.
45
- * `GET /definition-documents/{definition_document_id}`
46
- */
47
- retrieveDocument(definitionDocumentId: DefinitionDocumentId, options?: RequestOptions): Promise<ApiResult<DefinitionDocumentResponseRead, DefinitionRevisionsRetrieveDocumentError>>;
48
- }
49
- export interface DefinitionRevisionsListParams {
50
- /**
51
- * Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
52
- * representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
53
- * invalid_request. List query parameters must appear only once; unrecognized parameters also
54
- * return 400.
55
- */
56
- limit?: number;
57
- /**
58
- * Opaque cursor from the preceding page's next_cursor. Valid only for the same account,
59
- * operation, filters, and ordering that issued it. Omit to start at the first page. Empty,
60
- * malformed, or repeated cursors return 400 invalid_request. The page limit may change between
61
- * requests.
62
- */
63
- cursor?: string;
64
- }
65
- /** Every error `list` can produce, as a discriminated union. */
66
- export type DefinitionRevisionsListError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
67
- /** Every error `retrieve` can produce, as a discriminated union. */
68
- export type DefinitionRevisionsRetrieveError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
69
- /** Every error `retrieveContent` can produce, as a discriminated union. */
70
- export type DefinitionRevisionsRetrieveContentError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
71
- /** Every error `retrieveDocumentContent` can produce, as a discriminated union. */
72
- export type DefinitionRevisionsRetrieveDocumentContentError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
73
- /** Every error `retrieveDocument` can produce, as a discriminated union. */
74
- export type DefinitionRevisionsRetrieveDocumentError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
75
- //# sourceMappingURL=definition-revisions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"definition-revisions.d.ts","sourceRoot":"","sources":["../../src/resources/definition-revisions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAY,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACV,oBAAoB,EAEpB,8BAA8B,EAC9B,YAAY,EAEZ,oBAAoB,EAGpB,sBAAsB,EAEtB,8BAA8B,EAC/B,MAAM,aAAa,CAAC;AAErB,qBAAa,2BAA2B;IAC1B,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;;;;OAQG;IACH,IAAI,CACF,YAAY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B,cAAc,GACd,eAAe,CAAC;AAEpB,2EAA2E;AAC3E,MAAM,MAAM,uCAAuC,GAC/C,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,mFAAmF;AACnF,MAAM,MAAM,+CAA+C,GACvD,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,4EAA4E;AAC5E,MAAM,MAAM,wCAAwC,GAChD,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
@@ -1,142 +0,0 @@
1
- // typeship — definitionRevisions 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 DefinitionRevisionsResource {
6
- _core;
7
- constructor(_core) {
8
- this._core = _core;
9
- }
10
- /**
11
- * List Definition Revisions
12
- *
13
- * Lists the Definition's revisions, newest first. Source content is not included; retrieve the
14
- * revision content or individual documents separately.
15
- *
16
- * Auto-paginates: `for await (const item of …)` walks every page.
17
- * `GET /definitions/{definition_id}/revisions`
18
- */
19
- list(definitionId, params, options) {
20
- return paginate(this._core, {
21
- method: "GET",
22
- path: `/definitions/${encodeURIComponent(String(definitionId))}/revisions`,
23
- security: [{ "apiKey": [] }],
24
- query: {
25
- limit: params?.limit,
26
- cursor: params?.cursor,
27
- },
28
- errors: {
29
- "400": BadRequestError,
30
- "401": UnauthorizedError,
31
- "403": ForbiddenError,
32
- "404": NotFoundError,
33
- "429": RateLimitedError,
34
- "500": InternalServerError,
35
- },
36
- idempotent: true,
37
- schemaKey: "definitionRevisions.list",
38
- options,
39
- }, {
40
- style: "cursor",
41
- itemsField: "data",
42
- cursorParam: "cursor",
43
- nextCursorField: "next_cursor",
44
- hasMoreField: "has_more",
45
- limitParam: "limit",
46
- });
47
- }
48
- /**
49
- * Retrieve a Definition Revision
50
- *
51
- * Returns metadata for a saved Definition Revision. Retrieve its resolved content or individual
52
- * source documents separately.
53
- * `GET /definition-revisions/{definition_revision_id}`
54
- */
55
- async retrieve(definitionRevisionId, options) {
56
- return this._core.request({
57
- method: "GET",
58
- path: `/definition-revisions/${encodeURIComponent(String(definitionRevisionId))}`,
59
- security: [{ "apiKey": [] }],
60
- errors: {
61
- "401": UnauthorizedError,
62
- "403": ForbiddenError,
63
- "404": NotFoundError,
64
- "429": RateLimitedError,
65
- "500": InternalServerError,
66
- },
67
- idempotent: true,
68
- schemaKey: "definitionRevisions.retrieve",
69
- options,
70
- });
71
- }
72
- /**
73
- * Retrieve a Definition Revision's canonical content
74
- *
75
- * Returns the saved, resolved content for this revision. Save it locally or compare it with
76
- * another revision.
77
- * `GET /definition-revisions/{definition_revision_id}/content`
78
- */
79
- async retrieveContent(definitionRevisionId, options) {
80
- return this._core.request({
81
- method: "GET",
82
- path: `/definition-revisions/${encodeURIComponent(String(definitionRevisionId))}/content`,
83
- security: [{ "apiKey": [] }],
84
- errors: {
85
- "401": UnauthorizedError,
86
- "403": ForbiddenError,
87
- "404": NotFoundError,
88
- "429": RateLimitedError,
89
- "500": InternalServerError,
90
- },
91
- idempotent: true,
92
- schemaKey: "definitionRevisions.retrieveContent",
93
- options,
94
- });
95
- }
96
- /**
97
- * Retrieve one source document from a Definition Revision
98
- * `GET /definition-revisions/{definition_revision_id}/documents/{document_id}/content`
99
- */
100
- async retrieveDocumentContent(definitionRevisionId, documentId, options) {
101
- return this._core.request({
102
- method: "GET",
103
- path: `/definition-revisions/${encodeURIComponent(String(definitionRevisionId))}/documents/${encodeURIComponent(String(documentId))}/content`,
104
- security: [{ "apiKey": [] }],
105
- errors: {
106
- "401": UnauthorizedError,
107
- "403": ForbiddenError,
108
- "404": NotFoundError,
109
- "429": RateLimitedError,
110
- "500": InternalServerError,
111
- },
112
- idempotent: true,
113
- schemaKey: "definitionRevisions.retrieveDocumentContent",
114
- options,
115
- });
116
- }
117
- /**
118
- * Retrieve a Definition Document
119
- *
120
- * Returns metadata for one source document captured in a Definition Revision. Retrieve its
121
- * content through the revision's document content endpoint. A document in another organization
122
- * returns 404 not_found.
123
- * `GET /definition-documents/{definition_document_id}`
124
- */
125
- async retrieveDocument(definitionDocumentId, options) {
126
- return this._core.request({
127
- method: "GET",
128
- path: `/definition-documents/${encodeURIComponent(String(definitionDocumentId))}`,
129
- security: [{ "apiKey": [] }],
130
- errors: {
131
- "401": UnauthorizedError,
132
- "403": ForbiddenError,
133
- "404": NotFoundError,
134
- "429": RateLimitedError,
135
- "500": InternalServerError,
136
- },
137
- idempotent: true,
138
- schemaKey: "definitionRevisions.retrieveDocument",
139
- options,
140
- });
141
- }
142
- }
@@ -1,50 +0,0 @@
1
- import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
2
- import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadRequestError, ConflictError, ForbiddenError, InternalServerError, NotFoundError, PreconditionFailedError, RateLimitedError, UnauthorizedError, UnprocessableEntityError } from "../errors.js";
3
- import type { DefinitionId, DefinitionRead, DefinitionUpdateRequest } from "../types.js";
4
- export declare class DefinitionsResource {
5
- private readonly _core;
6
- constructor(_core: HttpCore);
7
- /**
8
- * Retrieve a Definition
9
- * `GET /definitions/{definition_id}`
10
- */
11
- retrieve(definitionId: DefinitionId, options?: RequestOptions): Promise<ApiResult<DefinitionRead, DefinitionsRetrieveError>>;
12
- /**
13
- * Update and resolve a Definition
14
- *
15
- * Resolves the source documents before saving the update and records a new Definition Revision
16
- * when the source changes.
17
- * Omitted fields remain unchanged; supplied objects and arrays replace the whole field.
18
- * If the Definition or its Project configuration changes during validation, returns 409
19
- * definition_changed without saving the rejected update. Retrieve the current Definition and
20
- * Project, reconcile your changes,
21
- * and submit a new request with a new Idempotency-Key if using one.
22
- *
23
- * See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
24
- * and If-Match.
25
- *
26
- * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
27
- * `PATCH /definitions/{definition_id}`
28
- */
29
- update(definitionId: DefinitionId, body: DefinitionUpdateRequest, params?: DefinitionsUpdateParams, options?: RequestOptions): Promise<ApiResult<DefinitionRead, DefinitionsUpdateError>>;
30
- }
31
- /** Every error `retrieve` can produce, as a discriminated union. */
32
- export type DefinitionsRetrieveError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
33
- export interface DefinitionsUpdateParams {
34
- /**
35
- * ETag from a preceding response. The write applies only if the resource still has that version;
36
- * otherwise it returns 412 precondition_failed without changes. Omit to write the current
37
- * version. See https://typeship.dev/docs/typeship-api#conditional-writes.
38
- */
39
- ifMatch?: string;
40
- /**
41
- * Identifies one logical write for 24 hours. The key is scoped to the authenticated account and
42
- * operation; account-less generation uses a hashed network identity. Retrying the same method,
43
- * path, query, If-Match header, and JSON body replays the original response. Reusing the key with
44
- * changed intent returns 409. After expiry the key starts a new write.
45
- */
46
- idempotencyKey?: string;
47
- }
48
- /** Every error `update` can produce, as a discriminated union. */
49
- export type DefinitionsUpdateError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | PreconditionFailedError | UnprocessableEntityError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
50
- //# sourceMappingURL=definitions.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"definitions.d.ts","sourceRoot":"","sources":["../../src/resources/definitions.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EACL,kBAAkB,EAClB,c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 +0,0 @@
1
- // typeship — definitions resource.
2
- // Generated by typeship — https://typeship.dev
3
- import { BadRequestError, ConflictError, ForbiddenError, InternalServerError, NotFoundError, PreconditionFailedError, RateLimitedError, UnauthorizedError, UnprocessableEntityError, } from "../errors.js";
4
- export class DefinitionsResource {
5
- _core;
6
- constructor(_core) {
7
- this._core = _core;
8
- }
9
- /**
10
- * Retrieve a Definition
11
- * `GET /definitions/{definition_id}`
12
- */
13
- async retrieve(definitionId, options) {
14
- return this._core.request({
15
- method: "GET",
16
- path: `/definitions/${encodeURIComponent(String(definitionId))}`,
17
- security: [{ "apiKey": [] }],
18
- errors: {
19
- "401": UnauthorizedError,
20
- "403": ForbiddenError,
21
- "404": NotFoundError,
22
- "429": RateLimitedError,
23
- "500": InternalServerError,
24
- },
25
- idempotent: true,
26
- schemaKey: "definitions.retrieve",
27
- options,
28
- });
29
- }
30
- /**
31
- * Update and resolve a Definition
32
- *
33
- * Resolves the source documents before saving the update and records a new Definition Revision
34
- * when the source changes.
35
- * Omitted fields remain unchanged; supplied objects and arrays replace the whole field.
36
- * If the Definition or its Project configuration changes during validation, returns 409
37
- * definition_changed without saving the rejected update. Retrieve the current Definition and
38
- * Project, reconcile your changes,
39
- * and submit a new request with a new Idempotency-Key if using one.
40
- *
41
- * See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
42
- * and If-Match.
43
- *
44
- * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
45
- * `PATCH /definitions/{definition_id}`
46
- */
47
- async update(definitionId, body, params, options) {
48
- return this._core.request({
49
- method: "PATCH",
50
- path: `/definitions/${encodeURIComponent(String(definitionId))}`,
51
- security: [{ "apiKey": [] }],
52
- headers: {
53
- "If-Match": params?.ifMatch === undefined ? undefined : String(params?.ifMatch),
54
- "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
55
- },
56
- body,
57
- errors: {
58
- "400": BadRequestError,
59
- "401": UnauthorizedError,
60
- "403": ForbiddenError,
61
- "404": NotFoundError,
62
- "409": ConflictError,
63
- "412": PreconditionFailedError,
64
- "422": UnprocessableEntityError,
65
- "429": RateLimitedError,
66
- "500": InternalServerError,
67
- },
68
- idempotencyKey: "Idempotency-Key",
69
- schemaKey: "definitions.update",
70
- options,
71
- });
72
- }
73
- }
@@ -1,265 +0,0 @@
1
- // typeship — definitionRevisions resource.
2
- // Generated by typeship — https://typeship.dev
3
-
4
- import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
5
- import { paginate, PagePromise } from "../core/pagination.js";
6
- import {
7
- ResponseParseError,
8
- TransportError,
9
- UnexpectedApiError,
10
- ValidationError,
11
- BadRequestError,
12
- ForbiddenError,
13
- InternalServerError,
14
- NotFoundError,
15
- RateLimitedError,
16
- UnauthorizedError,
17
- } from "../errors.js";
18
- import type {
19
- DefinitionDocumentId,
20
- DefinitionDocumentResponse,
21
- DefinitionDocumentResponseRead,
22
- DefinitionId,
23
- DefinitionRevision,
24
- DefinitionRevisionId,
25
- DefinitionRevisionList,
26
- DefinitionRevisionListRead,
27
- DefinitionRevisionRead,
28
- DefinitionRevisionResponse,
29
- DefinitionRevisionResponseRead,
30
- } from "../types.js";
31
-
32
- export class DefinitionRevisionsResource {
33
- constructor(private readonly _core: HttpCore) {}
34
- /**
35
- * List Definition Revisions
36
- *
37
- * Lists the Definition's revisions, newest first. Source content is not included; retrieve the
38
- * revision content or individual documents separately.
39
- *
40
- * Auto-paginates: `for await (const item of …)` walks every page.
41
- * `GET /definitions/{definition_id}/revisions`
42
- */
43
- list(
44
- definitionId: DefinitionId,
45
- params?: DefinitionRevisionsListParams,
46
- options?: RequestOptions,
47
- ): PagePromise<DefinitionRevisionRead, DefinitionRevisionsListError> {
48
- return paginate<DefinitionRevisionRead, DefinitionRevisionsListError>(this._core, {
49
- method: "GET",
50
- path: `/definitions/${encodeURIComponent(String(definitionId))}/revisions`,
51
- security: [{"apiKey":[]}],
52
- query: {
53
- limit: params?.limit,
54
- cursor: params?.cursor,
55
- },
56
- errors: {
57
- "400": BadRequestError,
58
- "401": UnauthorizedError,
59
- "403": ForbiddenError,
60
- "404": NotFoundError,
61
- "429": RateLimitedError,
62
- "500": InternalServerError,
63
- },
64
- idempotent: true,
65
- schemaKey: "definitionRevisions.list",
66
- options,
67
- }, {
68
- style: "cursor",
69
- itemsField: "data",
70
- cursorParam: "cursor",
71
- nextCursorField: "next_cursor",
72
- hasMoreField: "has_more",
73
- limitParam: "limit",
74
- });
75
- }
76
-
77
- /**
78
- * Retrieve a Definition Revision
79
- *
80
- * Returns metadata for a saved Definition Revision. Retrieve its resolved content or individual
81
- * source documents separately.
82
- * `GET /definition-revisions/{definition_revision_id}`
83
- */
84
- async retrieve(
85
- definitionRevisionId: DefinitionRevisionId,
86
- options?: RequestOptions,
87
- ): Promise<ApiResult<DefinitionRevisionResponseRead, DefinitionRevisionsRetrieveError>> {
88
- return this._core.request<DefinitionRevisionResponseRead, DefinitionRevisionsRetrieveError>({
89
- method: "GET",
90
- path: `/definition-revisions/${encodeURIComponent(String(definitionRevisionId))}`,
91
- security: [{"apiKey":[]}],
92
- errors: {
93
- "401": UnauthorizedError,
94
- "403": ForbiddenError,
95
- "404": NotFoundError,
96
- "429": RateLimitedError,
97
- "500": InternalServerError,
98
- },
99
- idempotent: true,
100
- schemaKey: "definitionRevisions.retrieve",
101
- options,
102
- });
103
- }
104
-
105
- /**
106
- * Retrieve a Definition Revision's canonical content
107
- *
108
- * Returns the saved, resolved content for this revision. Save it locally or compare it with
109
- * another revision.
110
- * `GET /definition-revisions/{definition_revision_id}/content`
111
- */
112
- async retrieveContent(
113
- definitionRevisionId: DefinitionRevisionId,
114
- options?: RequestOptions,
115
- ): Promise<ApiResult<string, DefinitionRevisionsRetrieveContentError>> {
116
- return this._core.request<string, DefinitionRevisionsRetrieveContentError>({
117
- method: "GET",
118
- path: `/definition-revisions/${encodeURIComponent(String(definitionRevisionId))}/content`,
119
- security: [{"apiKey":[]}],
120
- errors: {
121
- "401": UnauthorizedError,
122
- "403": ForbiddenError,
123
- "404": NotFoundError,
124
- "429": RateLimitedError,
125
- "500": InternalServerError,
126
- },
127
- idempotent: true,
128
- schemaKey: "definitionRevisions.retrieveContent",
129
- options,
130
- });
131
- }
132
-
133
- /**
134
- * Retrieve one source document from a Definition Revision
135
- * `GET /definition-revisions/{definition_revision_id}/documents/{document_id}/content`
136
- */
137
- async retrieveDocumentContent(
138
- definitionRevisionId: DefinitionRevisionId,
139
- documentId: DefinitionDocumentId,
140
- options?: RequestOptions,
141
- ): Promise<ApiResult<string, DefinitionRevisionsRetrieveDocumentContentError>> {
142
- return this._core.request<string, DefinitionRevisionsRetrieveDocumentContentError>({
143
- method: "GET",
144
- path: `/definition-revisions/${encodeURIComponent(String(definitionRevisionId))}/documents/${encodeURIComponent(String(documentId))}/content`,
145
- security: [{"apiKey":[]}],
146
- errors: {
147
- "401": UnauthorizedError,
148
- "403": ForbiddenError,
149
- "404": NotFoundError,
150
- "429": RateLimitedError,
151
- "500": InternalServerError,
152
- },
153
- idempotent: true,
154
- schemaKey: "definitionRevisions.retrieveDocumentContent",
155
- options,
156
- });
157
- }
158
-
159
- /**
160
- * Retrieve a Definition Document
161
- *
162
- * Returns metadata for one source document captured in a Definition Revision. Retrieve its
163
- * content through the revision's document content endpoint. A document in another organization
164
- * returns 404 not_found.
165
- * `GET /definition-documents/{definition_document_id}`
166
- */
167
- async retrieveDocument(
168
- definitionDocumentId: DefinitionDocumentId,
169
- options?: RequestOptions,
170
- ): Promise<ApiResult<DefinitionDocumentResponseRead, DefinitionRevisionsRetrieveDocumentError>> {
171
- return this._core.request<DefinitionDocumentResponseRead, DefinitionRevisionsRetrieveDocumentError>({
172
- method: "GET",
173
- path: `/definition-documents/${encodeURIComponent(String(definitionDocumentId))}`,
174
- security: [{"apiKey":[]}],
175
- errors: {
176
- "401": UnauthorizedError,
177
- "403": ForbiddenError,
178
- "404": NotFoundError,
179
- "429": RateLimitedError,
180
- "500": InternalServerError,
181
- },
182
- idempotent: true,
183
- schemaKey: "definitionRevisions.retrieveDocument",
184
- options,
185
- });
186
- }
187
- }
188
-
189
- export interface DefinitionRevisionsListParams {
190
- /**
191
- * Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
192
- * representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
193
- * invalid_request. List query parameters must appear only once; unrecognized parameters also
194
- * return 400.
195
- */
196
- limit?: number;
197
- /**
198
- * Opaque cursor from the preceding page's next_cursor. Valid only for the same account,
199
- * operation, filters, and ordering that issued it. Omit to start at the first page. Empty,
200
- * malformed, or repeated cursors return 400 invalid_request. The page limit may change between
201
- * requests.
202
- */
203
- cursor?: string;
204
- }
205
-
206
- /** Every error `list` can produce, as a discriminated union. */
207
- export type DefinitionRevisionsListError =
208
- | BadRequestError
209
- | UnauthorizedError
210
- | ForbiddenError
211
- | NotFoundError
212
- | RateLimitedError
213
- | InternalServerError
214
- | UnexpectedApiError
215
- | ResponseParseError
216
- | TransportError
217
- | ValidationError;
218
-
219
- /** Every error `retrieve` can produce, as a discriminated union. */
220
- export type DefinitionRevisionsRetrieveError =
221
- | UnauthorizedError
222
- | ForbiddenError
223
- | NotFoundError
224
- | RateLimitedError
225
- | InternalServerError
226
- | UnexpectedApiError
227
- | ResponseParseError
228
- | TransportError
229
- | ValidationError;
230
-
231
- /** Every error `retrieveContent` can produce, as a discriminated union. */
232
- export type DefinitionRevisionsRetrieveContentError =
233
- | UnauthorizedError
234
- | ForbiddenError
235
- | NotFoundError
236
- | RateLimitedError
237
- | InternalServerError
238
- | UnexpectedApiError
239
- | ResponseParseError
240
- | TransportError
241
- | ValidationError;
242
-
243
- /** Every error `retrieveDocumentContent` can produce, as a discriminated union. */
244
- export type DefinitionRevisionsRetrieveDocumentContentError =
245
- | UnauthorizedError
246
- | ForbiddenError
247
- | NotFoundError
248
- | RateLimitedError
249
- | InternalServerError
250
- | UnexpectedApiError
251
- | ResponseParseError
252
- | TransportError
253
- | ValidationError;
254
-
255
- /** Every error `retrieveDocument` can produce, as a discriminated union. */
256
- export type DefinitionRevisionsRetrieveDocumentError =
257
- | UnauthorizedError
258
- | ForbiddenError
259
- | NotFoundError
260
- | RateLimitedError
261
- | InternalServerError
262
- | UnexpectedApiError
263
- | ResponseParseError
264
- | TransportError
265
- | ValidationError;