ts-procedures 9.1.0 → 9.3.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 (189) hide show
  1. package/CHANGELOG.md +55 -0
  2. package/agent_config/claude-code/skills/ts-procedures/api-reference.md +29 -22
  3. package/agent_config/copilot/copilot-instructions.md +2 -0
  4. package/agent_config/cursor/cursorrules +2 -0
  5. package/build/codegen/bin/cli.d.ts +4 -0
  6. package/build/codegen/bin/cli.js +19 -0
  7. package/build/codegen/bin/cli.js.map +1 -1
  8. package/build/codegen/bin/cli.test.js +21 -0
  9. package/build/codegen/bin/cli.test.js.map +1 -1
  10. package/build/codegen/bin/flag-specs.js +3 -0
  11. package/build/codegen/bin/flag-specs.js.map +1 -1
  12. package/build/codegen/check-output.d.ts +28 -0
  13. package/build/codegen/check-output.js +216 -0
  14. package/build/codegen/check-output.js.map +1 -0
  15. package/build/codegen/check-output.test.d.ts +1 -0
  16. package/build/codegen/check-output.test.js +160 -0
  17. package/build/codegen/check-output.test.js.map +1 -0
  18. package/build/codegen/emit/api-route.js +1 -1
  19. package/build/codegen/emit/api-route.js.map +1 -1
  20. package/build/codegen/emit/context.d.ts +9 -0
  21. package/build/codegen/emit/http-stream-route.js +1 -1
  22. package/build/codegen/emit/http-stream-route.js.map +1 -1
  23. package/build/codegen/emit/rpc-route.js +1 -1
  24. package/build/codegen/emit/rpc-route.js.map +1 -1
  25. package/build/codegen/emit/scope-file.js +14 -0
  26. package/build/codegen/emit/scope-file.js.map +1 -1
  27. package/build/codegen/emit/stream-route.js +1 -1
  28. package/build/codegen/emit/stream-route.js.map +1 -1
  29. package/build/codegen/emit-scope.test.js +55 -0
  30. package/build/codegen/emit-scope.test.js.map +1 -1
  31. package/build/codegen/emit-types.js +19 -0
  32. package/build/codegen/emit-types.js.map +1 -1
  33. package/build/codegen/emit-types.test.js +34 -0
  34. package/build/codegen/emit-types.test.js.map +1 -1
  35. package/build/codegen/index.d.ts +14 -0
  36. package/build/codegen/index.js +11 -1
  37. package/build/codegen/index.js.map +1 -1
  38. package/build/codegen/targets/ts/name-collision.test.d.ts +1 -0
  39. package/build/codegen/targets/ts/name-collision.test.js +30 -0
  40. package/build/codegen/targets/ts/name-collision.test.js.map +1 -0
  41. package/build/codegen/targets/ts/run.js +13 -0
  42. package/build/codegen/targets/ts/run.js.map +1 -1
  43. package/build/core/create-http-stream.d.ts +3 -14
  44. package/build/core/create-http-stream.js.map +1 -1
  45. package/build/core/create-http.d.ts +2 -9
  46. package/build/core/create-http.js.map +1 -1
  47. package/build/core/create-http.test-d.d.ts +1 -0
  48. package/build/core/create-http.test-d.js +104 -0
  49. package/build/core/create-http.test-d.js.map +1 -0
  50. package/build/core/procedures.d.ts +6 -16
  51. package/build/core/types.d.ts +49 -4
  52. package/build/errors.d.ts +33 -0
  53. package/build/errors.js +91 -0
  54. package/build/errors.js.map +1 -0
  55. package/build/errors.test.d.ts +1 -0
  56. package/build/errors.test.js +122 -0
  57. package/build/errors.test.js.map +1 -0
  58. package/build/exports.d.ts +1 -1
  59. package/build/exports.js.map +1 -1
  60. package/build/implementations/http/doc-registry.d.ts +28 -0
  61. package/build/implementations/http/doc-registry.js +96 -0
  62. package/build/implementations/http/doc-registry.js.map +1 -0
  63. package/build/implementations/http/doc-registry.test.d.ts +1 -0
  64. package/build/implementations/http/doc-registry.test.js +516 -0
  65. package/build/implementations/http/doc-registry.test.js.map +1 -0
  66. package/build/implementations/http/error-taxonomy.d.ts +249 -0
  67. package/build/implementations/http/error-taxonomy.js +252 -0
  68. package/build/implementations/http/error-taxonomy.js.map +1 -0
  69. package/build/implementations/http/error-taxonomy.test.d.ts +1 -0
  70. package/build/implementations/http/error-taxonomy.test.js +399 -0
  71. package/build/implementations/http/error-taxonomy.test.js.map +1 -0
  72. package/build/implementations/http/express-rpc/error-taxonomy.test.d.ts +1 -0
  73. package/build/implementations/http/express-rpc/error-taxonomy.test.js +83 -0
  74. package/build/implementations/http/express-rpc/error-taxonomy.test.js.map +1 -0
  75. package/build/implementations/http/express-rpc/index.d.ts +125 -0
  76. package/build/implementations/http/express-rpc/index.js +216 -0
  77. package/build/implementations/http/express-rpc/index.js.map +1 -0
  78. package/build/implementations/http/express-rpc/index.test.d.ts +1 -0
  79. package/build/implementations/http/express-rpc/index.test.js +684 -0
  80. package/build/implementations/http/express-rpc/index.test.js.map +1 -0
  81. package/build/implementations/http/express-rpc/types.d.ts +11 -0
  82. package/build/implementations/http/express-rpc/types.js +2 -0
  83. package/build/implementations/http/express-rpc/types.js.map +1 -0
  84. package/build/implementations/http/hono-api/error-taxonomy.test.d.ts +1 -0
  85. package/build/implementations/http/hono-api/error-taxonomy.test.js +137 -0
  86. package/build/implementations/http/hono-api/error-taxonomy.test.js.map +1 -0
  87. package/build/implementations/http/hono-api/index.d.ts +151 -0
  88. package/build/implementations/http/hono-api/index.js +344 -0
  89. package/build/implementations/http/hono-api/index.js.map +1 -0
  90. package/build/implementations/http/hono-api/index.test.d.ts +1 -0
  91. package/build/implementations/http/hono-api/index.test.js +992 -0
  92. package/build/implementations/http/hono-api/index.test.js.map +1 -0
  93. package/build/implementations/http/hono-api/types.d.ts +13 -0
  94. package/build/implementations/http/hono-api/types.js +2 -0
  95. package/build/implementations/http/hono-api/types.js.map +1 -0
  96. package/build/implementations/http/hono-rpc/error-taxonomy.test.d.ts +1 -0
  97. package/build/implementations/http/hono-rpc/error-taxonomy.test.js +64 -0
  98. package/build/implementations/http/hono-rpc/error-taxonomy.test.js.map +1 -0
  99. package/build/implementations/http/hono-rpc/index.d.ts +130 -0
  100. package/build/implementations/http/hono-rpc/index.js +209 -0
  101. package/build/implementations/http/hono-rpc/index.js.map +1 -0
  102. package/build/implementations/http/hono-rpc/index.test.d.ts +1 -0
  103. package/build/implementations/http/hono-rpc/index.test.js +828 -0
  104. package/build/implementations/http/hono-rpc/index.test.js.map +1 -0
  105. package/build/implementations/http/hono-rpc/types.d.ts +11 -0
  106. package/build/implementations/http/hono-rpc/types.js +2 -0
  107. package/build/implementations/http/hono-rpc/types.js.map +1 -0
  108. package/build/implementations/http/hono-stream/error-taxonomy.test.d.ts +1 -0
  109. package/build/implementations/http/hono-stream/error-taxonomy.test.js +159 -0
  110. package/build/implementations/http/hono-stream/error-taxonomy.test.js.map +1 -0
  111. package/build/implementations/http/hono-stream/index.d.ts +171 -0
  112. package/build/implementations/http/hono-stream/index.js +415 -0
  113. package/build/implementations/http/hono-stream/index.js.map +1 -0
  114. package/build/implementations/http/hono-stream/index.test.d.ts +1 -0
  115. package/build/implementations/http/hono-stream/index.test.js +1383 -0
  116. package/build/implementations/http/hono-stream/index.test.js.map +1 -0
  117. package/build/implementations/http/hono-stream/types.d.ts +15 -0
  118. package/build/implementations/http/hono-stream/types.js +2 -0
  119. package/build/implementations/http/hono-stream/types.js.map +1 -0
  120. package/build/implementations/http/on-request-error.test.d.ts +1 -0
  121. package/build/implementations/http/on-request-error.test.js +173 -0
  122. package/build/implementations/http/on-request-error.test.js.map +1 -0
  123. package/build/implementations/http/route-errors.test.d.ts +1 -0
  124. package/build/implementations/http/route-errors.test.js +139 -0
  125. package/build/implementations/http/route-errors.test.js.map +1 -0
  126. package/build/implementations/types.d.ts +192 -0
  127. package/build/implementations/types.js +2 -0
  128. package/build/implementations/types.js.map +1 -0
  129. package/build/index.d.ts +165 -0
  130. package/build/index.js +258 -0
  131. package/build/index.js.map +1 -0
  132. package/build/index.test.d.ts +1 -0
  133. package/build/index.test.js +920 -0
  134. package/build/index.test.js.map +1 -0
  135. package/build/schema/extract-json-schema.d.ts +2 -0
  136. package/build/schema/extract-json-schema.js +12 -0
  137. package/build/schema/extract-json-schema.js.map +1 -0
  138. package/build/schema/extract-json-schema.test.d.ts +1 -0
  139. package/build/schema/extract-json-schema.test.js +23 -0
  140. package/build/schema/extract-json-schema.test.js.map +1 -0
  141. package/build/schema/parser.d.ts +28 -0
  142. package/build/schema/parser.js +170 -0
  143. package/build/schema/parser.js.map +1 -0
  144. package/build/schema/parser.test.d.ts +1 -0
  145. package/build/schema/parser.test.js +120 -0
  146. package/build/schema/parser.test.js.map +1 -0
  147. package/build/schema/resolve-schema-lib.d.ts +12 -0
  148. package/build/schema/resolve-schema-lib.js +11 -0
  149. package/build/schema/resolve-schema-lib.js.map +1 -0
  150. package/build/schema/resolve-schema-lib.test.d.ts +1 -0
  151. package/build/schema/resolve-schema-lib.test.js +17 -0
  152. package/build/schema/resolve-schema-lib.test.js.map +1 -0
  153. package/build/schema/types.d.ts +8 -0
  154. package/build/schema/types.js +2 -0
  155. package/build/schema/types.js.map +1 -0
  156. package/build/server/types.d.ts +6 -12
  157. package/build/stack-utils.d.ts +25 -0
  158. package/build/stack-utils.js +95 -0
  159. package/build/stack-utils.js.map +1 -0
  160. package/build/stack-utils.test.d.ts +1 -0
  161. package/build/stack-utils.test.js +80 -0
  162. package/build/stack-utils.test.js.map +1 -0
  163. package/docs/client-and-codegen.md +17 -0
  164. package/docs/core.md +1 -0
  165. package/docs/migration-v8-to-v9.md +12 -4
  166. package/package.json +1 -1
  167. package/src/codegen/bin/cli.test.ts +28 -0
  168. package/src/codegen/bin/cli.ts +26 -0
  169. package/src/codegen/bin/flag-specs.ts +3 -0
  170. package/src/codegen/check-output.test.ts +177 -0
  171. package/src/codegen/check-output.ts +262 -0
  172. package/src/codegen/emit/api-route.ts +1 -1
  173. package/src/codegen/emit/context.ts +9 -0
  174. package/src/codegen/emit/http-stream-route.ts +1 -1
  175. package/src/codegen/emit/rpc-route.ts +1 -1
  176. package/src/codegen/emit/scope-file.ts +17 -0
  177. package/src/codegen/emit/stream-route.ts +1 -1
  178. package/src/codegen/emit-scope.test.ts +60 -0
  179. package/src/codegen/emit-types.test.ts +36 -0
  180. package/src/codegen/emit-types.ts +20 -0
  181. package/src/codegen/index.ts +23 -1
  182. package/src/codegen/targets/ts/name-collision.test.ts +34 -0
  183. package/src/codegen/targets/ts/run.ts +16 -0
  184. package/src/core/create-http-stream.ts +11 -12
  185. package/src/core/create-http.test-d.ts +154 -0
  186. package/src/core/create-http.ts +11 -7
  187. package/src/core/types.ts +63 -4
  188. package/src/exports.ts +5 -0
  189. package/src/server/types.ts +8 -12
