@typeship-ax/mcp 0.10.0 → 0.20.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 (107) hide show
  1. package/AGENTS.md +11 -5
  2. package/README.md +16 -5
  3. package/api.json +8824 -3777
  4. package/api.md +8359 -3987
  5. package/dist/api-identity.d.ts.map +1 -1
  6. package/dist/api-identity.js +6 -1
  7. package/dist/core/http.d.ts +29 -16
  8. package/dist/core/http.d.ts.map +1 -1
  9. package/dist/core/http.js +108 -25
  10. package/dist/core/pagination.d.ts +8 -8
  11. package/dist/core/pagination.d.ts.map +1 -1
  12. package/dist/core/pagination.js +7 -16
  13. package/dist/errors.d.ts +20 -13
  14. package/dist/errors.d.ts.map +1 -1
  15. package/dist/errors.js +29 -20
  16. package/dist/index.d.ts +37 -19
  17. package/dist/index.d.ts.map +1 -1
  18. package/dist/index.js +42 -18
  19. package/dist/mcp-protocol.d.ts +10 -6
  20. package/dist/mcp-protocol.d.ts.map +1 -1
  21. package/dist/mcp-protocol.js +110 -39
  22. package/dist/mcp.d.ts.map +1 -1
  23. package/dist/mcp.js +38 -18
  24. package/dist/ops.d.ts +5 -1
  25. package/dist/ops.d.ts.map +1 -1
  26. package/dist/ops.js +42 -35
  27. package/dist/resources/api-keys.d.ts +44 -18
  28. package/dist/resources/api-keys.d.ts.map +1 -1
  29. package/dist/resources/api-keys.js +46 -14
  30. package/dist/resources/deliveries.d.ts +46 -0
  31. package/dist/resources/deliveries.d.ts.map +1 -0
  32. package/dist/resources/deliveries.js +70 -0
  33. package/dist/resources/drafts.d.ts +155 -0
  34. package/dist/resources/drafts.d.ts.map +1 -0
  35. package/dist/resources/drafts.js +230 -0
  36. package/dist/resources/files.d.ts +23 -0
  37. package/dist/resources/files.d.ts.map +1 -0
  38. package/dist/resources/files.js +38 -0
  39. package/dist/resources/generate.d.ts +49 -20
  40. package/dist/resources/generate.d.ts.map +1 -1
  41. package/dist/resources/generate.js +56 -14
  42. package/dist/resources/generations.d.ts +70 -18
  43. package/dist/resources/generations.d.ts.map +1 -1
  44. package/dist/resources/generations.js +84 -16
  45. package/dist/resources/organization.d.ts +18 -0
  46. package/dist/resources/organization.d.ts.map +1 -0
  47. package/dist/resources/organization.js +32 -0
  48. package/dist/resources/projects.d.ts +87 -124
  49. package/dist/resources/projects.d.ts.map +1 -1
  50. package/dist/resources/projects.js +70 -173
  51. package/dist/resources/publications.d.ts +46 -0
  52. package/dist/resources/publications.d.ts.map +1 -0
  53. package/dist/resources/publications.js +70 -0
  54. package/dist/resources/releases.d.ts +66 -0
  55. package/dist/resources/releases.d.ts.map +1 -0
  56. package/dist/resources/releases.js +101 -0
  57. package/dist/resources/spec-revisions.d.ts +85 -0
  58. package/dist/resources/spec-revisions.d.ts.map +1 -0
  59. package/dist/resources/spec-revisions.js +116 -0
  60. package/dist/resources/specs.d.ts +72 -0
  61. package/dist/resources/specs.d.ts.map +1 -0
  62. package/dist/resources/specs.js +107 -0
  63. package/dist/resources/targets.d.ts +85 -105
  64. package/dist/resources/targets.d.ts.map +1 -1
  65. package/dist/resources/targets.js +70 -163
  66. package/dist/schemas.d.ts.map +1 -1
  67. package/dist/schemas.js +175 -129
  68. package/dist/types.d.ts +2626 -1141
  69. package/dist/types.d.ts.map +1 -1
  70. package/dist/types.js +90 -11
  71. package/package.json +3 -3
  72. package/server.json +3 -3
  73. package/src/api-identity.ts +6 -2
  74. package/src/core/http.ts +106 -30
  75. package/src/core/pagination.ts +13 -23
  76. package/src/errors.ts +30 -20
  77. package/src/index.ts +46 -24
  78. package/src/mcp-protocol.ts +95 -38
  79. package/src/mcp.ts +34 -16
  80. package/src/ops.ts +47 -36
  81. package/src/resources/api-keys.ts +87 -19
  82. package/src/resources/deliveries.ts +139 -0
  83. package/src/resources/drafts.ts +422 -0
  84. package/src/resources/files.ts +68 -0
  85. package/src/resources/generate.ts +81 -19
  86. package/src/resources/generations.ts +167 -29
  87. package/src/resources/organization.ts +53 -0
  88. package/src/resources/projects.ts +129 -322
  89. package/src/resources/publications.ts +139 -0
  90. package/src/resources/releases.ts +199 -0
  91. package/src/resources/spec-revisions.ts +237 -0
  92. package/src/resources/specs.ts +200 -0
  93. package/src/resources/targets.ts +135 -304
  94. package/src/schemas.ts +175 -129
  95. package/src/types.ts +2793 -1177
  96. package/dist/resources/account.d.ts +0 -18
  97. package/dist/resources/account.d.ts.map +0 -1
  98. package/dist/resources/account.js +0 -27
  99. package/dist/resources/definition-revisions.d.ts +0 -58
  100. package/dist/resources/definition-revisions.d.ts.map +0 -1
  101. package/dist/resources/definition-revisions.js +0 -114
  102. package/dist/resources/definitions.d.ts +0 -35
  103. package/dist/resources/definitions.d.ts.map +0 -1
  104. package/dist/resources/definitions.js +0 -60
  105. package/src/resources/account.ts +0 -46
  106. package/src/resources/definition-revisions.ts +0 -207
  107. package/src/resources/definitions.ts +0 -122
