@typeship-ax/mcp 0.21.0 → 0.22.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 (129) hide show
  1. package/AGENTS.md +15 -11
  2. package/README.md +22 -53
  3. package/api.json +9998 -10118
  4. package/api.md +8983 -9120
  5. package/dist/arguments.d.ts +47 -0
  6. package/dist/arguments.d.ts.map +1 -0
  7. package/dist/arguments.js +254 -0
  8. package/dist/core/http.d.ts +162 -19
  9. package/dist/core/http.d.ts.map +1 -1
  10. package/dist/core/http.js +381 -48
  11. package/dist/core/pagination.d.ts +42 -6
  12. package/dist/core/pagination.d.ts.map +1 -1
  13. package/dist/core/pagination.js +111 -17
  14. package/dist/credential-storage.d.ts +10 -3
  15. package/dist/credential-storage.d.ts.map +1 -1
  16. package/dist/credential-storage.js +15 -6
  17. package/dist/dates.d.ts +1 -1
  18. package/dist/dates.js +1 -1
  19. package/dist/errors.d.ts +20 -84
  20. package/dist/errors.d.ts.map +1 -1
  21. package/dist/errors.js +20 -108
  22. package/dist/fields.d.ts +29 -0
  23. package/dist/fields.d.ts.map +1 -0
  24. package/dist/fields.js +101 -0
  25. package/dist/index.d.ts +28 -18
  26. package/dist/index.d.ts.map +1 -1
  27. package/dist/index.js +35 -25
  28. package/dist/mcp-authorization.d.ts.map +1 -1
  29. package/dist/mcp-authorization.js +34 -10
  30. package/dist/mcp-protocol.d.ts +87 -44
  31. package/dist/mcp-protocol.d.ts.map +1 -1
  32. package/dist/mcp-protocol.js +552 -478
  33. package/dist/mcp.d.ts.map +1 -1
  34. package/dist/mcp.js +127 -28
  35. package/dist/named-credentials.d.ts +19 -0
  36. package/dist/named-credentials.d.ts.map +1 -1
  37. package/dist/named-credentials.js +81 -1
  38. package/dist/oauth-request.d.ts +7 -1
  39. package/dist/oauth-request.d.ts.map +1 -1
  40. package/dist/oauth-request.js +26 -4
  41. package/dist/oauth-session.d.ts +13 -1
  42. package/dist/oauth-session.d.ts.map +1 -1
  43. package/dist/oauth-session.js +34 -18
  44. package/dist/ops.d.ts +53 -5
  45. package/dist/ops.d.ts.map +1 -1
  46. package/dist/ops.js +49 -40
  47. package/dist/resources/api-keys.d.ts +10 -7
  48. package/dist/resources/api-keys.d.ts.map +1 -1
  49. package/dist/resources/api-keys.js +10 -31
  50. package/dist/resources/deliveries.d.ts +88 -4
  51. package/dist/resources/deliveries.d.ts.map +1 -1
  52. package/dist/resources/deliveries.js +95 -18
  53. package/dist/resources/drafts.d.ts +15 -15
  54. package/dist/resources/drafts.d.ts.map +1 -1
  55. package/dist/resources/drafts.js +11 -64
  56. package/dist/resources/files.d.ts +4 -4
  57. package/dist/resources/files.d.ts.map +1 -1
  58. package/dist/resources/files.js +3 -12
  59. package/dist/resources/generations.d.ts +14 -14
  60. package/dist/resources/generations.d.ts.map +1 -1
  61. package/dist/resources/generations.js +21 -45
  62. package/dist/resources/organization.d.ts +4 -4
  63. package/dist/resources/organization.d.ts.map +1 -1
  64. package/dist/resources/organization.js +3 -10
  65. package/dist/resources/{generate.d.ts → packages.d.ts} +16 -16
  66. package/dist/resources/packages.d.ts.map +1 -0
  67. package/dist/resources/{generate.js → packages.js} +13 -29
  68. package/dist/resources/projects.d.ts +50 -50
  69. package/dist/resources/projects.d.ts.map +1 -1
  70. package/dist/resources/projects.js +60 -116
  71. package/dist/resources/releases.d.ts +21 -16
  72. package/dist/resources/releases.d.ts.map +1 -1
  73. package/dist/resources/releases.js +18 -39
  74. package/dist/resources/spec-revisions.d.ts +15 -6
  75. package/dist/resources/spec-revisions.d.ts.map +1 -1
  76. package/dist/resources/spec-revisions.js +6 -28
  77. package/dist/resources/specs.d.ts +7 -7
  78. package/dist/resources/specs.d.ts.map +1 -1
  79. package/dist/resources/specs.js +6 -34
  80. package/dist/resources/targets.d.ts +48 -48
  81. package/dist/resources/targets.d.ts.map +1 -1
  82. package/dist/resources/targets.js +58 -114
  83. package/dist/schemas.d.ts.map +1 -1
  84. package/dist/schemas.js +78 -76
  85. package/dist/search.d.ts +54 -0
  86. package/dist/search.d.ts.map +1 -0
  87. package/dist/search.js +421 -0
  88. package/dist/types.d.ts +499 -339
  89. package/dist/types.d.ts.map +1 -1
  90. package/dist/types.js +18 -18
  91. package/dist/worker.js +2 -2
  92. package/package.json +5 -2
  93. package/server.json +5 -5
  94. package/src/arguments.ts +242 -0
  95. package/src/core/http.ts +457 -58
  96. package/src/core/pagination.ts +129 -18
  97. package/src/credential-storage.ts +16 -6
  98. package/src/dates.ts +1 -1
  99. package/src/errors.ts +46 -115
  100. package/src/fields.ts +91 -0
  101. package/src/index.ts +45 -28
  102. package/src/mcp-authorization.ts +29 -9
  103. package/src/mcp-protocol.ts +580 -428
  104. package/src/mcp.ts +113 -26
  105. package/src/named-credentials.ts +66 -1
  106. package/src/oauth-request.ts +32 -6
  107. package/src/oauth-session.ts +37 -19
  108. package/src/ops.ts +82 -44
  109. package/src/resources/api-keys.ts +34 -48
  110. package/src/resources/deliveries.ts +211 -30
  111. package/src/resources/drafts.ts +60 -107
  112. package/src/resources/files.ts +19 -20
  113. package/src/resources/generations.ts +57 -75
  114. package/src/resources/organization.ts +11 -16
  115. package/src/resources/{generate.ts → packages.ts} +43 -51
  116. package/src/resources/projects.ts +145 -200
  117. package/src/resources/releases.ts +48 -65
  118. package/src/resources/spec-revisions.ts +38 -47
  119. package/src/resources/specs.ts +39 -59
  120. package/src/resources/targets.ts +143 -193
  121. package/src/schemas.ts +78 -76
  122. package/src/search.ts +434 -0
  123. package/src/types.ts +538 -357
  124. package/src/worker.ts +2 -2
  125. package/dist/resources/generate.d.ts.map +0 -1
  126. package/dist/resources/publications.d.ts +0 -47
  127. package/dist/resources/publications.d.ts.map +0 -1
  128. package/dist/resources/publications.js +0 -70
  129. package/src/resources/publications.ts +0 -140