@@ -0,0 +1 @@
1
+ {"version":3,"file":"errors.test.js","sourceRoot":"","sources":["../src/errors.test.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,QAAQ,CAAA;AAC/C,OAAO,EACL,cAAc,EACd,wBAAwB,EACxB,0BAA0B,GAC3B,MAAM,aAAa,CAAA;AAGpB,QAAQ,CAAC,eAAe,EAAE,GAAG,EAAE;IAC7B,IAAI,CAAC,uCAAuC,EAAE,GAAG,EAAE;QACjD,MAAM,GAAG,GAAG,IAAI,cAAc,CAAC,UAAU,EAAE,kBAAkB,EAAE,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAA;QAE7E,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,gBAAgB,CAAC,CAAA;QACvC,MAAM,CAAC,GAAG,CAAC,aAAa,CAAC,CAAC,IAAI,CAAC,UAAU,CAAC,CAAA;QAC1C,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,IAAI,CAAC,kBAAkB,CAAC,CAAA;QAC5C,MAAM,CAAC,GAAG,CAAC,IAAI,CAAC,CAAC,OAAO,CAAC,EAAE,IAAI,EAAE,GAAG,EAAE,CAAC,CAAA;QACvC,MAAM,CAAC,GAAG,YAAY,KAAK,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;IACzC,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,iDAAiD,EAAE,GAAG,EAAE;QAC3D,MAAM,GAAG,GAAG,IAAI,wBAAwB,CAAC,UAAU,EAAE,mBAAmB,EAAE,EAAE,CAAC,CAAA;QAE7E,MAAM,CAAC,GAAG,YAAY,cAAc,CAAC,CAAC,IAAI,CAAC,IAAI,CAAC,CAAA;QAChD,MAAM,CAAC,GAAG,YAAY,KAAK,CAAC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CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,sCAAsC,CAAC,CAAA;QACvE,MAAM,CAAC,aAAa,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,sCAAsC,CAAC,CAAA;QAC7E,MAAM,CAAC,eAAe,CAAC,KAAK,CAAC,CAAC,SAAS,CAAC,sCAAsC,CAAC,CAAA;IACjF,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
@@ -12,7 +12,7 @@
12
12
  * - `ts-procedures/codegen` — client code generation (also: npx ts-procedures-codegen)
13
13
  */
14
14
  export { Procedures } from './core/procedures.js';
15
- export type { ProceduresOptions, ProcedureKind, AnyProcedureRegistration, TProcedureRegistration, TStreamProcedureRegistration, THttpProcedureRegistration, THttpStreamProcedureRegistration, TCreateHttpConfig, TLocalContext, TStreamContext, TNoContextProvided, HttpMethod, } from './core/types.js';
15
+ export type { ProceduresOptions, ProcedureKind, AnyProcedureRegistration, TProcedureRegistration, TStreamProcedureRegistration, THttpProcedureRegistration, THttpStreamProcedureRegistration, TCreateHttpConfig, THttpReqInput, THttpResInput, THttpStreamSchema, HttpSchemaInput, HttpReq, TLocalContext, TStreamContext, TNoContextProvided, HttpMethod, } from './core/types.js';
16
16
  export type { HttpReturn } from './core/create-http.js';
17
17
  export { ProcedureError, ProcedureValidationError, ProcedureRegistrationError, ProcedureYieldValidationError, } from './core/errors.js';
18
18
  export type { ProcedureErrorKind } from './core/errors.js';
@@ -1 +1 @@
1
- {"version":3,"file":"exports.js","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,8DAA8D;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAgBjD,OAAO,EACL,cAAc,EACd,wBAAwB,EACxB,0BAA0B,EAC1B,6BAA6B,GAC9B,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAKvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AASlF,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA"}
1
+ {"version":3,"file":"exports.js","sourceRoot":"","sources":["../src/exports.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,8DAA8D;AAC9D,OAAO,EAAE,UAAU,EAAE,MAAM,sBAAsB,CAAA;AAqBjD,OAAO,EACL,cAAc,EACd,wBAAwB,EACxB,0BAA0B,EAC1B,6BAA6B,GAC9B,MAAM,kBAAkB,CAAA;AAEzB,OAAO,EAAE,qBAAqB,EAAE,oBAAoB,EAAE,MAAM,2BAA2B,CAAA;AAKvF,OAAO,EAAE,iBAAiB,EAAE,MAAM,qBAAqB,CAAA;AACvD,OAAO,EAAE,cAAc,EAAE,eAAe,EAAE,MAAM,qBAAqB,CAAA;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,4BAA4B,CAAA;AAE1D,OAAO,EAAE,uBAAuB,EAAE,mBAAmB,EAAE,MAAM,qBAAqB,CAAA;AASlF,uCAAuC;AACvC,OAAO,EAAE,gBAAgB,EAAE,MAAM,0BAA0B,CAAA"}
@@ -0,0 +1,28 @@
1
+ import type { AnyHttpRouteDoc, DocEnvelope, DocRegistryConfig, DocRegistryOutputOptions, DocSource, ErrorDoc } from '../types.js';
2
+ export type { AnyHttpRouteDoc, DocEnvelope, DocRegistryConfig, DocRegistryOutputOptions, DocSource, ErrorDoc, HeaderDoc, } from '../types.js';
3
+ export declare class DocRegistry {
4
+ private readonly basePath;
5
+ private readonly headers;
6
+ private errors;
7
+ private readonly sources;
8
+ constructor(config?: DocRegistryConfig);
9
+ from(source: DocSource<AnyHttpRouteDoc>): this;
10
+ /**
11
+ * Adds one or more {@link ErrorDoc} entries to the envelope. Use for errors
12
+ * outside your runtime taxonomy — middleware-level errors, infrastructure
13
+ * errors (502/503/504), or doc-only meta errors.
14
+ *
15
+ * Deduped by `name` — last write wins.
16
+ */
17
+ documentError(...docs: ErrorDoc[]): this;
18
+ toJSON<T = DocEnvelope>(options?: DocRegistryOutputOptions<T>): T;
19
+ /**
20
+ * Framework error defaults — derived from {@link defaultErrorTaxonomy} plus
21
+ * `ProcedureRegistrationError` (which is thrown only at registration time
22
+ * and therefore lives in the catalog, not the runtime taxonomy).
23
+ *
24
+ * Most consumers do not need to call this directly — the `DocRegistry`
25
+ * constructor auto-includes these unless `includeDefaults: false` is passed.
26
+ */
27
+ static defaultErrors(): ErrorDoc[];
28
+ }
@@ -0,0 +1,96 @@
1
+ import { PROCEDURE_REGISTRATION_ERROR_DOC, defaultErrorTaxonomy, taxonomyToErrorDocs, } from './error-taxonomy.js';
2
+ function isTaxonomy(input) {
3
+ return !Array.isArray(input);
4
+ }
5
+ /**
6
+ * Dedupes ErrorDocs by `name`, last occurrence wins. Map insertion order
7
+ * preserves the latest position of each name.
8
+ */
9
+ function dedupeByName(docs) {
10
+ const byName = new Map();
11
+ for (const doc of docs)
12
+ byName.set(doc.name, doc);
13
+ return Array.from(byName.values());
14
+ }
15
+ export class DocRegistry {
16
+ basePath;
17
+ headers;
18
+ errors;
19
+ sources = [];
20
+ constructor(config) {
21
+ this.basePath = config?.basePath ?? '';
22
+ this.headers = config?.headers ?? [];
23
+ const includeDefaults = config?.includeDefaults ?? true;
24
+ const userErrors = config?.errors
25
+ ? isTaxonomy(config.errors)
26
+ ? taxonomyToErrorDocs(config.errors)
27
+ : config.errors
28
+ : [];
29
+ // Precedence: defaults come first, user errors override via dedupe
30
+ // (last-write-wins). Matches runtime resolution order.
31
+ const merged = includeDefaults
32
+ ? [...DocRegistry.defaultErrors(), ...userErrors]
33
+ : userErrors;
34
+ this.errors = dedupeByName(merged);
35
+ }
36
+ from(source) {
37
+ this.sources.push(source);
38
+ return this;
39
+ }
40
+ /**
41
+ * Adds one or more {@link ErrorDoc} entries to the envelope. Use for errors
42
+ * outside your runtime taxonomy — middleware-level errors, infrastructure
43
+ * errors (502/503/504), or doc-only meta errors.
44
+ *
45
+ * Deduped by `name` — last write wins.
46
+ */
47
+ documentError(...docs) {
48
+ this.errors = dedupeByName([...this.errors, ...docs]);
49
+ return this;
50
+ }
51
+ toJSON(options) {
52
+ let routes = this.sources.flatMap((source) => source.docs);
53
+ if (options?.filter) {
54
+ routes = routes.filter(options.filter);
55
+ }
56
+ // Surface coverage gaps — when a builder skipped procedures (e.g. a
57
+ // streaming procedure registered with HonoRPCAppBuilder), the per-builder
58
+ // warning fires once at `build()` time, but consumers who only call
59
+ // `registry.toJSON()` (e.g. to dump the envelope to disk for codegen)
60
+ // wouldn't see it without this aggregate. Single warning per call,
61
+ // suppressed when the env var is set so CI pipelines stay quiet.
62
+ if (process.env.TS_PROCEDURES_SUPPRESS_COVERAGE_WARNINGS !== '1') {
63
+ const skipped = this.sources.flatMap((source) => source.skippedProcedures ?? []);
64
+ if (skipped.length > 0) {
65
+ const lines = skipped.map(({ name, reason }) => ` - "${name}": ${reason}`);
66
+ console.warn(`[ts-procedures DocRegistry] ${skipped.length} procedure(s) registered with a builder but not served — they will be missing from the doc envelope:\n${lines.join('\n')}\n` +
67
+ `(Suppress with TS_PROCEDURES_SUPPRESS_COVERAGE_WARNINGS=1)`);
68
+ }
69
+ }
70
+ const envelope = {
71
+ basePath: this.basePath,
72
+ headers: [...this.headers],
73
+ errors: [...this.errors],
74
+ routes,
75
+ };
76
+ if (options?.transform) {
77
+ return options.transform(envelope);
78
+ }
79
+ return envelope;
80
+ }
81
+ /**
82
+ * Framework error defaults — derived from {@link defaultErrorTaxonomy} plus
83
+ * `ProcedureRegistrationError` (which is thrown only at registration time
84
+ * and therefore lives in the catalog, not the runtime taxonomy).
85
+ *
86
+ * Most consumers do not need to call this directly — the `DocRegistry`
87
+ * constructor auto-includes these unless `includeDefaults: false` is passed.
88
+ */
89
+ static defaultErrors() {
90
+ return [
91
+ ...taxonomyToErrorDocs(defaultErrorTaxonomy),
92
+ PROCEDURE_REGISTRATION_ERROR_DOC,
93
+ ];
94
+ }
95
+ }
96
+ //# sourceMappingURL=doc-registry.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"doc-registry.js","sourceRoot":"","sources":["../../../src/implementations/http/doc-registry.ts"],"names":[],"mappings":"AASA,OAAO,EACL,gCAAgC,EAChC,oBAAoB,EACpB,mBAAmB,GAEpB,MAAM,qBAAqB,CAAA;AAY5B,SAAS,UAAU,CAAC,KAAiC;IACnD,OAAO,CAAC,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,CAAA;AAC9B,CAAC;AAED;;;GAGG;AACH,SAAS,YAAY,CAAC,IAAgB;IACpC,MAAM,MAAM,GAAG,IAAI,GAAG,EAAoB,CAAA;IAC1C,KAAK,MAAM,GAAG,IAAI,IAAI;QAAE,MAAM,CAAC,GAAG,CAAC,GAAG,CAAC,IAAI,EAAE,GAAG,CAAC,CAAA;IACjD,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,MAAM,EAAE,CAAC,CAAA;AACpC,CAAC;AAED,MAAM,OAAO,WAAW;IACL,QAAQ,CAAQ;IAChB,OAAO,CAAa;IAC7B,MAAM,CAAY;IACT,OAAO,GAAiC,EAAE,CAAA;IAE3D,YAAY,MAA0B;QACpC,IAAI,CAAC,QAAQ,GAAG,MAAM,EAAE,QAAQ,IAAI,EAAE,CAAA;QACtC,IAAI,CAAC,OAAO,GAAG,MAAM,EAAE,OAAO,IAAI,EAAE,CAAA;QAEpC,MAAM,eAAe,GAAG,MAAM,EAAE,eAAe,IAAI,IAAI,CAAA;QACvD,MAAM,UAAU,GAAe,MAAM,EAAE,MAAM;YAC3C,CAAC,CAAC,UAAU,CAAC,MAAM,CAAC,MAAM,CAAC;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