@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,10 @@
|
|
|
1
|
+
# Core Config Secrets Example
|
|
2
|
+
|
|
3
|
+
This example shows Config secret
|
|
4
|
+
values moving into response metadata only through the shared redacted string shape.
|
|
5
|
+
|
|
6
|
+
## Limitations
|
|
7
|
+
|
|
8
|
+
This example is limited to config and secret-redaction API shape. Placeholder
|
|
9
|
+
configuration values must remain placeholder-only; real tokens do not belong in
|
|
10
|
+
examples or goldens.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { Results, Sloppy } from "sloppy";
|
|
2
|
+
|
|
3
|
+
const app = Sloppy.create();
|
|
4
|
+
|
|
5
|
+
app.get("/config-status", () => {
|
|
6
|
+
const endpoint = app.config.getString("Provider:Endpoint", "runtime:/provider.sock");
|
|
7
|
+
const providerCredential = app.config.getSecret("Provider:Token");
|
|
8
|
+
|
|
9
|
+
return Results.json({
|
|
10
|
+
endpoint,
|
|
11
|
+
credential: String(providerCredential),
|
|
12
|
+
});
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export default app;
|
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
# Core FS Time Codec Example
|
|
2
|
+
|
|
3
|
+
This example shows filesystem bytes,
|
|
4
|
+
an operation deadline, and the shared Codec UTF-8 decoder used together.
|
|
5
|
+
|
|
6
|
+
## Limitations
|
|
7
|
+
|
|
8
|
+
This example is limited to the combined filesystem, deadline, and codec API
|
|
9
|
+
shape shown above.
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
import { Text } from "sloppy/codec";
|
|
2
|
+
import { File } from "sloppy/fs";
|
|
3
|
+
import { Deadline } from "sloppy/time";
|
|
4
|
+
|
|
5
|
+
const deadline = Deadline.after(500);
|
|
6
|
+
const bytes = await File.readBytes("data:/message.txt", { timeoutMs: 250, deadline });
|
|
7
|
+
|
|
8
|
+
export const message = Text.utf8.decode(bytes, { fatal: true });
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
# Core Network Time Codec Example
|
|
2
|
+
|
|
3
|
+
This example uses LocalEndpoint
|
|
4
|
+
operation options, a shared Deadline, and Codec UTF-8 helpers for byte ownership at the
|
|
5
|
+
network boundary.
|
|
6
|
+
|
|
7
|
+
## Limitations
|
|
8
|
+
|
|
9
|
+
This example is limited to the local endpoint, deadline, and codec API shape
|
|
10
|
+
shown above. Broader network policy and sandbox behavior are separate runtime
|
|
11
|
+
docs.
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Text } from "sloppy/codec";
|
|
2
|
+
import { LocalEndpoint } from "sloppy/net";
|
|
3
|
+
import { Deadline } from "sloppy/time";
|
|
4
|
+
|
|
5
|
+
export async function readLocalStatus(signal) {
|
|
6
|
+
const deadline = Deadline.after(1000);
|
|
7
|
+
const endpoint = await LocalEndpoint.connect({
|
|
8
|
+
path: "runtime:/status.sock",
|
|
9
|
+
deadline,
|
|
10
|
+
signal,
|
|
11
|
+
});
|
|
12
|
+
|
|
13
|
+
try {
|
|
14
|
+
await endpoint.write(Text.utf8.encode("status\n"), { deadline, signal });
|
|
15
|
+
const bytes = await endpoint.read({ maxBytes: 4096, deadline, signal });
|
|
16
|
+
return Text.utf8.decode(bytes, { fatal: true });
|
|
17
|
+
} finally {
|
|
18
|
+
await endpoint.close();
|
|
19
|
+
}
|
|
20
|
+
}
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
# Core Policy Audit Example
|
|
2
|
+
|
|
3
|
+
This example keeps capability and
|
|
4
|
+
strict-policy metadata explicit so doctor/audit output can describe implemented and deferred
|
|
5
|
+
policy behavior honestly.
|
|
6
|
+
|
|
7
|
+
The policy object is example metadata, not an OS sandbox or package manifest.
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import { Sloppy } from "sloppy";
|
|
2
|
+
|
|
3
|
+
const PolicyModule = Sloppy.module("core-policy").capabilities((capabilities) => {
|
|
4
|
+
capabilities.addDatabase("data.main", {
|
|
5
|
+
provider: "sqlite",
|
|
6
|
+
access: "readwrite",
|
|
7
|
+
metadata: { strict: true },
|
|
8
|
+
});
|
|
9
|
+
});
|
|
10
|
+
|
|
11
|
+
// Audit-only fixture metadata; current app construction does not enforce this object.
|
|
12
|
+
export const policyMetadata = Object.freeze({
|
|
13
|
+
filesystem: { mode: "strict", roots: ["data:/"] },
|
|
14
|
+
network: { mode: "strict", connect: ["127.0.0.1:9000"] },
|
|
15
|
+
process: { mode: "strict", run: ["status-tool"] },
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
const app = Sloppy.createBuilder()
|
|
19
|
+
.addModule(PolicyModule)
|
|
20
|
+
.build();
|
|
21
|
+
|
|
22
|
+
export default app;
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
import { Text } from "sloppy/codec";
|
|
2
|
+
import { Process } from "sloppy/os";
|
|
3
|
+
import { Deadline } from "sloppy/time";
|
|
4
|
+
|
|
5
|
+
let statusText = "";
|
|
6
|
+
|
|
7
|
+
async function refreshStatusText() {
|
|
8
|
+
let process = null;
|
|
9
|
+
try {
|
|
10
|
+
process = await Process.start("status-tool", ["--format=text"], {
|
|
11
|
+
stdout: "pipe",
|
|
12
|
+
deadline: Deadline.after(1000),
|
|
13
|
+
});
|
|
14
|
+
const output = await process.stdout.read(4096);
|
|
15
|
+
statusText = typeof output === "string"
|
|
16
|
+
? output
|
|
17
|
+
: Text.utf8.decode(output, { fatal: true });
|
|
18
|
+
} catch {
|
|
19
|
+
statusText = "";
|
|
20
|
+
} finally {
|
|
21
|
+
if (process !== null) {
|
|
22
|
+
await process.dispose();
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
return statusText;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export { refreshStatusText, statusText };
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { WorkQueue } from "sloppy/workers";
|
|
2
|
+
import { Deadline } from "sloppy/time";
|
|
3
|
+
|
|
4
|
+
const queue = WorkQueue.create("core-worker-time", {
|
|
5
|
+
maxQueued: 8,
|
|
6
|
+
concurrency: 2,
|
|
7
|
+
overflow: "backpressure",
|
|
8
|
+
});
|
|
9
|
+
|
|
10
|
+
queue.process(async (job, ctx) => {
|
|
11
|
+
ctx.signal.throwIfCancelled();
|
|
12
|
+
return { id: job.data.id, attempt: job.attempt };
|
|
13
|
+
});
|
|
14
|
+
|
|
15
|
+
export const scheduled = queue.enqueue({ id: "daily-summary" }, {
|
|
16
|
+
deadline: Deadline.after(500),
|
|
17
|
+
});
|
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
# Crypto Hash And HMAC Example
|
|
2
|
+
|
|
3
|
+
This example documents SHA-256 digest helpers,
|
|
4
|
+
incremental hashing, SHA-512 HMAC signing, HMAC verification, and `Secret` ownership around a
|
|
5
|
+
configuration-supplied key.
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
import { Hash, Hmac, Secret } from "sloppy/crypto";
|
|
9
|
+
|
|
10
|
+
const digest = await Hash.sha256Hex(payload);
|
|
11
|
+
const signature = await Hmac.sha512(signingKey, payload);
|
|
12
|
+
const ok = await Hmac.verifySha512(signingKey, payload, signature);
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
HMAC verification uses the constant-time comparison path. The example keeps the
|
|
16
|
+
non-cryptographic hash namespace out of security-shaped code and does not define
|
|
17
|
+
a custom crypto algorithm.
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
import { Hash, Hmac, Secret } from "sloppy/crypto";
|
|
2
|
+
|
|
3
|
+
function readSigningKeyFromConfig(config) {
|
|
4
|
+
return config.hmacKey;
|
|
5
|
+
}
|
|
6
|
+
|
|
7
|
+
export async function describePayload(payload, config) {
|
|
8
|
+
const signingKey = Secret.fromUtf8(readSigningKeyFromConfig(config));
|
|
9
|
+
try {
|
|
10
|
+
const sha256Hex = await Hash.sha256Hex(payload);
|
|
11
|
+
const sha256Base64 = await Hash.sha256Base64(payload);
|
|
12
|
+
const hasher = Hash.create("sha256");
|
|
13
|
+
hasher.update("event:");
|
|
14
|
+
hasher.update(payload);
|
|
15
|
+
const incrementalHex = await hasher.digest("hex");
|
|
16
|
+
const signature = await Hmac.sha512(signingKey, payload);
|
|
17
|
+
const signatureOk = await Hmac.verifySha512(signingKey, payload, signature);
|
|
18
|
+
|
|
19
|
+
return {
|
|
20
|
+
sha256Hex,
|
|
21
|
+
sha256Base64,
|
|
22
|
+
incrementalHex,
|
|
23
|
+
signatureBytes: signature.byteLength,
|
|
24
|
+
signatureOk,
|
|
25
|
+
};
|
|
26
|
+
} finally {
|
|
27
|
+
signingKey.dispose();
|
|
28
|
+
}
|
|
29
|
+
}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Crypto Password Example
|
|
2
|
+
|
|
3
|
+
This example documents the async password
|
|
4
|
+
hashing, verification, and rehash policy shape.
|
|
5
|
+
|
|
6
|
+
```js
|
|
7
|
+
import { Password } from "sloppy/crypto";
|
|
8
|
+
|
|
9
|
+
const encodedHash = await Password.hash(password);
|
|
10
|
+
const ok = await Password.verify(password, encodedHash);
|
|
11
|
+
const shouldUpgrade = await Password.needsRehash(encodedHash);
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Password hashing is async in the public API and offloaded from the V8 owner thread in the
|
|
15
|
+
V8-enabled runtime. Password values must not be logged, printed, placed in diagnostics, or committed to
|
|
16
|
+
goldens.
|
|
17
|
+
|
|
18
|
+
## Limitations
|
|
19
|
+
|
|
20
|
+
This example uses Sloppy's password API as provided. It does not define a custom
|
|
21
|
+
password hashing algorithm.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Password } from "sloppy/crypto";
|
|
2
|
+
|
|
3
|
+
export async function createPasswordRecord(password) {
|
|
4
|
+
const encodedHash = await Password.hash(password);
|
|
5
|
+
return { encodedHash };
|
|
6
|
+
}
|
|
7
|
+
|
|
8
|
+
export async function verifyPasswordRecord(password, encodedHash) {
|
|
9
|
+
const ok = await Password.verify(password, encodedHash);
|
|
10
|
+
const shouldUpgrade = await Password.needsRehash(encodedHash);
|
|
11
|
+
return { ok, shouldUpgrade };
|
|
12
|
+
}
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
# Crypto Random Token Example
|
|
2
|
+
|
|
3
|
+
This example documents the intended
|
|
4
|
+
`sloppy/crypto` random helper shape for UUIDs, random bytes, URL-safe tokens, hex text, and
|
|
5
|
+
numeric codes.
|
|
6
|
+
|
|
7
|
+
```js
|
|
8
|
+
import { Random } from "sloppy/crypto";
|
|
9
|
+
|
|
10
|
+
const resetToken = Random.token(32);
|
|
11
|
+
const recoveryCode = Random.numericCode(6);
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
Random helpers use OS CSPRNG backends only. The example does not print generated
|
|
15
|
+
tokens or describe randomness quality from deterministic tests. There is no
|
|
16
|
+
`Math.random` fallback.
|
|
@@ -0,0 +1,12 @@
|
|
|
1
|
+
import { Random } from "sloppy/crypto";
|
|
2
|
+
|
|
3
|
+
const resetToken = Random.token(32);
|
|
4
|
+
const recoveryCode = Random.numericCode(6);
|
|
5
|
+
|
|
6
|
+
export default {
|
|
7
|
+
requestId: Random.uuid(),
|
|
8
|
+
randomBytesLength: Random.bytes(32).byteLength,
|
|
9
|
+
resetTokenLength: resetToken.length,
|
|
10
|
+
randomHexLength: Random.hex(32).length,
|
|
11
|
+
recoveryCodeLength: recoveryCode.length,
|
|
12
|
+
};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
# Crypto Secret And Constant-Time Example
|
|
2
|
+
|
|
3
|
+
This example documents `Secret` ownership,
|
|
4
|
+
cleanup-once disposal, HMAC verification, and constant-time byte comparison.
|
|
5
|
+
|
|
6
|
+
```js
|
|
7
|
+
import { ConstantTime, Hmac, Secret } from "sloppy/crypto";
|
|
8
|
+
|
|
9
|
+
const key = Secret.fromUtf8(configuredKeyText);
|
|
10
|
+
try {
|
|
11
|
+
const expected = await Hmac.sha256(key, body);
|
|
12
|
+
return ConstantTime.equals(expected, providedSignature);
|
|
13
|
+
} finally {
|
|
14
|
+
key.dispose();
|
|
15
|
+
}
|
|
16
|
+
```
|
|
17
|
+
|
|
18
|
+
`Secret.dispose()` is best-effort cleanup of Sloppy-owned buffers. Prior JavaScript string
|
|
19
|
+
copies, engine internals, OS paging, or crash dumps may still contain data. The example
|
|
20
|
+
avoids printing secret material. Deterministic tests verify API behavior, not side-channel
|
|
21
|
+
resistance.
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { ConstantTime, Hmac, Secret } from "sloppy/crypto";
|
|
2
|
+
|
|
3
|
+
export async function verifyWebhook(body, providedSignature, configuredKeyText) {
|
|
4
|
+
const key = Secret.fromUtf8(configuredKeyText);
|
|
5
|
+
try {
|
|
6
|
+
const expectedSignature = await Hmac.sha256(key, body);
|
|
7
|
+
return ConstantTime.equals(expectedSignature, providedSignature);
|
|
8
|
+
} finally {
|
|
9
|
+
key.dispose();
|
|
10
|
+
}
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export function verifyOpaqueBytes(left, right) {
|
|
14
|
+
return ConstantTime.equals(left, right);
|
|
15
|
+
}
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
# Data Foundation Example
|
|
2
|
+
|
|
3
|
+
Bootstrap data/capabilities foundation example.
|
|
4
|
+
This example shows the current JavaScript-only shape for database capability metadata,
|
|
5
|
+
query template lowering, a fake data provider service, and transaction callback semantics.
|
|
6
|
+
|
|
7
|
+
What works today:
|
|
8
|
+
|
|
9
|
+
- `Sloppy.module("data").capabilities(...)` declares a database capability token.
|
|
10
|
+
- `caps.addDatabase("data.main", { provider: "sqlite", access: "readwrite" })` stores
|
|
11
|
+
metadata only.
|
|
12
|
+
- `data.createFakeProvider(...)` creates a test/example provider with `query`, `queryOne`,
|
|
13
|
+
`exec`, and `transaction`.
|
|
14
|
+
- tagged query templates keep SQL text and parameter values separate.
|
|
15
|
+
- `sql` and provider methods lower placeholders to `?` by default.
|
|
16
|
+
- fake transactions record begin/commit/rollback behavior for tests.
|
|
17
|
+
|
|
18
|
+
Current product state:
|
|
19
|
+
|
|
20
|
+
- This source-stdlib example is a checked-in API-shape fixture.
|
|
21
|
+
- `sloppy run --artifacts` currently runs emitted artifacts such as
|
|
22
|
+
`examples/compiler-hello`.
|
|
23
|
+
- `sloppyc` compilation and `app.plan.json` emission for this data shape are future
|
|
24
|
+
source-extraction work.
|
|
25
|
+
- The bounded `sloppy run` path currently loads generated artifacts, not this
|
|
26
|
+
source-stdlib data example.
|
|
27
|
+
- The real SQLite provider is covered by native C tests. This example uses a fake
|
|
28
|
+
JavaScript provider so the metadata and callback shape stay inspectable.
|
|
29
|
+
- PostgreSQL and SQL Server have separate provider examples. This example stays on the
|
|
30
|
+
fake JavaScript provider.
|
|
31
|
+
- The fake provider records calls only; it opens no database connection and executes no SQL.
|
|
32
|
+
- Filesystem and network capability enforcement belong to their provider/runtime lanes.
|
|
33
|
+
- Migrations and ORM behavior are separate application-framework features.
|
|
34
|
+
- Native SQL execution, pooling, and true-async external providers are covered by
|
|
35
|
+
provider-specific SQLite/PostgreSQL/SQL Server examples and tests.
|
|
36
|
+
- Bare `"sloppy"` imports are the current source shape for this example.
|
|
37
|
+
|
|
38
|
+
See `examples/sqlite-basic/`, `examples/postgres-basic/`, and `examples/sqlserver-basic/`
|
|
39
|
+
for provider registration shapes.
|
|
@@ -0,0 +1,63 @@
|
|
|
1
|
+
import { Sloppy, data, sql } from "sloppy";
|
|
2
|
+
|
|
3
|
+
export const DataModule = Sloppy.module("data")
|
|
4
|
+
.capabilities((caps) => {
|
|
5
|
+
caps.addDatabase("data.main", {
|
|
6
|
+
provider: "sqlite",
|
|
7
|
+
access: "readwrite",
|
|
8
|
+
});
|
|
9
|
+
})
|
|
10
|
+
.services((services) => {
|
|
11
|
+
services.addSingleton("data.main", () => data.createFakeProvider({
|
|
12
|
+
query(lowered) {
|
|
13
|
+
return [{
|
|
14
|
+
id: lowered.parameters[0] ?? "demo",
|
|
15
|
+
loweredText: lowered.text,
|
|
16
|
+
}];
|
|
17
|
+
},
|
|
18
|
+
exec(lowered) {
|
|
19
|
+
return {
|
|
20
|
+
affectedRows: 1,
|
|
21
|
+
loweredText: lowered.text,
|
|
22
|
+
};
|
|
23
|
+
},
|
|
24
|
+
}));
|
|
25
|
+
});
|
|
26
|
+
|
|
27
|
+
export const UsersModule = Sloppy.module("users")
|
|
28
|
+
.dependsOn("data")
|
|
29
|
+
.routes((app) => {
|
|
30
|
+
app.mapGroup("/users")
|
|
31
|
+
.withTags("Users")
|
|
32
|
+
.mapGet("/{id:int}", async ({ route, services }) => {
|
|
33
|
+
const db = services.get("data.main");
|
|
34
|
+
const user = await db.queryOne`
|
|
35
|
+
select id, name
|
|
36
|
+
from users
|
|
37
|
+
where id = ${route.id ?? "demo"}
|
|
38
|
+
`;
|
|
39
|
+
|
|
40
|
+
await db.transaction(async (tx) => {
|
|
41
|
+
await tx.exec`
|
|
42
|
+
insert into audit_log (user_id)
|
|
43
|
+
values (${route.id ?? "demo"})
|
|
44
|
+
`;
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
return user;
|
|
48
|
+
})
|
|
49
|
+
.withName("Users.Get");
|
|
50
|
+
});
|
|
51
|
+
|
|
52
|
+
const lowered = sql`select id from users where id = ${1}`;
|
|
53
|
+
|
|
54
|
+
const builder = Sloppy.createBuilder();
|
|
55
|
+
|
|
56
|
+
builder
|
|
57
|
+
.addModule(UsersModule)
|
|
58
|
+
.addModule(DataModule);
|
|
59
|
+
|
|
60
|
+
const app = builder.build();
|
|
61
|
+
|
|
62
|
+
export { lowered };
|
|
63
|
+
export default app;
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
# Dependency Graph
|
|
2
|
+
|
|
3
|
+
This example shows a small dependency graph with:
|
|
4
|
+
|
|
5
|
+
- one local fixture package installed through `file:`;
|
|
6
|
+
- one Node compatibility shim (`node:path`);
|
|
7
|
+
- one asset included by `assetInclude`;
|
|
8
|
+
- a graph that can be inspected with `sloppy deps`.
|
|
9
|
+
|
|
10
|
+
## Setup
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
npm install
|
|
14
|
+
sloppy build
|
|
15
|
+
sloppy deps .sloppy
|
|
16
|
+
sloppy deps .sloppy --format json
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
The package is local to this example and does not require a registry call.
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
This asset is included by assetInclude.
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
# Contributor/Internal Evidence Catalog
|
|
2
|
+
|
|
3
|
+
This contributor/internal directory is a machine-readable catalog of current
|
|
4
|
+
runtime evidence targets. The source is `dogfood.json`.
|
|
5
|
+
|
|
6
|
+
Current runnable or diagnosable targets:
|
|
7
|
+
|
|
8
|
+
- `hello-artifact`: uses `examples/compiler-hello/app.js` and the checked-in generated
|
|
9
|
+
artifact fixture under `compiler/tests/fixtures/hello-mapget/expected`.
|
|
10
|
+
- `hello-source-input`: uses `examples/hello-minimal/src/main.ts` through the source-input
|
|
11
|
+
fixture harness.
|
|
12
|
+
- `prealpha-control-plane`: uses `examples/prealpha-control-plane/` through project-mode
|
|
13
|
+
source input and the app test host coverage suite.
|
|
14
|
+
- `package-hello-artifact`: uses the package outside-checkout smoke fixture when a package
|
|
15
|
+
archive is provided.
|
|
16
|
+
|
|
17
|
+
Feature app targets for HTTP, HTTPS/TLS, SQLite, PostgreSQL, SQL Server, and the typed
|
|
18
|
+
framework surface are listed with their current blocked or gated status until the required
|
|
19
|
+
runtime support is available.
|
|
20
|
+
|
|
21
|
+
Default non-V8 runs validate clear diagnostics for V8-required examples.
|
|
22
|
+
Positive execution of the hello handlers and control-plane example requires a
|
|
23
|
+
V8-enabled build.
|