@ddd-ts-kit/http 0.113.2 → 0.115.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.
- package/README.fr.md +40 -16
- package/README.md +36 -16
- package/dist/error/answered-edge-error.d.ts +10 -2
- package/dist/error/answered-edge-error.d.ts.map +1 -1
- package/dist/error/answered-edge-error.js +17 -5
- package/dist/error/answered-edge-error.js.map +1 -1
- package/dist/error/create-error-mapper.d.ts.map +1 -1
- package/dist/error/create-error-mapper.js +2 -1
- package/dist/error/create-error-mapper.js.map +1 -1
- package/dist/error/default-error-mapping.d.ts.map +1 -1
- package/dist/error/default-error-mapping.js +2 -0
- package/dist/error/default-error-mapping.js.map +1 -1
- package/dist/error/edge-refusal.d.ts +5 -7
- package/dist/error/edge-refusal.d.ts.map +1 -1
- package/dist/error/edge-refusal.js.map +1 -1
- package/dist/error/mapped-status.d.ts +8 -0
- package/dist/error/mapped-status.d.ts.map +1 -0
- package/dist/error/mapped-status.js +9 -0
- package/dist/error/mapped-status.js.map +1 -0
- package/dist/error/to-problem.d.ts.map +1 -1
- package/dist/error/to-problem.js +2 -1
- package/dist/error/to-problem.js.map +1 -1
- package/dist/express/express-mount-options.d.ts +11 -0
- package/dist/express/express-mount-options.d.ts.map +1 -0
- package/dist/express/express-mount-options.js +2 -0
- package/dist/express/express-mount-options.js.map +1 -0
- package/dist/express/mount-express.d.ts +11 -9
- package/dist/express/mount-express.d.ts.map +1 -1
- package/dist/express/mount-express.js +33 -23
- package/dist/express/mount-express.js.map +1 -1
- package/dist/express.d.ts +2 -1
- package/dist/express.d.ts.map +1 -1
- package/dist/express.js.map +1 -1
- package/dist/fastify/mount-fastify.d.ts +2 -2
- package/dist/fastify/mount-fastify.d.ts.map +1 -1
- package/dist/fastify/mount-fastify.js +14 -20
- package/dist/fastify/mount-fastify.js.map +1 -1
- package/dist/hono/hono-mount-options.d.ts +1 -1
- package/dist/hono/mount-hono.d.ts.map +1 -1
- package/dist/hono/mount-hono.js +6 -14
- package/dist/hono/mount-hono.js.map +1 -1
- package/dist/hono/read-body.d.ts.map +1 -1
- package/dist/hono/read-body.js +3 -3
- package/dist/hono/read-body.js.map +1 -1
- package/dist/index.d.ts +1 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +0 -1
- package/dist/index.js.map +1 -1
- package/dist/nest/is-unread-json-body.d.ts.map +1 -1
- package/dist/nest/is-unread-json-body.js +2 -2
- package/dist/nest/is-unread-json-body.js.map +1 -1
- package/dist/orpc/orpc-router.js +1 -1
- package/dist/orpc/orpc-router.js.map +1 -1
- package/dist/pipeline/admitted-caller.d.ts +3 -5
- package/dist/pipeline/admitted-caller.d.ts.map +1 -1
- package/dist/pipeline/admitted-caller.js +2 -2
- package/dist/pipeline/admitted-caller.js.map +1 -1
- package/dist/pipeline/closing-with.d.ts +7 -0
- package/dist/pipeline/closing-with.d.ts.map +1 -0
- package/dist/pipeline/closing-with.js +21 -0
- package/dist/pipeline/closing-with.js.map +1 -0
- package/dist/pipeline/conditional-answer.d.ts +1 -1
- package/dist/pipeline/conditional-answer.d.ts.map +1 -1
- package/dist/pipeline/conditional-answer.js +12 -3
- package/dist/pipeline/conditional-answer.js.map +1 -1
- package/dist/pipeline/entity-tag-of.d.ts +4 -3
- package/dist/pipeline/entity-tag-of.d.ts.map +1 -1
- package/dist/pipeline/entity-tag-of.js +5 -4
- package/dist/pipeline/entity-tag-of.js.map +1 -1
- package/dist/pipeline/execute-route.d.ts.map +1 -1
- package/dist/pipeline/execute-route.js +44 -58
- package/dist/pipeline/execute-route.js.map +1 -1
- package/dist/pipeline/is-listed.d.ts +3 -0
- package/dist/pipeline/is-listed.d.ts.map +1 -0
- package/dist/pipeline/is-listed.js +7 -0
- package/dist/pipeline/is-listed.js.map +1 -0
- package/dist/pipeline/payload.d.ts +22 -0
- package/dist/pipeline/payload.d.ts.map +1 -0
- package/dist/pipeline/payload.js +2 -0
- package/dist/pipeline/payload.js.map +1 -0
- package/dist/pipeline/progress.d.ts +16 -0
- package/dist/pipeline/progress.d.ts.map +1 -0
- package/dist/pipeline/progress.js +24 -0
- package/dist/pipeline/progress.js.map +1 -0
- package/dist/pipeline/reported-stream.d.ts.map +1 -1
- package/dist/pipeline/reported-stream.js +18 -8
- package/dist/pipeline/reported-stream.js.map +1 -1
- package/dist/pipeline/represented-answer.d.ts +3 -3
- package/dist/pipeline/represented-answer.d.ts.map +1 -1
- package/dist/pipeline/represented.d.ts +8 -3
- package/dist/pipeline/represented.d.ts.map +1 -1
- package/dist/pipeline/represented.js +35 -9
- package/dist/pipeline/represented.js.map +1 -1
- package/dist/pipeline/route-response.d.ts +10 -3
- package/dist/pipeline/route-response.d.ts.map +1 -1
- package/dist/pipeline/whole-of.d.ts +9 -0
- package/dist/pipeline/whole-of.d.ts.map +1 -0
- package/dist/pipeline/whole-of.js +8 -0
- package/dist/pipeline/whole-of.js.map +1 -0
- package/dist/pipeline/writing.d.ts +11 -0
- package/dist/pipeline/writing.d.ts.map +1 -0
- package/dist/pipeline/writing.js +2 -0
- package/dist/pipeline/writing.js.map +1 -0
- package/dist/pipeline/written-in.d.ts +10 -4
- package/dist/pipeline/written-in.d.ts.map +1 -1
- package/dist/pipeline/written-in.js +12 -10
- package/dist/pipeline/written-in.js.map +1 -1
- package/dist/representation/is-json-content-type.d.ts +3 -0
- package/dist/representation/is-json-content-type.d.ts.map +1 -0
- package/dist/representation/is-json-content-type.js +7 -0
- package/dist/representation/is-json-content-type.js.map +1 -0
- package/dist/representation/json-representation.js +9 -1
- package/dist/representation/json-representation.js.map +1 -1
- package/dist/route/reads-its-stream.d.ts +4 -0
- package/dist/route/reads-its-stream.d.ts.map +1 -0
- package/dist/route/reads-its-stream.js +5 -0
- package/dist/route/reads-its-stream.js.map +1 -0
- package/dist/rpc/rpc-answer.d.ts.map +1 -1
- package/dist/rpc/rpc-answer.js +18 -17
- package/dist/rpc/rpc-answer.js.map +1 -1
- package/dist/testing/written-text.d.ts +10 -0
- package/dist/testing/written-text.d.ts.map +1 -0
- package/dist/testing/written-text.js +17 -0
- package/dist/testing/written-text.js.map +1 -0
- package/dist/testing.d.ts +1 -0
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +1 -0
- package/dist/testing.js.map +1 -1
- package/dist/trpc/trpc-router.js +1 -1
- package/dist/trpc/trpc-router.js.map +1 -1
- package/package.json +15 -15
- package/dist/pipeline/serialize-body.d.ts +0 -7
- package/dist/pipeline/serialize-body.d.ts.map +0 -1
- package/dist/pipeline/serialize-body.js +0 -16
- package/dist/pipeline/serialize-body.js.map +0 -1
- package/dist/pipeline/write-stream.d.ts +0 -8
- package/dist/pipeline/write-stream.d.ts.map +0 -1
- package/dist/pipeline/write-stream.js +0 -23
- package/dist/pipeline/write-stream.js.map +0 -1
|
@@ -1,23 +0,0 @@
|
|
|
1
|
-
import { once } from 'node:events';
|
|
2
|
-
/**
|
|
3
|
-
* Writes the chunks of a streamed list to a response, waiting for the client when it reads slower
|
|
4
|
-
* than the list is produced, and stops reading the list when the client leaves. A failure once
|
|
5
|
-
* the status is sent can only cut the response short: the connection is closed.
|
|
6
|
-
*/
|
|
7
|
-
export async function writeStream(target, chunks) {
|
|
8
|
-
try {
|
|
9
|
-
for await (const chunk of chunks) {
|
|
10
|
-
if (target.destroyed) {
|
|
11
|
-
return;
|
|
12
|
-
}
|
|
13
|
-
if (!target.write(chunk)) {
|
|
14
|
-
await Promise.race([once(target, 'drain'), once(target, 'close')]);
|
|
15
|
-
}
|
|
16
|
-
}
|
|
17
|
-
target.end();
|
|
18
|
-
}
|
|
19
|
-
catch (error) {
|
|
20
|
-
target.destroy(error instanceof Error ? error : undefined);
|
|
21
|
-
}
|
|
22
|
-
}
|
|
23
|
-
//# sourceMappingURL=write-stream.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"write-stream.js","sourceRoot":"","sources":["../../src/pipeline/write-stream.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,aAAa,CAAC;AAGnC;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,WAAW,CAAC,MAAgB,EAAE,MAA6B;IAC/E,IAAI,CAAC;QACH,IAAI,KAAK,EAAE,MAAM,KAAK,IAAI,MAAM,EAAE,CAAC;YACjC,IAAI,MAAM,CAAC,SAAS,EAAE,CAAC;gBACrB,OAAO;YACT,CAAC;YAED,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,KAAK,CAAC,EAAE,CAAC;gBACzB,MAAM,OAAO,CAAC,IAAI,CAAC,CAAC,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,CAAC,MAAM,EAAE,OAAO,CAAC,CAAC,CAAC,CAAC;YACrE,CAAC;QACH,CAAC;QAED,MAAM,CAAC,GAAG,EAAE,CAAC;IACf,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,CAAC,OAAO,CAAC,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,SAAS,CAAC,CAAC;IAC7D,CAAC;AACH,CAAC"}
|