@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,146 +0,0 @@
1
- // typeship — definitions resource.
2
- // Generated by typeship — https://typeship.dev
3
-
4
- import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
5
- import {
6
- ResponseParseError,
7
- TransportError,
8
- UnexpectedApiError,
9
- ValidationError,
10
- BadRequestError,
11
- ConflictError,
12
- ForbiddenError,
13
- InternalServerError,
14
- NotFoundError,
15
- PreconditionFailedError,
16
- RateLimitedError,
17
- UnauthorizedError,
18
- UnprocessableEntityError,
19
- } from "../errors.js";
20
- import type {
21
- Definition,
22
- DefinitionId,
23
- DefinitionRead,
24
- DefinitionUpdateRequest,
25
- } from "../types.js";
26
-
27
- export class DefinitionsResource {
28
- constructor(private readonly _core: HttpCore) {}
29
- /**
30
- * Retrieve a Definition
31
- * `GET /definitions/{definition_id}`
32
- */
33
- async retrieve(
34
- definitionId: DefinitionId,
35
- options?: RequestOptions,
36
- ): Promise<ApiResult<DefinitionRead, DefinitionsRetrieveError>> {
37
- return this._core.request<DefinitionRead, DefinitionsRetrieveError>({
38
- method: "GET",
39
- path: `/definitions/${encodeURIComponent(String(definitionId))}`,
40
- security: [{"apiKey":[]}],
41
- errors: {
42
- "401": UnauthorizedError,
43
- "403": ForbiddenError,
44
- "404": NotFoundError,
45
- "429": RateLimitedError,
46
- "500": InternalServerError,
47
- },
48
- idempotent: true,
49
- schemaKey: "definitions.retrieve",
50
- options,
51
- });
52
- }
53
-
54
- /**
55
- * Update and resolve a Definition
56
- *
57
- * Resolves the source documents before saving the update and records a new Definition Revision
58
- * when the source changes.
59
- * Omitted fields remain unchanged; supplied objects and arrays replace the whole field.
60
- * If the Definition or its Project configuration changes during validation, returns 409
61
- * definition_changed without saving the rejected update. Retrieve the current Definition and
62
- * Project, reconcile your changes,
63
- * and submit a new request with a new Idempotency-Key if using one.
64
- *
65
- * See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
66
- * and If-Match.
67
- *
68
- * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
69
- * `PATCH /definitions/{definition_id}`
70
- */
71
- async update(
72
- definitionId: DefinitionId,
73
- body: DefinitionUpdateRequest,
74
- params?: DefinitionsUpdateParams,
75
- options?: RequestOptions,
76
- ): Promise<ApiResult<DefinitionRead, DefinitionsUpdateError>> {
77
- return this._core.request<DefinitionRead, DefinitionsUpdateError>({
78
- method: "PATCH",
79
- path: `/definitions/${encodeURIComponent(String(definitionId))}`,
80
- security: [{"apiKey":[]}],
81
- headers: {
82
- "If-Match": params?.ifMatch === undefined ? undefined : String(params?.ifMatch),
83
- "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
84
- },
85
- body,
86
- errors: {
87
- "400": BadRequestError,
88
- "401": UnauthorizedError,
89
- "403": ForbiddenError,
90
- "404": NotFoundError,
91
- "409": ConflictError,
92
- "412": PreconditionFailedError,
93
- "422": UnprocessableEntityError,
94
- "429": RateLimitedError,
95
- "500": InternalServerError,
96
- },
97
- idempotencyKey: "Idempotency-Key",
98
- schemaKey: "definitions.update",
99
- options,
100
- });
101
- }
102
- }
103
-
104
- /** Every error `retrieve` can produce, as a discriminated union. */
105
- export type DefinitionsRetrieveError =
106
- | UnauthorizedError
107
- | ForbiddenError
108
- | NotFoundError
109
- | RateLimitedError
110
- | InternalServerError
111
- | UnexpectedApiError
112
- | ResponseParseError
113
- | TransportError
114
- | ValidationError;
115
-
116
- export interface DefinitionsUpdateParams {
117
- /**
118
- * ETag from a preceding response. The write applies only if the resource still has that version;
119
- * otherwise it returns 412 precondition_failed without changes. Omit to write the current
120
- * version. See https://typeship.dev/docs/typeship-api#conditional-writes.
121
- */
122
- ifMatch?: string;
123
- /**
124
- * Identifies one logical write for 24 hours. The key is scoped to the authenticated account and
125
- * operation; account-less generation uses a hashed network identity. Retrying the same method,
126
- * path, query, If-Match header, and JSON body replays the original response. Reusing the key with
127
- * changed intent returns 409. After expiry the key starts a new write.
128
- */
129
- idempotencyKey?: string;
130
- }
131
-
132
- /** Every error `update` can produce, as a discriminated union. */
133
- export type DefinitionsUpdateError =
134
- | BadRequestError
135
- | UnauthorizedError
136
- | ForbiddenError
137
- | NotFoundError
138
- | ConflictError
139
- | PreconditionFailedError
140
- | UnprocessableEntityError
141
- | RateLimitedError
142
- | InternalServerError
143
- | UnexpectedApiError
144
- | ResponseParseError
145
- | TransportError
146
- | ValidationError;