@@ -1,12 +1,36 @@
1
- // typeship — targets resource.
2
- // Generated by typeship — https://typeship.dev
1
+ // Typeship — targets resource.
2
+ // Generated by Typeship — https://typeship.dev
3
3
  import { paginate } from "../core/pagination.js";
4
- import { BadGatewayError, BadRequestError, ConflictError, ForbiddenError, InternalServerError, NotFoundError, PaymentRequiredError, PreconditionFailedError, RateLimitedError, UnauthorizedError, UnprocessableEntityError, } from "../errors.js";
4
+ import { PaymentRequiredError, PreconditionFailedError, } from "../errors.js";
5
5
  export class TargetsResource {
6
6
  _core;
7
7
  constructor(_core) {
8
8
  this._core = _core;
9
9
  }
10
+ /**
11
+ * Create a Target
12
+ *
13
+ * Creates a Target with its own configuration, Deliveries, and release history. Multiple Targets
14
+ * can use the same generator.
15
+ *
16
+ * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
17
+ * `POST /targets`
18
+ */
19
+ async create(body, params, options) {
20
+ return this._core.requestData({
21
+ method: "POST",
22
+ path: "/targets",
23
+ security: [{ "apiKey": [] }],
24
+ headers: {
25
+ "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
26
+ },
27
+ body,
28
+ errors: { "402": PaymentRequiredError },
29
+ idempotencyKey: "Idempotency-Key",
30
+ schemaKey: "targets.create",
31
+ options,
32
+ });
33
+ }
10
34
  /**
11
35
  * List Targets
12
36
  *
@@ -23,14 +47,6 @@ export class TargetsResource {
23
47
  cursor: params?.cursor,
24
48
  project_id: params?.projectId,
25
49
  },
26
- errors: {
27
- "400": BadRequestError,
28
- "401": UnauthorizedError,
29
- "403": ForbiddenError,
30
- "404": NotFoundError,
31
- "429": RateLimitedError,
32
- "500": InternalServerError,
33
- },
34
50
  idempotent: true,
35
51
  schemaKey: "targets.list",
36
52
  options,
@@ -43,40 +59,6 @@ export class TargetsResource {
43
59
  limitParam: "limit",
44
60
  });
45
61
  }
46
- /**
47
- * Create an independently configured Target
48
- *
49
- * Creates a Target with its own configuration, Deliveries, and release history. Multiple Targets
50
- * can use the same generator.
51
- *
52
- * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
53
- * `POST /targets`
54
- */
55
- async create(body, params, options) {
56
- return this._core.requestData({
57
- method: "POST",
58
- path: "/targets",
59
- security: [{ "apiKey": [] }],
60
- headers: {
61
- "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
62
- },
63
- body,
64
- errors: {
65
- "400": BadRequestError,
66
- "401": UnauthorizedError,
67
- "402": PaymentRequiredError,
68
- "403": ForbiddenError,
69
- "404": NotFoundError,
70
- "409": ConflictError,
71
- "422": UnprocessableEntityError,
72
- "429": RateLimitedError,
73
- "500": InternalServerError,
74
- },
75
- idempotencyKey: "Idempotency-Key",
76
- schemaKey: "targets.create",
77
- options,
78
- });
79
- }
80
62
  /**
81
63
  * Get a Target
82
64
  * `GET /targets/{target_id}`
@@ -86,101 +68,73 @@ export class TargetsResource {
86
68
  method: "GET",
87
69
  path: `/targets/${encodeURIComponent(String(targetId))}`,
88
70
  security: [{ "apiKey": [] }],
89
- errors: {
90
- "401": UnauthorizedError,
91
- "403": ForbiddenError,
92
- "404": NotFoundError,
93
- "429": RateLimitedError,
94
- "500": InternalServerError,
95
- },
96
71
  idempotent: true,
97
72
  schemaKey: "targets.get",
98
73
  options,
99
74
  });
100
75
  }
101
76
  /**
102
- * Delete an unused Target
77
+ * Update a Target
103
78
  *
104
- * Deletes a Target with no Generation history, release history, or active Draft. A `409
105
- * resource_has_dependencies` means one of those resources still depends on it. Retrieve the
106
- * Target, disable it instead, or resolve the dependency before retrying.
79
+ * Omitted fields keep their current values. Supplied config and checks replace their complete
80
+ * stored values. Change Deliveries with createDelivery, updateDelivery, and deleteDelivery.
81
+ * With Project auto_generate enabled, changing Target config or checks queues that Target's
82
+ * Generation. A queued or running Target reuses that Generation.
83
+ * Omitting If-Match applies the update to the current resource; with If-Match, a stale ETag
84
+ * returns 412 precondition_failed without saving.
85
+ * Select the next version through PATCH /drafts/{draft_id} on the Target's draft_id.
107
86
  *
87
+ * A `409 target_busy` means the Target is publishing; wait for it to finish. A `409
88
+ * delivery_conflict` means another Target owns the requested repository tree; retrieve both
89
+ * Targets, choose a free destination, and retry.
90
+ * A `502 follow_up_failed` means the update was saved, but retiring an obsolete review or
91
+ * regenerating the Target failed. Retrieve the Target and follow the error's retryable and
92
+ * suggested_action fields.
108
93
  * See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
109
94
  * and If-Match.
110
- * `DELETE /targets/{target_id}`
95
+ * `PATCH /targets/{target_id}`
111
96
  */
112
- async delete(targetId, params, options) {
97
+ async update(targetId, body, params, options) {
113
98
  return this._core.requestData({
114
- method: "DELETE",
99
+ method: "PATCH",
115
100
  path: `/targets/${encodeURIComponent(String(targetId))}`,
116
101
  security: [{ "apiKey": [] }],
117
102
  headers: {
118
103
  "If-Match": params?.ifMatch === undefined ? undefined : String(params?.ifMatch),
119
104
  },
120
- errors: {
121
- "400": BadRequestError,
122
- "401": UnauthorizedError,
123
- "403": ForbiddenError,
124
- "404": NotFoundError,
125
- "409": ConflictError,
126
- "412": PreconditionFailedError,
127
- "429": RateLimitedError,
128
- "500": InternalServerError,
129
- },
130
- idempotent: true,
131
- schemaKey: "targets.delete",
105
+ body,
106
+ errors: { "402": PaymentRequiredError, "412": PreconditionFailedError },
107
+ schemaKey: "targets.update",
132
108
  options,
133
109
  });
134
110
  }
135
111
  /**
136
- * Update a Target or its Deliveries
112
+ * Delete a Target
137
113
  *
138
- * Omitted fields keep their current values. Supplied config, checks, and deliveries replace their
139
- * complete stored values.
140
- * With Project auto_generate enabled, changing Target config, checks, or Deliveries queues that
141
- * Target's Generation. A queued or running Target reuses that Generation.
142
- * Omitting If-Match applies the update to the current resource; with If-Match, a stale ETag
143
- * returns 412 precondition_failed without saving.
144
- * Select the next version through PATCH /drafts/{draft_id} on the Target's draft_id.
114
+ * Deletes a Target with no Generation history, release history, or active Draft. A `409
115
+ * resource_has_dependencies` means one of those resources still depends on it. Retrieve the
116
+ * Target, disable it instead, or resolve the dependency before retrying.
145
117
  *
146
- * A `409 target_busy` means the Target is publishing; wait for it to finish. A `409
147
- * delivery_conflict` means another Target owns the requested repository tree; retrieve both
148
- * Targets, choose a free destination, and retry.
149
- * A `502 follow_up_failed` means the update was saved, but retiring an obsolete review or
150
- * regenerating the Target failed. Retrieve the Target and follow the error's retryable and
151
- * suggested_action fields.
152
118
  * See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
153
119
  * and If-Match.
154
- * `PATCH /targets/{target_id}`
120
+ * `DELETE /targets/{target_id}`
155
121
  */
156
- async update(targetId, body, params, options) {
122
+ async delete(targetId, params, options) {
157
123
  return this._core.requestData({
158
- method: "PATCH",
124
+ method: "DELETE",
159
125
  path: `/targets/${encodeURIComponent(String(targetId))}`,
160
126
  security: [{ "apiKey": [] }],
161
127
  headers: {
162
128
  "If-Match": params?.ifMatch === undefined ? undefined : String(params?.ifMatch),
163
129
  },
164
- body,
165
- errors: {
166
- "400": BadRequestError,
167
- "401": UnauthorizedError,
168
- "402": PaymentRequiredError,
169
- "403": ForbiddenError,
170
- "404": NotFoundError,
171
- "409": ConflictError,
172
- "412": PreconditionFailedError,
173
- "422": UnprocessableEntityError,
174
- "429": RateLimitedError,
175
- "500": InternalServerError,
176
- "502": BadGatewayError,
177
- },
178
- schemaKey: "targets.update",
130
+ errors: { "412": PreconditionFailedError },
131
+ idempotent: true,
132
+ schemaKey: "targets.delete",
179
133
  options,
180
134
  });
181
135
  }
182
136
  /**
183
- * Adopt a verified existing package as the latest release
137
+ * Adopt a package release
184
138
  *
185
139
  * Checks the repository tag, package metadata, and registry artifact, then records the package as
186
140
  * an Imported latest release. Opens the first Typeship Draft at the next major version; review it
@@ -198,16 +152,6 @@ export class TargetsResource {
198
152
  "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
199
153
  },
200
154
  body,
201
- errors: {
202
- "400": BadRequestError,
203
- "401": UnauthorizedError,
204
- "403": ForbiddenError,
205
- "404": NotFoundError,
206
- "409": ConflictError,
207
- "422": UnprocessableEntityError,
208
- "429": RateLimitedError,
209
- "500": InternalServerError,
210
- },
211
155
  idempotencyKey: "Idempotency-Key",
212
156
  schemaKey: "targets.adopt",
213
157
  options,
@@ -1 +1 @@
1
- {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,CA0CpE,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CA0KxC,CAAC"}
1
+ {"version":3,"file":"schemas.d.ts","sourceRoot":"","sources":["../src/schemas.ts"],"names":[],"mappings":"AAOA,eAAO,MAAM,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE;IAAE,GAAG,CAAC,EAAE,OAAO,CAAC;IAAC,GAAG,CAAC,EAAE,OAAO,CAAA;CAAE,CA2CpE,CAAC;AAEF,eAAO,MAAM,IAAI,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CA2KxC,CAAC"}