fundus 0.0.2 → 0.0.3
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.md +58 -0
- package/build/client/_app/immutable/assets/0.DLhIsYA_.css.br +0 -0
- package/build/client/_app/immutable/assets/0.DLhIsYA_.css.gz +0 -0
- package/build/client/_app/immutable/assets/2.wavcNhPC.css +1 -0
- package/build/client/_app/immutable/assets/2.wavcNhPC.css.br +0 -0
- package/build/client/_app/immutable/assets/2.wavcNhPC.css.gz +0 -0
- package/build/client/_app/immutable/assets/3.Cjh_fXPY.css +1 -0
- package/build/client/_app/immutable/assets/3.Cjh_fXPY.css.br +0 -0
- package/build/client/_app/immutable/assets/3.Cjh_fXPY.css.gz +0 -0
- package/build/client/_app/immutable/assets/4.p004hmEN.css +1 -0
- package/build/client/_app/immutable/assets/4.p004hmEN.css.br +0 -0
- package/build/client/_app/immutable/assets/4.p004hmEN.css.gz +0 -0
- package/build/client/_app/immutable/assets/ConfirmDialog.BdKlitwi.css +1 -0
- package/build/client/_app/immutable/assets/ConfirmDialog.BdKlitwi.css.br +0 -0
- package/build/client/_app/immutable/assets/ConfirmDialog.BdKlitwi.css.gz +0 -0
- package/build/client/_app/immutable/assets/LibraryContextMenu.zyZtpKzC.css +1 -0
- package/build/client/_app/immutable/assets/LibraryContextMenu.zyZtpKzC.css.br +0 -0
- package/build/client/_app/immutable/assets/LibraryContextMenu.zyZtpKzC.css.gz +0 -0
- package/build/client/_app/immutable/chunks/BiIto6ft.js +1 -0
- package/build/client/_app/immutable/chunks/BiIto6ft.js.br +0 -0
- package/build/client/_app/immutable/chunks/BiIto6ft.js.gz +0 -0
- package/build/client/_app/immutable/chunks/Bjy-W4x2.js.br +0 -0
- package/build/client/_app/immutable/chunks/Bjy-W4x2.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CNRz3sSw.js.br +0 -0
- package/build/client/_app/immutable/chunks/CNRz3sSw.js.gz +0 -0
- package/build/client/_app/immutable/chunks/CO4RBJfa.js.br +0 -0
- package/build/client/_app/immutable/chunks/CO4RBJfa.js.gz +0 -0
- package/{dist/editor/_app/immutable/chunks/DjvOiDmq.js → build/client/_app/immutable/chunks/CvY6YsFE.js} +1 -1
- package/build/client/_app/immutable/chunks/CvY6YsFE.js.br +0 -0
- package/build/client/_app/immutable/chunks/CvY6YsFE.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DL0_39Ys.js +5 -0
- package/build/client/_app/immutable/chunks/DL0_39Ys.js.br +0 -0
- package/build/client/_app/immutable/chunks/DL0_39Ys.js.gz +0 -0
- package/{dist/editor/_app/immutable/chunks/BfPE5wdt.js → build/client/_app/immutable/chunks/DQ8SXFaX.js} +1 -1
- package/build/client/_app/immutable/chunks/DQ8SXFaX.js.br +0 -0
- package/build/client/_app/immutable/chunks/DQ8SXFaX.js.gz +0 -0
- package/build/client/_app/immutable/chunks/DjdrdRzT.js.br +0 -0
- package/build/client/_app/immutable/chunks/DjdrdRzT.js.gz +0 -0
- package/build/client/_app/immutable/chunks/xihTtKlq.js.br +1 -0
- package/build/client/_app/immutable/chunks/xihTtKlq.js.gz +0 -0
- package/{dist/editor/_app/immutable/entry/app.BkqbfI8n.js → build/client/_app/immutable/entry/app.ubN0v9bN.js} +2 -2
- package/build/client/_app/immutable/entry/app.ubN0v9bN.js.br +0 -0
- package/build/client/_app/immutable/entry/app.ubN0v9bN.js.gz +0 -0
- package/build/client/_app/immutable/entry/start.BW8dBDh6.js +1 -0
- package/build/client/_app/immutable/entry/start.BW8dBDh6.js.br +0 -0
- package/build/client/_app/immutable/entry/start.BW8dBDh6.js.gz +0 -0
- package/{dist/editor/_app/immutable/nodes/0.xdMI5GEU.js → build/client/_app/immutable/nodes/0.Dr5ijCIl.js} +1 -1
- package/build/client/_app/immutable/nodes/0.Dr5ijCIl.js.br +0 -0
- package/build/client/_app/immutable/nodes/0.Dr5ijCIl.js.gz +0 -0
- package/{dist/editor/_app/immutable/nodes/1.D9p2tfoJ.js → build/client/_app/immutable/nodes/1.DiIGIRAb.js} +1 -1
- package/build/client/_app/immutable/nodes/1.DiIGIRAb.js.br +3 -0
- package/build/client/_app/immutable/nodes/1.DiIGIRAb.js.gz +0 -0
- package/{dist/editor/_app/immutable/nodes/2.BrA0Hyzu.js → build/client/_app/immutable/nodes/2.B8KYmQcV.js} +3 -3
- package/build/client/_app/immutable/nodes/2.B8KYmQcV.js.br +0 -0
- package/build/client/_app/immutable/nodes/2.B8KYmQcV.js.gz +0 -0
- package/build/client/_app/immutable/nodes/3.B1jc7arT.js +104 -0
- package/build/client/_app/immutable/nodes/3.B1jc7arT.js.br +0 -0
- package/build/client/_app/immutable/nodes/3.B1jc7arT.js.gz +0 -0
- package/build/client/_app/immutable/nodes/4.BPK9n1mH.js +2 -0
- package/build/client/_app/immutable/nodes/4.BPK9n1mH.js.br +0 -0
- package/build/client/_app/immutable/nodes/4.BPK9n1mH.js.gz +0 -0
- package/build/client/_app/version.json +1 -0
- package/build/client/_app/version.json.br +0 -0
- package/build/client/_app/version.json.gz +0 -0
- package/build/env.js +100 -0
- package/build/env.js.map +1 -0
- package/build/handler.js +22 -0
- package/build/handler.js.map +1 -0
- package/build/index.js +145 -0
- package/build/index.js.map +1 -0
- package/build/server/chunks/chunks/context.js-Bw4WWLhG.js +443 -0
- package/build/server/chunks/chunks/context.js-Bw4WWLhG.js.map +1 -0
- package/build/server/chunks/chunks/core.js-DDntpb72.js +409 -0
- package/build/server/chunks/chunks/core.js-DDntpb72.js.map +1 -0
- package/build/server/chunks/chunks/env.js-l0sNRNKZ.js +2 -0
- package/build/server/chunks/chunks/env.js-l0sNRNKZ.js.map +1 -0
- package/build/server/chunks/chunks/exports.js-CLTzaOxn.js +152 -0
- package/build/server/chunks/chunks/exports.js-CLTzaOxn.js.map +1 -0
- package/build/server/chunks/chunks/folder-path.js-ytx9ucgg.js +64 -0
- package/build/server/chunks/chunks/folder-path.js-ytx9ucgg.js.map +1 -0
- package/build/server/chunks/chunks/http.js-Dxoa-jtP.js +100 -0
- package/build/server/chunks/chunks/http.js-Dxoa-jtP.js.map +1 -0
- package/build/server/chunks/chunks/internal.js-BDBSzJId.js +5753 -0
- package/build/server/chunks/chunks/internal.js-BDBSzJId.js.map +1 -0
- package/build/server/chunks/chunks/internal2.js-BlXt2rfE.js +22 -0
- package/build/server/chunks/chunks/internal2.js-BlXt2rfE.js.map +1 -0
- package/{dist/operations-DYM-5KVl.js → build/server/chunks/chunks/library-store.js-BP8cL-qD.js} +344 -444
- package/build/server/chunks/chunks/library-store.js-BP8cL-qD.js.map +1 -0
- package/build/server/chunks/chunks/manifest-appearance.js-DTk355LQ.js +146 -0
- package/build/server/chunks/chunks/manifest-appearance.js-DTk355LQ.js.map +1 -0
- package/build/server/chunks/chunks/routing.js-y-tryuip.js +213 -0
- package/build/server/chunks/chunks/routing.js-y-tryuip.js.map +1 -0
- package/build/server/chunks/chunks/shared.js-BWXgl1Xf.js +255 -0
- package/build/server/chunks/chunks/shared.js-BWXgl1Xf.js.map +1 -0
- package/build/server/chunks/chunks/utils.js-9oI5Oz0w.js +1048 -0
- package/build/server/chunks/chunks/utils.js-9oI5Oz0w.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/_...path_/_server.ts.js-WknZVW_S.js +27 -0
- package/build/server/chunks/entries/endpoints/api/_...path_/_server.ts.js-WknZVW_S.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/assets/_id_/_server.ts.js-BrZ__-HZ.js +24 -0
- package/build/server/chunks/entries/endpoints/api/assets/_id_/_server.ts.js-BrZ__-HZ.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/assets/_server.ts.js-PqADGPXc.js +45 -0
- package/build/server/chunks/entries/endpoints/api/assets/_server.ts.js-PqADGPXc.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/assets/delete/_server.ts.js-OqoE5PN-.js +31 -0
- package/build/server/chunks/entries/endpoints/api/assets/delete/_server.ts.js-OqoE5PN-.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/assets/move/_server.ts.js-CJ08e1ho.js +31 -0
- package/build/server/chunks/entries/endpoints/api/assets/move/_server.ts.js-CJ08e1ho.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/folders/_path_/_server.ts.js-DdF3eK2I.js +38 -0
- package/build/server/chunks/entries/endpoints/api/folders/_path_/_server.ts.js-DdF3eK2I.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/folders/_server.ts.js-Cxt6jsJ5.js +31 -0
- package/build/server/chunks/entries/endpoints/api/folders/_server.ts.js-Cxt6jsJ5.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/manifests/_name_/_server.ts.js-BWVM2Ntl.js +24 -0
- package/build/server/chunks/entries/endpoints/api/manifests/_name_/_server.ts.js-BWVM2Ntl.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/manifests/_server.ts.js-Z2bM-qHM.js +31 -0
- package/build/server/chunks/entries/endpoints/api/manifests/_server.ts.js-Z2bM-qHM.js.map +1 -0
- package/build/server/chunks/entries/endpoints/api/state/_server.ts.js-BX9H2Z34.js +24 -0
- package/build/server/chunks/entries/endpoints/api/state/_server.ts.js-BX9H2Z34.js.map +1 -0
- package/build/server/chunks/entries/endpoints/files/_...path_/_server.ts.js-BWHDZ8mz.js +27 -0
- package/build/server/chunks/entries/endpoints/files/_...path_/_server.ts.js-BWHDZ8mz.js.map +1 -0
- package/build/server/chunks/entries/endpoints/files/proxy/_...path_/_server.ts.js-CR_7mndO.js +24 -0
- package/build/server/chunks/entries/endpoints/files/proxy/_...path_/_server.ts.js-CR_7mndO.js.map +1 -0
- package/build/server/chunks/entries/endpoints/files/raw/_...path_/_server.ts.js-Cw1PDBvb.js +24 -0
- package/build/server/chunks/entries/endpoints/files/raw/_...path_/_server.ts.js-Cw1PDBvb.js.map +1 -0
- package/build/server/chunks/entries/hooks.server.js-BHoE0yBi.js +23 -0
- package/build/server/chunks/entries/hooks.server.js-BHoE0yBi.js.map +1 -0
- package/build/server/chunks/handler-10cx4zHn.js +1475 -0
- package/build/server/chunks/handler-10cx4zHn.js.map +1 -0
- package/build/server/chunks/index.js-DvPfiC00.js +3789 -0
- package/build/server/chunks/index.js-DvPfiC00.js.map +1 -0
- package/build/server/chunks/manifest.js-DoPjUnzD.js +149 -0
- package/build/server/chunks/manifest.js-DoPjUnzD.js.map +1 -0
- package/build/server/chunks/nodes/0.js-Di3qgAtW.js +11 -0
- package/build/server/chunks/nodes/0.js-Di3qgAtW.js.map +1 -0
- package/build/server/chunks/nodes/1.js-BlWSFIA8.js +7 -0
- package/build/server/chunks/nodes/1.js-BlWSFIA8.js.map +1 -0
- package/build/server/chunks/nodes/2.js-CO9nSPUN.js +7 -0
- package/build/server/chunks/nodes/2.js-CO9nSPUN.js.map +1 -0
- package/build/server/chunks/nodes/3.js-C2D6xpEO.js +7 -0
- package/build/server/chunks/nodes/3.js-C2D6xpEO.js.map +1 -0
- package/build/server/chunks/nodes/4.js-B3IuagJW.js +7 -0
- package/build/server/chunks/nodes/4.js-B3IuagJW.js.map +1 -0
- package/build/shims.js +33 -0
- package/build/shims.js.map +1 -0
- package/dist/cli.d.ts +2 -1
- package/dist/cli.js +109 -1332
- package/dist/config.d.ts +3 -2
- package/dist/config.js +2 -2
- package/dist/core/api-types.d.ts +141 -0
- package/dist/core/api-types.js +1 -0
- package/dist/core/asset-id.d.ts +28 -0
- package/dist/core/asset-id.js +59 -0
- package/dist/core/asset-reference.d.ts +23 -0
- package/dist/core/asset-reference.js +15 -0
- package/dist/core/canonicalize.d.ts +9 -0
- package/dist/core/canonicalize.js +36 -0
- package/dist/core/chroma-key.d.ts +30 -0
- package/dist/core/chroma-key.js +55 -0
- package/dist/core/config.d.ts +35 -0
- package/dist/core/config.js +4 -0
- package/dist/core/folder-path.d.ts +19 -0
- package/dist/core/folder-path.js +86 -0
- package/dist/core/index.d.ts +33 -499
- package/dist/core/index.js +17 -962
- package/dist/core/ingest.d.ts +18 -0
- package/dist/core/ingest.js +58 -0
- package/dist/core/library.d.ts +54 -0
- package/dist/core/library.js +138 -0
- package/dist/core/manifest-appearance.d.ts +35 -0
- package/dist/core/manifest-appearance.js +123 -0
- package/dist/core/manifest-entry.d.ts +104 -0
- package/dist/core/manifest-entry.js +1 -0
- package/dist/core/manifest-membership.d.ts +56 -0
- package/dist/core/manifest-membership.js +54 -0
- package/dist/core/plugins/audio.d.ts +26 -0
- package/dist/core/plugins/audio.js +44 -0
- package/dist/core/plugins/chroma-key-video.d.ts +29 -0
- package/dist/core/plugins/chroma-key-video.js +69 -0
- package/dist/core/plugins/contract.d.ts +35 -0
- package/dist/core/plugins/contract.js +1 -0
- package/dist/core/plugins/image.d.ts +30 -0
- package/dist/core/plugins/image.js +45 -0
- package/dist/core/plugins/slice.d.ts +22 -0
- package/dist/core/plugins/slice.js +60 -0
- package/dist/core/plugins/video.d.ts +45 -0
- package/dist/core/plugins/video.js +77 -0
- package/dist/core/reference-graph.d.ts +41 -0
- package/dist/core/reference-graph.js +138 -0
- package/dist/core/slice-data.d.ts +61 -0
- package/dist/core/slice-data.js +49 -0
- package/dist/runtime/chroma-key-gl.d.ts +40 -22
- package/dist/runtime/chroma-key-gl.js +189 -183
- package/dist/runtime/components/ChromaKeyVideo.svelte +3 -3
- package/dist/runtime/components/ChromaKeyVideo.svelte.d.ts +21 -0
- package/dist/runtime/components/Image.svelte +1 -1
- package/dist/runtime/components/Image.svelte.d.ts +9 -0
- package/dist/runtime/components/Slice.svelte +1 -1
- package/dist/runtime/components/Slice.svelte.d.ts +19 -0
- package/dist/runtime/components/SliceCanvas.svelte +3 -3
- package/dist/runtime/components/SliceCanvas.svelte.d.ts +10 -0
- package/dist/runtime/components/SliceDom.svelte +3 -3
- package/dist/runtime/components/SliceDom.svelte.d.ts +10 -0
- package/dist/runtime/components/Video.svelte +2 -2
- package/dist/runtime/components/Video.svelte.d.ts +18 -0
- package/dist/runtime/geometry.d.ts +55 -35
- package/dist/runtime/geometry.js +186 -191
- package/dist/runtime/index.d.ts +9 -9
- package/dist/runtime/index.js +9 -9
- package/dist/runtime/kind-handlers.d.ts +33 -24
- package/dist/runtime/kind-handlers.js +74 -65
- package/dist/runtime/manifest.d.ts +53 -47
- package/dist/runtime/manifest.js +133 -113
- package/dist/runtime/observe-border-box-size.d.ts +1 -4
- package/dist/runtime/observe-border-box-size.js +9 -10
- package/dist/runtime/preload-registry.d.ts +22 -8
- package/dist/runtime/preload-registry.js +65 -62
- package/dist/server/build.d.ts +8 -0
- package/dist/server/build.js +25 -0
- package/dist/server/check.d.ts +24 -0
- package/dist/server/check.js +199 -0
- package/dist/server/cli-commands.d.ts +25 -0
- package/dist/server/cli-commands.js +1178 -0
- package/dist/server/cli-init.d.ts +3 -0
- package/dist/server/cli-init.js +53 -0
- package/dist/server/cli-io.d.ts +46 -0
- package/dist/server/cli-io.js +105 -0
- package/dist/server/codegen.d.ts +58 -0
- package/dist/server/codegen.js +185 -0
- package/dist/server/config-loader.d.ts +34 -0
- package/dist/server/config-loader.js +103 -0
- package/dist/server/context.d.ts +8 -0
- package/dist/server/context.js +19 -0
- package/dist/server/folder-filesystem.d.ts +7 -0
- package/dist/server/folder-filesystem.js +39 -0
- package/dist/server/http.d.ts +12 -0
- package/dist/server/http.js +100 -0
- package/dist/server/index.d.ts +16 -0
- package/dist/server/index.js +9 -0
- package/dist/server/job-hash.d.ts +10 -0
- package/dist/server/job-hash.js +23 -0
- package/dist/server/library-store.d.ts +82 -0
- package/dist/server/library-store.js +763 -0
- package/dist/server/operations.d.ts +87 -0
- package/dist/server/operations.js +427 -0
- package/dist/server/plugins/audio.d.ts +7 -0
- package/dist/server/plugins/audio.js +27 -0
- package/dist/server/plugins/chroma-key-video.d.ts +9 -0
- package/dist/server/plugins/chroma-key-video.js +38 -0
- package/dist/server/plugins/contract.d.ts +100 -0
- package/dist/server/plugins/contract.js +16 -0
- package/dist/server/plugins/image.d.ts +8 -0
- package/dist/server/plugins/image.js +30 -0
- package/dist/server/plugins/slice.d.ts +14 -0
- package/dist/server/plugins/slice.js +63 -0
- package/dist/server/plugins/video.d.ts +6 -0
- package/dist/server/plugins/video.js +29 -0
- package/dist/server/plugins.d.ts +23 -0
- package/dist/server/plugins.js +33 -0
- package/dist/server/processing/audio-processing.d.ts +17 -0
- package/dist/server/processing/audio-processing.js +46 -0
- package/dist/server/processing/ffmpeg.d.ts +9 -0
- package/dist/server/processing/ffmpeg.js +50 -0
- package/dist/server/processing/image-processing.d.ts +16 -0
- package/dist/server/processing/image-processing.js +26 -0
- package/dist/server/processing/media-probe.d.ts +15 -0
- package/dist/server/processing/media-probe.js +27 -0
- package/dist/server/processing/processor.d.ts +50 -0
- package/dist/server/processing/processor.js +158 -0
- package/dist/server/processing/video-processing.d.ts +35 -0
- package/dist/server/processing/video-processing.js +87 -0
- package/dist/server/server.d.ts +13 -0
- package/dist/server/server.js +57 -0
- package/dist/server/start.d.ts +1 -0
- package/dist/server/start.js +33 -0
- package/package.json +29 -16
- package/dist/build-CZYFLLvl.js +0 -191
- package/dist/core/image-Dqmz8FXS.js +0 -54
- package/dist/core/reference-graph-CjuHbLDw.d.ts +0 -280
- package/dist/core/testing.d.ts +0 -27
- package/dist/core/testing.js +0 -80
- package/dist/editor/200.html +0 -37
- package/dist/editor/_app/immutable/assets/2.DIbbW7U1.css +0 -1
- package/dist/editor/_app/immutable/assets/3.C-9vFQ9A.css +0 -1
- package/dist/editor/_app/immutable/assets/4.BS8ElpOV.css +0 -1
- package/dist/editor/_app/immutable/assets/ConfirmDialog.CHEISE-L.css +0 -1
- package/dist/editor/_app/immutable/assets/LibraryContextMenu.CDjCmdV-.css +0 -1
- package/dist/editor/_app/immutable/chunks/Cx6qtxJg.js +0 -1
- package/dist/editor/_app/immutable/chunks/n7mvYc42.js +0 -5
- package/dist/editor/_app/immutable/entry/start.C8HHOLly.js +0 -1
- package/dist/editor/_app/immutable/nodes/3.WO7tZH_d.js +0 -104
- package/dist/editor/_app/immutable/nodes/4.DQtx17aW.js +0 -2
- package/dist/editor/_app/version.json +0 -1
- package/dist/index.d.ts +0 -370
- package/dist/index.js +0 -4
- package/dist/start-Bhnqt9Dc.js +0 -279
- package/dist/start-D2IXOrni.js +0 -2
- /package/{dist/editor → build/client}/_app/immutable/assets/0.DLhIsYA_.css +0 -0
- /package/{dist/editor → build/client}/_app/immutable/chunks/Bjy-W4x2.js +0 -0
- /package/{dist/editor → build/client}/_app/immutable/chunks/CNRz3sSw.js +0 -0
- /package/{dist/editor → build/client}/_app/immutable/chunks/CO4RBJfa.js +0 -0
- /package/{dist/editor → build/client}/_app/immutable/chunks/DjdrdRzT.js +0 -0
- /package/{dist/editor → build/client}/_app/immutable/chunks/xihTtKlq.js +0 -0
package/build/env.js
ADDED
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import path from 'node:path';
|
|
2
|
+
import process from 'node:process';
|
|
3
|
+
import { fileURLToPath } from 'node:url';
|
|
4
|
+
|
|
5
|
+
// since env.js is an entrypoint, `dir` will point to the output directory
|
|
6
|
+
const dir = path.dirname(fileURLToPath(import.meta.url));
|
|
7
|
+
|
|
8
|
+
const expected = new Set([
|
|
9
|
+
'SOCKET_PATH',
|
|
10
|
+
'HOST',
|
|
11
|
+
'PORT',
|
|
12
|
+
'ORIGIN',
|
|
13
|
+
'XFF_DEPTH',
|
|
14
|
+
'ADDRESS_HEADER',
|
|
15
|
+
'PROTOCOL_HEADER',
|
|
16
|
+
'HOST_HEADER',
|
|
17
|
+
'PORT_HEADER',
|
|
18
|
+
'BODY_SIZE_LIMIT',
|
|
19
|
+
'SHUTDOWN_TIMEOUT',
|
|
20
|
+
'IDLE_TIMEOUT',
|
|
21
|
+
'KEEP_ALIVE_TIMEOUT',
|
|
22
|
+
'HEADERS_TIMEOUT'
|
|
23
|
+
]);
|
|
24
|
+
|
|
25
|
+
const expected_unprefixed = new Set(['LISTEN_PID', 'LISTEN_FDS']);
|
|
26
|
+
|
|
27
|
+
const env_prefix = "FUNDUS_ADAPTER_";
|
|
28
|
+
|
|
29
|
+
{
|
|
30
|
+
for (const name in process.env) {
|
|
31
|
+
if (name.startsWith(env_prefix)) {
|
|
32
|
+
const unprefixed = name.slice(env_prefix.length);
|
|
33
|
+
if (!expected.has(unprefixed)) {
|
|
34
|
+
throw new Error(
|
|
35
|
+
`You should change envPrefix (${env_prefix}) to avoid conflicts with existing environment variables — unexpectedly saw ${name}`
|
|
36
|
+
);
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
}
|
|
41
|
+
|
|
42
|
+
/**
|
|
43
|
+
* @param {string} name
|
|
44
|
+
* @param {any} [fallback]
|
|
45
|
+
*/
|
|
46
|
+
function env(name, fallback) {
|
|
47
|
+
const prefix = expected_unprefixed.has(name) ? '' : env_prefix;
|
|
48
|
+
const prefixed = prefix + name;
|
|
49
|
+
return prefixed in process.env ? process.env[prefixed] : fallback;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const integer_regexp = /^\d+$/;
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Throw a consistently-structured parsing error for environment variables.
|
|
56
|
+
* @param {string} name
|
|
57
|
+
* @param {any} value
|
|
58
|
+
* @param {string} description
|
|
59
|
+
* @returns {never}
|
|
60
|
+
*/
|
|
61
|
+
function parsing_error(name, value, description) {
|
|
62
|
+
throw new Error(
|
|
63
|
+
`Invalid value for environment variable ${name}: ${JSON.stringify(value)} (${description})`
|
|
64
|
+
);
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* Check the environment for a timeout value (non-negative integer) in seconds.
|
|
69
|
+
* @param {string} name
|
|
70
|
+
* @param {number} [fallback]
|
|
71
|
+
* @returns {number | undefined}
|
|
72
|
+
*/
|
|
73
|
+
function timeout_env(name, fallback) {
|
|
74
|
+
const raw = env(name, fallback);
|
|
75
|
+
if (!raw) {
|
|
76
|
+
return fallback;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
if (!integer_regexp.test(raw)) {
|
|
80
|
+
parsing_error(name, raw, 'should be a non-negative integer');
|
|
81
|
+
}
|
|
82
|
+
|
|
83
|
+
const parsed = Number.parseInt(raw, 10);
|
|
84
|
+
|
|
85
|
+
// We don't technically need to check `Number.isNaN` because the value already passed the regexp test.
|
|
86
|
+
// However, just in case there's some new codepath introduced somewhere down the line, it's probably good
|
|
87
|
+
// to stick this in here.
|
|
88
|
+
if (Number.isNaN(parsed)) {
|
|
89
|
+
parsing_error(name, raw, 'should be a non-negative integer');
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
if (parsed < 0) {
|
|
93
|
+
parsing_error(name, raw, 'should be a non-negative integer');
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
return parsed;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
export { dir, env, env_prefix, timeout_env };
|
|
100
|
+
//# sourceMappingURL=env.js.map
|
package/build/env.js.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"env.js","sources":["../.svelte-kit/adapter-node/entries/env.js"],"sourcesContent":["import path from 'node:path';\nimport process from 'node:process';\nimport { fileURLToPath } from 'node:url';\n\n// since env.js is an entrypoint, `dir` will point to the output directory\nconst dir = path.dirname(fileURLToPath(import.meta.url));\n\nconst expected = new Set([\n\t'SOCKET_PATH',\n\t'HOST',\n\t'PORT',\n\t'ORIGIN',\n\t'XFF_DEPTH',\n\t'ADDRESS_HEADER',\n\t'PROTOCOL_HEADER',\n\t'HOST_HEADER',\n\t'PORT_HEADER',\n\t'BODY_SIZE_LIMIT',\n\t'SHUTDOWN_TIMEOUT',\n\t'IDLE_TIMEOUT',\n\t'KEEP_ALIVE_TIMEOUT',\n\t'HEADERS_TIMEOUT'\n]);\n\nconst expected_unprefixed = new Set(['LISTEN_PID', 'LISTEN_FDS']);\n\nconst env_prefix = ENV_PREFIX;\n\nif (env_prefix) {\n\tfor (const name in process.env) {\n\t\tif (name.startsWith(env_prefix)) {\n\t\t\tconst unprefixed = name.slice(env_prefix.length);\n\t\t\tif (!expected.has(unprefixed)) {\n\t\t\t\tthrow new Error(\n\t\t\t\t\t`You should change envPrefix (${env_prefix}) to avoid conflicts with existing environment variables — unexpectedly saw ${name}`\n\t\t\t\t);\n\t\t\t}\n\t\t}\n\t}\n}\n\n/**\n * @param {string} name\n * @param {any} [fallback]\n */\nfunction env(name, fallback) {\n\tconst prefix = expected_unprefixed.has(name) ? '' : env_prefix;\n\tconst prefixed = prefix + name;\n\treturn prefixed in process.env ? process.env[prefixed] : fallback;\n}\n\nconst integer_regexp = /^\\d+$/;\n\n/**\n * Throw a consistently-structured parsing error for environment variables.\n * @param {string} name\n * @param {any} value\n * @param {string} description\n * @returns {never}\n */\nfunction parsing_error(name, value, description) {\n\tthrow new Error(\n\t\t`Invalid value for environment variable ${name}: ${JSON.stringify(value)} (${description})`\n\t);\n}\n\n/**\n * Check the environment for a timeout value (non-negative integer) in seconds.\n * @param {string} name\n * @param {number} [fallback]\n * @returns {number | undefined}\n */\nfunction timeout_env(name, fallback) {\n\tconst raw = env(name, fallback);\n\tif (!raw) {\n\t\treturn fallback;\n\t}\n\n\tif (!integer_regexp.test(raw)) {\n\t\tparsing_error(name, raw, 'should be a non-negative integer');\n\t}\n\n\tconst parsed = Number.parseInt(raw, 10);\n\n\t// We don't technically need to check `Number.isNaN` because the value already passed the regexp test.\n\t// However, just in case there's some new codepath introduced somewhere down the line, it's probably good\n\t// to stick this in here.\n\tif (Number.isNaN(parsed)) {\n\t\tparsing_error(name, raw, 'should be a non-negative integer');\n\t}\n\n\tif (parsed < 0) {\n\t\tparsing_error(name, raw, 'should be a non-negative integer');\n\t}\n\n\treturn parsed;\n}\n\nexport { dir, env, env_prefix, timeout_env };\n"],"names":[],"mappings":";;;;AAIA;AACK,MAAC,GAAG,GAAG,IAAI,CAAC,OAAO,CAAC,aAAa,CAAC,MAAM,CAAC,IAAI,CAAC,GAAG,CAAC;;AAEvD,MAAM,QAAQ,GAAG,IAAI,GAAG,CAAC;AACzB,CAAC,aAAa;AACd,CAAC,MAAM;AACP,CAAC,MAAM;AACP,CA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EAAE,CAAC,uCAAuC,EAAE,IAAI,CAAC,EAAE,EAAE,IAAI,CAAC,SAAS,CAAC,KAAK,CAAC,CAAC,EAAE,EAAE,WAAW,CAAC,CAAC;AAC5F,EAAE;AACF;;AAEA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS,WAAW,CAAC,IAAI,EAAE,QAAQ,EAAE;AACrC,CAAC,MAAM,GAAG,GAAG,GAAG,CAAC,IAAI,EAAE,QAAQ,CAAC;AAChC,CAAC,IAAI,CAAC,GAAG,EAAE;AACX,EAAE,OAAO,QAAQ;AACjB,CAAC;;AAED,CAAC,IAAI,CAAC,cAAc,CAAC,IAAI,CAAC,GAAG,CAAC,EAAE;AAChC,EAAE,aAAa,CAAC,IAAI,EAAE,GAAG,EAAE,kCAAkC,CAAC;AAC9D,CAAC;;AAED,CAAC,MAAM,MAAM,GAAG,MAAM,CAAC,QAAQ,CAAC,GAAG,EAAE,EAAE,CAAC;;AAExC;AACA;AACA;AACA,CAAC,IAAI,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,EAAE;AAC3B,EAAE,aAAa,CAAC,IAAI,EAAE,GAAG,EAAE,kCAAkC,CAAC;AAC9D,CAAC;;AAED,CAAC,IAAI,MAAM,GAAG,CAAC,EAAE;AACjB,EAAE,aAAa,CAAC,IAAI,EAAE,GAAG,EAAE,kCAAkC,CAAC;AAC9D,CAAC;;AAED,CAAC,OAAO,MAAM;AACd;;;;"}
|
package/build/handler.js
ADDED
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import './shims.js';
|
|
2
|
+
import 'node:fs';
|
|
3
|
+
import 'node:path';
|
|
4
|
+
import 'node:process';
|
|
5
|
+
export { h as handler } from './server/chunks/handler-10cx4zHn.js';
|
|
6
|
+
import './server/chunks/index.js-DvPfiC00.js';
|
|
7
|
+
import './server/chunks/manifest.js-DoPjUnzD.js';
|
|
8
|
+
import './env.js';
|
|
9
|
+
import 'node:buffer';
|
|
10
|
+
import 'node:crypto';
|
|
11
|
+
import 'node:http';
|
|
12
|
+
import 'node:timers';
|
|
13
|
+
import 'node:querystring';
|
|
14
|
+
import 'node:stream';
|
|
15
|
+
import './server/chunks/chunks/shared.js-BWXgl1Xf.js';
|
|
16
|
+
import './server/chunks/chunks/internal.js-BDBSzJId.js';
|
|
17
|
+
import './server/chunks/chunks/utils.js-9oI5Oz0w.js';
|
|
18
|
+
import 'node:url';
|
|
19
|
+
import './server/chunks/chunks/internal2.js-BlXt2rfE.js';
|
|
20
|
+
import './server/chunks/chunks/exports.js-CLTzaOxn.js';
|
|
21
|
+
import './server/chunks/chunks/routing.js-y-tryuip.js';
|
|
22
|
+
//# sourceMappingURL=handler.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"handler.js","sources":[],"sourcesContent":[],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;"}
|
package/build/index.js
ADDED
|
@@ -0,0 +1,145 @@
|
|
|
1
|
+
import http from 'node:http';
|
|
2
|
+
import fs__default from 'node:fs';
|
|
3
|
+
import process from 'node:process';
|
|
4
|
+
import { p as polka, h as handler, f as format_listening_address } from './server/chunks/handler-10cx4zHn.js';
|
|
5
|
+
import { env, timeout_env } from './env.js';
|
|
6
|
+
import { rm } from 'node:fs/promises';
|
|
7
|
+
import './shims.js';
|
|
8
|
+
import 'node:buffer';
|
|
9
|
+
import 'node:crypto';
|
|
10
|
+
import 'node:path';
|
|
11
|
+
import 'node:timers';
|
|
12
|
+
import 'node:querystring';
|
|
13
|
+
import 'node:stream';
|
|
14
|
+
import './server/chunks/chunks/shared.js-BWXgl1Xf.js';
|
|
15
|
+
import './server/chunks/chunks/internal.js-BDBSzJId.js';
|
|
16
|
+
import './server/chunks/chunks/utils.js-9oI5Oz0w.js';
|
|
17
|
+
import './server/chunks/index.js-DvPfiC00.js';
|
|
18
|
+
import './server/chunks/chunks/internal2.js-BlXt2rfE.js';
|
|
19
|
+
import './server/chunks/chunks/exports.js-CLTzaOxn.js';
|
|
20
|
+
import './server/chunks/chunks/routing.js-y-tryuip.js';
|
|
21
|
+
import './server/chunks/manifest.js-DoPjUnzD.js';
|
|
22
|
+
import 'node:url';
|
|
23
|
+
|
|
24
|
+
const path = env('SOCKET_PATH', false);
|
|
25
|
+
const host = env('HOST', '0.0.0.0');
|
|
26
|
+
const port = env('PORT', !path && '3000');
|
|
27
|
+
|
|
28
|
+
const shutdown_timeout = parseInt(env('SHUTDOWN_TIMEOUT', '30'));
|
|
29
|
+
const idle_timeout = parseInt(env('IDLE_TIMEOUT', '0'));
|
|
30
|
+
const listen_pid = parseInt(env('LISTEN_PID', '0'));
|
|
31
|
+
const listen_fds = parseInt(env('LISTEN_FDS', '0'));
|
|
32
|
+
// https://www.freedesktop.org/software/systemd/man/latest/sd_listen_fds.html
|
|
33
|
+
const SD_LISTEN_FDS_START = 3;
|
|
34
|
+
|
|
35
|
+
if (listen_pid !== 0 && listen_pid !== process.pid) {
|
|
36
|
+
throw new Error(`received LISTEN_PID ${listen_pid} but current process id is ${process.pid}`);
|
|
37
|
+
}
|
|
38
|
+
if (listen_fds > 1) {
|
|
39
|
+
throw new Error(
|
|
40
|
+
`only one socket is allowed for socket activation, but LISTEN_FDS was set to ${listen_fds}`
|
|
41
|
+
);
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
const socket_activation = listen_pid === process.pid && listen_fds === 1;
|
|
45
|
+
|
|
46
|
+
let requests = 0;
|
|
47
|
+
/** @type {NodeJS.Timeout | void} */
|
|
48
|
+
let shutdown_timeout_id;
|
|
49
|
+
/** @type {NodeJS.Timeout | void} */
|
|
50
|
+
let idle_timeout_id;
|
|
51
|
+
|
|
52
|
+
// Initialize the HTTP server here so that we can set properties before starting to listen.
|
|
53
|
+
// Otherwise, polka delays creating the server until listen() is called. Settings these
|
|
54
|
+
// properties after the server has started listening could lead to race conditions.
|
|
55
|
+
const httpServer = http.createServer();
|
|
56
|
+
|
|
57
|
+
const keep_alive_timeout = timeout_env('KEEP_ALIVE_TIMEOUT');
|
|
58
|
+
if (keep_alive_timeout !== undefined) {
|
|
59
|
+
// Convert the keep-alive timeout from seconds to milliseconds (the unit Node.js expects).
|
|
60
|
+
httpServer.keepAliveTimeout = keep_alive_timeout * 1000;
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
const headers_timeout = timeout_env('HEADERS_TIMEOUT');
|
|
64
|
+
if (headers_timeout !== undefined) {
|
|
65
|
+
// Convert the headers timeout from seconds to milliseconds (the unit Node.js expects).
|
|
66
|
+
httpServer.headersTimeout = headers_timeout * 1000;
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
const server = polka({ server: httpServer }).use(handler);
|
|
70
|
+
|
|
71
|
+
if (socket_activation) {
|
|
72
|
+
server.listen({ fd: SD_LISTEN_FDS_START }, () => {
|
|
73
|
+
console.log(`Listening on file descriptor ${SD_LISTEN_FDS_START}`);
|
|
74
|
+
});
|
|
75
|
+
} else {
|
|
76
|
+
if (path) {
|
|
77
|
+
try {
|
|
78
|
+
if (fs__default.statSync(path).size === 0) {
|
|
79
|
+
await rm(path);
|
|
80
|
+
}
|
|
81
|
+
} catch {
|
|
82
|
+
// ignore
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
|
|
86
|
+
server.listen({ path, host, port }, () => {
|
|
87
|
+
console.log(`Listening on ${format_listening_address(path, host, port, httpServer.address())}`);
|
|
88
|
+
});
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
/** @param {'SIGINT' | 'SIGTERM' | 'IDLE'} reason */
|
|
92
|
+
function graceful_shutdown(reason) {
|
|
93
|
+
if (shutdown_timeout_id) return;
|
|
94
|
+
|
|
95
|
+
// If a connection was opened with a keep-alive header close() will wait for the connection to
|
|
96
|
+
// time out rather than close it even if it is not handling any requests, so call this first
|
|
97
|
+
httpServer.closeIdleConnections();
|
|
98
|
+
|
|
99
|
+
httpServer.close((error) => {
|
|
100
|
+
// occurs if the server is already closed
|
|
101
|
+
if (error) return;
|
|
102
|
+
|
|
103
|
+
if (shutdown_timeout_id) {
|
|
104
|
+
clearTimeout(shutdown_timeout_id);
|
|
105
|
+
}
|
|
106
|
+
if (idle_timeout_id) {
|
|
107
|
+
clearTimeout(idle_timeout_id);
|
|
108
|
+
}
|
|
109
|
+
|
|
110
|
+
// @ts-expect-error custom events cannot be typed
|
|
111
|
+
process.emit('sveltekit:shutdown', reason);
|
|
112
|
+
});
|
|
113
|
+
|
|
114
|
+
shutdown_timeout_id = setTimeout(() => httpServer.closeAllConnections(), shutdown_timeout * 1000);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
httpServer.on(
|
|
118
|
+
'request',
|
|
119
|
+
/** @param {import('node:http').IncomingMessage} req */
|
|
120
|
+
(req) => {
|
|
121
|
+
requests++;
|
|
122
|
+
|
|
123
|
+
if (socket_activation && idle_timeout_id) {
|
|
124
|
+
idle_timeout_id = clearTimeout(idle_timeout_id);
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
req.on('close', () => {
|
|
128
|
+
requests--;
|
|
129
|
+
|
|
130
|
+
if (shutdown_timeout_id) {
|
|
131
|
+
// close connections as soon as they become idle, so they don't accept new requests
|
|
132
|
+
httpServer.closeIdleConnections();
|
|
133
|
+
}
|
|
134
|
+
if (requests === 0 && socket_activation && idle_timeout) {
|
|
135
|
+
idle_timeout_id = setTimeout(() => graceful_shutdown('IDLE'), idle_timeout * 1000);
|
|
136
|
+
}
|
|
137
|
+
});
|
|
138
|
+
}
|
|
139
|
+
);
|
|
140
|
+
|
|
141
|
+
process.on('SIGTERM', graceful_shutdown);
|
|
142
|
+
process.on('SIGINT', graceful_shutdown);
|
|
143
|
+
|
|
144
|
+
export { host, path, port, server };
|
|
145
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sources":["../.svelte-kit/adapter-node/entries/index.js"],"sourcesContent":["import http from 'node:http';\nimport fs__default from 'node:fs';\nimport process from 'node:process';\nimport { handler } from './handler.js';\nimport { env, timeout_env } from './env.js';\nimport { p as polka } from './chunks/vendor.js';\nimport { rm } from 'node:fs/promises';\nimport { format_listening_address } from './utils.js';\n\nconst path = env('SOCKET_PATH', false);\nconst host = env('HOST', '0.0.0.0');\nconst port = env('PORT', !path && '3000');\n\nconst shutdown_timeout = parseInt(env('SHUTDOWN_TIMEOUT', '30'));\nconst idle_timeout = parseInt(env('IDLE_TIMEOUT', '0'));\nconst listen_pid = parseInt(env('LISTEN_PID', '0'));\nconst listen_fds = parseInt(env('LISTEN_FDS', '0'));\n// https://www.freedesktop.org/software/systemd/man/latest/sd_listen_fds.html\nconst SD_LISTEN_FDS_START = 3;\n\nif (listen_pid !== 0 && listen_pid !== process.pid) {\n\tthrow new Error(`received LISTEN_PID ${listen_pid} but current process id is ${process.pid}`);\n}\nif (listen_fds > 1) {\n\tthrow new Error(\n\t\t`only one socket is allowed for socket activation, but LISTEN_FDS was set to ${listen_fds}`\n\t);\n}\n\nconst socket_activation = listen_pid === process.pid && listen_fds === 1;\n\nlet requests = 0;\n/** @type {NodeJS.Timeout | void} */\nlet shutdown_timeout_id;\n/** @type {NodeJS.Timeout | void} */\nlet idle_timeout_id;\n\n// Initialize the HTTP server here so that we can set properties before starting to listen.\n// Otherwise, polka delays creating the server until listen() is called. Settings these\n// properties after the server has started listening could lead to race conditions.\nconst httpServer = http.createServer();\n\nconst keep_alive_timeout = timeout_env('KEEP_ALIVE_TIMEOUT');\nif (keep_alive_timeout !== undefined) {\n\t// Convert the keep-alive timeout from seconds to milliseconds (the unit Node.js expects).\n\thttpServer.keepAliveTimeout = keep_alive_timeout * 1000;\n}\n\nconst headers_timeout = timeout_env('HEADERS_TIMEOUT');\nif (headers_timeout !== undefined) {\n\t// Convert the headers timeout from seconds to milliseconds (the unit Node.js expects).\n\thttpServer.headersTimeout = headers_timeout * 1000;\n}\n\nconst server = polka({ server: httpServer }).use(handler);\n\nif (socket_activation) {\n\tserver.listen({ fd: SD_LISTEN_FDS_START }, () => {\n\t\tconsole.log(`Listening on file descriptor ${SD_LISTEN_FDS_START}`);\n\t});\n} else {\n\tif (path) {\n\t\ttry {\n\t\t\tif (fs__default.statSync(path).size === 0) {\n\t\t\t\tawait rm(path);\n\t\t\t}\n\t\t} catch {\n\t\t\t// ignore\n\t\t}\n\t}\n\n\tserver.listen({ path, host, port }, () => {\n\t\tconsole.log(`Listening on ${format_listening_address(path, host, port, httpServer.address())}`);\n\t});\n}\n\n/** @param {'SIGINT' | 'SIGTERM' | 'IDLE'} reason */\nfunction graceful_shutdown(reason) {\n\tif (shutdown_timeout_id) return;\n\n\t// If a connection was opened with a keep-alive header close() will wait for the connection to\n\t// time out rather than close it even if it is not handling any requests, so call this first\n\thttpServer.closeIdleConnections();\n\n\thttpServer.close((error) => {\n\t\t// occurs if the server is already closed\n\t\tif (error) return;\n\n\t\tif (shutdown_timeout_id) {\n\t\t\tclearTimeout(shutdown_timeout_id);\n\t\t}\n\t\tif (idle_timeout_id) {\n\t\t\tclearTimeout(idle_timeout_id);\n\t\t}\n\n\t\t// @ts-expect-error custom events cannot be typed\n\t\tprocess.emit('sveltekit:shutdown', reason);\n\t});\n\n\tshutdown_timeout_id = setTimeout(() => httpServer.closeAllConnections(), shutdown_timeout * 1000);\n}\n\nhttpServer.on(\n\t'request',\n\t/** @param {import('node:http').IncomingMessage} req */\n\t(req) => {\n\t\trequests++;\n\n\t\tif (socket_activation && idle_timeout_id) {\n\t\t\tidle_timeout_id = clearTimeout(idle_timeout_id);\n\t\t}\n\n\t\treq.on('close', () => {\n\t\t\trequests--;\n\n\t\t\tif (shutdown_timeout_id) {\n\t\t\t\t// close connections as soon as they become idle, so they don't accept new requests\n\t\t\t\thttpServer.closeIdleConnections();\n\t\t\t}\n\t\t\tif (requests === 0 && socket_activation && idle_timeout) {\n\t\t\t\tidle_timeout_id = setTimeout(() => graceful_shutdown('IDLE'), idle_timeout * 1000);\n\t\t\t}\n\t\t});\n\t}\n);\n\nprocess.on('SIGTERM', graceful_shutdown);\nprocess.on('SIGINT', graceful_shutdown);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