@typeship-ax/mcp 0.21.0 → 0.23.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 (133) 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 +54 -0
  6. package/dist/arguments.d.ts.map +1 -0
  7. package/dist/arguments.js +265 -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 +36 -0
  23. package/dist/fields.d.ts.map +1 -0
  24. package/dist/fields.js +187 -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 +108 -44
  31. package/dist/mcp-protocol.d.ts.map +1 -1
  32. package/dist/mcp-protocol.js +780 -484
  33. package/dist/mcp.d.ts.map +1 -1
  34. package/dist/mcp.js +129 -29
  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 +58 -5
  45. package/dist/ops.d.ts.map +1 -1
  46. package/dist/ops.js +110 -41
  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 +89 -5
  51. package/dist/resources/deliveries.d.ts.map +1 -1
  52. package/dist/resources/deliveries.js +96 -19
  53. package/dist/resources/drafts.d.ts +16 -16
  54. package/dist/resources/drafts.d.ts.map +1 -1
  55. package/dist/resources/drafts.js +12 -65
  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 +16 -16
  60. package/dist/resources/generations.d.ts.map +1 -1
  61. package/dist/resources/generations.js +23 -47
  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 +22 -17
  72. package/dist/resources/releases.d.ts.map +1 -1
  73. package/dist/resources/releases.js +19 -40
  74. package/dist/resources/spec-revisions.d.ts +16 -7
  75. package/dist/resources/spec-revisions.d.ts.map +1 -1
  76. package/dist/resources/spec-revisions.js +7 -29
  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 +49 -49
  81. package/dist/resources/targets.d.ts.map +1 -1
  82. package/dist/resources/targets.js +59 -115
  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/type-docs.d.ts +61 -0
  89. package/dist/type-docs.d.ts.map +1 -0
  90. package/dist/type-docs.js +174 -0
  91. package/dist/types.d.ts +499 -339
  92. package/dist/types.d.ts.map +1 -1
  93. package/dist/types.js +18 -18
  94. package/dist/worker.js +2 -2
  95. package/package.json +5 -2
  96. package/server.json +5 -5
  97. package/src/arguments.ts +254 -0
  98. package/src/core/http.ts +457 -58
  99. package/src/core/pagination.ts +129 -18
  100. package/src/credential-storage.ts +16 -6
  101. package/src/dates.ts +1 -1
  102. package/src/errors.ts +46 -115
  103. package/src/fields.ts +167 -0
  104. package/src/index.ts +45 -28
  105. package/src/mcp-authorization.ts +29 -9
  106. package/src/mcp-protocol.ts +808 -435
  107. package/src/mcp.ts +115 -27
  108. package/src/named-credentials.ts +66 -1
  109. package/src/oauth-request.ts +32 -6
  110. package/src/oauth-session.ts +37 -19
  111. package/src/ops.ts +146 -45
  112. package/src/resources/api-keys.ts +34 -48
  113. package/src/resources/deliveries.ts +213 -32
  114. package/src/resources/drafts.ts +62 -109
  115. package/src/resources/files.ts +19 -20
  116. package/src/resources/generations.ts +61 -79
  117. package/src/resources/organization.ts +11 -16
  118. package/src/resources/{generate.ts → packages.ts} +43 -51
  119. package/src/resources/projects.ts +145 -200
  120. package/src/resources/releases.ts +50 -67
  121. package/src/resources/spec-revisions.ts +40 -49
  122. package/src/resources/specs.ts +39 -59
  123. package/src/resources/targets.ts +144 -194
  124. package/src/schemas.ts +78 -76
  125. package/src/search.ts +434 -0
  126. package/src/type-docs.ts +205 -0
  127. package/src/types.ts +538 -357
  128. package/src/worker.ts +2 -2
  129. package/dist/resources/generate.d.ts.map +0 -1
  130. package/dist/resources/publications.d.ts +0 -47
  131. package/dist/resources/publications.d.ts.map +0 -1
  132. package/dist/resources/publications.js +0 -70
  133. package/src/resources/publications.ts +0 -140
@@ -1,7 +1,7 @@
1
1
  import { HttpCore, type RequestOptions } from "../core/http.js";
2
2
  import { PagePromise } from "../core/pagination.js";
