@typeship-ax/mcp 0.6.0 → 0.9.1

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 (114) hide show
  1. package/AGENTS.md +31 -0
  2. package/README.md +67 -10
  3. package/api.json +6735 -3243
  4. package/api.md +8537 -248
  5. package/dist/api-identity.d.ts +40 -0
  6. package/dist/api-identity.d.ts.map +1 -0
  7. package/dist/api-identity.js +128 -0
  8. package/dist/auth-profiles.d.ts +30 -0
  9. package/dist/auth-profiles.d.ts.map +1 -0
  10. package/dist/auth-profiles.js +138 -0
  11. package/dist/core/http.d.ts +21 -92
  12. package/dist/core/http.d.ts.map +1 -1
  13. package/dist/core/http.js +143 -221
  14. package/dist/core/pagination.d.ts.map +1 -1
  15. package/dist/core/pagination.js +6 -34
  16. package/dist/credential-storage.d.ts +24 -0
  17. package/dist/credential-storage.d.ts.map +1 -0
  18. package/dist/credential-storage.js +207 -0
  19. package/dist/dates.d.ts +0 -2
  20. package/dist/dates.d.ts.map +1 -1
  21. package/dist/dates.js +0 -1
  22. package/dist/docs.d.ts +36 -0
  23. package/dist/docs.d.ts.map +1 -0
  24. package/dist/docs.js +258 -0
  25. package/dist/errors.d.ts +42 -34
  26. package/dist/errors.d.ts.map +1 -1
  27. package/dist/errors.js +30 -20
  28. package/dist/index.d.ts +27 -12
  29. package/dist/index.d.ts.map +1 -1
  30. package/dist/index.js +40 -14
  31. package/dist/mcp-authorization.d.ts +52 -0
  32. package/dist/mcp-authorization.d.ts.map +1 -0
  33. package/dist/mcp-authorization.js +232 -0
  34. package/dist/mcp-protocol.d.ts +69 -25
  35. package/dist/mcp-protocol.d.ts.map +1 -1
  36. package/dist/mcp-protocol.js +386 -138
  37. package/dist/mcp.d.ts +21 -3
  38. package/dist/mcp.d.ts.map +1 -1
  39. package/dist/mcp.js +199 -85
  40. package/dist/named-credentials.d.ts +21 -0
  41. package/dist/named-credentials.d.ts.map +1 -0
  42. package/dist/named-credentials.js +86 -0
  43. package/dist/oauth-request.d.ts +21 -0
  44. package/dist/oauth-request.d.ts.map +1 -0
  45. package/dist/oauth-request.js +119 -0
  46. package/dist/oauth-session.d.ts +106 -0
  47. package/dist/oauth-session.d.ts.map +1 -0
  48. package/dist/oauth-session.js +244 -0
  49. package/dist/ops.d.ts +18 -0
  50. package/dist/ops.d.ts.map +1 -1
  51. package/dist/ops.js +31 -17
  52. package/dist/resources/account.d.ts +4 -4
  53. package/dist/resources/account.d.ts.map +1 -1
  54. package/dist/resources/account.js +1 -0
  55. package/dist/resources/api-keys.d.ts +13 -8
  56. package/dist/resources/api-keys.d.ts.map +1 -1
  57. package/dist/resources/api-keys.js +5 -1
  58. package/dist/resources/definition-revisions.d.ts +58 -0
  59. package/dist/resources/definition-revisions.d.ts.map +1 -0
  60. package/dist/resources/definition-revisions.js +114 -0
  61. package/dist/resources/definitions.d.ts +35 -0
  62. package/dist/resources/definitions.d.ts.map +1 -0
  63. package/dist/resources/definitions.js +60 -0
  64. package/dist/resources/generate.d.ts +18 -7
  65. package/dist/resources/generate.d.ts.map +1 -1
  66. package/dist/resources/generate.js +13 -5
  67. package/dist/resources/generations.d.ts +6 -6
  68. package/dist/resources/generations.d.ts.map +1 -1
  69. package/dist/resources/generations.js +3 -1
  70. package/dist/resources/projects.d.ts +111 -35
  71. package/dist/resources/projects.d.ts.map +1 -1
  72. package/dist/resources/projects.js +125 -15
  73. package/dist/resources/targets.d.ts +97 -0
  74. package/dist/resources/targets.d.ts.map +1 -0
  75. package/dist/resources/targets.js +197 -0
  76. package/dist/schemas.d.ts.map +1 -1
  77. package/dist/schemas.js +135 -62
  78. package/dist/types.d.ts +2072 -267
  79. package/dist/types.d.ts.map +1 -1
  80. package/dist/types.js +20 -3
  81. package/dist/worker.js +4 -4
  82. package/package.json +11 -1
  83. package/server.json +42 -0
  84. package/src/api-identity.ts +98 -0
  85. package/src/auth-profiles.ts +114 -0
  86. package/src/core/http.ts +156 -305
  87. package/src/core/pagination.ts +6 -30
  88. package/src/credential-storage.ts +183 -0
  89. package/src/dates.ts +0 -1
  90. package/src/docs.ts +239 -0
  91. package/src/errors.ts +52 -41
  92. package/src/index.ts +49 -14
  93. package/src/mcp-authorization.ts +211 -0
  94. package/src/mcp-protocol.ts +432 -133
  95. package/src/mcp.ts +204 -90
  96. package/src/named-credentials.ts +74 -0
  97. package/src/oauth-request.ts +90 -0
  98. package/src/oauth-session.ts +258 -0
  99. package/src/ops.ts +56 -17
  100. package/src/resources/account.ts +6 -3
  101. package/src/resources/api-keys.ts +27 -7
  102. package/src/resources/definition-revisions.ts +207 -0
  103. package/src/resources/definitions.ts +122 -0
  104. package/src/resources/generate.ts +29 -6
  105. package/src/resources/generations.ts +9 -4
  106. package/src/resources/projects.ts +274 -41
  107. package/src/resources/targets.ts +378 -0
  108. package/src/schemas.ts +135 -62
  109. package/src/types.ts +2273 -322
  110. package/src/worker.ts +4 -4
  111. package/dist/resources/spec-revisions.d.ts +0 -47
  112. package/dist/resources/spec-revisions.d.ts.map +0 -1
  113. package/dist/resources/spec-revisions.js +0 -90
  114. package/src/resources/spec-revisions.ts +0 -150
