ts-procedures 9.2.0 → 10.0.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 (128) hide show
  1. package/CHANGELOG.md +25 -0
  2. package/build/codegen/bin/cli.js +1 -1
  3. package/build/codegen/bin/cli.js.map +1 -1
  4. package/build/codegen/emit/api-route.js +1 -1
  5. package/build/codegen/emit/api-route.js.map +1 -1
  6. package/build/codegen/emit/scope-file.js +1 -1
  7. package/build/codegen/emit/scope-file.js.map +1 -1
  8. package/build/codegen/emit-errors.integration.test.js +2 -2
  9. package/build/codegen/emit-errors.integration.test.js.map +1 -1
  10. package/build/codegen/resolve-envelope.js +1 -1
  11. package/build/codegen/resolve-envelope.js.map +1 -1
  12. package/build/codegen/test-helpers/run-tsc.js +1 -1
  13. package/build/codegen/test-helpers/run-tsc.js.map +1 -1
  14. package/package.json +8 -8
  15. package/src/codegen/bin/cli.ts +1 -1
  16. package/src/codegen/emit/api-route.ts +1 -1
  17. package/src/codegen/emit/scope-file.ts +2 -1
  18. package/src/codegen/emit-errors.integration.test.ts +2 -2
  19. package/src/codegen/resolve-envelope.ts +1 -1
  20. package/src/codegen/test-helpers/run-tsc.ts +1 -0
  21. package/build/errors.d.ts +0 -33
  22. package/build/errors.js +0 -91
  23. package/build/errors.js.map +0 -1
  24. package/build/errors.test.d.ts +0 -1
  25. package/build/errors.test.js +0 -122
  26. package/build/errors.test.js.map +0 -1
  27. package/build/implementations/http/doc-registry.d.ts +0 -28
  28. package/build/implementations/http/doc-registry.js +0 -96
  29. package/build/implementations/http/doc-registry.js.map +0 -1
  30. package/build/implementations/http/doc-registry.test.d.ts +0 -1
  31. package/build/implementations/http/doc-registry.test.js +0 -516
  32. package/build/implementations/http/doc-registry.test.js.map +0 -1
  33. package/build/implementations/http/error-taxonomy.d.ts +0 -249
  34. package/build/implementations/http/error-taxonomy.js +0 -252
  35. package/build/implementations/http/error-taxonomy.js.map +0 -1
  36. package/build/implementations/http/error-taxonomy.test.d.ts +0 -1
  37. package/build/implementations/http/error-taxonomy.test.js +0 -399
  38. package/build/implementations/http/error-taxonomy.test.js.map +0 -1
  39. package/build/implementations/http/express-rpc/error-taxonomy.test.d.ts +0 -1
  40. package/build/implementations/http/express-rpc/error-taxonomy.test.js +0 -83
  41. package/build/implementations/http/express-rpc/error-taxonomy.test.js.map +0 -1
  42. package/build/implementations/http/express-rpc/index.d.ts +0 -125
  43. package/build/implementations/http/express-rpc/index.js +0 -216
  44. package/build/implementations/http/express-rpc/index.js.map +0 -1
  45. package/build/implementations/http/express-rpc/index.test.d.ts +0 -1
  46. package/build/implementations/http/express-rpc/index.test.js +0 -684
  47. package/build/implementations/http/express-rpc/index.test.js.map +0 -1
  48. package/build/implementations/http/express-rpc/types.d.ts +0 -11
  49. package/build/implementations/http/express-rpc/types.js +0 -2
  50. package/build/implementations/http/express-rpc/types.js.map +0 -1
  51. package/build/implementations/http/hono-api/error-taxonomy.test.d.ts +0 -1
  52. package/build/implementations/http/hono-api/error-taxonomy.test.js +0 -137
  53. package/build/implementations/http/hono-api/error-taxonomy.test.js.map +0 -1
  54. package/build/implementations/http/hono-api/index.d.ts +0 -151
  55. package/build/implementations/http/hono-api/index.js +0 -344
  56. package/build/implementations/http/hono-api/index.js.map +0 -1
  57. package/build/implementations/http/hono-api/index.test.d.ts +0 -1
  58. package/build/implementations/http/hono-api/index.test.js +0 -992
  59. package/build/implementations/http/hono-api/index.test.js.map +0 -1
  60. package/build/implementations/http/hono-api/types.d.ts +0 -13
  61. package/build/implementations/http/hono-api/types.js +0 -2
  62. package/build/implementations/http/hono-api/types.js.map +0 -1
  63. package/build/implementations/http/hono-rpc/error-taxonomy.test.d.ts +0 -1
  64. package/build/implementations/http/hono-rpc/error-taxonomy.test.js +0 -64
  65. package/build/implementations/http/hono-rpc/error-taxonomy.test.js.map +0 -1
  66. package/build/implementations/http/hono-rpc/index.d.ts +0 -130
  67. package/build/implementations/http/hono-rpc/index.js +0 -209
  68. package/build/implementations/http/hono-rpc/index.js.map +0 -1
  69. package/build/implementations/http/hono-rpc/index.test.d.ts +0 -1
  70. package/build/implementations/http/hono-rpc/index.test.js +0 -828
  71. package/build/implementations/http/hono-rpc/index.test.js.map +0 -1
  72. package/build/implementations/http/hono-rpc/types.d.ts +0 -11
  73. package/build/implementations/http/hono-rpc/types.js +0 -2
  74. package/build/implementations/http/hono-rpc/types.js.map +0 -1
  75. package/build/implementations/http/hono-stream/error-taxonomy.test.d.ts +0 -1
  76. package/build/implementations/http/hono-stream/error-taxonomy.test.js +0 -159
  77. package/build/implementations/http/hono-stream/error-taxonomy.test.js.map +0 -1
  78. package/build/implementations/http/hono-stream/index.d.ts +0 -171
  79. package/build/implementations/http/hono-stream/index.js +0 -415
  80. package/build/implementations/http/hono-stream/index.js.map +0 -1
  81. package/build/implementations/http/hono-stream/index.test.d.ts +0 -1
  82. package/build/implementations/http/hono-stream/index.test.js +0 -1383
  83. package/build/implementations/http/hono-stream/index.test.js.map +0 -1
  84. package/build/implementations/http/hono-stream/types.d.ts +0 -15
  85. package/build/implementations/http/hono-stream/types.js +0 -2
  86. package/build/implementations/http/hono-stream/types.js.map +0 -1
  87. package/build/implementations/http/on-request-error.test.d.ts +0 -1
  88. package/build/implementations/http/on-request-error.test.js +0 -173
  89. package/build/implementations/http/on-request-error.test.js.map +0 -1
  90. package/build/implementations/http/route-errors.test.d.ts +0 -1
  91. package/build/implementations/http/route-errors.test.js +0 -139
  92. package/build/implementations/http/route-errors.test.js.map +0 -1
  93. package/build/implementations/types.d.ts +0 -192
  94. package/build/implementations/types.js +0 -2
  95. package/build/implementations/types.js.map +0 -1
  96. package/build/index.d.ts +0 -165
  97. package/build/index.js +0 -258
  98. package/build/index.js.map +0 -1
  99. package/build/index.test.d.ts +0 -1
  100. package/build/index.test.js +0 -920
  101. package/build/index.test.js.map +0 -1
  102. package/build/schema/extract-json-schema.d.ts +0 -2
  103. package/build/schema/extract-json-schema.js +0 -12
  104. package/build/schema/extract-json-schema.js.map +0 -1
  105. package/build/schema/extract-json-schema.test.d.ts +0 -1
  106. package/build/schema/extract-json-schema.test.js +0 -23
  107. package/build/schema/extract-json-schema.test.js.map +0 -1
  108. package/build/schema/parser.d.ts +0 -28
  109. package/build/schema/parser.js +0 -170
  110. package/build/schema/parser.js.map +0 -1
  111. package/build/schema/parser.test.d.ts +0 -1
  112. package/build/schema/parser.test.js +0 -120
  113. package/build/schema/parser.test.js.map +0 -1
  114. package/build/schema/resolve-schema-lib.d.ts +0 -12
  115. package/build/schema/resolve-schema-lib.js +0 -11
  116. package/build/schema/resolve-schema-lib.js.map +0 -1
  117. package/build/schema/resolve-schema-lib.test.d.ts +0 -1
  118. package/build/schema/resolve-schema-lib.test.js +0 -17
  119. package/build/schema/resolve-schema-lib.test.js.map +0 -1
  120. package/build/schema/types.d.ts +0 -8
  121. package/build/schema/types.js +0 -2
  122. package/build/schema/types.js.map +0 -1
  123. package/build/stack-utils.d.ts +0 -25
  124. package/build/stack-utils.js +0 -95
  125. package/build/stack-utils.js.map +0 -1
  126. package/build/stack-utils.test.d.ts +0 -1
  127. package/build/stack-utils.test.js +0 -80
  128. package/build/stack-utils.test.js.map +0 -1