3
- import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadRequestError, ForbiddenError, InternalServerError, NotFoundError, PreconditionFailedError, RateLimitedError, UnauthorizedError } from "../errors.js";
4
- import type { ApiKeyRead, ApiKeyResponseRead } from "../types.js";
3
+ import { RateLimitError, ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadRequestError, ForbiddenError, NotFoundError, PreconditionFailedError, ServerError, UnauthorizedError } from "../errors.js";
4
+ import type { ApiKeyRead, ApiKeyResponseRead, ErrorModelRead } from "../types.js";
5
5
  export declare class ApiKeysResource {
6
6
  private readonly _core;
7
7
  constructor(_core: HttpCore);
@@ -25,13 +25,14 @@ export declare class ApiKeysResource {
25
25
  /**
26
26
  * Revoke an API key
27
27
  *
28
- * Revokes a key. Repeating the request returns the same result.
28
+ * Revokes a key immediately. The key stays listed with `status: revoked`. Repeating the request
29
+ * returns the same result.
29
30
  *
30
31
  * With OAuth, members can revoke their own keys; organization admins can revoke any key.
31
32
  * Organization API keys can revoke any key in their organization.
32
33
  * See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
33
34
  * and If-Match.
34
- * `DELETE /api-keys/{api_key_id}`
35
+ * `POST /api-keys/{api_key_id}/revoke`
35
36
  */
36
37
  revoke(apiKeyId: string, params?: ApiKeysRevokeParams, options?: RequestOptions): Promise<ApiKeyResponseRead>;
37
38
  }
@@ -51,11 +52,13 @@ export interface ApiKeysListParams {
51
52
  * change between requests.
52
53
  */
53
54
  cursor?: string;
55
+ /** Only keys with this status. */
56
+ status?: "active" | "revoked";
54
57
  }
55
58
  /** Typed errors `list` can throw. */
56
- export type ApiKeysListError = BadRequestError | UnauthorizedError | ForbiddenError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
59
+ export type ApiKeysListError = BadRequestError<ErrorModelRead> | UnauthorizedError<ErrorModelRead> | ForbiddenError<ErrorModelRead> | RateLimitError<ErrorModelRead> | ServerError<ErrorModelRead> | RateLimitError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
57
60
  /** Typed errors `get` can throw. */
58
- export type ApiKeysGetError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
61
+ export type ApiKeysGetError = UnauthorizedError<ErrorModelRead> | ForbiddenError<ErrorModelRead> | NotFoundError<ErrorModelRead> | RateLimitError<ErrorModelRead> | ServerError<ErrorModelRead> | RateLimitError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
59
62
  export interface ApiKeysRevokeParams {
60
63
  /**
61
64
  * ETag from a preceding response. The write applies only if the resource still has that version;
@@ -65,5 +68,5 @@ export interface ApiKeysRevokeParams {
65
68
  ifMatch?: string;
66
69
  }
67
70
  /** Typed errors `revoke` can throw. */
68
- export type ApiKeysRevokeError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | PreconditionFailedError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
71
+ export type ApiKeysRevokeError = BadRequestError<ErrorModelRead> | UnauthorizedError<ErrorModelRead> | ForbiddenError<ErrorModelRead> | NotFoundError<ErrorModelRead> | PreconditionFailedError | RateLimitError<ErrorModelRead> | ServerError<ErrorModelRead> | RateLimitError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
69
72
  //# sourceMappingURL=api-keys.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"api-keys.d.ts","sourceRoot":"","sources":["../../src/resources/api-keys.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAY,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EACL,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,cAAc,EACd,mBAAmB,EACnB,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kCAAkC;IAClC,MAAM,CAAC,EAAE,QAAQ,GAAG,SAAS,CAAC;CAC/B;AAED,qCAAqC;AACrC,MAAM,MAAM,gBAAgB,GACxB,eAAe,CAAC,cAAc,CAAC,GAC/B,iBAAiB,CAAC,cAAc,CAAC,GACjC,cAAc,CAAC,cAAc,CAAC,GAC9B,cAAc,CAAC,cAAc,CAAC,GAC9B,WAAW,CAAC,cAAc,CAAC,GAC3B,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,oCAAoC;AACpC,MAAM,MAAM,eAAe,GACvB,iBAAiB,CAAC,cAAc,CAAC,GACjC,cAAc,CAAC,cAAc,CAAC,GAC9B,aAAa,CAAC,cAAc,CAAC,GAC7B,cAAc,CAAC,cAAc,CAAC,GAC9B,WAAW,CAAC,cAAc,CAAC,GAC3B,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,MAAM,WAAW,mBAAmB;IAClC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,uCAAuC;AACvC,MAAM,MAAM,kBAAkB,GAC1B,eAAe,CAAC,cAAc,CAAC,GAC/B,iBAAiB,CAAC,cAAc,CAAC,GACjC,cAAc,CAAC,cAAc,CAAC,GAC9B,aAAa,CAAC,cAAc,CAAC,GAC7B,uBAAuB,GACvB,cAAc,CAAC,cAAc,CAAC,GAC9B,WAAW,CAAC,cAAc,CAAC,GAC3B,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
@@ -1,7 +1,7 @@
1
- // typeship — apiKeys resource.
2
- // Generated by typeship — https://typeship.dev
1
+ // Typeship — apiKeys resource.
2
+ // Generated by Typeship — https://typeship.dev
3
3
  import { paginate } from "../core/pagination.js";
4
- import { BadRequestError, ForbiddenError, InternalServerError, NotFoundError, PreconditionFailedError, RateLimitedError, UnauthorizedError, } from "../errors.js";
4
+ import { PreconditionFailedError, } from "../errors.js";
5
5
  export class ApiKeysResource {
6
6
  _core;
7
7
  constructor(_core) {
@@ -24,13 +24,7 @@ export class ApiKeysResource {
24
24
  query: {
25
25
  limit: params?.limit,
26
26
  cursor: params?.cursor,
27
- },
28
- errors: {
29
- "400": BadRequestError,
30
- "401": UnauthorizedError,
31
- "403": ForbiddenError,
32
- "429": RateLimitedError,
33
- "500": InternalServerError,
27
+ status: params?.status,
34
28
  },
35
29
  idempotent: true,
36
30
  schemaKey: "apiKeys.list",
@@ -55,13 +49,6 @@ export class ApiKeysResource {
55
49
  method: "GET",
56
50
  path: `/api-keys/${encodeURIComponent(String(apiKeyId))}`,
57
51
  security: [{ "apiKey": [] }],
58
- errors: {
59
- "401": UnauthorizedError,
60
- "403": ForbiddenError,
61
- "404": NotFoundError,
62
- "429": RateLimitedError,
63
- "500": InternalServerError,
64
- },
65
52
  idempotent: true,
66
53
  schemaKey: "apiKeys.get",
67
54
  options,
@@ -70,32 +57,24 @@ export class ApiKeysResource {
70
57
  /**
71
58
  * Revoke an API key
72
59
  *
73
- * Revokes a key. Repeating the request returns the same result.
60
+ * Revokes a key immediately. The key stays listed with `status: revoked`. Repeating the request
61
+ * returns the same result.
74
62
  *
75
63
  * With OAuth, members can revoke their own keys; organization admins can revoke any key.
76
64
  * Organization API keys can revoke any key in their organization.
77
65
  * See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
78
66
  * and If-Match.
79
- * `DELETE /api-keys/{api_key_id}`
67
+ * `POST /api-keys/{api_key_id}/revoke`
80
68
  */
81
69
  async revoke(apiKeyId, params, options) {
82
70
  return this._core.requestData({
83
- method: "DELETE",
84
- path: `/api-keys/${encodeURIComponent(String(apiKeyId))}`,
71
+ method: "POST",
72
+ path: `/api-keys/${encodeURIComponent(String(apiKeyId))}/revoke`,
85
73
  security: [{ "apiKey": [] }],
86
74
  headers: {
87
75
  "If-Match": params?.ifMatch === undefined ? undefined : String(params?.ifMatch),
88
76
  },
89
- errors: {
90
- "400": BadRequestError,
91
- "401": UnauthorizedError,
92
- "403": ForbiddenError,
93
- "404": NotFoundError,
94
- "412": PreconditionFailedError,
95
- "429": RateLimitedError,
96
- "500": InternalServerError,
97
- },
98
- idempotent: true,
77
+ errors: { "412": PreconditionFailedError },
99
78
  schemaKey: "apiKeys.revoke",
100
79
  options,
101
80
  });
@@ -1,10 +1,28 @@
1
1
  import { HttpCore, type RequestOptions } from "../core/http.js";
2
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 { DeliveryId, DeliveryRead, DeliveryResponseRead, TargetId } from "../types.js";
3
+ import { RateLimitError, ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadRequestError, ConflictError, ForbiddenError, NotFoundError, PreconditionFailedError, ServerError, UnauthorizedError, UnprocessableEntityError } from "../errors.js";
4
+ import type { DeletedDeliveryRead, DeliveryCreateRequest, DeliveryId, DeliveryRead, DeliveryResponseRead, DeliveryUpdateRequest, ErrorModelRead, TargetId } from "../types.js";
5
5
  export declare class DeliveriesResource {
6
6
  private readonly _core;
7
7
  constructor(_core: HttpCore);
8
+ /**
9
+ * Create a Delivery
10
+ *
11
+ * Adds a repository or hosted MCP Delivery to a Target. A Target has at most one Delivery of each
12
+ * type; a `409 delivery_exists` means it already has one, so update that Delivery instead.
13
+ * With Project auto_generate enabled, adding a Delivery queues the Target's Generation. A queued
14
+ * or running Target reuses that Generation.
15
+ *
16
+ * A `409 delivery_conflict` means another Target owns the requested repository directory. A `409
17
+ * target_busy` means the Target is publishing; wait for it to finish.
18
+ * A `502 follow_up_failed` means the Delivery was saved, but retiring an obsolete review or
19
+ * regenerating the Target failed. Get the Delivery and follow the error's retryable and
20
+ * suggested_action fields.
21
+ *
22
+ * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
23
+ * `POST /deliveries`
24
+ */
25
+ create(body: DeliveryCreateRequest, params?: DeliveriesCreateParams, options?: RequestOptions): Promise<DeliveryResponseRead>;
8
26
  /**
9
27
  * List Deliveries
10
28
  *
@@ -20,7 +38,53 @@ export declare class DeliveriesResource {
20
38
  * `GET /deliveries/{delivery_id}`
21
39
  */
22
40
  get(deliveryId: DeliveryId, options?: RequestOptions): Promise<DeliveryResponseRead>;
41
+ /**
42
+ * Update a Delivery
43
+ *
44
+ * Replaces a repository Delivery's settings. Omitted optional settings reset to their defaults.
45
+ * Hosted MCP Deliveries have no settings to update.
46
+ * With Project auto_generate enabled, changing a Delivery queues the Target's Generation. A
47
+ * queued or running Target reuses that Generation.
48
+ * Omitting If-Match applies the update to the current Delivery; with If-Match, a stale ETag
49
+ * returns 412 precondition_failed without saving.
50
+ *
51
+ * A `409 delivery_conflict` means another Target owns the requested repository directory. A `409
52
+ * target_busy` means the Target is publishing; wait for it to finish.
53
+ * A `502 follow_up_failed` means the Delivery was saved, but retiring an obsolete review or
54
+ * regenerating the Target failed. Get the Delivery and follow the error's retryable and
55
+ * suggested_action fields.
56
+ * See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
57
+ * and If-Match.
58
+ * `PATCH /deliveries/{delivery_id}`
59
+ */
60
+ update(deliveryId: DeliveryId, body: DeliveryUpdateRequest, params?: DeliveriesUpdateParams, options?: RequestOptions): Promise<DeliveryResponseRead>;
61
+ /**
62
+ * Delete a Delivery
63
+ *
64
+ * Removes a Delivery from its Target. Removing a repository Delivery retires the Target's open
65
+ * Draft pull request; removing a hosted MCP Delivery stops serving its URL. Recreating the type
66
+ * later allocates a new ID and, for hosted MCP, a new URL.
67
+ *
68
+ * A `409 target_busy` means the Target is publishing; wait for it to finish. A `502
69
+ * follow_up_failed` means the Delivery was removed, but retiring an obsolete review or
70
+ * regenerating the Target failed.
71
+ * See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
72
+ * and If-Match.
73
+ * `DELETE /deliveries/{delivery_id}`
74
+ */
75
+ delete(deliveryId: DeliveryId, params?: DeliveriesDeleteParams, options?: RequestOptions): Promise<DeletedDeliveryRead>;
76
+ }
77
+ export interface DeliveriesCreateParams {
78
+ /**
79
+ * Identifies one logical write for 24 hours. The key is scoped to the authenticated organization
80
+ * and operation; generation without an organization uses a hashed network identity. Retrying the
81
+ * same method, path, query, If-Match header, and JSON body replays the original response. Reusing
82
+ * the key with changed intent returns 409. After expiry the key starts a new write.
83
+ */
84
+ idempotencyKey?: string;
23
85
  }
86
+ /** Typed errors `create` can throw. */
87
+ export type DeliveriesCreateError = BadRequestError<ErrorModelRead> | UnauthorizedError<ErrorModelRead> | ForbiddenError<ErrorModelRead> | NotFoundError<ErrorModelRead> | ConflictError<ErrorModelRead> | UnprocessableEntityError<ErrorModelRead> | RateLimitError<ErrorModelRead> | ServerError<ErrorModelRead> | RateLimitError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
24
88
  export interface DeliveriesListParams {
25
89
  /**
26
90
  * Maximum number of resources to return. Omit for 20; otherwise supply base-10 digits
@@ -38,10 +102,30 @@ export interface DeliveriesListParams {
38
102
  */
39
103
  cursor?: string;
40
104
  /** Only Deliveries of this Target. */
41
- targetId?: TargetId;
105
+ target_id?: TargetId;
42
106
  }
43
107
  /** Typed errors `list` can throw. */
44
- export type DeliveriesListError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
108
+ export type DeliveriesListError = BadRequestError<ErrorModelRead> | UnauthorizedError<ErrorModelRead> | ForbiddenError<ErrorModelRead> | NotFoundError<ErrorModelRead> | RateLimitError<ErrorModelRead> | ServerError<ErrorModelRead> | RateLimitError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
45
109
  /** Typed errors `get` can throw. */
46
- export type DeliveriesGetError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
110
+ export type DeliveriesGetError = UnauthorizedError<ErrorModelRead> | ForbiddenError<ErrorModelRead> | NotFoundError<ErrorModelRead> | RateLimitError<ErrorModelRead> | ServerError<ErrorModelRead> | RateLimitError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
111
+ export interface DeliveriesUpdateParams {
112
+ /**
113
+ * ETag from a preceding response. The write applies only if the resource still has that version;
114
+ * otherwise it returns 412 precondition_failed without changes. Omit to write the current
115
+ * version. See https://typeship.dev/docs/typeship-api#conditional-writes.
116
+ */
117
+ ifMatch?: string;
118
+ }
119
+ /** Typed errors `update` can throw. */
120
+ export type DeliveriesUpdateError = BadRequestError<ErrorModelRead> | UnauthorizedError<ErrorModelRead> | ForbiddenError<ErrorModelRead> | NotFoundError<ErrorModelRead> | ConflictError<ErrorModelRead> | PreconditionFailedError | UnprocessableEntityError<ErrorModelRead> | RateLimitError<ErrorModelRead> | ServerError<ErrorModelRead> | RateLimitError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
121
+ export interface DeliveriesDeleteParams {
122
+ /**
123
+ * ETag from a preceding response. The write applies only if the resource still has that version;
124
+ * otherwise it returns 412 precondition_failed without changes. Omit to write the current
125
+ * version. See https://typeship.dev/docs/typeship-api#conditional-writes.
126
+ */
127
+ ifMatch?: string;
128
+ }
129
+ /** Typed errors `delete` can throw. */
130
+ export type DeliveriesDeleteError = BadRequestError<ErrorModelRead> | UnauthorizedError<ErrorModelRead> | ForbiddenError<ErrorModelRead> | NotFoundError<ErrorModelRead> | ConflictError<ErrorModelRead> | PreconditionFailedError | RateLimitError<ErrorModelRead> | ServerError<ErrorModelRead> | RateLimitError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
47
131
  //# sourceMappingURL=deliveries.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"deliveries.d.ts","sourceRoot":"","sources":["../../src/resources/deliveries.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,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9B,WAAW,CAAC,cAAc,CAAC,GAC3B,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,uCAAuC;AACvC,MAAM,MAAM,qBAAqB,GAC7B,eAAe,CAAC,cAAc,CAAC,GAC/B,iBAAiB,CAAC,cAAc,CAAC,GACjC,cAAc,CAAC,cAAc,CAAC,GAC9B,aAAa,CAAC,cAAc,CAAC,GAC7B,aAAa,CAAC,cAAc,CAAC,GAC7B,uBAAuB,GACvB,wBAAwB,CAAC,cAAc,CAAC,GACxC,cAAc,CAAC,cAAc,CAAC,GAC9B,WAAW,CAAC,cAAc,CAAC,GAC3B,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,MAAM,WAAW,sBAAsB;IACrC;;;;OAIG;IACH,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB;AAED,uCAAuC;AACvC,MAAM,MAAM,qBAAqB,GAC7B,eAAe,CAAC,cAAc,CAAC,GAC/B,iBAAiB,CAAC,cAAc,CAAC,GACjC,cAAc,CAAC,cAAc,CAAC,GAC9B,aAAa,CAAC,cAAc,CAAC,GAC7B,aAAa,CAAC,cAAc,CAAC,GAC7B,uBAAuB,GACvB,cAAc,CAAC,cAAc,CAAC,GAC9B,WAAW,CAAC,cAAc,CAAC,GAC3B,cAAc,GACd,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
@@ -1,12 +1,43 @@
1
- // typeship — deliveries resource.
2
- // Generated by typeship — https://typeship.dev
1
+ // Typeship — deliveries resource.
2
+ // Generated by Typeship — https://typeship.dev
3
3
  import { paginate } from "../core/pagination.js";
4
- import { BadRequestError, ForbiddenError, InternalServerError, NotFoundError, RateLimitedError, UnauthorizedError, } from "../errors.js";
4
+ import { PreconditionFailedError, } from "../errors.js";
5
5
  export class DeliveriesResource {
6
6
  _core;
7
7
  constructor(_core) {
8
8
  this._core = _core;
9
9
  }
10
+ /**
11
+ * Create a Delivery
12
+ *
13
+ * Adds a repository or hosted MCP Delivery to a Target. A Target has at most one Delivery of each
14
+ * type; a `409 delivery_exists` means it already has one, so update that Delivery instead.
15
+ * With Project auto_generate enabled, adding a Delivery queues the Target's Generation. A queued
16
+ * or running Target reuses that Generation.
17
+ *
18
+ * A `409 delivery_conflict` means another Target owns the requested repository directory. A `409
19
+ * target_busy` means the Target is publishing; wait for it to finish.
20
+ * A `502 follow_up_failed` means the Delivery was saved, but retiring an obsolete review or
21
+ * regenerating the Target failed. Get the Delivery and follow the error's retryable and
22
+ * suggested_action fields.
23
+ *
24
+ * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
25
+ * `POST /deliveries`
26
+ */
27
+ async create(body, params, options) {
28
+ return this._core.requestData({
29
+ method: "POST",
30
+ path: "/deliveries",
31
+ security: [{ "apiKey": [] }],
32
+ headers: {
33
+ "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
34
+ },
35
+ body,
36
+ idempotencyKey: "Idempotency-Key",
37
+ schemaKey: "deliveries.create",
38
+ options,
39
+ });
40
+ }
10
41
  /**
11
42
  * List Deliveries
12
43
  *
@@ -21,15 +52,7 @@ export class DeliveriesResource {
21
52
  query: {
22
53
  limit: params?.limit,
23
54
  cursor: params?.cursor,
24
- target_id: params?.targetId,
25
- },
26
- errors: {
27
- "400": BadRequestError,
28
- "401": UnauthorizedError,
29
- "403": ForbiddenError,
30
- "404": NotFoundError,
31
- "429": RateLimitedError,
32
- "500": InternalServerError,
55
+ target_id: params?.target_id,
33
56
  },
34
57
  idempotent: true,
35
58
  schemaKey: "deliveries.list",
@@ -55,16 +78,70 @@ export class DeliveriesResource {
55
78
  method: "GET",
56
79
  path: `/deliveries/${encodeURIComponent(String(deliveryId))}`,
57
80
  security: [{ "apiKey": [] }],
58
- errors: {
59
- "401": UnauthorizedError,
60
- "403": ForbiddenError,
61
- "404": NotFoundError,
62
- "429": RateLimitedError,
63
- "500": InternalServerError,
64
- },
65
81
  idempotent: true,
66
82
  schemaKey: "deliveries.get",
67
83
  options,
68
84
  });
69
85
  }
86
+ /**
87
+ * Update a Delivery
88
+ *
89
+ * Replaces a repository Delivery's settings. Omitted optional settings reset to their defaults.
90
+ * Hosted MCP Deliveries have no settings to update.
91
+ * With Project auto_generate enabled, changing a Delivery queues the Target's Generation. A
92
+ * queued or running Target reuses that Generation.
93
+ * Omitting If-Match applies the update to the current Delivery; with If-Match, a stale ETag
94
+ * returns 412 precondition_failed without saving.
95
+ *
96
+ * A `409 delivery_conflict` means another Target owns the requested repository directory. A `409
97
+ * target_busy` means the Target is publishing; wait for it to finish.
98
+ * A `502 follow_up_failed` means the Delivery was saved, but retiring an obsolete review or
99
+ * regenerating the Target failed. Get the Delivery and follow the error's retryable and
100
+ * suggested_action fields.
101
+ * See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
102
+ * and If-Match.
103
+ * `PATCH /deliveries/{delivery_id}`
104
+ */
105
+ async update(deliveryId, body, params, options) {
106
+ return this._core.requestData({
107
+ method: "PATCH",
108
+ path: `/deliveries/${encodeURIComponent(String(deliveryId))}`,
109
+ security: [{ "apiKey": [] }],
110
+ headers: {
111
+ "If-Match": params?.ifMatch === undefined ? undefined : String(params?.ifMatch),
112
+ },
113
+ body,
114
+ errors: { "412": PreconditionFailedError },
115
+ schemaKey: "deliveries.update",
116
+ options,
117
+ });
118
+ }
119
+ /**
120
+ * Delete a Delivery
121
+ *
122
+ * Removes a Delivery from its Target. Removing a repository Delivery retires the Target's open
123
+ * Draft pull request; removing a hosted MCP Delivery stops serving its URL. Recreating the type
124
+ * later allocates a new ID and, for hosted MCP, a new URL.
125
+ *
126
+ * A `409 target_busy` means the Target is publishing; wait for it to finish. A `502
127
+ * follow_up_failed` means the Delivery was removed, but retiring an obsolete review or
128
+ * regenerating the Target failed.
129
+ * See [conditional writes](https://typeship.dev/docs/typeship-api#conditional-writes) for ETag
130
+ * and If-Match.
131
+ * `DELETE /deliveries/{delivery_id}`
132
+ */
133
+ async delete(deliveryId, params, options) {
134
+ return this._core.requestData({
135
+ method: "DELETE",
136
+ path: `/deliveries/${encodeURIComponent(String(deliveryId))}`,
137
+ security: [{ "apiKey": [] }],
138
+ headers: {
139
+ "If-Match": params?.ifMatch === undefined ? undefined : String(params?.ifMatch),
140
+ },
141
+ errors: { "412": PreconditionFailedError },
142
+ idempotent: true,
143
+ schemaKey: "deliveries.delete",
144
+ options,
145
+ });
146
+ }
70
147
  }
@@ -1,7 +1,7 @@
1
1
  import { HttpCore, type RequestOptions } from "../core/http.js";
2
2
  import { PagePromise } from "../core/pagination.js";
3
- import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadGatewayError, BadRequestError, ConflictError, ForbiddenError, InternalServerError, NotFoundError, PreconditionFailedError, RateLimitedError, UnauthorizedError, UnprocessableEntityError } from "../errors.js";
4
- import type { DraftFileRead, DraftId, DraftRead, DraftRecoverRequest, DraftResolveRequest, DraftResponseRead, DraftStatus, DraftUpdateRequest, TargetId } from "../types.js";
3
+ import { RateLimitError, ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadRequestError, ConflictError, ForbiddenError, NotFoundError, PreconditionFailedError, ServerError, UnauthorizedError, UnprocessableEntityError } from "../errors.js";
4
+ import type { DraftFileRead, DraftId, DraftRead, DraftRecoverRequest, DraftResolveRequest, DraftResponseRead, DraftStatus, DraftUpdateRequest, ErrorModelRead, TargetId } from "../types.js";
5
5
  export declare class DraftsResource {
6
6
  private readonly _core;
7
7
  constructor(_core: HttpCore);
@@ -19,14 +19,14 @@ export declare class DraftsResource {
19
19
  * Get a Draft
20
20
  *
21
21
  * Returns the Draft's status. An open Draft also reports its typed reason when action is
22
- * required, next version and its source, readiness, checks, and conflict counts. The response
23
- * carries an `ETag`; send it in `If-Match` when updating the Draft to avoid changing a newer
24
- * version selection.
22
+ * required, next version and its source, compatibility and version assessment, blocking errors,
23
+ * checks, and conflict counts. The response carries an `ETag`; send it in `If-Match` when
24
+ * updating the Draft to avoid changing a newer version selection.
25
25
  * `GET /drafts/{draft_id}`
26
26
  */
27
27
  get(draftId: DraftId, options?: RequestOptions): Promise<DraftResponseRead>;
28
28
  /**
29
- * Select an exact Draft version or return to automatic versioning
29
+ * Update a Draft
30
30
  *
31
31
  * Checks your version choice against the required version bump, then regenerates the existing
32
32
  * Draft pull request.
@@ -49,7 +49,7 @@ export declare class DraftsResource {
49
49
  */
50
50
  update(draftId: DraftId, body: DraftUpdateRequest, params?: DraftsUpdateParams, options?: RequestOptions): Promise<DraftResponseRead>;
51
51
  /**
52
- * List customized and conflicted files on a Draft
52
+ * List a Draft's files
53
53
  *
54
54
  * Lists the Draft's files that differ from the last merged package or need a conflict decision,
55
55
  * ordered by path, without file content. Each conflict names its kind, the saved decision, and
@@ -64,7 +64,7 @@ export declare class DraftsResource {
64
64
  */
65
65
  listFiles(draftId: DraftId, params?: DraftsListFilesParams, options?: RequestOptions): PagePromise<DraftFileRead, DraftsListFilesError>;
66
66
  /**
67
- * Resolve selected Draft files
67
+ * Resolve Draft conflicts
68
68
  *
69
69
  * Resolves conflicts on the Draft's head_sha: keep yours or generated, or supply final content as
70
70
  * text or, for binary files, base64. Choosing generated for a customized path replaces it with
@@ -78,7 +78,7 @@ export declare class DraftsResource {
78
78
  */
79
79
  resolve(draftId: DraftId, body: DraftResolveRequest, options?: RequestOptions): Promise<DraftResponseRead>;
80
80
  /**
81
- * Approve recovery from rewritten default-branch history
81
+ * Recover a Draft's history
82
82
  *
83
83
  * When the Draft has status `action_required` and reason `history_rewritten`, review affected
84
84
  * files with `listDraftFiles` and `filter=history`, then approve with the Draft's
@@ -107,14 +107,14 @@ export interface DraftsListParams {
107
107
  */
108
108
  cursor?: string;
109
109
  /** Only Drafts of this Target. */
110
- targetId?: TargetId;
110
+ target_id?: TargetId;
111
111
  /** Only Drafts with this status. */
112
112
  status?: DraftStatus;
113
113
  }
114
114
  /** Typed errors `list` can throw. */
115
- export type DraftsListError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
115
+ export type DraftsListError = BadRequestError<ErrorModelRead> | UnauthorizedError<ErrorModelRead> | ForbiddenError<ErrorModelRead> | NotFoundError<ErrorModelRead> | RateLimitError<ErrorModelRead> | ServerError<ErrorModelRead> | RateLimitError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
116
116
  /** Typed errors `get` can throw. */
117
- export type DraftsGetError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
117
+ export type DraftsGetError = UnauthorizedError<ErrorModelRead> | ForbiddenError<ErrorModelRead> | NotFoundError<ErrorModelRead> | RateLimitError<ErrorModelRead> | ServerError<ErrorModelRead> | RateLimitError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
118
118
  export interface DraftsUpdateParams {
119
119
  /**
120
120
  * ETag from a preceding response. The write applies only if the resource still has that version;
@@ -124,7 +124,7 @@ export interface DraftsUpdateParams {
124
124
  ifMatch?: string;
125
125
  }
126
126
  /** Typed errors `update` can throw. */
127
- export type DraftsUpdateError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | PreconditionFailedError | UnprocessableEntityError | RateLimitedError | InternalServerError | BadGatewayError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
127
+ export type DraftsUpdateError = BadRequestError<ErrorModelRead> | UnauthorizedError<ErrorModelRead> | ForbiddenError<ErrorModelRead> | NotFoundError<ErrorModelRead> | ConflictError<ErrorModelRead> | PreconditionFailedError | UnprocessableEntityError<ErrorModelRead> | RateLimitError<ErrorModelRead> | ServerError<ErrorModelRead> | RateLimitError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
128
128
  export interface DraftsListFilesParams {
129
129
  /**
130
130
  * conflicted: conflicts only. customized: files that differ from the last merged package.
@@ -149,9 +149,9 @@ export interface DraftsListFilesParams {
149
149
  cursor?: string;
150
150
  }
151
151
  /** Typed errors `listFiles` can throw. */
152
- export type DraftsListFilesError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
152
+ export type DraftsListFilesError = BadRequestError<ErrorModelRead> | UnauthorizedError<ErrorModelRead> | ForbiddenError<ErrorModelRead> | NotFoundError<ErrorModelRead> | ConflictError<ErrorModelRead> | RateLimitError<ErrorModelRead> | ServerError<ErrorModelRead> | RateLimitError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
153
153
  /** Typed errors `resolve` can throw. */
154
- export type DraftsResolveError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
154
+ export type DraftsResolveError = BadRequestError<ErrorModelRead> | UnauthorizedError<ErrorModelRead> | ForbiddenError<ErrorModelRead> | NotFoundError<ErrorModelRead> | ConflictError<ErrorModelRead> | RateLimitError<ErrorModelRead> | ServerError<ErrorModelRead> | RateLimitError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
155
155
  /** Typed errors `recover` can throw. */
156
- export type DraftsRecoverError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | RateLimitedError | InternalServerError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
156
+ export type DraftsRecoverError = BadRequestError<ErrorModelRead> | UnauthorizedError<ErrorModelRead> | ForbiddenError<ErrorModelRead> | NotFoundError<ErrorModelRead> | ConflictError<ErrorModelRead> | RateLimitError<ErrorModelRead> | ServerError<ErrorModelRead> | RateLimitError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
157
157
  //# sourceMappingURL=drafts.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"drafts.d.ts","sourceRoot":"","sources":["../../src/res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AAC,EAAE,YAAY,GAAG,YAAY,GAAG,SAAS,CAAC;IACjD;;;;;OAKG;IACH,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;;;;OAMG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,0CAA0C;AAC1C,MAAM,MAAM,oBAAoB,GAC5B,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,wCAAwC;AACxC,MAAM,MAAM,kBAAkB,GAC1B,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,wCAAwC;AACxC,MAAM,MAAM,kBAAkB,GAC1B,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,aAAa,GACb,gBAAgB,GAChB,mBAAmB,GACnB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
1
+ {"version":3,"file":"drafts.d.ts","sourceRoot":"","sources":["../../src/resources/drafts.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChE,OAAO,EAAY,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,aAAa,EACb,cAAc,EACd,aAAa,EACb,uBAAuB,EACvB,WAAW,EACX,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAKV,aAAa,EACb,OAAO,EAGP,SAAS,EACT,mBAAmB,EACnB,mBAAmB,EAEnB,iBAAiB,EACjB,WAAW,EACX,kBAAkB,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