target-supabase-sdk 0.2.0 → 0.2.2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +130 -11
- package/dist/browser.d.ts +44 -36
- package/dist/browser.d.ts.map +1 -1
- package/dist/browser.js +6 -45
- package/dist/browser.js.map +1 -1
- package/dist/chunks/create-logger-DyH3mZ8p.js +1028 -0
- package/dist/chunks/create-logger-DyH3mZ8p.js.map +1 -0
- package/dist/chunks/enable-log-persist-BH-tbKEj.js +1481 -0
- package/dist/chunks/enable-log-persist-BH-tbKEj.js.map +1 -0
- package/dist/chunks/word.interface-DLgRobKV.js +1973 -0
- package/dist/chunks/word.interface-DLgRobKV.js.map +1 -0
- package/dist/command/command.api.d.ts +1 -1
- package/dist/command/command.api.d.ts.map +1 -1
- package/dist/command/command.interface.d.ts +1 -1
- package/dist/command/command.interface.d.ts.map +1 -1
- package/dist/core.api.d.ts +10 -6
- package/dist/core.api.d.ts.map +1 -1
- package/dist/core.interface.d.ts +3 -2
- package/dist/core.interface.d.ts.map +1 -1
- package/dist/core.utils.d.ts +1 -1
- package/dist/core.utils.d.ts.map +1 -1
- package/dist/idea/idea.interface.d.ts +1 -1
- package/dist/idea/idea.interface.d.ts.map +1 -1
- package/dist/link/link.api.d.ts +1 -1
- package/dist/link/link.api.d.ts.map +1 -1
- package/dist/link/link.interface.d.ts +2 -2
- package/dist/link/link.interface.d.ts.map +1 -1
- package/dist/list/list.api.d.ts +3 -1
- package/dist/list/list.api.d.ts.map +1 -1
- package/dist/list/list.interface.d.ts +2 -2
- package/dist/list/list.interface.d.ts.map +1 -1
- package/dist/node/env/env-parsers.d.ts +19 -0
- package/dist/node/env/env-parsers.d.ts.map +1 -0
- package/dist/node/env/index.d.ts +11 -0
- package/dist/node/env/index.d.ts.map +1 -0
- package/dist/node/env/init-supabase-from-env.d.ts +17 -0
- package/dist/node/env/init-supabase-from-env.d.ts.map +1 -0
- package/dist/node/env/load-env.d.ts +20 -0
- package/dist/node/env/load-env.d.ts.map +1 -0
- package/dist/node/env/project-root.d.ts +11 -0
- package/dist/node/env/project-root.d.ts.map +1 -0
- package/dist/node/env/public-base-url.d.ts +10 -0
- package/dist/node/env/public-base-url.d.ts.map +1 -0
- package/dist/node/env/require-env.d.ts +3 -0
- package/dist/node/env/require-env.d.ts.map +1 -0
- package/dist/node/fs/json-state-store.d.ts +19 -0
- package/dist/node/fs/json-state-store.d.ts.map +1 -0
- package/dist/node/fs/read-source-file.d.ts +19 -0
- package/dist/node/fs/read-source-file.d.ts.map +1 -0
- package/dist/node/node-liveness.d.ts +30 -0
- package/dist/node/node-liveness.d.ts.map +1 -0
- package/dist/node/node-runtime.base.d.ts +21 -3
- package/dist/node/node-runtime.base.d.ts.map +1 -1
- package/dist/node/node.api.d.ts +1 -1
- package/dist/node/node.api.d.ts.map +1 -1
- package/dist/node/node.interface.d.ts +1 -6
- package/dist/node/node.interface.d.ts.map +1 -1
- package/dist/node/preload/run-service-preload.d.ts +14 -0
- package/dist/node/preload/run-service-preload.d.ts.map +1 -0
- package/dist/node/preload/service-preload.interface.d.ts +15 -0
- package/dist/node/preload/service-preload.interface.d.ts.map +1 -0
- package/dist/node/process/index.d.ts +5 -0
- package/dist/node/process/index.d.ts.map +1 -0
- package/dist/node/process/managed-child-processes.d.ts +37 -0
- package/dist/node/process/managed-child-processes.d.ts.map +1 -0
- package/dist/node/process/process-spawn.d.ts +27 -0
- package/dist/node/process/process-spawn.d.ts.map +1 -0
- package/dist/node/readiness/index.d.ts +9 -0
- package/dist/node/readiness/index.d.ts.map +1 -0
- package/dist/node/readiness/poll-until.d.ts +11 -0
- package/dist/node/readiness/poll-until.d.ts.map +1 -0
- package/dist/node/readiness/readiness-checks.d.ts +22 -0
- package/dist/node/readiness/readiness-checks.d.ts.map +1 -0
- package/dist/node/readiness/readiness.types.d.ts +12 -0
- package/dist/node/readiness/readiness.types.d.ts.map +1 -0
- package/dist/node/readiness/run-readiness-checks.d.ts +4 -0
- package/dist/node/readiness/run-readiness-checks.d.ts.map +1 -0
- package/dist/node/readiness/service-ready-gate.d.ts +26 -0
- package/dist/node/readiness/service-ready-gate.d.ts.map +1 -0
- package/dist/node.d.ts +26 -12
- package/dist/node.d.ts.map +1 -1
- package/dist/node.js +2482 -18
- package/dist/node.js.map +1 -1
- package/dist/parcel/chunk-fetch-registry.d.ts +14 -0
- package/dist/parcel/chunk-fetch-registry.d.ts.map +1 -0
- package/dist/parcel/chunk-url.utils.d.ts +9 -0
- package/dist/parcel/chunk-url.utils.d.ts.map +1 -0
- package/dist/parcel/parcel-manager.d.ts +44 -20
- package/dist/parcel/parcel-manager.d.ts.map +1 -1
- package/dist/parcel/parcel.api.d.ts +306 -0
- package/dist/parcel/parcel.api.d.ts.map +1 -0
- package/dist/parcel/parcel.interface.d.ts +26 -5
- package/dist/parcel/parcel.interface.d.ts.map +1 -1
- package/dist/parcel/parcel.service.d.ts +38 -0
- package/dist/parcel/parcel.service.d.ts.map +1 -0
- package/dist/parcel/storage-provider-registry.d.ts +17 -0
- package/dist/parcel/storage-provider-registry.d.ts.map +1 -0
- package/dist/parcel/storage-provider.types.d.ts +31 -0
- package/dist/parcel/storage-provider.types.d.ts.map +1 -0
- package/dist/preload.d.ts +7 -0
- package/dist/preload.d.ts.map +1 -0
- package/dist/preload.js +47 -0
- package/dist/preload.js.map +1 -0
- package/dist/repo/repo-context.utils.d.ts.map +1 -1
- package/dist/repo/repo-manager.d.ts +1 -1
- package/dist/repo/repo-manager.d.ts.map +1 -1
- package/dist/repo/repo.api.d.ts +1 -1
- package/dist/repo/repo.api.d.ts.map +1 -1
- package/dist/repo/repo.interface.d.ts +1 -1
- package/dist/repo/repo.interface.d.ts.map +1 -1
- package/dist/repo/repo.script-loader.d.ts +3 -3
- package/dist/repo/repo.script-loader.d.ts.map +1 -1
- package/dist/service/base.interface.d.ts +54 -57
- package/dist/service/base.interface.d.ts.map +1 -1
- package/dist/service/index.d.ts +21 -0
- package/dist/service/index.d.ts.map +1 -0
- package/dist/service/service.api.d.ts +503 -0
- package/dist/service/service.api.d.ts.map +1 -0
- package/dist/service/service.interface.d.ts +36 -9
- package/dist/service/service.interface.d.ts.map +1 -1
- package/dist/shared/http/fetch-retry.d.ts +21 -0
- package/dist/shared/http/fetch-retry.d.ts.map +1 -0
- package/dist/shared/log/create-logger.d.ts +27 -0
- package/dist/shared/log/create-logger.d.ts.map +1 -0
- package/dist/shared/log/enable-log-persist.d.ts +28 -0
- package/dist/shared/log/enable-log-persist.d.ts.map +1 -0
- package/dist/shared/log/index.d.ts +6 -6
- package/dist/shared/log/index.d.ts.map +1 -1
- package/dist/shared/log/log-manager.d.ts +25 -27
- package/dist/shared/log/log-manager.d.ts.map +1 -1
- package/dist/shared/log/log-persist-batch-id.d.ts +13 -0
- package/dist/shared/log/log-persist-batch-id.d.ts.map +1 -0
- package/dist/shared/log/log-persist-flush.d.ts +8 -0
- package/dist/shared/log/log-persist-flush.d.ts.map +1 -0
- package/dist/shared/log/log-persist-hook.d.ts +6 -0
- package/dist/shared/log/log-persist-hook.d.ts.map +1 -0
- package/dist/shared/log/log-persist-logger.d.ts +15 -0
- package/dist/shared/log/log-persist-logger.d.ts.map +1 -0
- package/dist/shared/log/log-persist-registry.d.ts +18 -0
- package/dist/shared/log/log-persist-registry.d.ts.map +1 -0
- package/dist/shared/log/log-persist.config.d.ts +10 -0
- package/dist/shared/log/log-persist.config.d.ts.map +1 -0
- package/dist/shared/log/log-persist.d.ts +55 -0
- package/dist/shared/log/log-persist.d.ts.map +1 -0
- package/dist/shared/log/log-persist.interface.d.ts +116 -0
- package/dist/shared/log/log-persist.interface.d.ts.map +1 -0
- package/dist/shared/log/log-scope.d.ts +25 -18
- package/dist/shared/log/log-scope.d.ts.map +1 -1
- package/dist/shared/utils/fetch-url.d.ts +3 -0
- package/dist/shared/utils/fetch-url.d.ts.map +1 -0
- package/dist/shared/utils/network-error.d.ts +14 -0
- package/dist/shared/utils/network-error.d.ts.map +1 -0
- package/dist/shared/utils/safe-file-name.d.ts +14 -0
- package/dist/shared/utils/safe-file-name.d.ts.map +1 -0
- package/dist/shared/utils/sha256.d.ts +3 -0
- package/dist/shared/utils/sha256.d.ts.map +1 -0
- package/dist/supabase.d.ts +7 -2
- package/dist/supabase.d.ts.map +1 -1
- package/dist/task/index.d.ts +8 -7
- package/dist/task/index.d.ts.map +1 -1
- package/dist/task/local-task-registry.d.ts +1 -1
- package/dist/task/local-task-registry.d.ts.map +1 -1
- package/dist/task/task-manager.d.ts +7 -9
- package/dist/task/task-manager.d.ts.map +1 -1
- package/dist/{node → task}/task-node.d.ts +2 -3
- package/dist/task/task-node.d.ts.map +1 -0
- package/dist/task/task-post-validated.api.d.ts +19 -0
- package/dist/task/task-post-validated.api.d.ts.map +1 -0
- package/dist/task/task-post.api.d.ts +10 -5
- package/dist/task/task-post.api.d.ts.map +1 -1
- package/dist/task/task-queue.d.ts +7 -0
- package/dist/task/task-queue.d.ts.map +1 -0
- package/dist/task/task-repo-context.d.ts.map +1 -1
- package/dist/task/task-repo-validation.d.ts +2 -2
- package/dist/task/task-repo-validation.d.ts.map +1 -1
- package/dist/task/task.api.d.ts +13 -13
- package/dist/task/task.api.d.ts.map +1 -1
- package/dist/task/task.constant.d.ts +4 -0
- package/dist/task/task.constant.d.ts.map +1 -0
- package/dist/task/task.interface.d.ts +1 -1
- package/dist/task/task.interface.d.ts.map +1 -1
- package/dist/trigger/trigger-manager.d.ts +25 -0
- package/dist/trigger/trigger-manager.d.ts.map +1 -0
- package/dist/trigger/trigger-node.d.ts +23 -0
- package/dist/trigger/trigger-node.d.ts.map +1 -0
- package/dist/trigger/trigger.api.d.ts +4 -4
- package/dist/trigger/trigger.api.d.ts.map +1 -1
- package/dist/trigger/trigger.constant.d.ts +8 -0
- package/dist/trigger/trigger.constant.d.ts.map +1 -0
- package/dist/trigger/trigger.interface.d.ts +46 -2
- package/dist/trigger/trigger.interface.d.ts.map +1 -1
- package/dist/word/word.api.d.ts +1 -1
- package/dist/word/word.api.d.ts.map +1 -1
- package/dist/word/word.interface.d.ts +2 -2
- package/dist/word/word.interface.d.ts.map +1 -1
- package/package.json +84 -74
- package/src/browser.ts +144 -79
- package/src/command/command.api.ts +19 -17
- package/src/command/command.interface.ts +2 -3
- package/src/core.api.ts +466 -477
- package/src/core.interface.ts +63 -62
- package/src/core.utils.ts +64 -64
- package/src/idea/idea.interface.ts +3 -3
- package/src/link/link.api.ts +28 -30
- package/src/link/link.interface.ts +3 -4
- package/src/list/list.api.ts +50 -29
- package/src/list/list.interface.ts +3 -4
- package/src/node/env/env-parsers.ts +77 -0
- package/src/node/env/index.ts +10 -0
- package/src/node/env/init-supabase-from-env.ts +38 -0
- package/src/node/env/load-env.ts +67 -0
- package/src/node/env/project-root.ts +34 -0
- package/src/node/env/public-base-url.ts +18 -0
- package/src/node/env/require-env.ts +15 -0
- package/src/node/fs/json-state-store.ts +97 -0
- package/src/node/fs/read-source-file.ts +75 -0
- package/src/node/node-liveness.ts +80 -0
- package/src/node/node-runtime.base.ts +135 -104
- package/src/node/node.api.ts +11 -10
- package/src/node/node.interface.ts +1 -8
- package/src/node/node.utils.ts +1 -1
- package/src/node/preload/run-service-preload.ts +48 -0
- package/src/node/preload/service-preload.interface.ts +14 -0
- package/src/node/process/index.ts +8 -0
- package/src/node/process/managed-child-processes.ts +121 -0
- package/src/node/process/process-spawn.ts +61 -0
- package/src/node/readiness/index.ts +20 -0
- package/src/node/readiness/poll-until.ts +27 -0
- package/src/node/readiness/readiness-checks.ts +79 -0
- package/src/node/readiness/readiness.types.ts +13 -0
- package/src/node/readiness/run-readiness-checks.ts +20 -0
- package/src/node/readiness/service-ready-gate.ts +65 -0
- package/src/node.ts +138 -47
- package/src/parcel/chunk-fetch-registry.ts +96 -0
- package/src/parcel/chunk-url.utils.ts +30 -0
- package/src/parcel/parcel-manager.ts +431 -173
- package/src/parcel/parcel.api.ts +103 -0
- package/src/parcel/parcel.interface.ts +44 -23
- package/src/parcel/parcel.service.ts +79 -0
- package/src/parcel/storage-provider-registry.ts +49 -0
- package/src/parcel/storage-provider.types.ts +45 -0
- package/src/preload.ts +7 -0
- package/src/repo/repo-context.utils.ts +3 -4
- package/src/repo/repo-manager.ts +7 -20
- package/src/repo/repo.api.ts +5 -5
- package/src/repo/repo.interface.ts +1 -2
- package/src/repo/repo.script-loader.ts +4 -8
- package/src/service/base.interface.ts +81 -90
- package/src/service/index.ts +173 -0
- package/src/service/service.api.ts +294 -0
- package/src/service/service.interface.ts +49 -17
- package/src/shared/http/fetch-retry.ts +145 -0
- package/src/shared/log/create-logger.ts +51 -0
- package/src/shared/log/enable-log-persist.ts +225 -0
- package/src/shared/log/index.ts +19 -11
- package/src/shared/log/log-manager.ts +65 -69
- package/src/shared/log/log-persist-batch-id.ts +43 -0
- package/src/shared/log/log-persist-flush.ts +128 -0
- package/src/shared/log/log-persist-hook.ts +13 -0
- package/src/shared/log/log-persist-logger.ts +33 -0
- package/src/shared/log/log-persist-registry.ts +252 -0
- package/src/shared/log/log-persist.config.ts +97 -0
- package/src/shared/log/log-persist.interface.ts +132 -0
- package/src/shared/log/log-persist.ts +704 -0
- package/src/shared/log/log-scope.ts +46 -46
- package/src/shared/utils/config-path.utils.ts +1 -1
- package/src/shared/utils/fetch-url.ts +13 -0
- package/src/shared/utils/network-error.ts +152 -0
- package/src/shared/utils/safe-file-name.ts +37 -0
- package/src/shared/utils/sha256.ts +15 -0
- package/src/supabase.ts +125 -119
- package/src/task/index.ts +31 -34
- package/src/task/local-task-registry.ts +9 -17
- package/src/task/task-manager.ts +34 -35
- package/src/{node → task}/task-node.ts +91 -73
- package/src/task/task-post-validated.api.ts +47 -0
- package/src/task/task-post.api.ts +81 -98
- package/src/task/task-queue.ts +18 -0
- package/src/task/task-repo-context.ts +2 -1
- package/src/task/task-repo-validation.ts +6 -8
- package/src/task/task.api.ts +61 -25
- package/src/task/task.constant.ts +4 -0
- package/src/task/task.interface.ts +4 -7
- package/src/trigger/trigger-manager.ts +287 -0
- package/src/trigger/trigger-node.ts +80 -0
- package/src/trigger/trigger.api.ts +11 -11
- package/src/trigger/trigger.constant.ts +10 -0
- package/src/trigger/trigger.interface.ts +52 -2
- package/src/trigger/trigger.utils.ts +1 -1
- package/src/word/word.api.ts +28 -30
- package/src/word/word.interface.ts +3 -4
- package/dist/auth/auth.api.d.ts +0 -28
- package/dist/auth/auth.api.d.ts.map +0 -1
- package/dist/auth/auth.api.js +0 -51
- package/dist/auth/auth.api.js.map +0 -1
- package/dist/command/command.api.js +0 -58
- package/dist/command/command.api.js.map +0 -1
- package/dist/command/command.interface.js +0 -9
- package/dist/command/command.interface.js.map +0 -1
- package/dist/core.api.js +0 -412
- package/dist/core.api.js.map +0 -1
- package/dist/core.interface.js +0 -46
- package/dist/core.interface.js.map +0 -1
- package/dist/core.utils.js +0 -81
- package/dist/core.utils.js.map +0 -1
- package/dist/feed/feed.interface.d.ts +0 -27
- package/dist/feed/feed.interface.d.ts.map +0 -1
- package/dist/feed/feed.interface.js +0 -17
- package/dist/feed/feed.interface.js.map +0 -1
- package/dist/file/file-manager.d.ts +0 -24
- package/dist/file/file-manager.d.ts.map +0 -1
- package/dist/file/file-manager.js +0 -109
- package/dist/file/file-manager.js.map +0 -1
- package/dist/file/file.api.d.ts +0 -15
- package/dist/file/file.api.d.ts.map +0 -1
- package/dist/file/file.api.js +0 -30
- package/dist/file/file.api.js.map +0 -1
- package/dist/file/file.interface.d.ts +0 -25
- package/dist/file/file.interface.d.ts.map +0 -1
- package/dist/file/file.interface.js +0 -9
- package/dist/file/file.interface.js.map +0 -1
- package/dist/file-list/file-list.api.d.ts +0 -15
- package/dist/file-list/file-list.api.d.ts.map +0 -1
- package/dist/file-list/file-list.api.js +0 -54
- package/dist/file-list/file-list.api.js.map +0 -1
- package/dist/file-list/file-list.interface.d.ts +0 -22
- package/dist/file-list/file-list.interface.d.ts.map +0 -1
- package/dist/file-list/file-list.interface.js +0 -5
- package/dist/file-list/file-list.interface.js.map +0 -1
- package/dist/idea/idea.interface.js +0 -15
- package/dist/idea/idea.interface.js.map +0 -1
- package/dist/index.js +0 -3
- package/dist/index.js.map +0 -1
- package/dist/link/link.api.js +0 -30
- package/dist/link/link.api.js.map +0 -1
- package/dist/link/link.interface.js +0 -7
- package/dist/link/link.interface.js.map +0 -1
- package/dist/list/list.api.js +0 -30
- package/dist/list/list.api.js.map +0 -1
- package/dist/list/list.interface.js +0 -6
- package/dist/list/list.interface.js.map +0 -1
- package/dist/node/node-log-scope.d.ts +0 -11
- package/dist/node/node-log-scope.d.ts.map +0 -1
- package/dist/node/node-log-scope.js +0 -7
- package/dist/node/node-log-scope.js.map +0 -1
- package/dist/node/node-runtime.base.js +0 -397
- package/dist/node/node-runtime.base.js.map +0 -1
- package/dist/node/node-task.preset.d.ts +0 -1
- package/dist/node/node-task.preset.d.ts.map +0 -1
- package/dist/node/node-task.preset.js +0 -14
- package/dist/node/node-task.preset.js.map +0 -1
- package/dist/node/node.api.js +0 -100
- package/dist/node/node.api.js.map +0 -1
- package/dist/node/node.interface.js +0 -19
- package/dist/node/node.interface.js.map +0 -1
- package/dist/node/node.utils.js +0 -36
- package/dist/node/node.utils.js.map +0 -1
- package/dist/node/task-node.d.ts.map +0 -1
- package/dist/node/task-node.js +0 -245
- package/dist/node/task-node.js.map +0 -1
- package/dist/node/trigger-node.d.ts +0 -18
- package/dist/node/trigger-node.d.ts.map +0 -1
- package/dist/node/trigger-node.js +0 -150
- package/dist/node/trigger-node.js.map +0 -1
- package/dist/parcel/parcel-manager.js +0 -156
- package/dist/parcel/parcel-manager.js.map +0 -1
- package/dist/parcel/parcel.interface.js +0 -11
- package/dist/parcel/parcel.interface.js.map +0 -1
- package/dist/question-list/question-list.api.d.ts +0 -13
- package/dist/question-list/question-list.api.d.ts.map +0 -1
- package/dist/question-list/question-list.api.js +0 -35
- package/dist/question-list/question-list.api.js.map +0 -1
- package/dist/question-list/question-list.interface.d.ts +0 -18
- package/dist/question-list/question-list.interface.d.ts.map +0 -1
- package/dist/question-list/question-list.interface.js +0 -5
- package/dist/question-list/question-list.interface.js.map +0 -1
- package/dist/repo/repo-context.utils.js +0 -81
- package/dist/repo/repo-context.utils.js.map +0 -1
- package/dist/repo/repo-manager.js +0 -166
- package/dist/repo/repo-manager.js.map +0 -1
- package/dist/repo/repo.api.js +0 -40
- package/dist/repo/repo.api.js.map +0 -1
- package/dist/repo/repo.interface.js +0 -8
- package/dist/repo/repo.interface.js.map +0 -1
- package/dist/repo/repo.script-loader.js +0 -108
- package/dist/repo/repo.script-loader.js.map +0 -1
- package/dist/review/review.api.d.ts +0 -14
- package/dist/review/review.api.d.ts.map +0 -1
- package/dist/review/review.api.js +0 -133
- package/dist/review/review.api.js.map +0 -1
- package/dist/review/review.interface.d.ts +0 -24
- package/dist/review/review.interface.d.ts.map +0 -1
- package/dist/review/review.interface.js +0 -10
- package/dist/review/review.interface.js.map +0 -1
- package/dist/review-v2/apis/post-review-setting.api.d.ts +0 -12
- package/dist/review-v2/apis/post-review-setting.api.d.ts.map +0 -1
- package/dist/review-v2/apis/post-review-setting.api.js +0 -27
- package/dist/review-v2/apis/post-review-setting.api.js.map +0 -1
- package/dist/review-v2/apis/post-review.api.d.ts +0 -13
- package/dist/review-v2/apis/post-review.api.d.ts.map +0 -1
- package/dist/review-v2/apis/post-review.api.js +0 -46
- package/dist/review-v2/apis/post-review.api.js.map +0 -1
- package/dist/review-v2/review-setting.interface.d.ts +0 -23
- package/dist/review-v2/review-setting.interface.d.ts.map +0 -1
- package/dist/review-v2/review-setting.interface.js +0 -5
- package/dist/review-v2/review-setting.interface.js.map +0 -1
- package/dist/review-v2/review.interface.d.ts +0 -20
- package/dist/review-v2/review.interface.d.ts.map +0 -1
- package/dist/review-v2/review.interface.js +0 -5
- package/dist/review-v2/review.interface.js.map +0 -1
- package/dist/service/api.interface.d.ts +0 -35
- package/dist/service/api.interface.d.ts.map +0 -1
- package/dist/service/api.interface.js +0 -12
- package/dist/service/api.interface.js.map +0 -1
- package/dist/service/base.interface.js +0 -7
- package/dist/service/base.interface.js.map +0 -1
- package/dist/service/service.interface.js +0 -11
- package/dist/service/service.interface.js.map +0 -1
- package/dist/shared/log/create-api-logger.d.ts +0 -21
- package/dist/shared/log/create-api-logger.d.ts.map +0 -1
- package/dist/shared/log/create-api-logger.js +0 -19
- package/dist/shared/log/create-api-logger.js.map +0 -1
- package/dist/shared/log/index.js +0 -10
- package/dist/shared/log/index.js.map +0 -1
- package/dist/shared/log/log-manager.js +0 -237
- package/dist/shared/log/log-manager.js.map +0 -1
- package/dist/shared/log/log-scope.js +0 -70
- package/dist/shared/log/log-scope.js.map +0 -1
- package/dist/shared/utils/config-path.utils.js +0 -85
- package/dist/shared/utils/config-path.utils.js.map +0 -1
- package/dist/shared/utils/error.utils.js +0 -15
- package/dist/shared/utils/error.utils.js.map +0 -1
- package/dist/shared/utils/id.utils.js +0 -5
- package/dist/shared/utils/id.utils.js.map +0 -1
- package/dist/supabase.js +0 -100
- package/dist/supabase.js.map +0 -1
- package/dist/task/index.js +0 -14
- package/dist/task/index.js.map +0 -1
- package/dist/task/local-task-registry.js +0 -214
- package/dist/task/local-task-registry.js.map +0 -1
- package/dist/task/task-manager.js +0 -196
- package/dist/task/task-manager.js.map +0 -1
- package/dist/task/task-post.api.js +0 -91
- package/dist/task/task-post.api.js.map +0 -1
- package/dist/task/task-repo-context.js +0 -12
- package/dist/task/task-repo-context.js.map +0 -1
- package/dist/task/task-repo-validation.js +0 -96
- package/dist/task/task-repo-validation.js.map +0 -1
- package/dist/task/task.api.js +0 -303
- package/dist/task/task.api.js.map +0 -1
- package/dist/task/task.interface.js +0 -36
- package/dist/task/task.interface.js.map +0 -1
- package/dist/task/task.utils.js +0 -2
- package/dist/task/task.utils.js.map +0 -1
- package/dist/trigger/trigger.api.js +0 -125
- package/dist/trigger/trigger.api.js.map +0 -1
- package/dist/trigger/trigger.interface.js +0 -11
- package/dist/trigger/trigger.interface.js.map +0 -1
- package/dist/trigger/trigger.utils.js +0 -39
- package/dist/trigger/trigger.utils.js.map +0 -1
- package/dist/word/word.api.js +0 -30
- package/dist/word/word.api.js.map +0 -1
- package/dist/word/word.interface.js +0 -6
- package/dist/word/word.interface.js.map +0 -1
- package/src/auth/auth.api.ts +0 -87
- package/src/feed/feed.interface.ts +0 -33
- package/src/file/file-manager.ts +0 -145
- package/src/file/file.api.ts +0 -43
- package/src/file/file.interface.ts +0 -30
- package/src/file-list/file-list.api.ts +0 -64
- package/src/file-list/file-list.interface.ts +0 -24
- package/src/node/node-log-scope.ts +0 -15
- package/src/node/node-task.preset.ts +0 -13
- package/src/node/trigger-node.ts +0 -180
- package/src/question-list/question-list.api.ts +0 -42
- package/src/question-list/question-list.interface.ts +0 -21
- package/src/review/review.api.ts +0 -145
- package/src/review/review.interface.ts +0 -26
- package/src/review-v2/apis/post-review-setting.api.ts +0 -35
- package/src/review-v2/apis/post-review.api.ts +0 -59
- package/src/review-v2/review-setting.interface.ts +0 -26
- package/src/review-v2/review.interface.ts +0 -23
- package/src/service/api.interface.ts +0 -47
- package/src/shared/log/create-api-logger.ts +0 -36
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
|
|
4
|
+
const DEFAULT_ENV_FILES = [".env.local", ".env"] as const;
|
|
5
|
+
|
|
6
|
+
export interface LoadEnvFilesOptions {
|
|
7
|
+
/** Files to load in order (later files do not override existing env). */
|
|
8
|
+
files?: readonly string[];
|
|
9
|
+
env?: NodeJS.ProcessEnv;
|
|
10
|
+
/** Called after all files are merged (e.g. legacy alias normalization). */
|
|
11
|
+
afterLoad?: () => void;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
function stripQuotes(value: string): string {
|
|
15
|
+
return value.replace(/^["']|["']$/g, "");
|
|
16
|
+
}
|
|
17
|
+
|
|
18
|
+
/** Parse one KEY=VALUE line; returns null if line should be skipped. */
|
|
19
|
+
export function parseEnvLine(line: string): { key: string; value: string } | null {
|
|
20
|
+
const trimmed = line.trim();
|
|
21
|
+
if (trimmed === "" || trimmed.startsWith("#")) {
|
|
22
|
+
return null;
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
const eq = trimmed.indexOf("=");
|
|
26
|
+
if (eq === -1) {
|
|
27
|
+
return null;
|
|
28
|
+
}
|
|
29
|
+
|
|
30
|
+
const key = trimmed.slice(0, eq).trim();
|
|
31
|
+
const raw = trimmed.slice(eq + 1).trim();
|
|
32
|
+
return { key, value: stripQuotes(raw) };
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
export function parseEnvFileContent(content: string, env: NodeJS.ProcessEnv): void {
|
|
36
|
+
for (const line of content.split("\n")) {
|
|
37
|
+
const parsed = parseEnvLine(line);
|
|
38
|
+
if (parsed == null) {
|
|
39
|
+
continue;
|
|
40
|
+
}
|
|
41
|
+
if (env[parsed.key] == null || env[parsed.key] === "") {
|
|
42
|
+
env[parsed.key] = parsed.value;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
|
|
47
|
+
export function parseEnvFile(filePath: string, env: NodeJS.ProcessEnv): void {
|
|
48
|
+
if (!existsSync(filePath)) {
|
|
49
|
+
return;
|
|
50
|
+
}
|
|
51
|
+
parseEnvFileContent(readFileSync(filePath, "utf8"), env);
|
|
52
|
+
}
|
|
53
|
+
|
|
54
|
+
/**
|
|
55
|
+
* Load `.env.local` then `.env` into `process.env` (or `options.env`).
|
|
56
|
+
* Existing non-empty env values are not overwritten.
|
|
57
|
+
*/
|
|
58
|
+
export function loadEnvFiles(root: string, options?: LoadEnvFilesOptions): void {
|
|
59
|
+
const env = options?.env ?? process.env;
|
|
60
|
+
const files = options?.files ?? DEFAULT_ENV_FILES;
|
|
61
|
+
|
|
62
|
+
for (const name of files) {
|
|
63
|
+
parseEnvFile(resolve(root, name), env);
|
|
64
|
+
}
|
|
65
|
+
|
|
66
|
+
options?.afterLoad?.();
|
|
67
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { existsSync, readFileSync } from "node:fs";
|
|
2
|
+
import { dirname, resolve } from "node:path";
|
|
3
|
+
import { fileURLToPath } from "node:url";
|
|
4
|
+
|
|
5
|
+
/**
|
|
6
|
+
* Resolve project root from a module URL (typically `import.meta.url`).
|
|
7
|
+
* @param relativePath Path relative to the module file (default `".."` = parent directory).
|
|
8
|
+
*/
|
|
9
|
+
export function resolveProjectRootFromModule(importMetaUrl: string, relativePath = ".."): string {
|
|
10
|
+
return resolve(fileURLToPath(new URL(relativePath, importMetaUrl)));
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
/**
|
|
14
|
+
* Walk upward from `importMetaUrl` until a `package.json` with matching `name` is found.
|
|
15
|
+
* Use for esbuild bundles under `dist/` where a single `..` hop lands in `dist/`, not repo root.
|
|
16
|
+
*/
|
|
17
|
+
export function resolveProjectRootByPackageName(importMetaUrl: string, packageName: string): string {
|
|
18
|
+
let dir = dirname(fileURLToPath(importMetaUrl));
|
|
19
|
+
for (;;) {
|
|
20
|
+
const packageJsonPath = resolve(dir, "package.json");
|
|
21
|
+
if (existsSync(packageJsonPath)) {
|
|
22
|
+
const pkg = JSON.parse(readFileSync(packageJsonPath, "utf8")) as { name?: string };
|
|
23
|
+
if (pkg.name === packageName) {
|
|
24
|
+
return dir;
|
|
25
|
+
}
|
|
26
|
+
}
|
|
27
|
+
const parent = dirname(dir);
|
|
28
|
+
if (parent === dir) {
|
|
29
|
+
break;
|
|
30
|
+
}
|
|
31
|
+
dir = parent;
|
|
32
|
+
}
|
|
33
|
+
throw new Error(`Could not find package root for "${packageName}" from ${importMetaUrl}`);
|
|
34
|
+
}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { readEnv } from "./require-env";
|
|
2
|
+
|
|
3
|
+
export interface PublicBaseUrlFromEnvOptions {
|
|
4
|
+
/** Env var for public URL override (e.g. `STORAGE_PUBLIC_URL`). */
|
|
5
|
+
envKey: string;
|
|
6
|
+
env?: NodeJS.ProcessEnv;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Public base URL: `envKey` if set (trailing slash stripped), else `http://localhost:{port}`.
|
|
11
|
+
*/
|
|
12
|
+
export function publicBaseUrlFromEnv(port: number, options: PublicBaseUrlFromEnvOptions): string {
|
|
13
|
+
const configured = readEnv(options.envKey, options.env ?? process.env);
|
|
14
|
+
if (configured != null) {
|
|
15
|
+
return configured.replace(/\/$/, "");
|
|
16
|
+
}
|
|
17
|
+
return `http://localhost:${port}`;
|
|
18
|
+
}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
export function readEnv(name: string, env: NodeJS.ProcessEnv = process.env): string | undefined {
|
|
2
|
+
const value = env[name]?.trim();
|
|
3
|
+
if (value == null || value === "") {
|
|
4
|
+
return undefined;
|
|
5
|
+
}
|
|
6
|
+
return value;
|
|
7
|
+
}
|
|
8
|
+
|
|
9
|
+
export function requireEnv(name: string, env: NodeJS.ProcessEnv = process.env): string {
|
|
10
|
+
const value = readEnv(name, env);
|
|
11
|
+
if (value == null) {
|
|
12
|
+
throw new Error(`Missing required environment variable: ${name}`);
|
|
13
|
+
}
|
|
14
|
+
return value;
|
|
15
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { mkdir, readFile, rename, writeFile } from "node:fs/promises";
|
|
2
|
+
import { dirname } from "node:path";
|
|
3
|
+
|
|
4
|
+
export type JsonStatePatch<T extends object, NK extends keyof T> = Partial<Omit<T, NK>> & {
|
|
5
|
+
[K in NK]?: T[K] extends object ? Partial<T[K]> : T[K];
|
|
6
|
+
};
|
|
7
|
+
|
|
8
|
+
export interface JsonFileStateStore<T extends object, NK extends keyof T = never> {
|
|
9
|
+
read(): Promise<T>;
|
|
10
|
+
write(patch: JsonStatePatch<T, NK>): Promise<T>;
|
|
11
|
+
reset(): Promise<T>;
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export interface CreateJsonFileStateStoreOptions<T extends object, NK extends keyof T = never> {
|
|
15
|
+
filePath: string;
|
|
16
|
+
defaultState: T;
|
|
17
|
+
/** Top-level keys shallow-merged one level deep on read and write. */
|
|
18
|
+
nestedKeys?: NK[];
|
|
19
|
+
/** When set, assigned `new Date().toISOString()` on write and reset. */
|
|
20
|
+
updatedAtKey?: keyof T;
|
|
21
|
+
}
|
|
22
|
+
|
|
23
|
+
function mergeWithNested<T extends object>(
|
|
24
|
+
defaults: T,
|
|
25
|
+
current: Partial<T> | undefined,
|
|
26
|
+
patch: Partial<T>,
|
|
27
|
+
nestedKeys: (keyof T)[],
|
|
28
|
+
): T {
|
|
29
|
+
const merged = {
|
|
30
|
+
...defaults,
|
|
31
|
+
...current,
|
|
32
|
+
...patch,
|
|
33
|
+
} as T;
|
|
34
|
+
|
|
35
|
+
for (const key of nestedKeys) {
|
|
36
|
+
const defaultNested = defaults[key];
|
|
37
|
+
if (defaultNested != null && typeof defaultNested === "object") {
|
|
38
|
+
(merged as Record<keyof T, unknown>)[key] = {
|
|
39
|
+
...defaultNested,
|
|
40
|
+
...(current?.[key] as object | undefined),
|
|
41
|
+
...(patch[key] as object | undefined),
|
|
42
|
+
};
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
return merged;
|
|
47
|
+
}
|
|
48
|
+
|
|
49
|
+
async function atomicWriteJson(filePath: string, data: unknown): Promise<void> {
|
|
50
|
+
await mkdir(dirname(filePath), { recursive: true });
|
|
51
|
+
const content = `${JSON.stringify(data, null, 2)}\n`;
|
|
52
|
+
const tempPath = `${filePath}.${process.pid}.tmp`;
|
|
53
|
+
await writeFile(tempPath, content, "utf8");
|
|
54
|
+
await rename(tempPath, filePath);
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
/** JSON file-backed state with optional nested key merge and atomic writes. */
|
|
58
|
+
export function createJsonFileStateStore<T extends object, NK extends keyof T = never>(
|
|
59
|
+
options: CreateJsonFileStateStoreOptions<T, NK>,
|
|
60
|
+
): JsonFileStateStore<T, NK> {
|
|
61
|
+
const { filePath, defaultState, nestedKeys = [] as NK[], updatedAtKey } = options;
|
|
62
|
+
|
|
63
|
+
function touchUpdatedAt(state: T): T {
|
|
64
|
+
if (updatedAtKey == null) {
|
|
65
|
+
return state;
|
|
66
|
+
}
|
|
67
|
+
return {
|
|
68
|
+
...state,
|
|
69
|
+
[updatedAtKey]: new Date().toISOString(),
|
|
70
|
+
};
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
return {
|
|
74
|
+
async read(): Promise<T> {
|
|
75
|
+
try {
|
|
76
|
+
const raw = await readFile(filePath, "utf8");
|
|
77
|
+
const parsed = JSON.parse(raw) as Partial<T>;
|
|
78
|
+
return mergeWithNested(defaultState, parsed, {}, nestedKeys);
|
|
79
|
+
} catch {
|
|
80
|
+
return { ...defaultState };
|
|
81
|
+
}
|
|
82
|
+
},
|
|
83
|
+
|
|
84
|
+
async write(patch: JsonStatePatch<T, NK>): Promise<T> {
|
|
85
|
+
const current = await this.read();
|
|
86
|
+
const next = touchUpdatedAt(mergeWithNested(defaultState, current, patch as Partial<T>, nestedKeys));
|
|
87
|
+
await atomicWriteJson(filePath, next);
|
|
88
|
+
return next;
|
|
89
|
+
},
|
|
90
|
+
|
|
91
|
+
async reset(): Promise<T> {
|
|
92
|
+
const next = touchUpdatedAt({ ...defaultState });
|
|
93
|
+
await atomicWriteJson(filePath, next);
|
|
94
|
+
return next;
|
|
95
|
+
},
|
|
96
|
+
};
|
|
97
|
+
}
|
|
@@ -0,0 +1,75 @@
|
|
|
1
|
+
import { access, readFile, stat } from "node:fs/promises";
|
|
2
|
+
import { resolve } from "node:path";
|
|
3
|
+
|
|
4
|
+
import { sha256Hex } from "../../shared/utils/sha256";
|
|
5
|
+
|
|
6
|
+
export interface SourceFilePayload {
|
|
7
|
+
absolutePath: string;
|
|
8
|
+
buffer: ArrayBuffer;
|
|
9
|
+
size: number;
|
|
10
|
+
sha256: string;
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
export interface ReadAndVerifySourceFileOptions {
|
|
14
|
+
/** When set, digest must match or an error is thrown. */
|
|
15
|
+
expectedSha256?: string;
|
|
16
|
+
/** Reject files larger than this many bytes. */
|
|
17
|
+
maxBytes?: number;
|
|
18
|
+
/** When false, allow zero-byte files (default rejects empty). */
|
|
19
|
+
allowEmpty?: boolean;
|
|
20
|
+
}
|
|
21
|
+
|
|
22
|
+
/** Copy a Node.js Buffer view to a standalone ArrayBuffer. */
|
|
23
|
+
export function nodeBufferToArrayBuffer(nodeBuffer: Buffer): ArrayBuffer {
|
|
24
|
+
return nodeBuffer.buffer.slice(nodeBuffer.byteOffset, nodeBuffer.byteOffset + nodeBuffer.byteLength) as ArrayBuffer;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
/** Read a local file with basic validation and SHA-256 digest. */
|
|
28
|
+
export async function readAndVerifySourceFile(
|
|
29
|
+
filePath: string,
|
|
30
|
+
options: ReadAndVerifySourceFileOptions = {},
|
|
31
|
+
): Promise<SourceFilePayload> {
|
|
32
|
+
const absolutePath = resolve(filePath);
|
|
33
|
+
const allowEmpty = options.allowEmpty === true;
|
|
34
|
+
|
|
35
|
+
try {
|
|
36
|
+
await access(absolutePath);
|
|
37
|
+
} catch {
|
|
38
|
+
throw new Error(`Source file not found: ${absolutePath}`);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
const fileStat = await stat(absolutePath);
|
|
42
|
+
if (!fileStat.isFile()) {
|
|
43
|
+
throw new Error(`Source path is not a file: ${absolutePath}`);
|
|
44
|
+
}
|
|
45
|
+
if (!allowEmpty && fileStat.size <= 0) {
|
|
46
|
+
throw new Error(`Source file is empty: ${absolutePath}`);
|
|
47
|
+
}
|
|
48
|
+
if (options.maxBytes != null && fileStat.size > options.maxBytes) {
|
|
49
|
+
throw new Error(`Source file exceeds maxBytes (${fileStat.size} > ${options.maxBytes}): ${absolutePath}`);
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
const nodeBuffer = await readFile(absolutePath);
|
|
53
|
+
const buffer = nodeBufferToArrayBuffer(nodeBuffer);
|
|
54
|
+
|
|
55
|
+
if (buffer.byteLength !== fileStat.size) {
|
|
56
|
+
throw new Error(
|
|
57
|
+
`Source file size mismatch after read (${buffer.byteLength} !== ${fileStat.size}): ${absolutePath}`,
|
|
58
|
+
);
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
const digest = await sha256Hex(buffer);
|
|
62
|
+
|
|
63
|
+
if (options.expectedSha256 != null && digest.toLowerCase() !== options.expectedSha256.toLowerCase()) {
|
|
64
|
+
throw new Error(
|
|
65
|
+
`Source file SHA-256 mismatch (expected ${options.expectedSha256}, got ${digest}): ${absolutePath}`,
|
|
66
|
+
);
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
return {
|
|
70
|
+
absolutePath,
|
|
71
|
+
buffer,
|
|
72
|
+
size: buffer.byteLength,
|
|
73
|
+
sha256: digest,
|
|
74
|
+
};
|
|
75
|
+
}
|
|
@@ -0,0 +1,80 @@
|
|
|
1
|
+
import { type Node, NodeStatus } from "./node.interface";
|
|
2
|
+
|
|
3
|
+
export interface TaskNodeLivenessFreshest {
|
|
4
|
+
nodeId: string;
|
|
5
|
+
status: string;
|
|
6
|
+
lastHeartBeat: string;
|
|
7
|
+
ageMs: number;
|
|
8
|
+
}
|
|
9
|
+
|
|
10
|
+
export interface TaskNodeLivenessReport {
|
|
11
|
+
healthy: boolean;
|
|
12
|
+
staleMs: number;
|
|
13
|
+
/** BUSY nodes with numeric heartbeat after {@link EvaluateBusyNodeLivenessOptions.excludeNodeId}. */
|
|
14
|
+
busyWorkerCount: number;
|
|
15
|
+
/** Subset of candidates with heartbeat age < staleMs. */
|
|
16
|
+
freshWorkerCount: number;
|
|
17
|
+
freshest: TaskNodeLivenessFreshest | null;
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export interface EvaluateBusyNodeLivenessOptions {
|
|
21
|
+
staleMs: number;
|
|
22
|
+
now?: number;
|
|
23
|
+
/** Omit this node id (e.g. supervisor self). */
|
|
24
|
+
excludeNodeId?: string;
|
|
25
|
+
/**
|
|
26
|
+
* When true, pick freshest only among peers already within staleMs (supervisor spawn guard).
|
|
27
|
+
* When false, pick freshest among all BUSY peers then compare age to staleMs (observability).
|
|
28
|
+
*/
|
|
29
|
+
onlyFreshCandidates?: boolean;
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
function isBusyWithHeartbeat(node: Node): boolean {
|
|
33
|
+
return node.details.status === NodeStatus.BUSY && typeof node.details.lastHeartBeat === "number";
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
/** Evaluate TaskNode liveness from a scanned node list (no I/O). */
|
|
37
|
+
export function evaluateBusyNodeLiveness(
|
|
38
|
+
nodes: Node[],
|
|
39
|
+
options: EvaluateBusyNodeLivenessOptions,
|
|
40
|
+
): TaskNodeLivenessReport {
|
|
41
|
+
const now = options.now ?? Date.now();
|
|
42
|
+
const { staleMs, excludeNodeId, onlyFreshCandidates = false } = options;
|
|
43
|
+
|
|
44
|
+
const candidates = nodes.filter(
|
|
45
|
+
(node) => (excludeNodeId == null || node.id !== excludeNodeId) && isBusyWithHeartbeat(node),
|
|
46
|
+
);
|
|
47
|
+
|
|
48
|
+
const busyWorkerCount = candidates.length;
|
|
49
|
+
const freshCandidates = candidates.filter((node) => now - node.details.lastHeartBeat < staleMs);
|
|
50
|
+
const freshWorkerCount = freshCandidates.length;
|
|
51
|
+
|
|
52
|
+
const pool = onlyFreshCandidates ? freshCandidates : candidates;
|
|
53
|
+
|
|
54
|
+
const freshestNode = pool.reduce<Node | null>((best, node) => {
|
|
55
|
+
if (best == null) {
|
|
56
|
+
return node;
|
|
57
|
+
}
|
|
58
|
+
return node.details.lastHeartBeat > best.details.lastHeartBeat ? node : best;
|
|
59
|
+
}, null);
|
|
60
|
+
|
|
61
|
+
const ageMs = freshestNode == null ? Number.POSITIVE_INFINITY : now - freshestNode.details.lastHeartBeat;
|
|
62
|
+
|
|
63
|
+
const healthy = onlyFreshCandidates ? freshestNode != null : freshestNode != null && ageMs < staleMs;
|
|
64
|
+
|
|
65
|
+
return {
|
|
66
|
+
healthy,
|
|
67
|
+
staleMs,
|
|
68
|
+
busyWorkerCount,
|
|
69
|
+
freshWorkerCount,
|
|
70
|
+
freshest:
|
|
71
|
+
freshestNode == null
|
|
72
|
+
? null
|
|
73
|
+
: {
|
|
74
|
+
nodeId: freshestNode.id,
|
|
75
|
+
status: freshestNode.details.status,
|
|
76
|
+
lastHeartBeat: new Date(freshestNode.details.lastHeartBeat).toISOString(),
|
|
77
|
+
ageMs,
|
|
78
|
+
},
|
|
79
|
+
};
|
|
80
|
+
}
|