@@ -1,6 +1,6 @@
1
1
  import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
2
- import { TransportError, UnexpectedApiError, ValidationError, ForbiddenError, RateLimitedError, UnauthorizedError } from "../errors.js";
3
- import type { Account } from "../types.js";
2
+ import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, ForbiddenError, RateLimitedError, UnauthorizedError } from "../errors.js";
3
+ import type { AccountRead } from "../types.js";
4
4
  export declare class AccountResource {
5
5
  private readonly _core;
6
6
  constructor(_core: HttpCore);
@@ -11,8 +11,8 @@ export declare class AccountResource {
11
11
  * identity endpoint the generated typeship CLI's `whoami` calls.
12
12
  * `GET /me`
13
13
  */
14
- retrieve(options?: RequestOptions): Promise<ApiResult<Account, AccountRetrieveError>>;
14
+ retrieve(options?: RequestOptions): Promise<ApiResult<AccountRead, AccountRetrieveError>>;
15
15
  }
16
16
  /** Every error `retrieve` can produce, as a discriminated union. */
17
- export type AccountRetrieveError = UnauthorizedError | ForbiddenError | RateLimitedError | UnexpectedApiError | TransportError | ValidationError;
17
+ export type AccountRetrieveError = UnauthorizedError | ForbiddenError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
18
18
  //# sourceMappingURL=account.d.ts.map
@@ -1 +1 @@
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,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,cAAc,EACd,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,aAAa,CAAC;AAE3C,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,OAAO,EAAE,oBAAoB,CAAC,CAAC;CAU5F;AAED,oEAAoE;AACpE,MAAM,MAAM,oBAAoB,GAC5B,iBAAiB,GACjB,cAAc,GACd,gBAAgB,GAChB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
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,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;CAWhG;AAED,oEAAoE;AACpE,MAAM,MAAM,oBAAoB,GAC5B,iBAAiB,GACjB,cAAc,GACd,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
@@ -17,6 +17,7 @@ export class AccountResource {
17
17
  return this._core.request({
18
18
  method: "GET",
19
19
  path: "/me",
20
+ security: [{ "apiKey": [] }],
20
21
  errors: { "401": UnauthorizedError, "403": ForbiddenError, "429": RateLimitedError },
21
22
  idempotent: true,
22
23
  schemaKey: "account.retrieve",
@@ -1,7 +1,7 @@
1
1
  import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
2
2
  import { PagePromise } from "../core/pagination.js";
3
- import { TransportError, UnexpectedApiError, ValidationError, BadRequestError, ForbiddenError, NotFoundError, RateLimitedError, UnauthorizedError } from "../errors.js";
4
- import type { ApiKey } from "../types.js";
3
+ import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadRequestError, ForbiddenError, NotFoundError, RateLimitedError, UnauthorizedError } from "../errors.js";
4
+ import type { ApiKeyRead, ApiKeyResponseRead } from "../types.js";
5
5
  export declare class ApiKeysResource {
6
6
  private readonly _core;
7
7
  constructor(_core: HttpCore);
@@ -14,24 +14,29 @@ export declare class ApiKeysResource {
14
14
  * Auto-paginates: `for await (const item of …)` walks every page.
15
15
  * `GET /api_keys`
16
16
  */
17
- list(params?: ApiKeysListParams, options?: RequestOptions): PagePromise<ApiKey, ApiKeysListError>;
17
+ list(params?: ApiKeysListParams, options?: RequestOptions): PagePromise<ApiKeyRead, ApiKeysListError>;
18
18
  /**
19
19
  * Revoke an API key
20
20
  *
21
21
  * Idempotent: revoking an already-revoked key returns the same body, so a rotation script that
22
- * re-runs does not have to special-case having already succeeded.
22
+ * re-runs does not have to special-case having already succeeded. An OAuth member may revoke a
23
+ * key they created; an organization admin may revoke any key. Organization API keys retain
24
+ * account-wide authority.
23
25
  * `DELETE /api_keys/{api_key_id}`
24
26
  */
25
- revoke(apiKeyId: string, options?: RequestOptions): Promise<ApiResult<ApiKey, ApiKeysRevokeError>>;
27
+ revoke(apiKeyId: string, options?: RequestOptions): Promise<ApiResult<ApiKeyResponseRead, ApiKeysRevokeError>>;
26
28
  }
27
29
  export interface ApiKeysListParams {
28
30
  /** Maximum number of resources to return. */
29
31
  limit?: number;
30
- /** Opaque cursor from the preceding page's next_cursor. */
32
+ /**
33
+ * Opaque cursor from the preceding page's next_cursor. Valid only for the same account,
34
+ * operation, filters, and ordering that issued it.
35
+ */
31
36
  cursor?: string;
32
37
  }
33
38
  /** Every error `list` can produce, as a discriminated union. */
34
- export type ApiKeysListError = BadRequestError | UnauthorizedError | ForbiddenError | RateLimitedError | UnexpectedApiError | TransportError | ValidationError;
39
+ export type ApiKeysListError = BadRequestError | UnauthorizedError | ForbiddenError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
35
40
  /** Every error `revoke` can produce, as a discriminated union. */
36
- export type ApiKeysRevokeError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | TransportError | ValidationError;
41
+ export type ApiKeysRevokeError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
37
42
  //# 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,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EAAY,WAAW,EAAE,MAAM,uBAAuB,CAAC;AAC9D,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,MAAM,EAAc,MAAM,aAAa,CAAC;AAEtD,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;;;;OAQG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC,MAAM,EAAE,gBAAgB,CAAC;IA2BjG;;;;;;OAMG;IACG,MAAM,CAAC,QAAQ,EAAE,MAAM,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE,kBAAkB,CAAC,CAAC;CAezG;AAED,MAAM,WAAW,iBAAiB;IAChC,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,2DAA2D;IAC3D,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,gEAAgE;AAChE,MAAM,MAAM,gBAAgB,GACxB,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,gBAAgB,GAChB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,kEAAkE;AAClE,MAAM,MAAM,kBAAkB,GAC1B,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
1
+ {"version":3,"file":"api-keys.d.ts","sourceRoot":"","sources":["../../src/resources/api-keys.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,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAIV,UAAU,EAEV,kBAAkB,EACnB,MAAM,aAAa,CAAC;AAErB,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;;;;OAQG;IACH,IAAI,CAAC,MAAM,CAAC,EAAE,iBAAiB,EAAE,OAAO,CAAC,EAAE,cAAc,GAAG,WAAW,CAAC,UAAU,EAAE,gBAAgB,CAAC;IA4BrG;;;;;;;;OAQG;IACG,MAAM,CACV,QAAQ,EAAE,MAAM,EAChB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,CAAC,kBAAkB,EAAE,kBAAkB,CAAC,CAAC;CAgB9D;AAED,MAAM,WAAW,iBAAiB;IAChC,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,gEAAgE;AAChE,MAAM,MAAM,gBAAgB,GACxB,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,kEAAkE;AAClE,MAAM,MAAM,kBAAkB,GAC1B,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
@@ -20,6 +20,7 @@ export class ApiKeysResource {
20
20
  return paginate(this._core, {
21
21
  method: "GET",
22
22
  path: "/api_keys",
23
+ security: [{ "apiKey": [] }],
23
24
  query: {
24
25
  limit: params?.limit,
25
26
  cursor: params?.cursor,
@@ -46,13 +47,16 @@ export class ApiKeysResource {
46
47
  * Revoke an API key
47
48
  *
48
49
  * Idempotent: revoking an already-revoked key returns the same body, so a rotation script that
49
- * re-runs does not have to special-case having already succeeded.
50
+ * re-runs does not have to special-case having already succeeded. An OAuth member may revoke a
51
+ * key they created; an organization admin may revoke any key. Organization API keys retain
52
+ * account-wide authority.
50
53
  * `DELETE /api_keys/{api_key_id}`
51
54
  */
52
55
  async revoke(apiKeyId, options) {
53
56
  return this._core.request({
54
57
  method: "DELETE",
55
58
  path: `/api_keys/${encodeURIComponent(String(apiKeyId))}`,
59
+ security: [{ "apiKey": [] }],
56
60
  errors: {
57
61
  "401": UnauthorizedError,
58
62
  "403": ForbiddenError,
@@ -0,0 +1,58 @@
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, NotFoundError, RateLimitedError, UnauthorizedError } from "../errors.js";
4
+ import type { DefinitionDocumentId, 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
+ * Immutable snapshots of the complete resolved document graph this Definition observed, newest
12
+ * first. Content is available from the revision and document endpoints and is never embedded in a
13
+ * list response.
14
+ *
15
+ * Auto-paginates: `for await (const item of …)` walks every page.
16
+ * `GET /definitions/{definition_id}/revisions`
17
+ */
18
+ list(definitionId: DefinitionId, params?: DefinitionRevisionsListParams, options?: RequestOptions): PagePromise<DefinitionRevisionRead, DefinitionRevisionsListError>;
19
+ /**
20
+ * Retrieve a Definition Revision
21
+ *
22
+ * Metadata for one immutable resolved document graph. Fetch its canonical content or individual
23
+ * source documents from the content endpoints.
24
+ * `GET /definition_revisions/{definition_revision_id}`
25
+ */
26
+ retrieve(definitionRevisionId: DefinitionRevisionId, options?: RequestOptions): Promise<ApiResult<DefinitionRevisionResponseRead, DefinitionRevisionsRetrieveError>>;
27
+ /**
28
+ * Retrieve a Definition Revision's canonical content
29
+ *
30
+ * Returns the exact canonical resolved content identified by the revision's graph digest,
31
+ * suitable for saving or piping into a diff.
32
+ * `GET /definition_revisions/{definition_revision_id}/content`
33
+ */
34
+ retrieveContent(definitionRevisionId: DefinitionRevisionId, options?: RequestOptions): Promise<ApiResult<string, DefinitionRevisionsRetrieveContentError>>;
35
+ /**
36
+ * Retrieve one source document from a Definition Revision
37
+ * `GET /definition_revisions/{definition_revision_id}/documents/{document_id}/content`
38
+ */
39
+ retrieveDocumentContent(definitionRevisionId: DefinitionRevisionId, documentId: DefinitionDocumentId, options?: RequestOptions): Promise<ApiResult<string, DefinitionRevisionsRetrieveDocumentContentError>>;
40
+ }
41
+ export interface DefinitionRevisionsListParams {
42
+ /** Maximum number of resources to return. */
43
+ limit?: number;
44
+ /**
45
+ * Opaque cursor from the preceding page's next_cursor. Valid only for the same account,
46
+ * operation, filters, and ordering that issued it.
47
+ */
48
+ cursor?: string;
49
+ }
50
+ /** Every error `list` can produce, as a discriminated union. */
51
+ export type DefinitionRevisionsListError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
52
+ /** Every error `retrieve` can produce, as a discriminated union. */
53
+ export type DefinitionRevisionsRetrieveError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
54
+ /** Every error `retrieveContent` can produce, as a discriminated union. */
55
+ export type DefinitionRevisionsRetrieveContentError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
56
+ /** Every error `retrieveDocumentContent` can produce, as a discriminated union. */
57
+ export type DefinitionRevisionsRetrieveDocumentContentError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
58
+ //# sourceMappingURL=definition-revisions.d.ts.map
@@ -0,0 +1 @@
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,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EACV,oBAAoB,EACpB,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;;;;;;;;;OASG;IACH,IAAI,CACF,YAAY,EAAE,YAAY,EAC1B,MAAM,CAAC,EAAE,6BAA6B,EACtC,OAAO,CAAC,EAAE,cAAc,GACvB,WAAW,CAAC,sBAAsB,EAAE,4BAA4B,CAAC;IA6BpE;;;;;;OAMG;IACG,QAAQ,CACZ,oBAAoB,EAAE,oBAAoB,EAC1C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,CAAC,8BAA8B,EAAE,gCAAgC,CAAC,CAAC;IAiBvF;;;;;;OAMG;IACG,eAAe,CACnB,oBAAoB,EAAE,oBAAoB,EAC1C,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE,uCAAuC,CAAC,CAAC;IAiBtE;;;OAGG;IACG,uBAAuB,CAC3B,oBAAoB,EAAE,oBAAoB,EAC1C,UAAU,EAAE,oBAAoB,EAChC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE,+CAA+C,CAAC,CAAC;CAgB/E;AAED,MAAM,WAAW,6BAA6B;IAC5C,6CAA6C;IAC7C,KAAK,CAAC,EAAE,MAAM,CAAC;IACf;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,CAAC;CACjB;AAED,gEAAgE;AAChE,MAAM,MAAM,4BAA4B,GACpC,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,oEAAoE;AACpE,MAAM,MAAM,gCAAgC,GACxC,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,2EAA2E;AAC3E,MAAM,MAAM,uCAAuC,GAC/C,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,mFAAmF;AACnF,MAAM,MAAM,+CAA+C,GACvD,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
@@ -0,0 +1,114 @@
1
+ // typeship — definitionRevisions resource.
2
+ // Generated by typeship — https://typeship.dev — do not edit by hand.
3
+ import { paginate } from "../core/pagination.js";
4
+ import { BadRequestError, ForbiddenError, 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
+ * Immutable snapshots of the complete resolved document graph this Definition observed, newest
14
+ * first. Content is available from the revision and document endpoints and is never embedded in a
15
+ * list response.
16
+ *
17
+ * Auto-paginates: `for await (const item of …)` walks every page.
18
+ * `GET /definitions/{definition_id}/revisions`
19
+ */
20
+ list(definitionId, params, options) {
21
+ return paginate(this._core, {
22
+ method: "GET",
23
+ path: `/definitions/${encodeURIComponent(String(definitionId))}/revisions`,
24
+ security: [{ "apiKey": [] }],
25
+ query: {
26
+ limit: params?.limit,
27
+ cursor: params?.cursor,
28
+ },
29
+ errors: {
30
+ "400": BadRequestError,
31
+ "401": UnauthorizedError,
32
+ "403": ForbiddenError,
33
+ "404": NotFoundError,
34
+ "429": RateLimitedError,
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
+ * Metadata for one immutable resolved document graph. Fetch its canonical content or individual
52
+ * source documents from the content endpoints.
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
+ },
66
+ idempotent: true,
67
+ schemaKey: "definitionRevisions.retrieve",
68
+ options,
69
+ });
70
+ }
71
+ /**
72
+ * Retrieve a Definition Revision's canonical content
73
+ *
74
+ * Returns the exact canonical resolved content identified by the revision's graph digest,
75
+ * suitable for saving or piping into a diff.
76
+ * `GET /definition_revisions/{definition_revision_id}/content`
77
+ */
78
+ async retrieveContent(definitionRevisionId, options) {
79
+ return this._core.request({
80
+ method: "GET",
81
+ path: `/definition_revisions/${encodeURIComponent(String(definitionRevisionId))}/content`,
82
+ security: [{ "apiKey": [] }],
83
+ errors: {
84
+ "401": UnauthorizedError,
85
+ "403": ForbiddenError,
86
+ "404": NotFoundError,
87
+ "429": RateLimitedError,
88
+ },
89
+ idempotent: true,
90
+ schemaKey: "definitionRevisions.retrieveContent",
91
+ options,
92
+ });
93
+ }
94
+ /**
95
+ * Retrieve one source document from a Definition Revision
96
+ * `GET /definition_revisions/{definition_revision_id}/documents/{document_id}/content`
97
+ */
98
+ async retrieveDocumentContent(definitionRevisionId, documentId, options) {
99
+ return this._core.request({
100
+ method: "GET",
101
+ path: `/definition_revisions/${encodeURIComponent(String(definitionRevisionId))}/documents/${encodeURIComponent(String(documentId))}/content`,
102
+ security: [{ "apiKey": [] }],
103
+ errors: {
104
+ "401": UnauthorizedError,
105
+ "403": ForbiddenError,
106
+ "404": NotFoundError,
107
+ "429": RateLimitedError,
108
+ },
109
+ idempotent: true,
110
+ schemaKey: "definitionRevisions.retrieveDocumentContent",
111
+ options,
112
+ });
113
+ }
114
+ }
@@ -0,0 +1,35 @@
1
+ import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
2
+ import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadRequestError, ConflictError, ForbiddenError, NotFoundError, 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 complete document graph and records a new immutable revision before saving.
16
+ *
17
+ * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
18
+ * `PATCH /definitions/{definition_id}`
19
+ */
20
+ update(definitionId: DefinitionId, body: DefinitionUpdateRequest, params?: DefinitionsUpdateParams, options?: RequestOptions): Promise<ApiResult<DefinitionRead, DefinitionsUpdateError>>;
21
+ }
22
+ /** Every error `retrieve` can produce, as a discriminated union. */
23
+ export type DefinitionsRetrieveError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
24
+ export interface DefinitionsUpdateParams {
25
+ /**
26
+ * Identifies one logical write for 24 hours. The key is scoped to the authenticated account and
27
+ * operation; account-less generation uses a hashed network identity. Retrying the same method,
28
+ * path, query, and JSON body replays the original response. Reusing the key with changed intent
29
+ * returns 409. After expiry the key starts a new write.
30
+ */
31
+ idempotencyKey?: string;
32
+ }
33
+ /** Every error `update` can produce, as a discriminated union. */
34
+ export type DefinitionsUpdateError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | ConflictError | UnprocessableEntityError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
35
+ //# sourceMappingURL=definitions.d.ts.map
@@ -0,0 +1 @@
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,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,aAAa,EACb,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAEV,YAAY,EACZ,cAAc,EACd,uBAAuB,EACxB,MAAM,aAAa,CAAC;AAErB,qBAAa,mBAAmB;IAClB,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;OAGG;IACG,QAAQ,CACZ,YAAY,EAAE,YAAY,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,CAAC,cAAc,EAAE,wBAAwB,CAAC,CAAC;IAiB/D;;;;;;;OAOG;IACG,MAAM,CACV,YAAY,EAAE,YAAY,EAC1B,IAAI,EAAE,uBAAuB,EAC7B,MAAM,CAAC,EAAE,uBAAuB,EAChC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,CAAC,cAAc,EAAE,sBAAsB,CAAC,CAAC;CAuB9D;AAED,oEAAoE;AACpE,MAAM,MAAM,wBAAwB,GAChC,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,MAAM,WAAW,uBAAuB;IACtC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,kEAAkE;AAClE,MAAM,MAAM,sBAAsB,GAC9B,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,aAAa,GACb,wBAAwB,GACxB,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
@@ -0,0 +1,60 @@
1
+ // typeship — definitions resource.
2
+ // Generated by typeship — https://typeship.dev — do not edit by hand.
3
+ import { BadRequestError, ConflictError, ForbiddenError, NotFoundError, 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
+ },
24
+ idempotent: true,
25
+ schemaKey: "definitions.retrieve",
26
+ options,
27
+ });
28
+ }
29
+ /**
30
+ * Update and resolve a Definition
31
+ *
32
+ * Resolves the complete document graph and records a new immutable revision before saving.
33
+ *
34
+ * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
35
+ * `PATCH /definitions/{definition_id}`
36
+ */
37
+ async update(definitionId, body, params, options) {
38
+ return this._core.request({
39
+ method: "PATCH",
40
+ path: `/definitions/${encodeURIComponent(String(definitionId))}`,
41
+ security: [{ "apiKey": [] }],
42
+ headers: {
43
+ "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
44
+ },
45
+ body,
46
+ errors: {
47
+ "400": BadRequestError,
48
+ "401": UnauthorizedError,
49
+ "403": ForbiddenError,
50
+ "404": NotFoundError,
51
+ "409": ConflictError,
52
+ "422": UnprocessableEntityError,
53
+ "429": RateLimitedError,
54
+ },
55
+ idempotencyKey: "Idempotency-Key",
56
+ schemaKey: "definitions.update",
57
+ options,
58
+ });
59
+ }
60
+ }
@@ -1,25 +1,36 @@
1
1
  import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
2
- import { TransportError, UnexpectedApiError, ValidationError, ApiResponseError, BadRequestError, ForbiddenError, PayloadTooLargeError, RateLimitedError, UnauthorizedError, UnprocessableEntityError } from "../errors.js";
3
- import type { GenerateRequest, GenerationResult } from "../types.js";
2
+ import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, ApiResponseError, BadRequestError, ConflictError, ForbiddenError, PayloadTooLargeError, RateLimitedError, UnauthorizedError, UnprocessableEntityError } from "../errors.js";
3
+ import type { GenerateRequest, GenerationResultRead } from "../types.js";
4
4
  export declare class GenerateResource {
5
5
  private readonly _core;
6
6
  constructor(_core: HttpCore);
7
7
  /**
8
- * Generate a package from a spec
8
+ * Generate one Target from a Definition
9
9
  *
10
10
  * Stateless generation: nothing is stored. Returns the full generated
11
11
  * package as files. Works without an API key: anonymous calls generate
12
12
  * the first 25 operations, rate limited per IP address, and the
13
13
  * response's `limits` object says what was held back and where to lift
14
- * it; anonymous calls from a spec URL also carry `claim.url`, a link
14
+ * it; anonymous calls from a Definition URL also carry `claim.url`, a link
15
15
  * that turns the run into a project once a person signs in. With a key, the free plan generates
16
16
  * the first 25 operations and
17
- * paid plans generate the whole spec. A present but invalid key is a
17
+ * paid plans generate the complete Definition. A present but invalid key is a
18
18
  * 401, not a downgrade to anonymous.
19
+ *
20
+ * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
19
21
  * `POST /generate`
20
22
  */
21
- run(body: GenerateRequest, options?: RequestOptions): Promise<ApiResult<GenerationResult, GenerateRunError>>;
23
+ run(body: GenerateRequest, params?: GenerateRunParams, options?: RequestOptions): Promise<ApiResult<GenerationResultRead, GenerateRunError>>;
24
+ }
25
+ export interface GenerateRunParams {
26
+ /**
27
+ * Identifies one logical write for 24 hours. The key is scoped to the authenticated account and
28
+ * operation; account-less generation uses a hashed network identity. Retrying the same method,
29
+ * path, query, and JSON body replays the original response. Reusing the key with changed intent
30
+ * returns 409. After expiry the key starts a new write.
31
+ */
32
+ idempotencyKey?: string;
22
33
  }
23
34
  /** Every error `run` can produce, as a discriminated union. */
24
- export type GenerateRunError = BadRequestError | UnauthorizedError | ForbiddenError | PayloadTooLargeError | UnprocessableEntityError | RateLimitedError | ApiResponseError | UnexpectedApiError | TransportError | ValidationError;
35
+ export type GenerateRunError = BadRequestError | UnauthorizedError | ForbiddenError | ConflictError | PayloadTooLargeError | UnprocessableEntityError | RateLimitedError | ApiResponseError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
25
36
  //# sourceMappingURL=generate.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/resources/generate.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,gBAAgB,EAChB,eAAe,EACf,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAErE,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;;;;;;;;;OAaG;IACG,GAAG,CACP,IAAI,EAAE,eAAe,EACrB,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,CAAC,gBAAgB,EAAE,gBAAgB,CAAC,CAAC;CAkB1D;AAED,+DAA+D;AAC/D,MAAM,MAAM,gBAAgB,GACxB,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,oBAAoB,GACpB,wBAAwB,GACxB,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
1
+ {"version":3,"file":"generate.d.ts","sourceRoot":"","sources":["../../src/resources/generate.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,gBAAgB,EAChB,eAAe,EACf,aAAa,EACb,cAAc,EACd,oBAAoB,EACpB,gBAAgB,EAChB,iBAAiB,EACjB,wBAAwB,EACzB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,eAAe,EAAoB,oBAAoB,EAAE,MAAM,aAAa,CAAC;AAE3F,qBAAa,gBAAgB;IACf,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;;;;;;;;;;;OAeG;IACG,GAAG,CACP,IAAI,EAAE,eAAe,EACrB,MAAM,CAAC,EAAE,iBAAiB,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,CAAC,oBAAoB,EAAE,gBAAgB,CAAC,CAAC;CAwB9D;AAED,MAAM,WAAW,iBAAiB;IAChC;;;;;OAKG;IACH,cAAc,CAAC,EAAE,MAAM,CAAC;CACzB;AAED,+DAA+D;AAC/D,MAAM,MAAM,gBAAgB,GACxB,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,oBAAoB,GACpB,wBAAwB,GACxB,gBAAgB,GAChB,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
@@ -1,39 +1,47 @@
1
1
  // typeship — generate resource.
2
2
  // Generated by typeship — https://typeship.dev — do not edit by hand.
3
- import { ApiResponseError, BadRequestError, ForbiddenError, PayloadTooLargeError, RateLimitedError, UnauthorizedError, UnprocessableEntityError, } from "../errors.js";
3
+ import { ApiResponseError, BadRequestError, ConflictError, ForbiddenError, PayloadTooLargeError, RateLimitedError, UnauthorizedError, UnprocessableEntityError, } from "../errors.js";
4
4
  export class GenerateResource {
5
5
  _core;
6
6
  constructor(_core) {
7
7
  this._core = _core;
8
8
  }
9
9
  /**
10
- * Generate a package from a spec
10
+ * Generate one Target from a Definition
11
11
  *
12
12
  * Stateless generation: nothing is stored. Returns the full generated
13
13
  * package as files. Works without an API key: anonymous calls generate
14
14
  * the first 25 operations, rate limited per IP address, and the
15
15
  * response's `limits` object says what was held back and where to lift
16
- * it; anonymous calls from a spec URL also carry `claim.url`, a link
16
+ * it; anonymous calls from a Definition URL also carry `claim.url`, a link
17
17
  * that turns the run into a project once a person signs in. With a key, the free plan generates
18
18
  * the first 25 operations and
19
- * paid plans generate the whole spec. A present but invalid key is a
19
+ * paid plans generate the complete Definition. A present but invalid key is a
20
20
  * 401, not a downgrade to anonymous.
21
+ *
22
+ * A `Idempotency-Key` UUID is generated per call (stable across retries) unless you pass one.
21
23
  * `POST /generate`
22
24
  */
23
- async run(body, options) {
25
+ async run(body, params, options) {
24
26
  return this._core.request({
25
27
  method: "POST",
26
28
  path: "/generate",
29
+ security: [{}, { "apiKey": [] }],
30
+ headers: {
31
+ "Idempotency-Key": params?.idempotencyKey === undefined ? undefined : String(params?.idempotencyKey),
32
+ },
27
33
  body,
28
34
  errors: {
29
35
  "400": BadRequestError,
30
36
  "401": UnauthorizedError,
31
37
  "403": ForbiddenError,
38
+ "409": ConflictError,
32
39
  "413": PayloadTooLargeError,
33
40
  "422": UnprocessableEntityError,
34
41
  "429": RateLimitedError,
35
42
  default: ApiResponseError,
36
43
  },
44
+ idempotencyKey: "Idempotency-Key",
37
45
  schemaKey: "generate.run",
38
46
  options,
39
47
  });
@@ -1,6 +1,6 @@
1
1
  import { HttpCore, type ApiResult, type RequestOptions } from "../core/http.js";
2
- import { TransportError, UnexpectedApiError, ValidationError, BadRequestError, ForbiddenError, NotFoundError, RateLimitedError, UnauthorizedError } from "../errors.js";
3
- import type { Generation, GenerationId } from "../types.js";
2
+ import { ResponseParseError, TransportError, UnexpectedApiError, ValidationError, BadRequestError, ForbiddenError, NotFoundError, RateLimitedError, UnauthorizedError } from "../errors.js";
3
+ import type { GenerationId, GenerationResponseRead } from "../types.js";
4
4
  export declare class GenerationsResource {
5
5
  private readonly _core;
6
6
  constructor(_core: HttpCore);
@@ -10,22 +10,22 @@ export declare class GenerationsResource {
10
10
  * Includes the generated files when the generation succeeded.
11
11
  * `GET /generations/{generation_id}`
12
12
  */
13
- retrieve(generationId: GenerationId, options?: RequestOptions): Promise<ApiResult<Generation, GenerationsRetrieveError>>;
13
+ retrieve(generationId: GenerationId, options?: RequestOptions): Promise<ApiResult<GenerationResponseRead, GenerationsRetrieveError>>;
14
14
  /**
15
15
  * Fetch one file from a generation
16
16
  *
17
- * Raw file content, for generations whose output was too large to inline (files_omitted true).
17
+ * Raw file content, for generations whose target was too large to inline (files_omitted true).
18
18
  * The generation's files_index lists valid paths.
19
19
  * `GET /generations/{generation_id}/file`
20
20
  */
21
21
  retrieveFile(generationId: GenerationId, params: GenerationsRetrieveFileParams, options?: RequestOptions): Promise<ApiResult<string, GenerationsRetrieveFileError>>;
22
22
  }
23
23
  /** Every error `retrieve` can produce, as a discriminated union. */
24
- export type GenerationsRetrieveError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | TransportError | ValidationError;
24
+ export type GenerationsRetrieveError = UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
25
25
  export interface GenerationsRetrieveFileParams {
26
26
  /** Repo-relative path inside the generated package. */
27
27
  path: string;
28
28
  }
29
29
  /** Every error `retrieveFile` can produce, as a discriminated union. */
30
- export type GenerationsRetrieveFileError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | TransportError | ValidationError;
30
+ export type GenerationsRetrieveFileError = BadRequestError | UnauthorizedError | ForbiddenError | NotFoundError | RateLimitedError | UnexpectedApiError | ResponseParseError | TransportError | ValidationError;
31
31
  //# sourceMappingURL=generations.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"generations.d.ts","sourceRoot":"","sources":["../../src/resources/generations.ts"],"names":[],"mappings":"AAGA,OAAO,EAAE,QAAQ,EAAE,KAAK,SAAS,EAAE,KAAK,cAAc,EAAE,MAAM,iBAAiB,CAAC;AAChF,OAAO,EACL,cAAc,EACd,kBAAkB,EAClB,eAAe,EACf,eAAe,EACf,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,UAAU,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAE5D,qBAAa,mBAAmB;IAClB,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;OAKG;IACG,QAAQ,CACZ,YAAY,EAAE,YAAY,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,CAAC,UAAU,EAAE,wBAAwB,CAAC,CAAC;IAgB3D;;;;;;OAMG;IACG,YAAY,CAChB,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,6BAA6B,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAAC;CAmB5D;AAED,oEAAoE;AACpE,MAAM,MAAM,wBAAwB,GAChC,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,MAAM,WAAW,6BAA6B;IAC5C,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wEAAwE;AACxE,MAAM,MAAM,4BAA4B,GACpC,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
1
+ {"version":3,"file":"generations.d.ts","sourceRoot":"","sources":["../../src/resources/generations.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,eAAe,EACf,cAAc,EACd,aAAa,EACb,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,cAAc,CAAC;AACtB,OAAO,KAAK,EAAE,YAAY,EAAsB,sBAAsB,EAAE,MAAM,aAAa,CAAC;AAE5F,qBAAa,mBAAmB;IAClB,OAAO,CAAC,QAAQ,CAAC,KAAK;gBAAL,KAAK,EAAE,QAAQ;IAC5C;;;;;OAKG;IACG,QAAQ,CACZ,YAAY,EAAE,YAAY,EAC1B,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,CAAC,sBAAsB,EAAE,wBAAwB,CAAC,CAAC;IAiBvE;;;;;;OAMG;IACG,YAAY,CAChB,YAAY,EAAE,YAAY,EAC1B,MAAM,EAAE,6BAA6B,EACrC,OAAO,CAAC,EAAE,cAAc,GACvB,OAAO,CAAC,SAAS,CAAC,MAAM,EAAE,4BAA4B,CAAC,CAAC;CAoB5D;AAED,oEAAoE;AACpE,MAAM,MAAM,wBAAwB,GAChC,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC;AAEpB,MAAM,WAAW,6BAA6B;IAC5C,uDAAuD;IACvD,IAAI,EAAE,MAAM,CAAC;CACd;AAED,wEAAwE;AACxE,MAAM,MAAM,4BAA4B,GACpC,eAAe,GACf,iBAAiB,GACjB,cAAc,GACd,aAAa,GACb,gBAAgB,GAChB,kBAAkB,GAClB,kBAAkB,GAClB,cAAc,GACd,eAAe,CAAC"}
@@ -16,6 +16,7 @@ export class GenerationsResource {
16
16
  return this._core.request({
17
17
  method: "GET",
18
18
  path: `/generations/${encodeURIComponent(String(generationId))}`,
19
+ security: [{ "apiKey": [] }],
19
20
  errors: {
20
21
  "401": UnauthorizedError,
21
22
  "403": ForbiddenError,
@@ -30,7 +31,7 @@ export class GenerationsResource {
30
31
  /**
31
32
  * Fetch one file from a generation
32
33
  *
33
- * Raw file content, for generations whose output was too large to inline (files_omitted true).
34
+ * Raw file content, for generations whose target was too large to inline (files_omitted true).
34
35
  * The generation's files_index lists valid paths.
35
36
  * `GET /generations/{generation_id}/file`
36
37
  */
@@ -38,6 +39,7 @@ export class GenerationsResource {
38
39
  return this._core.request({
39
40
  method: "GET",
40
41
  path: `/generations/${encodeURIComponent(String(generationId))}/file`,
42
+ security: [{ "apiKey": [] }],
41
43
  query: {
42
44
  path: params.path,
43
45
  },