@wbce/projen-d9 0.0.27 → 0.1.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/.jsii +185 -46
- package/API.md +153 -37
- package/CHANGELOG.md +20 -0
- package/README.md +10 -3
- package/docs/D9-plumbing.md +189 -0
- package/lib/cli/atlas.d.ts +10 -0
- package/lib/cli/atlas.js +65 -0
- package/lib/cli/commands/cedar/cedar-format.d.ts +7 -0
- package/lib/cli/commands/cedar/cedar-format.js +75 -0
- package/lib/cli/commands/cedar/cedar-to-d9-translations.d.ts +12 -0
- package/lib/cli/commands/cedar/cedar-to-d9-translations.js +130 -0
- package/lib/cli/commands/cedar/cedar-to-d9.d.ts +57 -0
- package/lib/cli/commands/cedar/cedar-to-d9.js +221 -0
- package/lib/cli/commands/cedar/cedar-translations.d.ts +9 -0
- package/lib/cli/commands/cedar/cedar-translations.js +213 -0
- package/lib/cli/commands/cedar/d9-permission.d.ts +27 -0
- package/lib/cli/commands/cedar/d9-permission.js +45 -0
- package/lib/cli/commands/cedar/d9-to-cedar.d.ts +33 -0
- package/lib/cli/commands/cedar/d9-to-cedar.js +157 -0
- package/lib/cli/commands/cedar/roles-table.d.ts +14 -0
- package/lib/cli/commands/cedar/roles-table.js +29 -0
- package/lib/cli/commands/save/apply-snapshot.js +39 -30
- package/lib/cli/commands/save/check-unsaved.d.ts +9 -0
- package/lib/cli/commands/save/check-unsaved.js +81 -0
- package/lib/cli/commands/save/env.d.ts +33 -0
- package/lib/cli/commands/save/env.js +109 -0
- package/lib/cli/commands/save/save-snapshot.d.ts +9 -0
- package/lib/cli/commands/save/save-snapshot.js +232 -0
- package/lib/cli/commands/save/sync-files.d.ts +5 -0
- package/lib/cli/commands/save/sync-files.js +46 -0
- package/lib/cli/commands/save/transfer.d.ts +18 -0
- package/lib/cli/commands/save/transfer.js +96 -0
- package/lib/cli/commands/save/utils.d.ts +5 -0
- package/lib/cli/commands/save/utils.js +33 -3
- package/lib/cli/commands/sync.js +4 -3
- package/lib/cli/index.js +65 -25
- package/lib/cli/logger.d.ts +2 -0
- package/lib/cli/logger.js +10 -0
- package/lib/cli/plumbing-config.d.ts +11 -0
- package/lib/cli/plumbing-config.js +13 -0
- package/lib/index.d.ts +44 -5
- package/lib/index.js +54 -41
- package/node_modules/@cedar-policy/cedar-wasm/README.md +181 -0
- package/node_modules/@cedar-policy/cedar-wasm/esm/README.md +181 -0
- package/node_modules/@cedar-policy/cedar-wasm/esm/cedar_wasm.d.ts +427 -0
- package/node_modules/@cedar-policy/cedar-wasm/esm/cedar_wasm.js +9 -0
- package/node_modules/@cedar-policy/cedar-wasm/esm/cedar_wasm_bg.js +434 -0
- package/node_modules/@cedar-policy/cedar-wasm/esm/cedar_wasm_bg.wasm +0 -0
- package/node_modules/@cedar-policy/cedar-wasm/esm/cedar_wasm_bg.wasm.d.ts +34 -0
- package/node_modules/@cedar-policy/cedar-wasm/esm/package.json +23 -0
- package/node_modules/@cedar-policy/cedar-wasm/nodejs/README.md +181 -0
- package/node_modules/@cedar-policy/cedar-wasm/nodejs/cedar_wasm.d.ts +427 -0
- package/node_modules/@cedar-policy/cedar-wasm/nodejs/cedar_wasm.js +463 -0
- package/node_modules/@cedar-policy/cedar-wasm/nodejs/cedar_wasm_bg.wasm +0 -0
- package/node_modules/@cedar-policy/cedar-wasm/nodejs/cedar_wasm_bg.wasm.d.ts +34 -0
- package/node_modules/@cedar-policy/cedar-wasm/nodejs/package.json +18 -0
- package/node_modules/@cedar-policy/cedar-wasm/package.json +53 -0
- package/node_modules/@cedar-policy/cedar-wasm/web/README.md +181 -0
- package/node_modules/@cedar-policy/cedar-wasm/web/cedar_wasm.d.ts +486 -0
- package/node_modules/@cedar-policy/cedar-wasm/web/cedar_wasm.js +534 -0
- package/node_modules/@cedar-policy/cedar-wasm/web/cedar_wasm_bg.wasm +0 -0
- package/node_modules/@cedar-policy/cedar-wasm/web/cedar_wasm_bg.wasm.d.ts +34 -0
- package/node_modules/@cedar-policy/cedar-wasm/web/package.json +21 -0
- package/node_modules/@types/node/README.md +5 -6
- package/node_modules/@types/node/assert/strict.d.ts +111 -0
- package/node_modules/@types/node/assert.d.ts +1040 -79
- package/node_modules/@types/node/async_hooks.d.ts +476 -119
- package/node_modules/@types/node/buffer.buffer.d.ts +472 -0
- package/node_modules/@types/node/buffer.d.ts +1925 -13
- package/node_modules/@types/node/child_process.d.ts +1204 -235
- package/node_modules/@types/node/cluster.d.ts +455 -137
- package/node_modules/@types/node/compatibility/disposable.d.ts +14 -0
- package/node_modules/@types/node/compatibility/index.d.ts +9 -0
- package/node_modules/@types/node/compatibility/indexable.d.ts +20 -0
- package/node_modules/@types/node/compatibility/iterators.d.ts +20 -0
- package/node_modules/@types/node/console.d.ts +450 -1
- package/node_modules/@types/node/constants.d.ts +20 -447
- package/node_modules/@types/node/crypto.d.ts +3962 -600
- package/node_modules/@types/node/dgram.d.ts +515 -33
- package/node_modules/@types/node/diagnostics_channel.d.ts +578 -0
- package/node_modules/@types/node/dns/promises.d.ts +503 -0
- package/node_modules/@types/node/dns.d.ts +798 -247
- package/node_modules/@types/node/domain.d.ts +164 -10
- package/node_modules/@types/node/events.d.ts +954 -25
- package/node_modules/@types/node/fs/promises.d.ts +1295 -0
- package/node_modules/@types/node/fs.d.ts +3463 -1569
- package/node_modules/@types/node/globals.d.ts +98 -1277
- package/node_modules/@types/node/globals.typedarray.d.ts +38 -0
- package/node_modules/@types/node/http.d.ts +1933 -300
- package/node_modules/@types/node/http2.d.ts +1946 -254
- package/node_modules/@types/node/https.d.ts +557 -134
- package/node_modules/@types/node/index.d.ts +54 -48
- package/node_modules/@types/node/inspector.d.ts +227 -3014
- package/node_modules/@types/node/inspector.generated.d.ts +4052 -0
- package/node_modules/@types/node/module.d.ts +890 -2
- package/node_modules/@types/node/net.d.ts +872 -105
- package/node_modules/@types/node/os.d.ts +452 -209
- package/node_modules/@types/node/package.json +78 -128
- package/node_modules/@types/node/path.d.ts +196 -155
- package/node_modules/@types/node/perf_hooks.d.ts +829 -120
- package/node_modules/@types/node/process.d.ts +2072 -3
- package/node_modules/@types/node/punycode.d.ts +69 -27
- package/node_modules/@types/node/querystring.d.ts +132 -9
- package/node_modules/@types/node/readline/promises.d.ts +161 -0
- package/node_modules/@types/node/readline.d.ts +485 -49
- package/node_modules/@types/node/repl.d.ts +121 -83
- package/node_modules/@types/node/sea.d.ts +153 -0
- package/node_modules/@types/node/sqlite.d.ts +721 -0
- package/node_modules/@types/node/stream/consumers.d.ts +38 -0
- package/node_modules/@types/node/stream/promises.d.ts +90 -0
- package/node_modules/@types/node/stream/web.d.ts +622 -0
- package/node_modules/@types/node/stream.d.ts +1470 -140
- package/node_modules/@types/node/string_decoder.d.ts +64 -4
- package/node_modules/@types/node/test.d.ts +2163 -0
- package/node_modules/@types/node/timers/promises.d.ts +108 -0
- package/node_modules/@types/node/timers.d.ts +284 -13
- package/node_modules/@types/node/tls.d.ts +850 -244
- package/node_modules/@types/node/trace_events.d.ts +147 -11
- package/node_modules/@types/node/ts5.6/buffer.buffer.d.ts +468 -0
- package/node_modules/@types/node/ts5.6/globals.typedarray.d.ts +34 -0
- package/node_modules/@types/node/ts5.6/index.d.ts +97 -0
- package/node_modules/@types/node/tty.d.ts +160 -18
- package/node_modules/@types/node/url.d.ts +890 -53
- package/node_modules/@types/node/util.d.ts +2566 -160
- package/node_modules/@types/node/v8.d.ts +806 -83
- package/node_modules/@types/node/vm.d.ts +932 -44
- package/node_modules/@types/node/wasi.d.ts +148 -22
- package/node_modules/@types/node/web-globals/abortcontroller.d.ts +34 -0
- package/node_modules/@types/node/web-globals/domexception.d.ts +68 -0
- package/node_modules/@types/node/web-globals/events.d.ts +97 -0
- package/node_modules/@types/node/web-globals/fetch.d.ts +55 -0
- package/node_modules/@types/node/web-globals/navigator.d.ts +22 -0
- package/node_modules/@types/node/web-globals/storage.d.ts +24 -0
- package/node_modules/@types/node/worker_threads.d.ts +657 -80
- package/node_modules/@types/node/zlib.d.ts +510 -119
- package/node_modules/pino/.prettierignore +1 -0
- package/node_modules/pino/CNAME +1 -0
- package/node_modules/pino/CONTRIBUTING.md +34 -0
- package/node_modules/pino/LICENSE +21 -0
- package/node_modules/pino/README.md +177 -0
- package/node_modules/pino/SECURITY.md +103 -0
- package/node_modules/pino/benchmarks/basic.bench.js +95 -0
- package/node_modules/pino/benchmarks/child-child.bench.js +52 -0
- package/node_modules/pino/benchmarks/child-creation.bench.js +73 -0
- package/node_modules/pino/benchmarks/child.bench.js +62 -0
- package/node_modules/pino/benchmarks/deep-object.bench.js +88 -0
- package/node_modules/pino/benchmarks/formatters.bench.js +50 -0
- package/node_modules/pino/benchmarks/internal/custom-levels.js +67 -0
- package/node_modules/pino/benchmarks/internal/just-pino-heavy.bench.js +76 -0
- package/node_modules/pino/benchmarks/internal/just-pino.bench.js +182 -0
- package/node_modules/pino/benchmarks/internal/parent-vs-child.bench.js +75 -0
- package/node_modules/pino/benchmarks/internal/redact.bench.js +86 -0
- package/node_modules/pino/benchmarks/long-string.bench.js +81 -0
- package/node_modules/pino/benchmarks/multi-arg.bench.js +193 -0
- package/node_modules/pino/benchmarks/multistream.js +98 -0
- package/node_modules/pino/benchmarks/object.bench.js +82 -0
- package/node_modules/pino/benchmarks/utils/generate-benchmark-doc.js +36 -0
- package/node_modules/pino/benchmarks/utils/runbench.js +138 -0
- package/node_modules/pino/benchmarks/utils/wrap-log-level.js +55 -0
- package/node_modules/pino/bin.js +6 -0
- package/node_modules/pino/browser.js +607 -0
- package/node_modules/pino/build/sync-version.js +25 -0
- package/node_modules/pino/docs/api.md +1664 -0
- package/node_modules/pino/docs/asynchronous.md +55 -0
- package/node_modules/pino/docs/benchmarks.md +55 -0
- package/node_modules/pino/docs/browser.md +341 -0
- package/node_modules/pino/docs/bundling.md +40 -0
- package/node_modules/pino/docs/child-loggers.md +116 -0
- package/node_modules/pino/docs/diagnostics.md +16 -0
- package/node_modules/pino/docs/ecosystem.md +87 -0
- package/node_modules/pino/docs/help.md +353 -0
- package/node_modules/pino/docs/lts.md +93 -0
- package/node_modules/pino/docs/pretty.md +38 -0
- package/node_modules/pino/docs/redaction.md +130 -0
- package/node_modules/pino/docs/transports.md +1447 -0
- package/node_modules/pino/docs/web.md +306 -0
- package/node_modules/pino/eslint.config.js +36 -0
- package/node_modules/pino/examples/basic.js +43 -0
- package/node_modules/pino/examples/transport.js +68 -0
- package/node_modules/pino/favicon.ico +0 -0
- package/node_modules/pino/file.js +12 -0
- package/node_modules/pino/inc-version.sh +42 -0
- package/node_modules/pino/index.html +55 -0
- package/node_modules/pino/lib/caller.js +40 -0
- package/node_modules/pino/lib/constants.js +28 -0
- package/node_modules/pino/lib/deprecations.js +8 -0
- package/node_modules/pino/lib/levels.js +241 -0
- package/node_modules/pino/lib/meta.js +3 -0
- package/node_modules/pino/lib/multistream.js +211 -0
- package/node_modules/pino/lib/proto.js +256 -0
- package/node_modules/pino/lib/redaction.js +119 -0
- package/node_modules/pino/lib/symbols.js +76 -0
- package/node_modules/pino/lib/time.js +39 -0
- package/node_modules/pino/lib/tools.js +427 -0
- package/node_modules/pino/lib/transport-stream.js +56 -0
- package/node_modules/pino/lib/transport.js +302 -0
- package/node_modules/pino/lib/worker.js +197 -0
- package/node_modules/pino/package.json +112 -0
- package/node_modules/pino/pino.d.ts +881 -0
- package/node_modules/pino/pino.js +259 -0
- package/node_modules/pino/test/basic.test.js +952 -0
- package/node_modules/pino/test/broken-pipe.test.js +59 -0
- package/node_modules/pino/test/browser-bindings.test.js +114 -0
- package/node_modules/pino/test/browser-child.test.js +132 -0
- package/node_modules/pino/test/browser-disabled.test.js +87 -0
- package/node_modules/pino/test/browser-early-console-freeze.test.js +12 -0
- package/node_modules/pino/test/browser-is-level-enabled.test.js +101 -0
- package/node_modules/pino/test/browser-levels.test.js +241 -0
- package/node_modules/pino/test/browser-redaction.test.js +264 -0
- package/node_modules/pino/test/browser-serializers.test.js +352 -0
- package/node_modules/pino/test/browser-set-bindings.test.js +99 -0
- package/node_modules/pino/test/browser-timestamp.test.js +88 -0
- package/node_modules/pino/test/browser-transmit.test.js +417 -0
- package/node_modules/pino/test/browser.test.js +698 -0
- package/node_modules/pino/test/caller.test.js +20 -0
- package/node_modules/pino/test/complex-objects.test.js +36 -0
- package/node_modules/pino/test/crlf.test.js +34 -0
- package/node_modules/pino/test/custom-levels.test.js +267 -0
- package/node_modules/pino/test/diagnostics.test.js +107 -0
- package/node_modules/pino/test/error-key.test.js +37 -0
- package/node_modules/pino/test/error.test.js +403 -0
- package/node_modules/pino/test/escaping.test.js +110 -0
- package/node_modules/pino/test/esm/esm.mjs +14 -0
- package/node_modules/pino/test/esm/index.test.js +21 -0
- package/node_modules/pino/test/esm/named-exports.mjs +29 -0
- package/node_modules/pino/test/exit.test.js +79 -0
- package/node_modules/pino/test/fixtures/broken-pipe/basic.js +9 -0
- package/node_modules/pino/test/fixtures/broken-pipe/destination.js +10 -0
- package/node_modules/pino/test/fixtures/broken-pipe/syncfalse.js +12 -0
- package/node_modules/pino/test/fixtures/caller-loop.js +6 -0
- package/node_modules/pino/test/fixtures/console-transport.js +13 -0
- package/node_modules/pino/test/fixtures/crashing-transport.js +13 -0
- package/node_modules/pino/test/fixtures/default-exit.js +8 -0
- package/node_modules/pino/test/fixtures/destination-exit.js +8 -0
- package/node_modules/pino/test/fixtures/eval/index.js +13 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/14-files.js +3 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/2-files.js +3 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file1.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file10.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file11.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file12.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file13.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file14.js +11 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file2.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file3.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file4.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file5.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file6.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file7.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file8.js +5 -0
- package/node_modules/pino/test/fixtures/eval/node_modules/file9.js +5 -0
- package/node_modules/pino/test/fixtures/noop-transport.js +10 -0
- package/node_modules/pino/test/fixtures/pretty/null-prototype.js +8 -0
- package/node_modules/pino/test/fixtures/stdout-hack-protection.js +11 -0
- package/node_modules/pino/test/fixtures/syncfalse-child.js +6 -0
- package/node_modules/pino/test/fixtures/syncfalse-exit.js +9 -0
- package/node_modules/pino/test/fixtures/syncfalse-flush-exit.js +10 -0
- package/node_modules/pino/test/fixtures/syncfalse.js +6 -0
- package/node_modules/pino/test/fixtures/syntax-error-esm.mjs +2 -0
- package/node_modules/pino/test/fixtures/to-file-transport-with-transform.js +20 -0
- package/node_modules/pino/test/fixtures/to-file-transport.js +13 -0
- package/node_modules/pino/test/fixtures/to-file-transport.mjs +8 -0
- package/node_modules/pino/test/fixtures/transport/index.js +12 -0
- package/node_modules/pino/test/fixtures/transport/package.json +5 -0
- package/node_modules/pino/test/fixtures/transport-exit-immediately-with-async-dest.js +16 -0
- package/node_modules/pino/test/fixtures/transport-exit-immediately.js +11 -0
- package/node_modules/pino/test/fixtures/transport-exit-on-ready.js +12 -0
- package/node_modules/pino/test/fixtures/transport-invalid-node-options.js +26 -0
- package/node_modules/pino/test/fixtures/transport-main.js +9 -0
- package/node_modules/pino/test/fixtures/transport-many-lines.js +29 -0
- package/node_modules/pino/test/fixtures/transport-preload-main.mjs +13 -0
- package/node_modules/pino/test/fixtures/transport-preload.mjs +13 -0
- package/node_modules/pino/test/fixtures/transport-string-stdout.js +9 -0
- package/node_modules/pino/test/fixtures/transport-transform.js +21 -0
- package/node_modules/pino/test/fixtures/transport-uses-pino-config.js +33 -0
- package/node_modules/pino/test/fixtures/transport-with-on-exit.js +12 -0
- package/node_modules/pino/test/fixtures/transport-worker-data.js +19 -0
- package/node_modules/pino/test/fixtures/transport-worker-name.js +24 -0
- package/node_modules/pino/test/fixtures/transport-worker.js +15 -0
- package/node_modules/pino/test/fixtures/transport-wrong-export-type.js +3 -0
- package/node_modules/pino/test/fixtures/ts/to-file-transport-native.mts +15 -0
- package/node_modules/pino/test/fixtures/ts/to-file-transport-with-transform.ts +18 -0
- package/node_modules/pino/test/fixtures/ts/to-file-transport.ts +11 -0
- package/node_modules/pino/test/fixtures/ts/transpile.cjs +36 -0
- package/node_modules/pino/test/fixtures/ts/transport-exit-immediately-with-async-dest.ts +15 -0
- package/node_modules/pino/test/fixtures/ts/transport-exit-immediately.ts +10 -0
- package/node_modules/pino/test/fixtures/ts/transport-exit-on-ready.ts +11 -0
- package/node_modules/pino/test/fixtures/ts/transport-main.ts +8 -0
- package/node_modules/pino/test/fixtures/ts/transport-string-stdout.ts +8 -0
- package/node_modules/pino/test/fixtures/ts/transport-worker.ts +14 -0
- package/node_modules/pino/test/formatters.test.js +364 -0
- package/node_modules/pino/test/helper.d.ts +4 -0
- package/node_modules/pino/test/helper.js +159 -0
- package/node_modules/pino/test/hooks.test.js +114 -0
- package/node_modules/pino/test/http.test.js +214 -0
- package/node_modules/pino/test/internals/version.test.js +17 -0
- package/node_modules/pino/test/is-level-enabled.test.js +179 -0
- package/node_modules/pino/test/jest/basic.spec.js +10 -0
- package/node_modules/pino/test/levels.test.js +810 -0
- package/node_modules/pino/test/metadata.test.js +120 -0
- package/node_modules/pino/test/mixin-merge-strategy.test.js +57 -0
- package/node_modules/pino/test/mixin.test.js +241 -0
- package/node_modules/pino/test/multistream.test.js +793 -0
- package/node_modules/pino/test/redact.test.js +923 -0
- package/node_modules/pino/test/serializers.test.js +257 -0
- package/node_modules/pino/test/smoke.js +59 -0
- package/node_modules/pino/test/stdout-protection.test.js +41 -0
- package/node_modules/pino/test/syncfalse.test.js +186 -0
- package/node_modules/pino/test/timestamp-nano.test.js +37 -0
- package/node_modules/pino/test/timestamp.test.js +124 -0
- package/node_modules/pino/test/transport/big.test.js +42 -0
- package/node_modules/pino/test/transport/bundlers-support.test.js +99 -0
- package/node_modules/pino/test/transport/caller.test.js +24 -0
- package/node_modules/pino/test/transport/core.test.js +818 -0
- package/node_modules/pino/test/transport/core.transpiled.test.ts +114 -0
- package/node_modules/pino/test/transport/crash.test.js +36 -0
- package/node_modules/pino/test/transport/module-link.test.js +241 -0
- package/node_modules/pino/test/transport/native-type-stripping.test.mjs +151 -0
- package/node_modules/pino/test/transport/node-options.test.js +116 -0
- package/node_modules/pino/test/transport/pipeline.test.js +137 -0
- package/node_modules/pino/test/transport/preload.test.js +54 -0
- package/node_modules/pino/test/transport/repl.test.js +15 -0
- package/node_modules/pino/test/transport/sync-false.test.js +79 -0
- package/node_modules/pino/test/transport/sync-true.test.js +57 -0
- package/node_modules/pino/test/transport/targets.test.js +48 -0
- package/node_modules/pino/test/transport/uses-pino-config.test.js +166 -0
- package/node_modules/pino/test/transport-stream.test.js +40 -0
- package/node_modules/pino/test/types/pino-import.tst.cts +30 -0
- package/node_modules/pino/test/types/pino-import.tst.js +73 -0
- package/node_modules/pino/test/types/pino-multistream.tst.ts +49 -0
- package/node_modules/pino/test/types/pino-top-export.tst.ts +32 -0
- package/node_modules/pino/test/types/pino-transport.tst.ts +171 -0
- package/node_modules/pino/test/types/pino-type-only.tst.ts +77 -0
- package/node_modules/pino/test/types/pino.ts +98 -0
- package/node_modules/pino/test/types/pino.tst.ts +681 -0
- package/node_modules/pino/test/types/tsconfig.json +10 -0
- package/node_modules/pino/tsconfig.json +14 -0
- package/node_modules/pino-pretty/.borp.yaml +6 -0
- package/node_modules/pino-pretty/.editorconfig +13 -0
- package/node_modules/pino-pretty/.github/dependabot.yml +13 -0
- package/node_modules/pino-pretty/.github/workflows/ci.yml +83 -0
- package/node_modules/pino-pretty/LICENSE +21 -0
- package/node_modules/pino-pretty/Readme.md +425 -0
- package/node_modules/pino-pretty/SECURITY.md +146 -0
- package/node_modules/pino-pretty/benchmark.js +105 -0
- package/node_modules/pino-pretty/bin.js +113 -0
- package/node_modules/pino-pretty/demo.png +0 -0
- package/node_modules/pino-pretty/docs/help.md +24 -0
- package/node_modules/pino-pretty/eslint.config.js +5 -0
- package/node_modules/pino-pretty/help/help.txt +68 -0
- package/node_modules/pino-pretty/index.d.ts +227 -0
- package/node_modules/pino-pretty/index.js +234 -0
- package/node_modules/pino-pretty/lib/colors.js +134 -0
- package/node_modules/pino-pretty/lib/colors.test.js +132 -0
- package/node_modules/pino-pretty/lib/constants.js +55 -0
- package/node_modules/pino-pretty/lib/pretty.js +171 -0
- package/node_modules/pino-pretty/lib/utils/build-safe-sonic-boom.js +69 -0
- package/node_modules/pino-pretty/lib/utils/build-safe-sonic-boom.test.js +84 -0
- package/node_modules/pino-pretty/lib/utils/create-date.js +26 -0
- package/node_modules/pino-pretty/lib/utils/create-date.test.js +20 -0
- package/node_modules/pino-pretty/lib/utils/delete-log-property.js +28 -0
- package/node_modules/pino-pretty/lib/utils/delete-log-property.test.js +31 -0
- package/node_modules/pino-pretty/lib/utils/filter-log.js +99 -0
- package/node_modules/pino-pretty/lib/utils/filter-log.test.js +265 -0
- package/node_modules/pino-pretty/lib/utils/format-time.js +66 -0
- package/node_modules/pino-pretty/lib/utils/format-time.test.js +71 -0
- package/node_modules/pino-pretty/lib/utils/get-level-label-data.js +29 -0
- package/node_modules/pino-pretty/lib/utils/get-property-value.js +30 -0
- package/node_modules/pino-pretty/lib/utils/get-property-value.test.js +31 -0
- package/node_modules/pino-pretty/lib/utils/handle-custom-levels-names-opts.js +38 -0
- package/node_modules/pino-pretty/lib/utils/handle-custom-levels-names-opts.test.js +45 -0
- package/node_modules/pino-pretty/lib/utils/handle-custom-levels-opts.js +39 -0
- package/node_modules/pino-pretty/lib/utils/handle-custom-levels-opts.test.js +47 -0
- package/node_modules/pino-pretty/lib/utils/index.js +108 -0
- package/node_modules/pino-pretty/lib/utils/index.test.js +37 -0
- package/node_modules/pino-pretty/lib/utils/interpret-conditionals.js +41 -0
- package/node_modules/pino-pretty/lib/utils/interpret-conditionals.test.js +84 -0
- package/node_modules/pino-pretty/lib/utils/is-object.js +7 -0
- package/node_modules/pino-pretty/lib/utils/is-object.test.js +10 -0
- package/node_modules/pino-pretty/lib/utils/is-valid-date.js +14 -0
- package/node_modules/pino-pretty/lib/utils/is-valid-date.test.js +16 -0
- package/node_modules/pino-pretty/lib/utils/join-lines-with-indentation.js +29 -0
- package/node_modules/pino-pretty/lib/utils/join-lines-with-indentation.test.js +16 -0
- package/node_modules/pino-pretty/lib/utils/noop.js +3 -0
- package/node_modules/pino-pretty/lib/utils/noop.test.js +12 -0
- package/node_modules/pino-pretty/lib/utils/parse-factory-options.js +171 -0
- package/node_modules/pino-pretty/lib/utils/prettify-error-log.js +76 -0
- package/node_modules/pino-pretty/lib/utils/prettify-error-log.test.js +143 -0
- package/node_modules/pino-pretty/lib/utils/prettify-error.js +54 -0
- package/node_modules/pino-pretty/lib/utils/prettify-error.test.js +25 -0
- package/node_modules/pino-pretty/lib/utils/prettify-level.js +41 -0
- package/node_modules/pino-pretty/lib/utils/prettify-level.test.js +70 -0
- package/node_modules/pino-pretty/lib/utils/prettify-message.js +65 -0
- package/node_modules/pino-pretty/lib/utils/prettify-message.test.js +287 -0
- package/node_modules/pino-pretty/lib/utils/prettify-metadata.js +75 -0
- package/node_modules/pino-pretty/lib/utils/prettify-metadata.test.js +170 -0
- package/node_modules/pino-pretty/lib/utils/prettify-object.js +115 -0
- package/node_modules/pino-pretty/lib/utils/prettify-object.test.js +217 -0
- package/node_modules/pino-pretty/lib/utils/prettify-time.js +43 -0
- package/node_modules/pino-pretty/lib/utils/prettify-time.test.js +264 -0
- package/node_modules/pino-pretty/lib/utils/split-property-key.js +49 -0
- package/node_modules/pino-pretty/lib/utils/split-property-key.test.js +29 -0
- package/node_modules/pino-pretty/lib/utils/strip-unsafe-control-chars.js +18 -0
- package/node_modules/pino-pretty/lib/utils/strip-unsafe-control-chars.test.js +9 -0
- package/node_modules/pino-pretty/package.json +64 -0
- package/node_modules/pino-pretty/test/basic.test.js +1305 -0
- package/node_modules/pino-pretty/test/boolean-options.test.js +228 -0
- package/node_modules/pino-pretty/test/cli-rc.test.js +275 -0
- package/node_modules/pino-pretty/test/cli.test.js +360 -0
- package/node_modules/pino-pretty/test/crlf.test.js +33 -0
- package/node_modules/pino-pretty/test/error-objects.test.js +494 -0
- package/node_modules/pino-pretty/test/example/example.js +33 -0
- package/node_modules/pino-pretty/test/helper.js +19 -0
- package/node_modules/pino-pretty/test/types/exports.tst.ts +15 -0
- package/node_modules/pino-pretty/test/types/pino-pretty.tst.ts +140 -0
- package/node_modules/pino-pretty/test/types/tsconfig.json +9 -0
- package/package.json +14 -7
- package/lib/cli/commands/init.d.ts +0 -1
- package/lib/cli/commands/init.js +0 -8
- package/lib/cli/commands/save/draft.js +0 -2
- package/node_modules/@types/node/globals.global.d.ts +0 -1
- /package/{lib/cli/commands/save/draft.d.ts → node_modules/pino/.nojekyll} +0 -0
package/API.md
CHANGED
|
@@ -60,6 +60,7 @@ new D9Project(options: D9ProjectOptions)
|
|
|
60
60
|
| <code><a href="#@wbce/projen-d9.D9Project.renderWorkflowSetup">renderWorkflowSetup</a></code> | Returns the set of workflow steps which should be executed to bootstrap a workflow. |
|
|
61
61
|
| <code><a href="#@wbce/projen-d9.D9Project.setScript">setScript</a></code> | Replaces the contents of an npm package.json script. |
|
|
62
62
|
| <code><a href="#@wbce/projen-d9.D9Project.addExtension">addExtension</a></code> | *No description.* |
|
|
63
|
+
| <code><a href="#@wbce/projen-d9.D9Project.configurePlumbing">configurePlumbing</a></code> | *No description.* |
|
|
63
64
|
|
|
64
65
|
---
|
|
65
66
|
|
|
@@ -625,6 +626,18 @@ public addExtension(name: string, extensionTypes: D9ExtensionType[], options?: A
|
|
|
625
626
|
|
|
626
627
|
---
|
|
627
628
|
|
|
629
|
+
##### `configurePlumbing` <a name="configurePlumbing" id="@wbce/projen-d9.D9Project.configurePlumbing"></a>
|
|
630
|
+
|
|
631
|
+
```typescript
|
|
632
|
+
public configurePlumbing(options: PlumbingOptions): void
|
|
633
|
+
```
|
|
634
|
+
|
|
635
|
+
###### `options`<sup>Required</sup> <a name="options" id="@wbce/projen-d9.D9Project.configurePlumbing.parameter.options"></a>
|
|
636
|
+
|
|
637
|
+
- *Type:* <a href="#@wbce/projen-d9.PlumbingOptions">PlumbingOptions</a>
|
|
638
|
+
|
|
639
|
+
---
|
|
640
|
+
|
|
628
641
|
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
629
642
|
|
|
630
643
|
| **Name** | **Description** |
|
|
@@ -759,11 +772,10 @@ When given a project, this it the project itself.
|
|
|
759
772
|
| <code><a href="#@wbce/projen-d9.D9Project.property.release">release</a></code> | <code>projen.release.Release</code> | Release management. |
|
|
760
773
|
| <code><a href="#@wbce/projen-d9.D9Project.property.upgradeWorkflow">upgradeWorkflow</a></code> | <code>projen.javascript.UpgradeDependencies</code> | The upgrade workflow. |
|
|
761
774
|
| <code><a href="#@wbce/projen-d9.D9Project.property.githubConfig">githubConfig</a></code> | <code>@wbce/projen-shared.GitHubConfig</code> | *No description.* |
|
|
762
|
-
| <code><a href="#@wbce/projen-d9.D9Project.property.applySchemaTask">applySchemaTask</a></code> | <code>projen.Task</code> | *No description.* |
|
|
763
775
|
| <code><a href="#@wbce/projen-d9.D9Project.property.buildExtensionTask">buildExtensionTask</a></code> | <code>projen.Task</code> | *No description.* |
|
|
764
776
|
| <code><a href="#@wbce/projen-d9.D9Project.property.cacheService">cacheService</a></code> | <code>projen.DockerComposeService</code> | *No description.* |
|
|
777
|
+
| <code><a href="#@wbce/projen-d9.D9Project.property.d9Service">d9Service</a></code> | <code>projen.DockerComposeService</code> | *No description.* |
|
|
765
778
|
| <code><a href="#@wbce/projen-d9.D9Project.property.databaseService">databaseService</a></code> | <code>projen.DockerComposeService</code> | *No description.* |
|
|
766
|
-
| <code><a href="#@wbce/projen-d9.D9Project.property.directusService">directusService</a></code> | <code>projen.DockerComposeService</code> | *No description.* |
|
|
767
779
|
| <code><a href="#@wbce/projen-d9.D9Project.property.dockerComposeFile">dockerComposeFile</a></code> | <code>projen.DockerCompose</code> | *No description.* |
|
|
768
780
|
| <code><a href="#@wbce/projen-d9.D9Project.property.dockerfile">dockerfile</a></code> | <code>@wbce/projen-shared.Dockerfile</code> | *No description.* |
|
|
769
781
|
| <code><a href="#@wbce/projen-d9.D9Project.property.extensionFolder">extensionFolder</a></code> | <code>string</code> | *No description.* |
|
|
@@ -1431,16 +1443,6 @@ public readonly githubConfig: GitHubConfig;
|
|
|
1431
1443
|
|
|
1432
1444
|
---
|
|
1433
1445
|
|
|
1434
|
-
##### `applySchemaTask`<sup>Required</sup> <a name="applySchemaTask" id="@wbce/projen-d9.D9Project.property.applySchemaTask"></a>
|
|
1435
|
-
|
|
1436
|
-
```typescript
|
|
1437
|
-
public readonly applySchemaTask: Task;
|
|
1438
|
-
```
|
|
1439
|
-
|
|
1440
|
-
- *Type:* projen.Task
|
|
1441
|
-
|
|
1442
|
-
---
|
|
1443
|
-
|
|
1444
1446
|
##### `buildExtensionTask`<sup>Required</sup> <a name="buildExtensionTask" id="@wbce/projen-d9.D9Project.property.buildExtensionTask"></a>
|
|
1445
1447
|
|
|
1446
1448
|
```typescript
|
|
@@ -1461,20 +1463,20 @@ public readonly cacheService: DockerComposeService;
|
|
|
1461
1463
|
|
|
1462
1464
|
---
|
|
1463
1465
|
|
|
1464
|
-
##### `
|
|
1466
|
+
##### `d9Service`<sup>Required</sup> <a name="d9Service" id="@wbce/projen-d9.D9Project.property.d9Service"></a>
|
|
1465
1467
|
|
|
1466
1468
|
```typescript
|
|
1467
|
-
public readonly
|
|
1469
|
+
public readonly d9Service: DockerComposeService;
|
|
1468
1470
|
```
|
|
1469
1471
|
|
|
1470
1472
|
- *Type:* projen.DockerComposeService
|
|
1471
1473
|
|
|
1472
1474
|
---
|
|
1473
1475
|
|
|
1474
|
-
##### `
|
|
1476
|
+
##### `databaseService`<sup>Required</sup> <a name="databaseService" id="@wbce/projen-d9.D9Project.property.databaseService"></a>
|
|
1475
1477
|
|
|
1476
1478
|
```typescript
|
|
1477
|
-
public readonly
|
|
1479
|
+
public readonly databaseService: DockerComposeService;
|
|
1478
1480
|
```
|
|
1479
1481
|
|
|
1480
1482
|
- *Type:* projen.DockerComposeService
|
|
@@ -1602,6 +1604,7 @@ new DirectusProject(options: D9ProjectOptions)
|
|
|
1602
1604
|
| <code><a href="#@wbce/projen-d9.DirectusProject.renderWorkflowSetup">renderWorkflowSetup</a></code> | Returns the set of workflow steps which should be executed to bootstrap a workflow. |
|
|
1603
1605
|
| <code><a href="#@wbce/projen-d9.DirectusProject.setScript">setScript</a></code> | Replaces the contents of an npm package.json script. |
|
|
1604
1606
|
| <code><a href="#@wbce/projen-d9.DirectusProject.addExtension">addExtension</a></code> | *No description.* |
|
|
1607
|
+
| <code><a href="#@wbce/projen-d9.DirectusProject.configurePlumbing">configurePlumbing</a></code> | *No description.* |
|
|
1605
1608
|
|
|
1606
1609
|
---
|
|
1607
1610
|
|
|
@@ -2167,6 +2170,18 @@ public addExtension(name: string, extensionTypes: D9ExtensionType[], options?: A
|
|
|
2167
2170
|
|
|
2168
2171
|
---
|
|
2169
2172
|
|
|
2173
|
+
##### ~~`configurePlumbing`~~ <a name="configurePlumbing" id="@wbce/projen-d9.DirectusProject.configurePlumbing"></a>
|
|
2174
|
+
|
|
2175
|
+
```typescript
|
|
2176
|
+
public configurePlumbing(options: PlumbingOptions): void
|
|
2177
|
+
```
|
|
2178
|
+
|
|
2179
|
+
###### `options`<sup>Required</sup> <a name="options" id="@wbce/projen-d9.DirectusProject.configurePlumbing.parameter.options"></a>
|
|
2180
|
+
|
|
2181
|
+
- *Type:* <a href="#@wbce/projen-d9.PlumbingOptions">PlumbingOptions</a>
|
|
2182
|
+
|
|
2183
|
+
---
|
|
2184
|
+
|
|
2170
2185
|
#### Static Functions <a name="Static Functions" id="Static Functions"></a>
|
|
2171
2186
|
|
|
2172
2187
|
| **Name** | **Description** |
|
|
@@ -2301,11 +2316,10 @@ When given a project, this it the project itself.
|
|
|
2301
2316
|
| <code><a href="#@wbce/projen-d9.DirectusProject.property.release">release</a></code> | <code>projen.release.Release</code> | Release management. |
|
|
2302
2317
|
| <code><a href="#@wbce/projen-d9.DirectusProject.property.upgradeWorkflow">upgradeWorkflow</a></code> | <code>projen.javascript.UpgradeDependencies</code> | The upgrade workflow. |
|
|
2303
2318
|
| <code><a href="#@wbce/projen-d9.DirectusProject.property.githubConfig">githubConfig</a></code> | <code>@wbce/projen-shared.GitHubConfig</code> | *No description.* |
|
|
2304
|
-
| <code><a href="#@wbce/projen-d9.DirectusProject.property.applySchemaTask">applySchemaTask</a></code> | <code>projen.Task</code> | *No description.* |
|
|
2305
2319
|
| <code><a href="#@wbce/projen-d9.DirectusProject.property.buildExtensionTask">buildExtensionTask</a></code> | <code>projen.Task</code> | *No description.* |
|
|
2306
2320
|
| <code><a href="#@wbce/projen-d9.DirectusProject.property.cacheService">cacheService</a></code> | <code>projen.DockerComposeService</code> | *No description.* |
|
|
2321
|
+
| <code><a href="#@wbce/projen-d9.DirectusProject.property.d9Service">d9Service</a></code> | <code>projen.DockerComposeService</code> | *No description.* |
|
|
2307
2322
|
| <code><a href="#@wbce/projen-d9.DirectusProject.property.databaseService">databaseService</a></code> | <code>projen.DockerComposeService</code> | *No description.* |
|
|
2308
|
-
| <code><a href="#@wbce/projen-d9.DirectusProject.property.directusService">directusService</a></code> | <code>projen.DockerComposeService</code> | *No description.* |
|
|
2309
2323
|
| <code><a href="#@wbce/projen-d9.DirectusProject.property.dockerComposeFile">dockerComposeFile</a></code> | <code>projen.DockerCompose</code> | *No description.* |
|
|
2310
2324
|
| <code><a href="#@wbce/projen-d9.DirectusProject.property.dockerfile">dockerfile</a></code> | <code>@wbce/projen-shared.Dockerfile</code> | *No description.* |
|
|
2311
2325
|
| <code><a href="#@wbce/projen-d9.DirectusProject.property.extensionFolder">extensionFolder</a></code> | <code>string</code> | *No description.* |
|
|
@@ -3071,18 +3085,6 @@ public readonly githubConfig: GitHubConfig;
|
|
|
3071
3085
|
|
|
3072
3086
|
---
|
|
3073
3087
|
|
|
3074
|
-
##### ~~`applySchemaTask`~~<sup>Required</sup> <a name="applySchemaTask" id="@wbce/projen-d9.DirectusProject.property.applySchemaTask"></a>
|
|
3075
|
-
|
|
3076
|
-
- *Deprecated:* Use {@link D9Project } instead. The package was renamed to `@wbce/projen-d9` to reflect that it targets the d9 fork, not upstream Directus.
|
|
3077
|
-
|
|
3078
|
-
```typescript
|
|
3079
|
-
public readonly applySchemaTask: Task;
|
|
3080
|
-
```
|
|
3081
|
-
|
|
3082
|
-
- *Type:* projen.Task
|
|
3083
|
-
|
|
3084
|
-
---
|
|
3085
|
-
|
|
3086
3088
|
##### ~~`buildExtensionTask`~~<sup>Required</sup> <a name="buildExtensionTask" id="@wbce/projen-d9.DirectusProject.property.buildExtensionTask"></a>
|
|
3087
3089
|
|
|
3088
3090
|
- *Deprecated:* Use {@link D9Project } instead. The package was renamed to `@wbce/projen-d9` to reflect that it targets the d9 fork, not upstream Directus.
|
|
@@ -3107,24 +3109,24 @@ public readonly cacheService: DockerComposeService;
|
|
|
3107
3109
|
|
|
3108
3110
|
---
|
|
3109
3111
|
|
|
3110
|
-
##### ~~`
|
|
3112
|
+
##### ~~`d9Service`~~<sup>Required</sup> <a name="d9Service" id="@wbce/projen-d9.DirectusProject.property.d9Service"></a>
|
|
3111
3113
|
|
|
3112
3114
|
- *Deprecated:* Use {@link D9Project } instead. The package was renamed to `@wbce/projen-d9` to reflect that it targets the d9 fork, not upstream Directus.
|
|
3113
3115
|
|
|
3114
3116
|
```typescript
|
|
3115
|
-
public readonly
|
|
3117
|
+
public readonly d9Service: DockerComposeService;
|
|
3116
3118
|
```
|
|
3117
3119
|
|
|
3118
3120
|
- *Type:* projen.DockerComposeService
|
|
3119
3121
|
|
|
3120
3122
|
---
|
|
3121
3123
|
|
|
3122
|
-
##### ~~`
|
|
3124
|
+
##### ~~`databaseService`~~<sup>Required</sup> <a name="databaseService" id="@wbce/projen-d9.DirectusProject.property.databaseService"></a>
|
|
3123
3125
|
|
|
3124
3126
|
- *Deprecated:* Use {@link D9Project } instead. The package was renamed to `@wbce/projen-d9` to reflect that it targets the d9 fork, not upstream Directus.
|
|
3125
3127
|
|
|
3126
3128
|
```typescript
|
|
3127
|
-
public readonly
|
|
3129
|
+
public readonly databaseService: DockerComposeService;
|
|
3128
3130
|
```
|
|
3129
3131
|
|
|
3130
3132
|
- *Type:* projen.DockerComposeService
|
|
@@ -8426,6 +8428,73 @@ public readonly packageVersions: PackageVersions;
|
|
|
8426
8428
|
|
|
8427
8429
|
---
|
|
8428
8430
|
|
|
8431
|
+
### IntermediateStorageOptions <a name="IntermediateStorageOptions" id="@wbce/projen-d9.IntermediateStorageOptions"></a>
|
|
8432
|
+
|
|
8433
|
+
Storage shared between environments, used by `d9-plumbing save` and `d9-plumbing apply-schema` to transfer files.
|
|
8434
|
+
|
|
8435
|
+
#### Initializer <a name="Initializer" id="@wbce/projen-d9.IntermediateStorageOptions.Initializer"></a>
|
|
8436
|
+
|
|
8437
|
+
```typescript
|
|
8438
|
+
import { IntermediateStorageOptions } from '@wbce/projen-d9'
|
|
8439
|
+
|
|
8440
|
+
const intermediateStorageOptions: IntermediateStorageOptions = { ... }
|
|
8441
|
+
```
|
|
8442
|
+
|
|
8443
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
8444
|
+
|
|
8445
|
+
| **Name** | **Type** | **Description** |
|
|
8446
|
+
| --- | --- | --- |
|
|
8447
|
+
| <code><a href="#@wbce/projen-d9.IntermediateStorageOptions.property.driver">driver</a></code> | <code>string</code> | The storage driver: s3, gcs, azure, local or cloudinary. |
|
|
8448
|
+
| <code><a href="#@wbce/projen-d9.IntermediateStorageOptions.property.options">options</a></code> | <code>{[ key: string ]: string}</code> | Non-secret driver options (root, bucket, region, endpoint...). |
|
|
8449
|
+
| <code><a href="#@wbce/projen-d9.IntermediateStorageOptions.property.secretEnv">secretEnv</a></code> | <code>{[ key: string ]: string}</code> | Secret driver options, mapping each option name to the name of the environment variable holding its value. |
|
|
8450
|
+
|
|
8451
|
+
---
|
|
8452
|
+
|
|
8453
|
+
##### `driver`<sup>Required</sup> <a name="driver" id="@wbce/projen-d9.IntermediateStorageOptions.property.driver"></a>
|
|
8454
|
+
|
|
8455
|
+
```typescript
|
|
8456
|
+
public readonly driver: string;
|
|
8457
|
+
```
|
|
8458
|
+
|
|
8459
|
+
- *Type:* string
|
|
8460
|
+
|
|
8461
|
+
The storage driver: s3, gcs, azure, local or cloudinary.
|
|
8462
|
+
|
|
8463
|
+
---
|
|
8464
|
+
|
|
8465
|
+
##### `options`<sup>Optional</sup> <a name="options" id="@wbce/projen-d9.IntermediateStorageOptions.property.options"></a>
|
|
8466
|
+
|
|
8467
|
+
```typescript
|
|
8468
|
+
public readonly options: {[ key: string ]: string};
|
|
8469
|
+
```
|
|
8470
|
+
|
|
8471
|
+
- *Type:* {[ key: string ]: string}
|
|
8472
|
+
|
|
8473
|
+
Non-secret driver options (root, bucket, region, endpoint...).
|
|
8474
|
+
|
|
8475
|
+
---
|
|
8476
|
+
|
|
8477
|
+
##### `secretEnv`<sup>Optional</sup> <a name="secretEnv" id="@wbce/projen-d9.IntermediateStorageOptions.property.secretEnv"></a>
|
|
8478
|
+
|
|
8479
|
+
```typescript
|
|
8480
|
+
public readonly secretEnv: {[ key: string ]: string};
|
|
8481
|
+
```
|
|
8482
|
+
|
|
8483
|
+
- *Type:* {[ key: string ]: string}
|
|
8484
|
+
|
|
8485
|
+
Secret driver options, mapping each option name to the name of the environment variable holding its value.
|
|
8486
|
+
|
|
8487
|
+
Only the variable name is written to `d9-plumbing.json`, never the value: it is read from the environment (or `.env`) at runtime.
|
|
8488
|
+
|
|
8489
|
+
---
|
|
8490
|
+
|
|
8491
|
+
*Example*
|
|
8492
|
+
|
|
8493
|
+
```typescript
|
|
8494
|
+
{ key: 'S3_ACCESS_KEY_ID_ENV_VAR', secret: 'S3_SECRET_ACCESS_KEY_ENV_VAR' } // the `secret` option is read from $S3_SECRET_ACCESS_KEY_ENV_VAR
|
|
8495
|
+
```
|
|
8496
|
+
|
|
8497
|
+
|
|
8429
8498
|
### PackageVersions <a name="PackageVersions" id="@wbce/projen-d9.PackageVersions"></a>
|
|
8430
8499
|
|
|
8431
8500
|
#### Initializer <a name="Initializer" id="@wbce/projen-d9.PackageVersions.Initializer"></a>
|
|
@@ -8440,7 +8509,7 @@ const packageVersions: PackageVersions = { ... }
|
|
|
8440
8509
|
|
|
8441
8510
|
| **Name** | **Type** | **Description** |
|
|
8442
8511
|
| --- | --- | --- |
|
|
8443
|
-
| <code><a href="#@wbce/projen-d9.PackageVersions.property.atlas">atlas</a></code> | <code>string</code> | The version of. |
|
|
8512
|
+
| <code><a href="#@wbce/projen-d9.PackageVersions.property.atlas">atlas</a></code> | <code>string</code> | The version of the Atlas binary downloaded by d9-plumbing. |
|
|
8444
8513
|
| <code><a href="#@wbce/projen-d9.PackageVersions.property.d9">d9</a></code> | <code>string</code> | *No description.* |
|
|
8445
8514
|
|
|
8446
8515
|
---
|
|
@@ -8452,9 +8521,9 @@ public readonly atlas: string;
|
|
|
8452
8521
|
```
|
|
8453
8522
|
|
|
8454
8523
|
- *Type:* string
|
|
8455
|
-
- *Default:* "
|
|
8524
|
+
- *Default:* "1.3.3"
|
|
8456
8525
|
|
|
8457
|
-
The version of.
|
|
8526
|
+
The version of the Atlas binary downloaded by d9-plumbing.
|
|
8458
8527
|
|
|
8459
8528
|
---
|
|
8460
8529
|
|
|
@@ -8468,5 +8537,52 @@ public readonly d9: string;
|
|
|
8468
8537
|
|
|
8469
8538
|
---
|
|
8470
8539
|
|
|
8540
|
+
### PlumbingOptions <a name="PlumbingOptions" id="@wbce/projen-d9.PlumbingOptions"></a>
|
|
8541
|
+
|
|
8542
|
+
Configuration of the d9-plumbing CLI, written to `d9-plumbing.json`.
|
|
8543
|
+
|
|
8544
|
+
#### Initializer <a name="Initializer" id="@wbce/projen-d9.PlumbingOptions.Initializer"></a>
|
|
8545
|
+
|
|
8546
|
+
```typescript
|
|
8547
|
+
import { PlumbingOptions } from '@wbce/projen-d9'
|
|
8548
|
+
|
|
8549
|
+
const plumbingOptions: PlumbingOptions = { ... }
|
|
8550
|
+
```
|
|
8551
|
+
|
|
8552
|
+
#### Properties <a name="Properties" id="Properties"></a>
|
|
8553
|
+
|
|
8554
|
+
| **Name** | **Type** | **Description** |
|
|
8555
|
+
| --- | --- | --- |
|
|
8556
|
+
| <code><a href="#@wbce/projen-d9.PlumbingOptions.property.intermediateStorage">intermediateStorage</a></code> | <code><a href="#@wbce/projen-d9.IntermediateStorageOptions">IntermediateStorageOptions</a></code> | Storage shared between environments. |
|
|
8557
|
+
| <code><a href="#@wbce/projen-d9.PlumbingOptions.property.logLevel">logLevel</a></code> | <code>string</code> | Default log level of the CLI, overridden by the LOG_LEVEL environment variable. |
|
|
8558
|
+
|
|
8559
|
+
---
|
|
8560
|
+
|
|
8561
|
+
##### `intermediateStorage`<sup>Optional</sup> <a name="intermediateStorage" id="@wbce/projen-d9.PlumbingOptions.property.intermediateStorage"></a>
|
|
8562
|
+
|
|
8563
|
+
```typescript
|
|
8564
|
+
public readonly intermediateStorage: IntermediateStorageOptions;
|
|
8565
|
+
```
|
|
8566
|
+
|
|
8567
|
+
- *Type:* <a href="#@wbce/projen-d9.IntermediateStorageOptions">IntermediateStorageOptions</a>
|
|
8568
|
+
- *Default:* none, the intermediate storage is configured with INTERMEDIATE_STORAGE_* variables or flags
|
|
8569
|
+
|
|
8570
|
+
Storage shared between environments.
|
|
8571
|
+
|
|
8572
|
+
---
|
|
8573
|
+
|
|
8574
|
+
##### `logLevel`<sup>Optional</sup> <a name="logLevel" id="@wbce/projen-d9.PlumbingOptions.property.logLevel"></a>
|
|
8575
|
+
|
|
8576
|
+
```typescript
|
|
8577
|
+
public readonly logLevel: string;
|
|
8578
|
+
```
|
|
8579
|
+
|
|
8580
|
+
- *Type:* string
|
|
8581
|
+
- *Default:* "debug"
|
|
8582
|
+
|
|
8583
|
+
Default log level of the CLI, overridden by the LOG_LEVEL environment variable.
|
|
8584
|
+
|
|
8585
|
+
---
|
|
8586
|
+
|
|
8471
8587
|
|
|
8472
8588
|
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
# @wbce/projen-directus
|
|
2
2
|
|
|
3
|
+
## 0.1.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 266e601: Add the `d9-to-cedar` and `cedar-to-d9` CLI commands, porting the Cedar permission
|
|
8
|
+
translation validated in app-api2. `d9-to-cedar` generates one folder of Cedar policies per
|
|
9
|
+
role from `directus_permissions.csv`; `cedar-to-d9` merges them back into the CSV and runs
|
|
10
|
+
as part of `apply-schema` whenever a `./permissions` folder is present.
|
|
11
|
+
|
|
12
|
+
### Patch Changes
|
|
13
|
+
|
|
14
|
+
- b5f28f4: new save schema command
|
|
15
|
+
|
|
16
|
+
## 0.0.28
|
|
17
|
+
|
|
18
|
+
### Patch Changes
|
|
19
|
+
|
|
20
|
+
- Updated dependencies [e348f46]
|
|
21
|
+
- @wbce/projen-d9-extension@0.0.15
|
|
22
|
+
|
|
3
23
|
## 0.0.27
|
|
4
24
|
|
|
5
25
|
### Patch Changes
|
package/README.md
CHANGED
|
@@ -2,6 +2,7 @@
|
|
|
2
2
|
|
|
3
3
|
Projen template for [d9](https://github.com/LaWebcapsule/d9) projects (fork of Directus v9). Scaffolds a local development setup with Docker Compose (Postgres + Redis), extension management, and GitHub workflows — then produces a Docker image you can deploy to any environment.
|
|
4
4
|
|
|
5
|
+
The generated stack (Docker Compose, first run) and `d9-plumbing` assume PostgreSQL as the d9 database; extensions, the Dockerfile and the GitHub workflows do not depend on it. Support for other databases may be added in the future.
|
|
5
6
|
|
|
6
7
|
Companion package: [`@wbce/projen-d9-extension`](../directus-extension) for authoring extensions.
|
|
7
8
|
|
|
@@ -61,10 +62,16 @@ Extensions live under `./plugins/` (configurable via `extensionsFolderName`) and
|
|
|
61
62
|
| Task | Description |
|
|
62
63
|
| --- | --- |
|
|
63
64
|
| `first-run` | Boot the stack, create admin, start d9 |
|
|
64
|
-
| `run` | Start d9 (`docker compose up
|
|
65
|
+
| `run` | Start d9 (`docker compose up d9`) |
|
|
65
66
|
| `build-extensions` | Install and build all extensions |
|
|
66
67
|
| `create-an-admin` | Create the default admin user |
|
|
67
68
|
|
|
69
|
+
## d9-plumbing CLI
|
|
70
|
+
|
|
71
|
+
The package ships the `d9-plumbing` CLI to save a d9 instance (schema, data, files, Cedar permissions) into the repository and apply it to other environments. See [docs/D9-plumbing.md](./docs/D9-plumbing.md).
|
|
72
|
+
|
|
73
|
+
`d9-plumbing` currently supports PostgreSQL only. Support for other databases may be added in the future.
|
|
74
|
+
|
|
68
75
|
## What gets generated
|
|
69
76
|
|
|
70
77
|
- `docker-compose.yml` — d9, Postgres (PostGIS), Redis with healthchecks
|
|
@@ -77,6 +84,6 @@ Extensions live under `./plugins/` (configurable via `extensionsFolderName`) and
|
|
|
77
84
|
See [API.md](./API.md) for the full `D9ProjectOptions` reference. Highlights:
|
|
78
85
|
|
|
79
86
|
- `extensionsFolderName` — folder for extension packages (default: `plugins`)
|
|
80
|
-
- `packageVersions.d9` — version of `@wbce-d9/directus9` (default: `12.0.
|
|
81
|
-
- `packageVersions.atlas` — version of
|
|
87
|
+
- `packageVersions.d9` — version of `@wbce-d9/directus9` (default: `12.0.15`)
|
|
88
|
+
- `packageVersions.atlas` — version of the Atlas Community Edition binary (Apache 2.0) that `d9-plumbing` downloads from release.ariga.io on first use, cached in `node_modules/.cache/d9-plumbing` (default: `1.3.3`)
|
|
82
89
|
- `githubConfig` — `GitHubConfigOptions` or `false` to disable
|
|
@@ -0,0 +1,189 @@
|
|
|
1
|
+
# d9-plumbing
|
|
2
|
+
|
|
3
|
+
`d9-plumbing` is the CLI shipped with `@wbce/projen-d9`. It saves the state of a d9 instance (schema, configuration data, files, permissions) into the repository and applies it to another instance.
|
|
4
|
+
|
|
5
|
+
Run it from the root of the d9 project, either directly or through the generated projen task:
|
|
6
|
+
|
|
7
|
+
```sh
|
|
8
|
+
npx d9-plumbing <command> [options]
|
|
9
|
+
npx projen d9-plumbing <command> [options]
|
|
10
|
+
npx d9-plumbing --help # list commands
|
|
11
|
+
npx d9-plumbing <command> --help # list the options of a command
|
|
12
|
+
```
|
|
13
|
+
|
|
14
|
+
It works with the following files of the project:
|
|
15
|
+
|
|
16
|
+
| Path | Content |
|
|
17
|
+
| --- | --- |
|
|
18
|
+
| `sql/schema.sql` | Database schema, dumped with Atlas |
|
|
19
|
+
| `sql/data/*.csv` | Content of the d9 configuration tables |
|
|
20
|
+
| `sql/tables_to_dump.txt` | Optional, extra tables to dump (one per line) |
|
|
21
|
+
| `sql/tables_not_to_dump.txt` | Optional, tables never to dump (one per line) |
|
|
22
|
+
| `permissions/<Role>/*.cedar` | Permissions as Cedar policies, generated from `sql/data/directus_permissions.csv` |
|
|
23
|
+
| `d9-plumbing.json` | CLI configuration, generated by projen |
|
|
24
|
+
|
|
25
|
+
## Configuration
|
|
26
|
+
|
|
27
|
+
The d9 environment (`.env`, environment variables) is read through `@wbce-d9/api`, resolved from the d9 project, so the CLI uses the same configuration as d9 itself.
|
|
28
|
+
|
|
29
|
+
### Database
|
|
30
|
+
|
|
31
|
+
| Flag | Fallback |
|
|
32
|
+
| --- | --- |
|
|
33
|
+
| `--host <host>` | `DB_HOST` |
|
|
34
|
+
| `--user <user>` | `DB_USER` |
|
|
35
|
+
| `--password <password>` | `DB_PASSWORD` |
|
|
36
|
+
| `--database <database>` | `DB_DATABASE` |
|
|
37
|
+
| `--ssl` | `DB_SSL`, or any nested `DB_SSL__*` key (Directus syntax, e.g. `DB_SSL__REJECT_UNAUTHORIZED`) |
|
|
38
|
+
|
|
39
|
+
### Current storage
|
|
40
|
+
|
|
41
|
+
The storage of the d9 instance: the first location of `STORAGE_LOCATIONS`, configured by `STORAGE_<LOCATION>_*`. Each entry can be overridden with the repeatable `--storage-config key=value` flag (nested keys use dots, e.g. `--storage-config driver=s3 --storage-config bucket=my-bucket`).
|
|
42
|
+
|
|
43
|
+
### Intermediate storage
|
|
44
|
+
|
|
45
|
+
A storage shared between environments, used to transfer the files referenced by `sql/data/directus_files.csv`. It is resolved from, by increasing priority:
|
|
46
|
+
|
|
47
|
+
1. `intermediateStorage` in `d9-plumbing.json` (`driver`, `options`, and `secretEnv` which maps an option to the name of the environment variable holding its value). Set it with `project.configurePlumbing({ intermediateStorage })` in `.projenrc`, e.g. `secretEnv: { secret: 'S3_SECRET_ACCESS_KEY_ENV_VAR' }` sets the `secret` option to the value of `$S3_SECRET_ACCESS_KEY_ENV_VAR` at runtime.
|
|
48
|
+
2. `INTERMEDIATE_STORAGE_*` environment variables (e.g. `INTERMEDIATE_STORAGE_DRIVER=s3`).
|
|
49
|
+
3. The repeatable `--intermediate-storage-config key=value` flag.
|
|
50
|
+
|
|
51
|
+
`save`, `apply-schema` and `first-import` skip the file sync when no intermediate storage is configured, or when it is disabled with `--no-files` or `SKIP_FILE_SYNC=true`.
|
|
52
|
+
|
|
53
|
+
### Logging
|
|
54
|
+
|
|
55
|
+
The log level is `LOG_LEVEL`, else `logLevel` in `d9-plumbing.json` (`project.configurePlumbing({ logLevel })`), else `debug`.
|
|
56
|
+
|
|
57
|
+
### Atlas
|
|
58
|
+
|
|
59
|
+
The schema is dumped and diffed with [Atlas](https://atlasgo.io/) Community Edition. The binary is downloaded from release.ariga.io on first use and cached in `node_modules/.cache/d9-plumbing`. Its version is set by `packageVersions.atlas`.
|
|
60
|
+
|
|
61
|
+
## Commands
|
|
62
|
+
|
|
63
|
+
### `save`
|
|
64
|
+
|
|
65
|
+
Saves the current d9 into the repository, then pushes its files to the intermediate storage.
|
|
66
|
+
|
|
67
|
+
1. Dumps the schema into `sql/schema.sql`.
|
|
68
|
+
2. Empties `sql/data` and dumps one CSV per table: every `directus_*` table except `directus_users`, `directus_sessions`, `directus_revisions`, `directus_activity` and `directus_presets`, plus the tables of `sql/tables_to_dump.txt`, minus those of `sql/tables_not_to_dump.txt`. Columns referencing a user are replaced by a fixed CI user. `directus_files` and `directus_folders` are limited to the `d9-plumbing-common` folder and its subfolders.
|
|
69
|
+
3. Regenerates the Cedar policies in `permissions/` (see [`d9-to-cedar`](#d9-to-cedar)).
|
|
70
|
+
4. Pushes the files to the intermediate storage (see [`push-files`](#push-files--pull-files)), unless the [file sync is skipped](#intermediate-storage).
|
|
71
|
+
|
|
72
|
+
Options: [database](#database), [storage](#current-storage), [intermediate storage](#intermediate-storage), `--no-cedar` to skip step 3, `--no-files` to skip step 4.
|
|
73
|
+
|
|
74
|
+
```sh
|
|
75
|
+
npx d9-plumbing save
|
|
76
|
+
```
|
|
77
|
+
|
|
78
|
+
### `apply-schema`
|
|
79
|
+
|
|
80
|
+
Applies the saved state of the repository to the current d9.
|
|
81
|
+
|
|
82
|
+
1. Checks that the current d9 has no unsaved changes (see [`check-unsaved`](#check-unsaved)).
|
|
83
|
+
2. Pulls the files from the intermediate storage, unless the [file sync is skipped](#intermediate-storage).
|
|
84
|
+
3. Applies the SQL snapshot and imports the reference tables.
|
|
85
|
+
|
|
86
|
+
Once done, purge the d9 cache (`POST /utils/cache/clear`) so the new schema, and permissions when `CACHE_ENABLED` is set, are taken into account. Restart d9 if flows, operations or webhooks changed.
|
|
87
|
+
|
|
88
|
+
Options: [database](#database), [storage](#current-storage), [intermediate storage](#intermediate-storage), and:
|
|
89
|
+
|
|
90
|
+
| Option | Description |
|
|
91
|
+
| --- | --- |
|
|
92
|
+
| `--last-save <commit>` | Commit of the last save of this environment, required |
|
|
93
|
+
| `--no-last-save` | Skip the unsaved changes check (asks for confirmation) |
|
|
94
|
+
| `--yes` | Do not ask for confirmation |
|
|
95
|
+
| `--no-files` | Skip step 2 |
|
|
96
|
+
|
|
97
|
+
```sh
|
|
98
|
+
npx d9-plumbing apply-schema --last-save 1b3387a
|
|
99
|
+
```
|
|
100
|
+
|
|
101
|
+
### `first-import`
|
|
102
|
+
|
|
103
|
+
Initializes an empty d9 database: applies the snapshot, then pulls the files if an intermediate storage is configured. Does nothing if the database already contains `directus_*` tables. Called by the `first-run` task (`npx projen first-run`).
|
|
104
|
+
|
|
105
|
+
Options: [database](#database), [storage](#current-storage), [intermediate storage](#intermediate-storage), `--no-files` to skip the file sync.
|
|
106
|
+
|
|
107
|
+
```sh
|
|
108
|
+
npx d9-plumbing first-import --host localhost --user d9 --password d9 --database d9
|
|
109
|
+
```
|
|
110
|
+
|
|
111
|
+
### `check-unsaved`
|
|
112
|
+
|
|
113
|
+
Fails if the current d9 differs from the state saved at `--last-save`. It compares the result of a fresh save with the `sql/` folder of the `--last-save` commit. Run by `apply-schema` before applying anything.
|
|
114
|
+
|
|
115
|
+
Options: [database](#database), `--last-save <commit>`, `--no-last-save`, `--yes` (see [`apply-schema`](#apply-schema)).
|
|
116
|
+
|
|
117
|
+
```sh
|
|
118
|
+
npx d9-plumbing check-unsaved --last-save 1b3387a
|
|
119
|
+
```
|
|
120
|
+
|
|
121
|
+
### `push-files` / `pull-files`
|
|
122
|
+
|
|
123
|
+
Syncs the files listed in `sql/data/directus_files.csv` from the current storage to the intermediate storage (`push-files`), or the other way (`pull-files`). Run by `save` and `apply-schema`.
|
|
124
|
+
|
|
125
|
+
Only the files of the d9 folder named `d9-plumbing-common` and its subfolders are saved and transferred: `save` dumps only those rows of `directus_files` and `directus_folders`, so everything else stays local to its environment. Put the files shared by all environments (logos, default images...) in `d9-plumbing-common`.
|
|
126
|
+
|
|
127
|
+
Options: [storage](#current-storage), [intermediate storage](#intermediate-storage).
|
|
128
|
+
|
|
129
|
+
```sh
|
|
130
|
+
npx d9-plumbing push-files
|
|
131
|
+
```
|
|
132
|
+
|
|
133
|
+
### `d9-to-cedar`
|
|
134
|
+
|
|
135
|
+
Deletes the permissions folder and regenerates it from `directus_permissions.csv` and `directus_roles.csv`. Each role gets a folder with:
|
|
136
|
+
|
|
137
|
+
- `authorize.cedar` — which actions the role can do on which collections, with their filters,
|
|
138
|
+
- `check-fields.cedar` — the fields allowed per action,
|
|
139
|
+
- `validate.cedar` — the validation rules.
|
|
140
|
+
|
|
141
|
+
Policies sharing the same conditions are grouped into a single `action in [...]` policy. Permissions without a role are in the `Public` folder. Run by `save`.
|
|
142
|
+
|
|
143
|
+
| Option | Default | Description |
|
|
144
|
+
| --- | --- | --- |
|
|
145
|
+
| `--permissions <path>` | `./permissions` | Cedar policies folder |
|
|
146
|
+
| `--sql <path>` | `./sql/data` | CSV folder |
|
|
147
|
+
|
|
148
|
+
### `cedar-to-d9`
|
|
149
|
+
|
|
150
|
+
The reverse of `d9-to-cedar`: reads the Cedar policies and merges them into `directus_permissions.csv`. The `permissions`, `fields` and `validation` columns are rewritten; the other columns (`id`, `role`, `presets`) are kept from the existing CSV. A (role, collection, action) added in Cedar creates a row, one removed from Cedar deletes its row. Every role folder must match a role of `directus_roles.csv` (except `Public`).
|
|
151
|
+
|
|
152
|
+
| Option | Default | Description |
|
|
153
|
+
| --- | --- | --- |
|
|
154
|
+
| `--permissions <path>` | `./permissions` | Cedar policies folder |
|
|
155
|
+
| `--sql <path>` | `./sql/data` | CSV folder |
|
|
156
|
+
| `--output <path>` | `<sql>/directus_permissions.csv` | Output CSV |
|
|
157
|
+
|
|
158
|
+
### `sync`
|
|
159
|
+
|
|
160
|
+
Not implemented yet.
|
|
161
|
+
|
|
162
|
+
## Workflows
|
|
163
|
+
|
|
164
|
+
### Promote changes to another environment
|
|
165
|
+
|
|
166
|
+
1. Make the changes in d9 on the source environment (usually local).
|
|
167
|
+
2. `npx d9-plumbing save`, commit `sql/` and `permissions/`, merge.
|
|
168
|
+
3. On the target environment, from the merged commit: `npx d9-plumbing apply-schema --last-save <commit of the last save of the target>`. If the target has changes that were never saved, the command fails: run `save` there first, commit and merge, then retry.
|
|
169
|
+
4. Purge the d9 cache of the target.
|
|
170
|
+
|
|
171
|
+
### Modify a permission with Cedar
|
|
172
|
+
|
|
173
|
+
1. Edit the policies in `permissions/<Role>/*.cedar`.
|
|
174
|
+
2. Write them back into the CSV:
|
|
175
|
+
|
|
176
|
+
```sh
|
|
177
|
+
npx d9-plumbing cedar-to-d9
|
|
178
|
+
```
|
|
179
|
+
|
|
180
|
+
3. Review the result with `git diff sql/data/directus_permissions.csv`.
|
|
181
|
+
4. Apply it to the local d9. The local database has not changed since the last commit, so use `HEAD` as the last save:
|
|
182
|
+
|
|
183
|
+
```sh
|
|
184
|
+
npx d9-plumbing apply-schema --last-save HEAD
|
|
185
|
+
```
|
|
186
|
+
|
|
187
|
+
5. Purge the d9 cache and check the permissions in d9.
|
|
188
|
+
6. Optionally run `npx d9-plumbing d9-to-cedar` to normalize the Cedar files (grouping, ordering) as the next `save` will.
|
|
189
|
+
7. Commit the `.cedar` files and the CSV together, then promote them as above.
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
export declare const DEFAULT_ATLAS_VERSION = "1.3.3";
|
|
2
|
+
/**
|
|
3
|
+
* Name of the Atlas release file, e.g. atlas-community-linux-amd64-v1.3.3
|
|
4
|
+
*/
|
|
5
|
+
export declare function atlasFileName(version: string, platform?: string, arch?: string): string;
|
|
6
|
+
/**
|
|
7
|
+
* Downloads the Atlas Community Edition binary (Apache 2.0) in the version configured in d9-plumbing.json and returns its path.
|
|
8
|
+
* The binary is cached in node_modules/.cache/d9-plumbing.
|
|
9
|
+
*/
|
|
10
|
+
export declare function ensureAtlas(): Promise<string>;
|
package/lib/cli/atlas.js
ADDED
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DEFAULT_ATLAS_VERSION = void 0;
|
|
4
|
+
exports.atlasFileName = atlasFileName;
|
|
5
|
+
exports.ensureAtlas = ensureAtlas;
|
|
6
|
+
const crypto_1 = require("crypto");
|
|
7
|
+
const fs_1 = require("fs");
|
|
8
|
+
const promises_1 = require("fs/promises");
|
|
9
|
+
const path_1 = require("path");
|
|
10
|
+
const logger_1 = require("./logger");
|
|
11
|
+
const plumbing_config_1 = require("./plumbing-config");
|
|
12
|
+
exports.DEFAULT_ATLAS_VERSION = '1.3.3';
|
|
13
|
+
const RELEASE_SERVER = 'https://release.ariga.io/atlas';
|
|
14
|
+
// resolved at startup: check-unsaved changes the cwd to a worktree without node_modules
|
|
15
|
+
const CACHE_DIR = (0, path_1.resolve)('./node_modules/.cache/d9-plumbing');
|
|
16
|
+
const PLATFORMS = { darwin: 'darwin', linux: 'linux' };
|
|
17
|
+
const ARCHS = { x64: 'amd64', arm64: 'arm64' };
|
|
18
|
+
/**
|
|
19
|
+
* Name of the Atlas release file, e.g. atlas-community-linux-amd64-v1.3.3
|
|
20
|
+
*/
|
|
21
|
+
function atlasFileName(version, platform = process.platform, arch = process.arch) {
|
|
22
|
+
const os = PLATFORMS[platform];
|
|
23
|
+
const cpu = ARCHS[arch];
|
|
24
|
+
if (!os || !cpu) {
|
|
25
|
+
throw new Error(`atlas is not available for ${platform}-${arch} (supported: darwin/linux, x64/arm64)`);
|
|
26
|
+
}
|
|
27
|
+
return `atlas-community-${os}-${cpu}-v${version}`;
|
|
28
|
+
}
|
|
29
|
+
async function download(url) {
|
|
30
|
+
const response = await fetch(url);
|
|
31
|
+
if (!response.ok) {
|
|
32
|
+
throw new Error(`failed to download ${url}: ${response.status} ${response.statusText}`);
|
|
33
|
+
}
|
|
34
|
+
return Buffer.from(await response.arrayBuffer());
|
|
35
|
+
}
|
|
36
|
+
/**
|
|
37
|
+
* Downloads the Atlas Community Edition binary (Apache 2.0) in the version configured in d9-plumbing.json and returns its path.
|
|
38
|
+
* The binary is cached in node_modules/.cache/d9-plumbing.
|
|
39
|
+
*/
|
|
40
|
+
async function ensureAtlas() {
|
|
41
|
+
const config = (0, plumbing_config_1.readPlumbingConfig)();
|
|
42
|
+
const fileName = atlasFileName(config.atlasVersion ?? exports.DEFAULT_ATLAS_VERSION);
|
|
43
|
+
const binPath = (0, path_1.join)(CACHE_DIR, fileName);
|
|
44
|
+
if ((0, fs_1.existsSync)(binPath)) {
|
|
45
|
+
return binPath;
|
|
46
|
+
}
|
|
47
|
+
logger_1.logger.info(`Downloading ${fileName}`);
|
|
48
|
+
const [binary, checksumFile] = await Promise.all([
|
|
49
|
+
download(`${RELEASE_SERVER}/${fileName}`),
|
|
50
|
+
download(`${RELEASE_SERVER}/${fileName}.sha256`),
|
|
51
|
+
]);
|
|
52
|
+
const expected = checksumFile.toString().trim().split(/\s+/)[0];
|
|
53
|
+
const actual = (0, crypto_1.createHash)('sha256').update(binary).digest('hex');
|
|
54
|
+
if (actual !== expected) {
|
|
55
|
+
throw new Error(`checksum mismatch for ${fileName}: expected ${expected}, got ${actual}`);
|
|
56
|
+
}
|
|
57
|
+
await (0, promises_1.mkdir)(CACHE_DIR, { recursive: true });
|
|
58
|
+
// written then renamed, so an interrupted download never leaves a broken binary in the cache
|
|
59
|
+
const tmpPath = `${binPath}.tmp`;
|
|
60
|
+
await (0, promises_1.writeFile)(tmpPath, binary);
|
|
61
|
+
await (0, promises_1.chmod)(tmpPath, 0o755);
|
|
62
|
+
await (0, promises_1.rename)(tmpPath, binPath);
|
|
63
|
+
return binPath;
|
|
64
|
+
}
|
|
65
|
+
//# sourceMappingURL=data:application/json;base64,eyJ2ZXJzaW9uIjozLCJmaWxlIjoiYXRsYXMuanMiLCJzb3VyY2VSb290IjoiIiwic291cmNlcyI6WyIuLi8uLi9zcmMvY2xpL2F0bGFzLnRzIl0sIm5hbWVzIjpbXSwibWFwcGluZ3MiOiI7OztBQW1CQSxzQ0FPQztBQWNELGtDQTBCQztBQWxFRCxtQ0FBb0M7QUFDcEMsMkJBQWdDO0FBQ2hDLDBDQUE4RDtBQUM5RCwrQkFBcUM7QUFDckMscUNBQWtDO0FBQ2xDLHVEQUF1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