@@ -1,7 +1,7 @@
1
1
  // typeship — apiKeys resource.
2
- // Generated by typeship — https://typeship.dev — do not edit by hand.
2
+ // Generated by typeship — https://typeship.dev
3
3
 
4
- import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
4
+ import { HttpCore, type RequestOptions } from "../core/http.js";
5
5
  import { paginate, PagePromise } from "../core/pagination.js";
6
6
  import {
7
7
  ResponseParseError,
@@ -10,7 +10,9 @@ import {
10
10
  ValidationError,
11
11
  BadRequestError,
12
12
  ForbiddenError,
13
+ InternalServerError,
13
14
  NotFoundError,
15
+ PreconditionFailedError,
14
16
  RateLimitedError,
15
17
  UnauthorizedError,
16
18
  } from "../errors.js";
@@ -28,16 +30,16 @@ export class ApiKeysResource {
28
30
  /**
29
31
  * List API keys
30
32
  *
31
- * Keys are never returned in full — only their identity and last four. Creation stays in the
32
- * console deliberately: a leaked key that can mint more keys is a leaked account.
33
+ * Lists key metadata and the last four characters of each key. Full keys are not returned. Create
34
+ * keys in the Console.
33
35
  *
34
36
  * Auto-paginates: `for await (const item of …)` walks every page.
35
- * `GET /api_keys`
37
+ * `GET /api-keys`
36
38
  */
37
39
  list(params?: ApiKeysListParams, options?: RequestOptions): PagePromise<ApiKeyRead, ApiKeysListError> {
38
40
  return paginate<ApiKeyRead, ApiKeysListError>(this._core, {
39
41
  method: "GET",
40
- path: "/api_keys",
42
+ path: "/api-keys",
41
43
  security: [{"apiKey":[]}],
42
44
  query: {
43
45
  limit: params?.limit,
@@ -48,6 +50,7 @@ export class ApiKeysResource {
48
50
  "401": UnauthorizedError,
49
51
  "403": ForbiddenError,
50
52
  "429": RateLimitedError,
53
+ "500": InternalServerError,
51
54
  },
52
55
  idempotent: true,
53
56
  schemaKey: "apiKeys.list",
@@ -62,28 +65,61 @@ export class ApiKeysResource {
62
65
  });
63
66
  }
64
67
 
68
+ /**
69
+ * Get an API key
70
+ *
71
+ * Returns the key summary and its ETag for conditional revocation.
72
+ * `GET /api-keys/{api_key_id}`
73
+ */
74
+ async get(apiKeyId: string, options?: RequestOptions): Promise<ApiKeyResponseRead> {
75
+ return this._core.requestData<ApiKeyResponseRead, ApiKeysGetError>({
76
+ method: "GET",
77
+ path: `/api-keys/${encodeURIComponent(String(apiKeyId))}`,
78
+ security: [{"apiKey":[]}],
79
+ errors: {
80
+ "401": UnauthorizedError,
81
+ "403": ForbiddenError,
82
+ "404": NotFoundError,
83
+ "429": RateLimitedError,
84
+ "500": InternalServerError,
85
+ },
86
+ idempotent: true,
87
+ schemaKey: "apiKeys.get",
88
+ options,
89
+ });
90
+ }
91
+
65
92
  /**
66
93
  * Revoke an API key
67
94
  *
68
- * Idempotent: revoking an already-revoked key returns the same body, so a rotation script that
69
- * re-runs does not have to special-case having already succeeded. An OAuth member may revoke a
70
- * key they created; an organization admin may revoke any key. Organization API keys retain
71
- * account-wide authority.
72
- * `DELETE /api_keys/{api_key_id}`
95
+ * Revokes a key. Repeating the request returns the same result.
96
+ *
97
+ * With OAuth, members can revoke their own keys; organization admins can revoke any key.
98
+ * Organization API keys can revoke any key in their organization.
99
+ * See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
100
+ * and If-Match.
101
+ * `DELETE /api-keys/{api_key_id}`
73
102
  */
74
103
  async revoke(
75
104
  apiKeyId: string,
105
+ params?: ApiKeysRevokeParams,
76
106
  options?: RequestOptions,
77
- ): Promise<ApiResult<ApiKeyResponseRead, ApiKeysRevokeError>> {
78
- return this._core.request<ApiKeyResponseRead, ApiKeysRevokeError>({
107
+ ): Promise<ApiKeyResponseRead> {
108
+ return this._core.requestData<ApiKeyResponseRead, ApiKeysRevokeError>({
79
109
  method: "DELETE",
80
- path: `/api_keys/${encodeURIComponent(String(apiKeyId))}`,
110
+ path: `/api-keys/${encodeURIComponent(String(apiKeyId))}`,
81
111
  security: [{"apiKey":[]}],
112
+ headers: {
113
+ "If-Match": params?.ifMatch === undefined ? undefined : String(params?.ifMatch),
114
+ },
82
115
  errors: {
116
+ "400": BadRequestError,
83
117
  "401": UnauthorizedError,
84
118
  "403": ForbiddenError,
85
119
  "404": NotFoundError,
120
+ "412": PreconditionFailedError,
86
121
  "429": RateLimitedError,
122
+ "500": InternalServerError,
87
123
  },
88
124
  idempotent: true,
89
125
  schemaKey: "apiKeys.revoke",
@@ -93,32 +129,64 @@ export class ApiKeysResource {
93
129
  }
94
130
 
95
131
  export interface ApiKeysListParams {
96
- /** Maximum number of resources to return. */
132
+ /**
133
+ * Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
134
+ * representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
135
+ * invalid_request. List query parameters must appear only once; unrecognized parameters also
136
+ * return 400.
137
+ */
97
138
  limit?: number;
98
139
  /**
99
- * Opaque cursor from the preceding page's next_cursor. Valid only for the same account,
100
- * operation, filters, and ordering that issued it.
140
+ * Opaque cursor from the preceding page's next_cursor. Valid only for the same organization,
141
+ * operation, filters, and ordering that issued it. Omit to start at the first page. Empty,
142
+ * malformed, or repeated cursors return 400 invalid_request. The page limit may change between
143
+ * requests.
101
144
  */
102
145
  cursor?: string;
103
146
  }
104
147
 
105
- /** Every error `list` can produce, as a discriminated union. */
148
+ /** Typed errors `list` can throw. */
106
149
  export type ApiKeysListError =
107
150
  | BadRequestError
108
151
  | UnauthorizedError
109
152
  | ForbiddenError
110
153
  | RateLimitedError
154
+ | InternalServerError
111
155
  | UnexpectedApiError
112
156
  | ResponseParseError
113
157
  | TransportError
114
158
  | ValidationError;
115
159
 
116
- /** Every error `revoke` can produce, as a discriminated union. */
160
+ /** Typed errors `get` can throw. */
161
+ export type ApiKeysGetError =
162
+ | UnauthorizedError
163
+ | ForbiddenError
164
+ | NotFoundError
165
+ | RateLimitedError
166
+ | InternalServerError
167
+ | UnexpectedApiError
168
+ | ResponseParseError
169
+ | TransportError
170
+ | ValidationError;
171
+
172
+ export interface ApiKeysRevokeParams {
173
+ /**
174
+ * ETag from a preceding response. The write applies only if the resource still has that version;
175
+ * otherwise it returns 412 precondition_failed without changes. Omit to write the current
176
+ * version. See https://typeship.dev/docs/typeship-api#conditional-writes.
177
+ */
178
+ ifMatch?: string;
179
+ }
180
+
181
+ /** Typed errors `revoke` can throw. */
117
182
  export type ApiKeysRevokeError =
183
+ | BadRequestError
118
184
  | UnauthorizedError
119
185
  | ForbiddenError
120
186
  | NotFoundError
187
+ | PreconditionFailedError
121
188
  | RateLimitedError
189
+ | InternalServerError
122
190
  | UnexpectedApiError
123
191
  | ResponseParseError
124
192
  | TransportError
@@ -0,0 +1,139 @@
1
+ // typeship — deliveries resource.
2
+ // Generated by typeship — https://typeship.dev
3
+
4
+ import { HttpCore, 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
+ Delivery,
20
+ DeliveryId,
21
+ DeliveryList,
22
+ DeliveryListRead,
23
+ DeliveryRead,
24
+ DeliveryResponse,
25
+ DeliveryResponseRead,
26
+ TargetId,
27
+ } from "../types.js";
28
+
29
+ export class DeliveriesResource {
30
+ constructor(private readonly _core: HttpCore) {}
31
+ /**
32
+ * List Deliveries
33
+ *
34
+ * Auto-paginates: `for await (const item of …)` walks every page.
35
+ * `GET /deliveries`
36
+ */
37
+ list(
38
+ params?: DeliveriesListParams,
39
+ options?: RequestOptions,
40
+ ): PagePromise<DeliveryRead, DeliveriesListError> {
41
+ return paginate<DeliveryRead, DeliveriesListError>(this._core, {
42
+ method: "GET",
43
+ path: "/deliveries",
44
+ security: [{"apiKey":[]}],
45
+ query: {
46
+ limit: params?.limit,
47
+ cursor: params?.cursor,
48
+ target_id: params?.targetId,
49
+ },
50
+ errors: {
51
+ "400": BadRequestError,
52
+ "401": UnauthorizedError,
53
+ "403": ForbiddenError,
54
+ "404": NotFoundError,
55
+ "429": RateLimitedError,
56
+ "500": InternalServerError,
57
+ },
58
+ idempotent: true,
59
+ schemaKey: "deliveries.list",
60
+ options,
61
+ }, {
62
+ style: "cursor",
63
+ itemsField: "data",
64
+ cursorParam: "cursor",
65
+ nextCursorField: "next_cursor",
66
+ hasMoreField: "has_more",
67
+ limitParam: "limit",
68
+ });
69
+ }
70
+
71
+ /**
72
+ * Get a Delivery
73
+ *
74
+ * Returns the configured repository or hosted MCP Delivery for a Target. A Delivery in another
75
+ * organization returns 404 not_found.
76
+ * `GET /deliveries/{delivery_id}`
77
+ */
78
+ async get(deliveryId: DeliveryId, options?: RequestOptions): Promise<DeliveryResponseRead> {
79
+ return this._core.requestData<DeliveryResponseRead, DeliveriesGetError>({
80
+ method: "GET",
81
+ path: `/deliveries/${encodeURIComponent(String(deliveryId))}`,
82
+ security: [{"apiKey":[]}],
83
+ errors: {
84
+ "401": UnauthorizedError,
85
+ "403": ForbiddenError,
86
+ "404": NotFoundError,
87
+ "429": RateLimitedError,
88
+ "500": InternalServerError,
89
+ },
90
+ idempotent: true,
91
+ schemaKey: "deliveries.get",
92
+ options,
93
+ });
94
+ }
95
+ }
96
+
97
+ export interface DeliveriesListParams {
98
+ /**
99
+ * Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
100
+ * representing an integer from 1 to 100. Empty, malformed, or out-of-range values return 400
101
+ * invalid_request. List query parameters must appear only once; unrecognized parameters also
102
+ * return 400.
103
+ */
104
+ limit?: number;
105
+ /**
106
+ * Opaque cursor from the preceding page's next_cursor. Valid only for the same organization,
107
+ * operation, filters, and ordering that issued it. Omit to start at the first page. Empty,
108
+ * malformed, or repeated cursors return 400 invalid_request. The page limit may change between
109
+ * requests.
110
+ */
111
+ cursor?: string;
112
+ /** Only Deliveries of this Target. */
113
+ targetId?: TargetId;
114
+ }
115
+
116
+ /** Typed errors `list` can throw. */
117
+ export type DeliveriesListError =
118
+ | BadRequestError
119
+ | UnauthorizedError
120
+ | ForbiddenError
121
+ | NotFoundError
122
+ | RateLimitedError
123
+ | InternalServerError
124
+ | UnexpectedApiError
125
+ | ResponseParseError
126
+ | TransportError
127
+ | ValidationError;
128
+
129
+ /** Typed errors `get` can throw. */
130
+ export type DeliveriesGetError =
131
+ | UnauthorizedError
132
+ | ForbiddenError
133
+ | NotFoundError
134
+ | RateLimitedError
135
+ | InternalServerError
136
+ | UnexpectedApiError
137
+ | ResponseParseError
138
+ | TransportError
139
+ | ValidationError;