@slopware/sloppy-linux-x64 0.1.0-alpha.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/LICENSE +201 -0
- package/README.md +5 -0
- package/bin/sloppy +0 -0
- package/bin/sloppyc +0 -0
- package/docs/KNOWN_LIMITATIONS.md +16 -0
- package/docs/LICENSES.md +6 -0
- package/docs/NOTICE.md +8 -0
- package/examples/README.md +140 -0
- package/examples/auth-api/README.md +20 -0
- package/examples/auth-api/app.js +61 -0
- package/examples/auth-api/appsettings.json +7 -0
- package/examples/auth-api/sloppy.json +5 -0
- package/examples/cache-basic/README.md +9 -0
- package/examples/cache-basic/app.js +32 -0
- package/examples/cache-hybrid-postgres/README.md +10 -0
- package/examples/cache-hybrid-postgres/app.js +27 -0
- package/examples/cache-output-api/README.md +10 -0
- package/examples/cache-output-api/app.js +35 -0
- package/examples/codec-base64-hex/README.md +14 -0
- package/examples/codec-base64-hex/app.js +15 -0
- package/examples/codec-checksums/README.md +15 -0
- package/examples/codec-checksums/app.js +8 -0
- package/examples/codec-compression/README.md +13 -0
- package/examples/codec-compression/app.js +9 -0
- package/examples/codec-streaming-compression/README.md +19 -0
- package/examples/codec-streaming-compression/app.js +16 -0
- package/examples/codec-text-binary/README.md +16 -0
- package/examples/codec-text-binary/app.js +17 -0
- package/examples/compiler-hello/README.md +71 -0
- package/examples/compiler-hello/app.js +7 -0
- package/examples/compiler-hello/expected/app.js +8 -0
- package/examples/compiler-hello/expected/app.js.map +53 -0
- package/examples/compiler-hello/expected/app.plan.json +229 -0
- package/examples/compiler-hello/expected/routes.slrt +0 -0
- package/examples/config-basic/README.md +13 -0
- package/examples/config-basic/app.js +13 -0
- package/examples/config-basic/appsettings.json +7 -0
- package/examples/config-secrets-redaction/README.md +9 -0
- package/examples/config-secrets-redaction/app.js +9 -0
- package/examples/config-secrets-redaction/appsettings.json +5 -0
- package/examples/config-strict-mode/README.md +7 -0
- package/examples/config-strict-mode/app.js +10 -0
- package/examples/config-strict-mode/appsettings.json +7 -0
- package/examples/configured-api/README.md +38 -0
- package/examples/configured-api/app.js +12 -0
- package/examples/configured-api/appsettings.Development.json +5 -0
- package/examples/configured-api/appsettings.json +6 -0
- package/examples/configured-api/sloppy.json +5 -0
- package/examples/core-config-secrets/README.md +10 -0
- package/examples/core-config-secrets/app.js +15 -0
- package/examples/core-fs-time-codec/README.md +9 -0
- package/examples/core-fs-time-codec/app.js +8 -0
- package/examples/core-network-time-codec/README.md +11 -0
- package/examples/core-network-time-codec/app.js +20 -0
- package/examples/core-policy-audit/README.md +7 -0
- package/examples/core-policy-audit/app.js +22 -0
- package/examples/core-process-time-codec/README.md +8 -0
- package/examples/core-process-time-codec/app.js +28 -0
- package/examples/core-worker-time/README.md +8 -0
- package/examples/core-worker-time/app.js +17 -0
- package/examples/crypto-hash-hmac/README.md +17 -0
- package/examples/crypto-hash-hmac/app.js +29 -0
- package/examples/crypto-password/README.md +21 -0
- package/examples/crypto-password/app.js +12 -0
- package/examples/crypto-random-token/README.md +16 -0
- package/examples/crypto-random-token/app.js +12 -0
- package/examples/crypto-secret-constant-time/README.md +21 -0
- package/examples/crypto-secret-constant-time/app.js +15 -0
- package/examples/data-foundation/README.md +39 -0
- package/examples/data-foundation/app.js +63 -0
- package/examples/dependency-graph/README.md +19 -0
- package/examples/dependency-graph/fixtures/graph-helper/index.js +3 -0
- package/examples/dependency-graph/fixtures/graph-helper/package.json +6 -0
- package/examples/dependency-graph/package.json +7 -0
- package/examples/dependency-graph/public/message.txt +1 -0
- package/examples/dependency-graph/sloppy.json +9 -0
- package/examples/dependency-graph/src/main.ts +8 -0
- package/examples/dogfood/README.md +23 -0
- package/examples/dogfood/dogfood.json +136 -0
- package/examples/dynamic-module-include/README.md +20 -0
- package/examples/dynamic-module-include/public/readme.txt +1 -0
- package/examples/dynamic-module-include/sloppy.json +12 -0
- package/examples/dynamic-module-include/src/main.ts +6 -0
- package/examples/dynamic-module-include/src/plugins/alpha.js +3 -0
- package/examples/dynamic-module-include/src/plugins/beta.js +3 -0
- package/examples/ergonomics/README.md +42 -0
- package/examples/ergonomics/app.js +38 -0
- package/examples/framework-controller/README.md +12 -0
- package/examples/framework-controller/app.js +31 -0
- package/examples/framework-di-services/README.md +17 -0
- package/examples/framework-di-services/app.ts +40 -0
- package/examples/framework-explicit-binding/README.md +12 -0
- package/examples/framework-explicit-binding/app.ts +34 -0
- package/examples/framework-hello/README.md +16 -0
- package/examples/framework-hello/app.ts +16 -0
- package/examples/framework-postgres-crud/README.md +73 -0
- package/examples/framework-postgres-crud/app.ts +64 -0
- package/examples/framework-sqlite-crud/README.md +52 -0
- package/examples/framework-sqlite-crud/app.ts +90 -0
- package/examples/framework-sqlite-crud/appsettings.json +11 -0
- package/examples/framework-sqlserver-crud/README.md +73 -0
- package/examples/framework-sqlserver-crud/app.ts +64 -0
- package/examples/framework-validation-errors/README.md +12 -0
- package/examples/framework-validation-errors/app.ts +16 -0
- package/examples/fs-basic/README.md +24 -0
- package/examples/fs-basic/app.js +12 -0
- package/examples/fs-roots-policy/README.md +14 -0
- package/examples/fs-roots-policy/app.js +4 -0
- package/examples/fs-streams/README.md +18 -0
- package/examples/fs-streams/app.js +11 -0
- package/examples/fs-watch/README.md +19 -0
- package/examples/fs-watch/app.js +11 -0
- package/examples/hello/README.md +63 -0
- package/examples/hello/app.js +19 -0
- package/examples/hello-minimal/README.md +51 -0
- package/examples/hello-minimal/sloppy.json +5 -0
- package/examples/hello-minimal/src/main.ts +9 -0
- package/examples/http-client-basic/README.md +11 -0
- package/examples/http-client-basic/app.js +46 -0
- package/examples/http-client-generated/README.md +22 -0
- package/examples/http-client-generated/openapi.json +45 -0
- package/examples/http-client-resilience/README.md +4 -0
- package/examples/http-client-resilience/app.js +38 -0
- package/examples/http-client-runtime-loopback/README.md +24 -0
- package/examples/http-client-testhost/README.md +4 -0
- package/examples/http-client-testhost/app.js +27 -0
- package/examples/http-client-testhost-package-mock/README.md +26 -0
- package/examples/http-client-typed/README.md +5 -0
- package/examples/http-client-typed/app.js +33 -0
- package/examples/modules-api/README.md +30 -0
- package/examples/modules-api/app.js +9 -0
- package/examples/modules-api/modules/routes.js +16 -0
- package/examples/modules-api/sloppy.json +5 -0
- package/examples/modules-basic/README.md +32 -0
- package/examples/modules-basic/app.js +41 -0
- package/examples/net-deadline-cancel/README.md +13 -0
- package/examples/net-deadline-cancel/app.js +34 -0
- package/examples/net-local-ipc/README.md +12 -0
- package/examples/net-local-ipc/app.js +46 -0
- package/examples/net-policy-strict/README.md +12 -0
- package/examples/net-policy-strict/app.js +34 -0
- package/examples/net-tcp-client/README.md +10 -0
- package/examples/net-tcp-client/app.js +23 -0
- package/examples/net-tcp-echo/README.md +11 -0
- package/examples/net-tcp-echo/app.js +45 -0
- package/examples/net-tcp-server/README.md +10 -0
- package/examples/net-tcp-server/app.js +28 -0
- package/examples/node-compat-path-events/README.md +15 -0
- package/examples/node-compat-path-events/sloppy.json +6 -0
- package/examples/node-compat-path-events/src/main.ts +15 -0
- package/examples/ops-compiler/README.md +9 -0
- package/examples/ops-compiler/app.js +26 -0
- package/examples/ops-health-metrics-management/README.md +14 -0
- package/examples/ops-health-metrics-management/app.js +24 -0
- package/examples/orm-basic/README.md +17 -0
- package/examples/orm-basic/app.js +82 -0
- package/examples/orm-cursor-export/README.md +16 -0
- package/examples/orm-cursor-export/app.js +28 -0
- package/examples/orm-migrations/README.md +14 -0
- package/examples/orm-migrations/migrations/.gitkeep +1 -0
- package/examples/orm-migrations/sloppy.json +9 -0
- package/examples/orm-migrations/src/app.ts +34 -0
- package/examples/orm-relations-includes/README.md +10 -0
- package/examples/orm-relations-includes/app.js +47 -0
- package/examples/orm-testservices/README.md +37 -0
- package/examples/orm-testservices/test.mjs +32 -0
- package/examples/os-runtime-api/README.md +11 -0
- package/examples/os-runtime-api/app.js +44 -0
- package/examples/package-zod-like/README.md +28 -0
- package/examples/package-zod-like/fixtures/zod-like/index.js +48 -0
- package/examples/package-zod-like/fixtures/zod-like/package.json +12 -0
- package/examples/package-zod-like/package.json +7 -0
- package/examples/package-zod-like/sloppy.json +6 -0
- package/examples/package-zod-like/src/main.ts +16 -0
- package/examples/postgres-basic/README.md +31 -0
- package/examples/postgres-basic/app.js +50 -0
- package/examples/prealpha-control-plane/README.md +50 -0
- package/examples/prealpha-control-plane/appsettings.Development.json +11 -0
- package/examples/prealpha-control-plane/appsettings.json +15 -0
- package/examples/prealpha-control-plane/sloppy.json +5 -0
- package/examples/prealpha-control-plane/src/db/schema.js +7 -0
- package/examples/prealpha-control-plane/src/db/seed.js +6 -0
- package/examples/prealpha-control-plane/src/main.js +21 -0
- package/examples/prealpha-control-plane/src/routes/apps.js +34 -0
- package/examples/prealpha-control-plane/src/routes/builds.js +25 -0
- package/examples/prealpha-control-plane/src/routes/deployments.js +19 -0
- package/examples/prealpha-control-plane/src/routes/diagnostics.js +11 -0
- package/examples/prealpha-control-plane/src/routes/health.js +27 -0
- package/examples/prealpha-control-plane/src/routes/projects.js +38 -0
- package/examples/prealpha-control-plane/src/services/diagnosticsSink.js +11 -0
- package/examples/prealpha-control-plane/src/services/repositories.js +9 -0
- package/examples/prealpha-control-plane/src/validation/schemas.js +6 -0
- package/examples/program-fs-process/README.md +31 -0
- package/examples/program-fs-process/sloppy.json +9 -0
- package/examples/program-fs-process/src/main.ts +27 -0
- package/examples/program-hello/README.md +32 -0
- package/examples/program-hello/main.ts +8 -0
- package/examples/program-hello/message.ts +1 -0
- package/examples/program-hello/sloppy.json +5 -0
- package/examples/rate-limit-auth/README.md +3 -0
- package/examples/rate-limit-auth/app.js +14 -0
- package/examples/rate-limit-basic/README.md +3 -0
- package/examples/rate-limit-basic/app.js +13 -0
- package/examples/rate-limit-redis/README.md +5 -0
- package/examples/rate-limit-redis/app.js +20 -0
- package/examples/rate-limit-testhost/README.md +4 -0
- package/examples/rate-limit-testhost/app.js +13 -0
- package/examples/rate-limit-websocket/README.md +3 -0
- package/examples/rate-limit-websocket/app.js +16 -0
- package/examples/realtime-auth/README.md +8 -0
- package/examples/realtime-auth/app.js +25 -0
- package/examples/realtime-auth/test.mjs +43 -0
- package/examples/realtime-chat/README.md +8 -0
- package/examples/realtime-chat/app.js +32 -0
- package/examples/realtime-chat/test.mjs +52 -0
- package/examples/realtime-dashboard/README.md +20 -0
- package/examples/realtime-dashboard/app.js +37 -0
- package/examples/realtime-presence/README.md +8 -0
- package/examples/realtime-presence/app.js +32 -0
- package/examples/realtime-presence/test.mjs +50 -0
- package/examples/realtime-testhost/README.md +8 -0
- package/examples/realtime-testhost/test.mjs +31 -0
- package/examples/redis-basic/README.md +17 -0
- package/examples/redis-basic/app.js +39 -0
- package/examples/redis-cache/README.md +14 -0
- package/examples/redis-cache/app.js +36 -0
- package/examples/redis-locks/README.md +13 -0
- package/examples/redis-locks/app.js +49 -0
- package/examples/request-context/README.md +32 -0
- package/examples/request-context/app.js +15 -0
- package/examples/sqlite-basic/README.md +52 -0
- package/examples/sqlite-basic/app.js +56 -0
- package/examples/sqlserver-basic/README.md +36 -0
- package/examples/sqlserver-basic/app.js +59 -0
- package/examples/static-files-basic/README.md +11 -0
- package/examples/static-files-basic/app.js +12 -0
- package/examples/static-files-basic/public/app.js +1 -0
- package/examples/static-files-basic/public/site.css +3 -0
- package/examples/static-files-package/README.md +12 -0
- package/examples/static-files-package/app.js +10 -0
- package/examples/static-files-package/public/index.html +2 -0
- package/examples/static-files-precompressed/README.md +12 -0
- package/examples/static-files-precompressed/app.js +11 -0
- package/examples/static-files-precompressed/public/app.js +1 -0
- package/examples/static-files-precompressed/public/app.js.br +0 -0
- package/examples/static-files-precompressed/public/app.js.gz +0 -0
- package/examples/static-files-spa/README.md +12 -0
- package/examples/static-files-spa/app.js +16 -0
- package/examples/static-files-spa/dist/assets/app.js +1 -0
- package/examples/static-files-spa/dist/index.html +4 -0
- package/examples/static-files-testhost/README.md +8 -0
- package/examples/static-files-testhost/app.js +13 -0
- package/examples/static-files-testhost/public/app.js +1 -0
- package/examples/static-files-testhost/public/app.js.gz +0 -0
- package/examples/static-files-testhost/test.mjs +38 -0
- package/examples/testhost-basic/README.md +26 -0
- package/examples/testhost-db/README.md +31 -0
- package/examples/testservices-postgres/README.md +68 -0
- package/examples/testservices-redis/README.md +71 -0
- package/examples/testservices-sqlserver/README.md +75 -0
- package/examples/time-basic/README.md +18 -0
- package/examples/time-basic/app.js +12 -0
- package/examples/time-deadline-cancellation/README.md +11 -0
- package/examples/time-deadline-cancellation/app.js +27 -0
- package/examples/time-fake-clock/README.md +14 -0
- package/examples/time-fake-clock/app.js +25 -0
- package/examples/time-interval-schedule/README.md +13 -0
- package/examples/time-interval-schedule/app.js +60 -0
- package/examples/users-api-sqlite/README.md +74 -0
- package/examples/users-api-sqlite/app.js +11 -0
- package/examples/users-api-sqlite/appsettings.Development.json +11 -0
- package/examples/users-api-sqlite/appsettings.json +11 -0
- package/examples/users-api-sqlite/modules/users.js +40 -0
- package/examples/users-api-sqlite/sloppy.json +5 -0
- package/examples/validation-errors/README.md +36 -0
- package/examples/validation-errors/app.js +14 -0
- package/examples/validation-errors/invalid-user.http +6 -0
- package/examples/validation-errors/sloppy.json +5 -0
- package/examples/web-dynamic-routes/README.md +17 -0
- package/examples/web-dynamic-routes/app.ts +27 -0
- package/examples/webhooks-basic/README.md +11 -0
- package/examples/webhooks-basic/app.js +48 -0
- package/examples/websocket-auth/README.md +8 -0
- package/examples/websocket-auth/app.js +16 -0
- package/examples/websocket-echo/README.md +9 -0
- package/examples/websocket-echo/app.js +36 -0
- package/examples/websocket-json-schema/README.md +5 -0
- package/examples/websocket-json-schema/app.js +25 -0
- package/examples/websocket-testhost/README.md +11 -0
- package/examples/websocket-testhost/test.mjs +49 -0
- package/examples/workers-background-service/README.md +7 -0
- package/examples/workers-background-service/app.js +16 -0
- package/examples/workers-js-isolate/README.md +8 -0
- package/examples/workers-js-isolate/app.js +19 -0
- package/examples/workers-js-isolate/workers/parser.ts +11 -0
- package/examples/workers-shutdown/README.md +6 -0
- package/examples/workers-shutdown/app.js +26 -0
- package/examples/workers-workerpool/README.md +6 -0
- package/examples/workers-workerpool/app.js +23 -0
- package/examples/workers-workqueue/README.md +8 -0
- package/examples/workers-workqueue/app.js +24 -0
- package/manifest.json +59 -0
- package/package.json +34 -0
- package/stdlib/sloppy/README.md +177 -0
- package/stdlib/sloppy/app.js +2142 -0
- package/stdlib/sloppy/auth.js +1813 -0
- package/stdlib/sloppy/bootstrap.manifest.json +83 -0
- package/stdlib/sloppy/cache.js +1542 -0
- package/stdlib/sloppy/codec.js +1153 -0
- package/stdlib/sloppy/config.js +61 -0
- package/stdlib/sloppy/crypto.js +312 -0
- package/stdlib/sloppy/data.js +2945 -0
- package/stdlib/sloppy/ffi.js +185 -0
- package/stdlib/sloppy/fs.js +795 -0
- package/stdlib/sloppy/health.js +603 -0
- package/stdlib/sloppy/http.js +1595 -0
- package/stdlib/sloppy/index.js +59 -0
- package/stdlib/sloppy/internal/bytes.js +31 -0
- package/stdlib/sloppy/internal/capabilities.js +155 -0
- package/stdlib/sloppy/internal/config.js +640 -0
- package/stdlib/sloppy/internal/disposable.js +31 -0
- package/stdlib/sloppy/internal/headers.js +63 -0
- package/stdlib/sloppy/internal/intrinsics.js +2 -0
- package/stdlib/sloppy/internal/json.js +20 -0
- package/stdlib/sloppy/internal/logging.js +278 -0
- package/stdlib/sloppy/internal/modules.js +405 -0
- package/stdlib/sloppy/internal/redaction.js +87 -0
- package/stdlib/sloppy/internal/routes.js +2279 -0
- package/stdlib/sloppy/internal/runtime-classic.js +19837 -0
- package/stdlib/sloppy/internal/services.js +690 -0
- package/stdlib/sloppy/internal/shared.js +32 -0
- package/stdlib/sloppy/internal/testhost-diagnostics.js +88 -0
- package/stdlib/sloppy/internal/testhost-http-server.js +238 -0
- package/stdlib/sloppy/internal/testhost-http.js +118 -0
- package/stdlib/sloppy/internal/testhost-loopback.js +50 -0
- package/stdlib/sloppy/internal/testservices-docker.js +154 -0
- package/stdlib/sloppy/internal/validation.js +117 -0
- package/stdlib/sloppy/metrics.js +427 -0
- package/stdlib/sloppy/net.js +5208 -0
- package/stdlib/sloppy/node/assert/strict.js +39 -0
- package/stdlib/sloppy/node/assert.js +228 -0
- package/stdlib/sloppy/node/buffer.js +247 -0
- package/stdlib/sloppy/node/console.js +33 -0
- package/stdlib/sloppy/node/constants.js +9 -0
- package/stdlib/sloppy/node/crypto.js +89 -0
- package/stdlib/sloppy/node/diagnostics_channel.js +41 -0
- package/stdlib/sloppy/node/events.js +113 -0
- package/stdlib/sloppy/node/fs/promises.js +27 -0
- package/stdlib/sloppy/node/fs.js +280 -0
- package/stdlib/sloppy/node/http.js +11 -0
- package/stdlib/sloppy/node/https.js +11 -0
- package/stdlib/sloppy/node/module.js +40 -0
- package/stdlib/sloppy/node/os.js +22 -0
- package/stdlib/sloppy/node/path.js +78 -0
- package/stdlib/sloppy/node/perf_hooks.js +12 -0
- package/stdlib/sloppy/node/process.js +129 -0
- package/stdlib/sloppy/node/querystring.js +21 -0
- package/stdlib/sloppy/node/stream/promises.js +3 -0
- package/stdlib/sloppy/node/stream.js +132 -0
- package/stdlib/sloppy/node/string_decoder.js +23 -0
- package/stdlib/sloppy/node/timers.js +26 -0
- package/stdlib/sloppy/node/tty.js +18 -0
- package/stdlib/sloppy/node/url.js +17 -0
- package/stdlib/sloppy/node/util.js +95 -0
- package/stdlib/sloppy/node/zlib.js +72 -0
- package/stdlib/sloppy/orm.js +2188 -0
- package/stdlib/sloppy/os.js +580 -0
- package/stdlib/sloppy/problem-details.js +29 -0
- package/stdlib/sloppy/providers/sqlite.js +26 -0
- package/stdlib/sloppy/rate-limit.js +856 -0
- package/stdlib/sloppy/realtime.js +1508 -0
- package/stdlib/sloppy/redis.js +1272 -0
- package/stdlib/sloppy/request-id.js +184 -0
- package/stdlib/sloppy/request-logging.js +101 -0
- package/stdlib/sloppy/results.js +933 -0
- package/stdlib/sloppy/schema.js +546 -0
- package/stdlib/sloppy/testing.js +4081 -0
- package/stdlib/sloppy/testservices.js +1041 -0
- package/stdlib/sloppy/time.js +894 -0
- package/stdlib/sloppy/webhooks.js +1330 -0
- package/stdlib/sloppy/workers.js +986 -0
- package/templates/api/README.md +82 -0
- package/templates/api/appsettings.Development.json +14 -0
- package/templates/api/appsettings.json +13 -0
- package/templates/api/data/.gitkeep +1 -0
- package/templates/api/gitignore +4 -0
- package/templates/api/migrations/0001_create_users.sql +1 -0
- package/templates/api/package.json +16 -0
- package/templates/api/public/hello.txt +1 -0
- package/templates/api/sloppy.json +14 -0
- package/templates/api/src/config.ts +1 -0
- package/templates/api/src/db/migrate.ts +14 -0
- package/templates/api/src/db/schema.ts +4 -0
- package/templates/api/src/db/usersRepository.ts +23 -0
- package/templates/api/src/main.ts +18 -0
- package/templates/api/src/models/user.ts +7 -0
- package/templates/api/src/routes/health.ts +20 -0
- package/templates/api/src/routes/users.ts +40 -0
- package/templates/api/src/services/usersService.ts +21 -0
- package/templates/api/tsconfig.json +15 -0
- package/templates/cli/README.md +16 -0
- package/templates/cli/gitignore +2 -0
- package/templates/cli/package.json +13 -0
- package/templates/cli/sloppy.json +6 -0
- package/templates/cli/src/commands/echo.ts +9 -0
- package/templates/cli/src/commands/inspect.ts +20 -0
- package/templates/cli/src/main.ts +50 -0
- package/templates/cli/tsconfig.json +15 -0
- package/templates/minimal-api/README.md +14 -0
- package/templates/minimal-api/gitignore +3 -0
- package/templates/minimal-api/package.json +14 -0
- package/templates/minimal-api/sloppy.json +5 -0
- package/templates/minimal-api/src/main.ts +9 -0
- package/templates/minimal-api/tsconfig.json +15 -0
- package/templates/node-compat/README.md +40 -0
- package/templates/node-compat/gitignore +2 -0
- package/templates/node-compat/package.json +11 -0
- package/templates/node-compat/sloppy.json +6 -0
- package/templates/node-compat/src/main.ts +40 -0
- package/templates/package-api/README.md +44 -0
- package/templates/package-api/fixtures/validator-lite/index.js +7 -0
- package/templates/package-api/fixtures/validator-lite/package.json +6 -0
- package/templates/package-api/gitignore +3 -0
- package/templates/package-api/package.json +17 -0
- package/templates/package-api/sloppy.json +5 -0
- package/templates/package-api/src/main.ts +10 -0
- package/templates/package-api/src/routes/health.ts +5 -0
- package/templates/package-api/src/routes/users.ts +12 -0
- package/templates/package-api/tsconfig.json +15 -0
- package/templates/program/README.md +12 -0
- package/templates/program/gitignore +1 -0
- package/templates/program/package.json +10 -0
- package/templates/program/sloppy.json +6 -0
- package/templates/program/src/main.ts +9 -0
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
# Sloppy API Starter
|
|
2
|
+
|
|
3
|
+
This is the recommended public alpha, pre-production starter for building a
|
|
4
|
+
backend with Sloppy. It shows routes, route modules, a small
|
|
5
|
+
service/repository split, configuration, SQLite provider metadata, Schema
|
|
6
|
+
request validation, health endpoints, and the app package flow.
|
|
7
|
+
|
|
8
|
+
## Layout
|
|
9
|
+
|
|
10
|
+
- `src/main.ts` wires the app, SQLite provider, middleware, services, and routes.
|
|
11
|
+
- `src/routes/` contains route registration modules.
|
|
12
|
+
- `src/services/` contains business logic.
|
|
13
|
+
- `migrations/` contains first-party SQLite schema migration files.
|
|
14
|
+
- `src/db/` contains runtime migration and repository helpers.
|
|
15
|
+
- `src/models/` contains request and response shapes.
|
|
16
|
+
- `public/` contains static assets served under `/public`.
|
|
17
|
+
- `appsettings*.json` contains runtime configuration.
|
|
18
|
+
- `data/` is where the development SQLite file is created.
|
|
19
|
+
|
|
20
|
+
## Build And Inspect
|
|
21
|
+
|
|
22
|
+
```sh
|
|
23
|
+
sloppy build
|
|
24
|
+
sloppy db migrate .sloppy --provider main
|
|
25
|
+
sloppy routes .sloppy
|
|
26
|
+
sloppy capabilities .sloppy
|
|
27
|
+
sloppy doctor .sloppy
|
|
28
|
+
sloppy audit .sloppy
|
|
29
|
+
```
|
|
30
|
+
|
|
31
|
+
## Run
|
|
32
|
+
|
|
33
|
+
```sh
|
|
34
|
+
sloppy run .sloppy --once GET /health
|
|
35
|
+
sloppy run .sloppy --once GET /users
|
|
36
|
+
sloppy run .sloppy --once GET /public/hello.txt
|
|
37
|
+
sloppy run .sloppy --once POST /users --json "{\"name\":\"Katherine Johnson\",\"email\":\"katherine@example.test\"}"
|
|
38
|
+
printf '{"name":"Katherine Johnson","email":"katherine@example.test"}' > user.json
|
|
39
|
+
sloppy run .sloppy --header "content-type: application/json" --body-file user.json --once POST /users
|
|
40
|
+
```
|
|
41
|
+
|
|
42
|
+
```powershell
|
|
43
|
+
Set-Content -Path user.json -Value '{"name":"Katherine Johnson","email":"katherine@example.test"}' -NoNewline
|
|
44
|
+
sloppy run .sloppy --header "content-type: application/json" --body-file user.json --once POST /users
|
|
45
|
+
```
|
|
46
|
+
You can also run the development server and send requests with your HTTP
|
|
47
|
+
client:
|
|
48
|
+
|
|
49
|
+
```sh
|
|
50
|
+
sloppy run .sloppy
|
|
51
|
+
curl -X POST http://127.0.0.1:5173/users -H "content-type: application/json" -d "{\"name\":\"Katherine Johnson\",\"email\":\"katherine@example.test\"}"
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Invalid JSON or invalid `name`/`email` fields return a `400
|
|
55
|
+
application/problem+json` validation problem.
|
|
56
|
+
|
|
57
|
+
Add `app.useErrors(...)` in `src/main.ts` when you want one explicit error
|
|
58
|
+
policy for typed exception mappings, request IDs in error bodies, and redacted
|
|
59
|
+
error logs.
|
|
60
|
+
|
|
61
|
+
## Package
|
|
62
|
+
|
|
63
|
+
```sh
|
|
64
|
+
sloppy package
|
|
65
|
+
sloppy db migrate .sloppy/package --provider main
|
|
66
|
+
sloppy run .sloppy/package --once GET /health
|
|
67
|
+
sloppy run .sloppy/package --once GET /users
|
|
68
|
+
sloppy run .sloppy/package --once GET /public/hello.txt
|
|
69
|
+
```
|
|
70
|
+
|
|
71
|
+
The alpha package format contains the compiled Sloppy artifacts. The SQLite
|
|
72
|
+
database path is configured as `data/app.db`; create that directory when you run
|
|
73
|
+
the package from a directory that does not already have it. `/health/ready`
|
|
74
|
+
performs a SQLite query after running the template migration.
|
|
75
|
+
|
|
76
|
+
## Alpha Limits
|
|
77
|
+
|
|
78
|
+
Sloppy is public alpha, pre-production software. SQLite is available through
|
|
79
|
+
Sloppy's current provider bridge. The template uses
|
|
80
|
+
`migrations/0001_create_users.sql` for schema setup and deterministic seed rows
|
|
81
|
+
in code. Sloppy is not full Node, and this template does not require internet
|
|
82
|
+
packages, Docker, external services, PostgreSQL, SQL Server, libpq, or ODBC.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
create table if not exists users (id integer primary key, name text not null, email text not null unique)
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sloppy-api-starter",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "sloppy build",
|
|
7
|
+
"run": "sloppy run .sloppy",
|
|
8
|
+
"package": "sloppy package",
|
|
9
|
+
"routes": "sloppy routes .sloppy",
|
|
10
|
+
"doctor": "sloppy doctor .sloppy",
|
|
11
|
+
"audit": "sloppy audit .sloppy"
|
|
12
|
+
},
|
|
13
|
+
"devDependencies": {
|
|
14
|
+
"@slopware/sloppy": "0.1.0-alpha.0"
|
|
15
|
+
}
|
|
16
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
Hello from the Sloppy API template.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export const appName = "Sloppy API Starter";
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { Migrations } from "sloppy/data";
|
|
2
|
+
import { seedUsers } from "./schema.ts";
|
|
3
|
+
|
|
4
|
+
export async function migrateUsers(db) {
|
|
5
|
+
await Migrations.apply(db, { provider: "sqlite", path: "migrations/*.sql" });
|
|
6
|
+
await db.transaction(async (tx) => {
|
|
7
|
+
for (const user of seedUsers) {
|
|
8
|
+
await tx.exec(
|
|
9
|
+
"insert or ignore into users (id, name, email) values (?, ?, ?)",
|
|
10
|
+
user,
|
|
11
|
+
);
|
|
12
|
+
}
|
|
13
|
+
});
|
|
14
|
+
}
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
import { toUser } from "../models/user.ts";
|
|
2
|
+
|
|
3
|
+
export async function repoListUsers(db) {
|
|
4
|
+
const rows = await db.query("select id, name, email from users order by id", []);
|
|
5
|
+
return rows.map(toUser);
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export async function repoGetUserById(db, id) {
|
|
9
|
+
const row = await db.queryOne("select id, name, email from users where id = ?", [id]);
|
|
10
|
+
return row === null ? null : toUser(row);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export async function repoCreateUser(db, input) {
|
|
14
|
+
await db.exec("insert into users (name, email) values (?, ?)", [input.name, input.email]);
|
|
15
|
+
const row = await db.queryOne(
|
|
16
|
+
"select id, name, email from users where id = last_insert_rowid()",
|
|
17
|
+
[],
|
|
18
|
+
);
|
|
19
|
+
if (row === null) {
|
|
20
|
+
throw new Error("inserted user could not be loaded");
|
|
21
|
+
}
|
|
22
|
+
return toUser(row);
|
|
23
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { ProblemDetails, Sloppy } from "sloppy";
|
|
2
|
+
import { sqlite } from "sloppy/providers/sqlite";
|
|
3
|
+
import { healthModule } from "./routes/health.ts";
|
|
4
|
+
import { usersModule } from "./routes/users.ts";
|
|
5
|
+
|
|
6
|
+
const app = Sloppy.create();
|
|
7
|
+
|
|
8
|
+
app.use(sqlite("main"));
|
|
9
|
+
app.use(ProblemDetails.defaults({ detail: "never" }));
|
|
10
|
+
app.useStaticFiles({
|
|
11
|
+
requestPath: "/public",
|
|
12
|
+
root: "public",
|
|
13
|
+
cache: { maxAgeSeconds: 60 },
|
|
14
|
+
});
|
|
15
|
+
app.useModule(usersModule);
|
|
16
|
+
app.useModule(healthModule);
|
|
17
|
+
|
|
18
|
+
export default app;
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Results } from "sloppy";
|
|
2
|
+
import { migrateUsers } from "../db/migrate.ts";
|
|
3
|
+
|
|
4
|
+
export function healthModule(app) {
|
|
5
|
+
const db = app.provider("sqlite:main");
|
|
6
|
+
|
|
7
|
+
app.get("/health", () => Results.text("ok"))
|
|
8
|
+
.withName("Health");
|
|
9
|
+
|
|
10
|
+
app.get("/health/live", () => Results.ok({ status: "healthy" }))
|
|
11
|
+
.withName("Health.Live");
|
|
12
|
+
|
|
13
|
+
app.get("/health/ready", async () => {
|
|
14
|
+
await migrateUsers(db);
|
|
15
|
+
const row = await db.queryOne("select 1 as ok", []);
|
|
16
|
+
return row === null
|
|
17
|
+
? Results.status(503, { status: "unhealthy", checks: [{ name: "sqlite", status: "unhealthy" }] })
|
|
18
|
+
: Results.ok({ status: "healthy", checks: [{ name: "sqlite", status: "healthy" }] });
|
|
19
|
+
}).withName("Health.Ready");
|
|
20
|
+
}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import { Results, Schema } from "sloppy";
|
|
2
|
+
import {
|
|
3
|
+
createUser,
|
|
4
|
+
getUser,
|
|
5
|
+
listUsers,
|
|
6
|
+
} from "../services/usersService.ts";
|
|
7
|
+
|
|
8
|
+
export function usersModule(app) {
|
|
9
|
+
const db = app.provider("sqlite:main");
|
|
10
|
+
const CreateUser = Schema.object({
|
|
11
|
+
name: Schema.string().min(1).max(100),
|
|
12
|
+
email: Schema.string().email(),
|
|
13
|
+
});
|
|
14
|
+
const User = Schema.object({
|
|
15
|
+
id: Schema.integer(),
|
|
16
|
+
name: Schema.string(),
|
|
17
|
+
email: Schema.string(),
|
|
18
|
+
});
|
|
19
|
+
|
|
20
|
+
app.get("/users", async () => Results.ok(await listUsers(db)))
|
|
21
|
+
.withName("Users.List");
|
|
22
|
+
|
|
23
|
+
app.get("/users/{id:int}", async (ctx) => {
|
|
24
|
+
const user = await getUser(db, ctx.route.id);
|
|
25
|
+
if (user === null) {
|
|
26
|
+
return Results.notFound();
|
|
27
|
+
}
|
|
28
|
+
return Results.ok(user);
|
|
29
|
+
})
|
|
30
|
+
.withName("Users.Get");
|
|
31
|
+
|
|
32
|
+
app.post("/users", async (ctx) => {
|
|
33
|
+
const input = await ctx.body.validate(CreateUser);
|
|
34
|
+
const user = await createUser(db, input);
|
|
35
|
+
return Results.created(`/users/${user.id}`, user);
|
|
36
|
+
})
|
|
37
|
+
.accepts(CreateUser)
|
|
38
|
+
.returns(User, { status: 201 })
|
|
39
|
+
.withName("Users.Create");
|
|
40
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import { migrateUsers } from "../db/migrate.ts";
|
|
2
|
+
import {
|
|
3
|
+
repoCreateUser,
|
|
4
|
+
repoGetUserById,
|
|
5
|
+
repoListUsers,
|
|
6
|
+
} from "../db/usersRepository.ts";
|
|
7
|
+
|
|
8
|
+
export async function listUsers(db) {
|
|
9
|
+
await migrateUsers(db);
|
|
10
|
+
return repoListUsers(db);
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export async function getUser(db, id) {
|
|
14
|
+
await migrateUsers(db);
|
|
15
|
+
return repoGetUserById(db, id);
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
export async function createUser(db, input) {
|
|
19
|
+
await migrateUsers(db);
|
|
20
|
+
return repoCreateUser(db, input);
|
|
21
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# CLI Starter
|
|
2
|
+
|
|
3
|
+
This public alpha, pre-production CLI starter is shaped like a practical local
|
|
4
|
+
tool. It has a command dispatcher, subcommands, filesystem inspection, safe
|
|
5
|
+
platform indicators, clear exit codes, and the packaged CLI flow.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
sloppy run src/main.ts -- --help
|
|
9
|
+
sloppy run src/main.ts -- echo hello
|
|
10
|
+
sloppy run src/main.ts -- inspect package.json
|
|
11
|
+
sloppy build
|
|
12
|
+
sloppy package
|
|
13
|
+
sloppy run .sloppy/package -- echo hello
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
Add commands under `src/commands/` and dispatch them from `src/main.ts`.
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sloppy-cli-starter",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "sloppy build",
|
|
7
|
+
"run": "sloppy run .sloppy -- --help",
|
|
8
|
+
"package": "sloppy package"
|
|
9
|
+
},
|
|
10
|
+
"devDependencies": {
|
|
11
|
+
"@slopware/sloppy": "0.1.0-alpha.0"
|
|
12
|
+
}
|
|
13
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { File } from "sloppy/fs";
|
|
2
|
+
|
|
3
|
+
function filesystemPath(value) {
|
|
4
|
+
const path = value || "package.json";
|
|
5
|
+
if (path.startsWith("./") || path.startsWith("../") || path.includes(":/")) {
|
|
6
|
+
return path;
|
|
7
|
+
}
|
|
8
|
+
return `./${path}`;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export async function inspect(args) {
|
|
12
|
+
const path = filesystemPath(args[0]);
|
|
13
|
+
if (!(await File.exists(path))) {
|
|
14
|
+
console.error(`not found: ${path}`);
|
|
15
|
+
return 1;
|
|
16
|
+
}
|
|
17
|
+
const bytes = await File.readBytes(path);
|
|
18
|
+
console.log(JSON.stringify({ path, bytes: bytes.length }, null, 2));
|
|
19
|
+
return 0;
|
|
20
|
+
}
|
|
@@ -0,0 +1,50 @@
|
|
|
1
|
+
import { Environment, System } from "sloppy/os";
|
|
2
|
+
import { echo } from "./commands/echo.ts";
|
|
3
|
+
import { inspect } from "./commands/inspect.ts";
|
|
4
|
+
|
|
5
|
+
function printHelp() {
|
|
6
|
+
console.log("Usage: sloppy run .sloppy -- <command> [args]");
|
|
7
|
+
console.log("");
|
|
8
|
+
console.log("Commands:");
|
|
9
|
+
console.log(" --help Show help");
|
|
10
|
+
console.log(" echo <text> Print text");
|
|
11
|
+
console.log(" inspect <path> Print basic file information");
|
|
12
|
+
console.log(" env Print platform information");
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
function environmentIndicators(env) {
|
|
16
|
+
const source = env || {};
|
|
17
|
+
return {
|
|
18
|
+
HOME: source.HOME ? "set" : "unset",
|
|
19
|
+
USERPROFILE: source.USERPROFILE ? "set" : "unset",
|
|
20
|
+
SHELL: source.SHELL ? "set" : "unset",
|
|
21
|
+
COMSPEC: source.COMSPEC ? "set" : "unset",
|
|
22
|
+
CI: source.CI ? "set" : "unset",
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export async function main(args, ctx) {
|
|
27
|
+
const command = args[0] || "--help";
|
|
28
|
+
if (command === "--help" || command === "help") {
|
|
29
|
+
printHelp();
|
|
30
|
+
return 0;
|
|
31
|
+
}
|
|
32
|
+
if (command === "echo") {
|
|
33
|
+
return echo(args.slice(1));
|
|
34
|
+
}
|
|
35
|
+
if (command === "inspect") {
|
|
36
|
+
return inspect(args.slice(1));
|
|
37
|
+
}
|
|
38
|
+
if (command === "env") {
|
|
39
|
+
console.log(JSON.stringify({
|
|
40
|
+
cwd: ctx.cwd,
|
|
41
|
+
environment: environmentIndicators(ctx.environment),
|
|
42
|
+
platform: System.platform,
|
|
43
|
+
homeSet: Boolean(Environment.get("HOME") || Environment.get("USERPROFILE")),
|
|
44
|
+
}, null, 2));
|
|
45
|
+
return 0;
|
|
46
|
+
}
|
|
47
|
+
console.error(`unknown command: ${command}`);
|
|
48
|
+
printHelp();
|
|
49
|
+
return 1;
|
|
50
|
+
}
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
# Minimal API Template
|
|
2
|
+
|
|
3
|
+
This is the smallest public alpha, pre-production API starter. Use it for a
|
|
4
|
+
quick first run or a smoke test; use `api` when you want a fuller backend
|
|
5
|
+
layout.
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
sloppy build
|
|
9
|
+
sloppy routes .sloppy
|
|
10
|
+
sloppy run .sloppy --once GET /health
|
|
11
|
+
sloppy run .sloppy --once GET /hello/Ada
|
|
12
|
+
sloppy package
|
|
13
|
+
sloppy run .sloppy/package --once GET /health
|
|
14
|
+
```
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "sloppy-minimal-api",
|
|
3
|
+
"private": true,
|
|
4
|
+
"type": "module",
|
|
5
|
+
"scripts": {
|
|
6
|
+
"build": "sloppy build",
|
|
7
|
+
"run": "sloppy run .sloppy",
|
|
8
|
+
"package": "sloppy package",
|
|
9
|
+
"routes": "sloppy routes .sloppy"
|
|
10
|
+
},
|
|
11
|
+
"devDependencies": {
|
|
12
|
+
"@slopware/sloppy": "0.1.0-alpha.0"
|
|
13
|
+
}
|
|
14
|
+
}
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { Results, Sloppy } from "sloppy";
|
|
2
|
+
|
|
3
|
+
const app = Sloppy.create();
|
|
4
|
+
|
|
5
|
+
app.get("/health", () => Results.text("ok")).withName("Health.Get");
|
|
6
|
+
app.get("/hello/{name}", (ctx) => Results.json({ hello: ctx.route.name }))
|
|
7
|
+
.withName("Hello.Get");
|
|
8
|
+
|
|
9
|
+
export default app;
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
# Node Compatibility Starter
|
|
2
|
+
|
|
3
|
+
This public alpha, pre-production Program Mode starter demonstrates explicit
|
|
4
|
+
supported Node compatibility shims. Sloppy is not full Node. Unsupported
|
|
5
|
+
builtins fail clearly, and the shim set grows over time.
|
|
6
|
+
|
|
7
|
+
This template uses:
|
|
8
|
+
|
|
9
|
+
- `node:path`
|
|
10
|
+
- `node:events`
|
|
11
|
+
- `node:buffer`
|
|
12
|
+
- `node:querystring`
|
|
13
|
+
- `node:assert`
|
|
14
|
+
- `node:process`
|
|
15
|
+
- `node:stream` basics
|
|
16
|
+
- `node:crypto` basics
|
|
17
|
+
- `node:module`, `node:string_decoder`, `node:perf_hooks`, and other package
|
|
18
|
+
compatibility helpers are documented in the Node compatibility reference.
|
|
19
|
+
|
|
20
|
+
It intentionally avoids full `node:http`, `node:net`, `node:tls`,
|
|
21
|
+
`node:child_process`, native addons, and process-wide Node identity. Import
|
|
22
|
+
compatibility modules explicitly in source. Bundled package programs may receive
|
|
23
|
+
temporary `global`, `process`, and `Buffer` compatibility globals while the
|
|
24
|
+
program entry runs.
|
|
25
|
+
|
|
26
|
+
Pure-JavaScript npm packages that fit the documented exports/imports
|
|
27
|
+
resolution shapes (see `tests/fixtures/npm-compat/matrix.json`) and exercise
|
|
28
|
+
documented runtime behaviors (see `tests/fixtures/npm-runtime/matrix.json`)
|
|
29
|
+
can be bundled alongside this template. The resolver matrix proves package
|
|
30
|
+
shapes resolve; the runtime matrix proves selected package behaviors execute
|
|
31
|
+
after packaging. Native addons, dynamic `require` without `moduleInclude`,
|
|
32
|
+
and unsupported Node builtins are rejected with explicit diagnostics.
|
|
33
|
+
|
|
34
|
+
```sh
|
|
35
|
+
sloppy build
|
|
36
|
+
sloppy deps .sloppy --explain
|
|
37
|
+
sloppy run .sloppy
|
|
38
|
+
sloppy package
|
|
39
|
+
sloppy run .sloppy/package
|
|
40
|
+
```
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
import path from "node:path";
|
|
2
|
+
import assert from "node:assert";
|
|
3
|
+
import { Buffer } from "node:buffer";
|
|
4
|
+
import crypto from "node:crypto";
|
|
5
|
+
import { EventEmitter } from "node:events";
|
|
6
|
+
import querystring from "node:querystring";
|
|
7
|
+
import { Readable } from "node:stream";
|
|
8
|
+
import process from "node:process";
|
|
9
|
+
|
|
10
|
+
export async function main() {
|
|
11
|
+
const emitter = new EventEmitter();
|
|
12
|
+
let event = "missing";
|
|
13
|
+
emitter.on("ready", (value) => {
|
|
14
|
+
event = value;
|
|
15
|
+
});
|
|
16
|
+
emitter.emit("ready", "ok");
|
|
17
|
+
|
|
18
|
+
const query = querystring.parse("ready=true&mode=alpha");
|
|
19
|
+
const encoded = Buffer.from("sloppy").toString("utf8");
|
|
20
|
+
const euroCodePoint = Buffer.from([0xe2, 0x82, 0xac]).toString("utf8").codePointAt(0);
|
|
21
|
+
const digest = await crypto.createHash("sha256").update(encoded).digest("hex");
|
|
22
|
+
const chunks = [];
|
|
23
|
+
for await (const chunk of Readable.from(["node", "-", "compat"])) {
|
|
24
|
+
chunks.push(chunk);
|
|
25
|
+
}
|
|
26
|
+
assert.strictEqual(event, "ok");
|
|
27
|
+
|
|
28
|
+
console.log(JSON.stringify({
|
|
29
|
+
joined: path.join("src", "main.ts"),
|
|
30
|
+
event,
|
|
31
|
+
encoded,
|
|
32
|
+
euroCodePoint,
|
|
33
|
+
digestPrefix: digest.slice(0, 8),
|
|
34
|
+
ready: query.ready,
|
|
35
|
+
mode: query.mode,
|
|
36
|
+
platform: process.platform,
|
|
37
|
+
stream: chunks.join(""),
|
|
38
|
+
}, null, 2));
|
|
39
|
+
return 0;
|
|
40
|
+
}
|