@@ -1,216 +0,0 @@
1
- import express from 'express';
2
- import { kebabCase } from 'es-toolkit/string';
3
- import { defineErrorTaxonomy, resolveErrorResponse, } from '../error-taxonomy.js';
4
- import { castArray } from 'es-toolkit/compat';
5
- export { defineErrorTaxonomy };
6
- /**
7
- * Builder class for creating an Express application with RPC routes.
8
- *
9
- * Usage:
10
- * const PublicRPC = Procedures<PublicRPCContext, RPCConfig>()
11
- * const ProtectedRPC = Procedures<ProtectedRPCContext, RPCConfig>()
12
- *
13
- * const rpcApp = new ExpressRPCAppBuilder()
14
- * .register(PublicRPC, (req): Promise<PublicRPCContext> => { /* context resolution logic * / })
15
- * .register(ProtectedRPC, (req): Promise<ProtectedRPCContext> => { /* context resolution logic * / })
16
- * .build();
17
- *
18
- * const app = rpcApp.app; // Express application
19
- * const docs = rpcApp.docs; // RPC route documentation
20
- */
21
- export class ExpressRPCAppBuilder {
22
- config;
23
- /**
24
- * Constructor for ExpressRPCAppBuilder.
25
- *
26
- * @param config
27
- */
28
- constructor(config) {
29
- this.config = config;
30
- if (config?.app) {
31
- this._app = config.app;
32
- }
33
- else {
34
- // Default middleware if no app is provided
35
- this._app.use(express.json());
36
- }
37
- if (config?.onRequestStart) {
38
- this._app.use((req, res, next) => {
39
- config.onRequestStart(req);
40
- next();
41
- });
42
- }
43
- if (config?.onRequestEnd) {
44
- this._app.use((req, res, next) => {
45
- res.on('finish', () => {
46
- config.onRequestEnd(req, res);
47
- });
48
- next();
49
- });
50
- }
51
- }
52
- /**
53
- * Generates the RPC route path based on the RPC configuration.
54
- * `RPCConfig.scope` can be a string or an array of strings to form nested paths.
55
- *
56
- * Example
57
- * name: 'GetUser'
58
- * scope: ['users', 'profile']
59
- * version: 1
60
- * path: /users/profile/get-user/1
61
- * @param config
62
- */
63
- static makeRPCHttpRoutePath({ name, config, prefix, }) {
64
- const normalizedPrefix = prefix ? (prefix.startsWith('/') ? prefix : `/${prefix}`) : '';
65
- return `${normalizedPrefix}/${castArray(config.scope).map(kebabCase).join('/')}/${kebabCase(name)}/${String(config.version).trim()}`;
66
- }
67
- /**
68
- * Instance method wrapper for makeRPCHttpRoutePath that uses the builder's pathPrefix.
69
- * @param config - The RPC configuration
70
- */
71
- makeRPCHttpRoutePath(name, config) {
72
- return ExpressRPCAppBuilder.makeRPCHttpRoutePath({
73
- name,
74
- config,
75
- prefix: this.config?.pathPrefix,
76
- });
77
- }
78
- factories = [];
79
- _app = express();
80
- _docs = [];
81
- get app() {
82
- return this._app;
83
- }
84
- get docs() {
85
- return this._docs;
86
- }
87
- /**
88
- * Registers a procedure factory with its context.
89
- * @param factory - The procedure factory created by Procedures<Context, RPCConfig>()
90
- * @param factoryContext - The context for procedure handlers. Can be a direct value,
91
- * a sync function (req) => Context, or an async function (req) => Promise<Context>
92
- * @param extendProcedureDoc - A custom function to extend the generated RPC route documentation for each procedure.
93
- */
94
- register(factory, factoryContext, extendProcedureDoc) {
95
- this.factories.push({ factory, factoryContext, extendProcedureDoc });
96
- return this;
97
- }
98
- /**
99
- * Builds and returns the Express application with registered RPC routes.
100
- * @return express.Application
101
- */
102
- build() {
103
- this.factories.forEach(({ factory, factoryContext, extendProcedureDoc }) => {
104
- factory.getProcedures().map((procedure) => {
105
- const route = this.buildRpcHttpRouteDoc(procedure, extendProcedureDoc);
106
- this._docs.push(route);
107
- this._app[route.method](route.path, async (req, res) => {
108
- try {
109
- const context = typeof factoryContext === 'function'
110
- ? await factoryContext(req)
111
- : factoryContext;
112
- let ac;
113
- const ctxWithSignal = Object.defineProperty({ ...context }, 'signal', {
114
- get() {
115
- if (!ac) {
116
- ac = new AbortController();
117
- req.on('close', () => { if (!res.writableFinished)
118
- ac.abort(); });
119
- }
120
- return ac.signal;
121
- },
122
- enumerable: true,
123
- });
124
- res.json(await procedure.handler(ctxWithSignal, req.body));
125
- if (this.config?.onSuccess) {
126
- this.config.onSuccess(procedure, req, res);
127
- }
128
- // if status not set, set to 200
129
- if (!res.status) {
130
- res.status(200);
131
- }
132
- }
133
- catch (error) {
134
- if (this.config?.onRequestError) {
135
- try {
136
- await this.config.onRequestError({ err: error, procedure, raw: { req, res } });
137
- }
138
- catch (observerErr) {
139
- console.error('[ts-procedures express-rpc] onRequestError threw — swallowed:', observerErr);
140
- }
141
- }
142
- if (this.config?.errors || this.config?.unknownError) {
143
- const resolved = resolveErrorResponse({
144
- err: error,
145
- userTaxonomy: this.config.errors,
146
- unknownError: this.config.unknownError,
147
- procedure,
148
- raw: { req, res },
149
- });
150
- if (resolved) {
151
- await resolved.runOnCatch();
152
- if (!res.headersSent) {
153
- res.status(resolved.statusCode).json(resolved.body);
154
- }
155
- return;
156
- }
157
- }
158
- if (this.config?.onError) {
159
- this.config.onError(procedure, req, res, error);
160
- return;
161
- }
162
- // Hard default — `res.status` is always truthy (it's a method),
163
- // so the previous `if (!res.status)` guard never ran. Set status
164
- // and body together unconditionally, respecting an already-sent
165
- // response.
166
- if (!res.headersSent) {
167
- res.status(500).json({ error: error.message });
168
- }
169
- }
170
- });
171
- });
172
- });
173
- return this._app;
174
- }
175
- /**
176
- * Generates the RPC HTTP route for the given procedure.
177
- * @param procedure
178
- */
179
- buildRpcHttpRouteDoc(procedure, extendProcedureDoc) {
180
- const { config } = procedure;
181
- const path = ExpressRPCAppBuilder.makeRPCHttpRoutePath({
182
- name: procedure.name,
183
- config,
184
- prefix: this.config?.pathPrefix,
185
- });
186
- const method = 'post'; // RPCs use POST method
187
- const jsonSchema = {};
188
- if (config.schema?.params) {
189
- jsonSchema.body = config.schema.params;
190
- }
191
- if (config.schema?.returnType) {
192
- jsonSchema.response = config.schema.returnType;
193
- }
194
- const base = {
195
- kind: 'rpc',
196
- name: procedure.name,
197
- version: config.version,
198
- scope: config.scope,
199
- path,
200
- method,
201
- jsonSchema,
202
- };
203
- if (config.errors && config.errors.length > 0) {
204
- base.errors = [...config.errors];
205
- }
206
- let extendedDoc = {};
207
- if (extendProcedureDoc) {
208
- extendedDoc = extendProcedureDoc({ base, procedure });
209
- }
210
- return {
211
- ...extendedDoc,
212
- ...base,
213
- };
214
- }
215
- }
216
- //# sourceMappingURL=index.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/implementations/http/express-rpc/index.ts"],"names":[],"mappings":"AAAA,OAAO,OAAO,MAAM,SAAS,CAAA;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAS7C,OAAO,EAIL,mBAAmB,EACnB,oBAAoB,GACrB,MAAM,sBAAsB,CAAA;AAC7B,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAA;AAI7C,OAAO,EAAE,mBAAmB,EAAE,CAAA;AA0D9B;;;;;;;;;;;;;;GAcG;AACH,MAAM,OAAO,oBAAoB;IAMV;IALrB;;;;OAIG;IACH,YAAqB,MAAmC;QA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