target-supabase-sdk 0.1.9 → 0.2.1
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 +184 -1
- package/dist/browser.d.ts +60 -0
- package/dist/browser.d.ts.map +1 -0
- package/dist/browser.js +6 -0
- package/dist/browser.js.map +1 -0
- 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-C_bSw6Kx.js +1362 -0
- package/dist/chunks/enable-log-persist-C_bSw6Kx.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/index.d.ts +2 -48
- package/dist/index.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 +3 -3
- 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 +60 -0
- package/dist/node/node-runtime.base.d.ts.map +1 -0
- package/dist/node/node.api.d.ts +4 -4
- 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 +36 -0
- package/dist/node.d.ts.map +1 -0
- package/dist/node.js +2483 -0
- package/dist/node.js.map +1 -0
- 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 +14 -3
- 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 +5 -5
- 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 +10 -0
- package/dist/shared/log/index.d.ts.map +1 -0
- package/dist/shared/log/log-manager.d.ts +37 -60
- 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 +17 -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 +56 -0
- package/dist/shared/log/log-scope.d.ts.map +1 -0
- 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 +16 -0
- package/dist/task/index.d.ts.map +1 -0
- package/dist/task/local-task-registry.d.ts +11 -1
- package/dist/task/local-task-registry.d.ts.map +1 -1
- package/dist/task/task-manager.d.ts +21 -11
- package/dist/task/task-manager.d.ts.map +1 -1
- package/dist/task/task-node.d.ts +19 -0
- 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 +54 -0
- package/dist/task/task-post.api.d.ts.map +1 -0
- 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 +2 -0
- package/dist/task/task-repo-context.d.ts.map +1 -1
- package/dist/task/task-repo-validation.d.ts +46 -0
- package/dist/task/task-repo-validation.d.ts.map +1 -0
- package/dist/task/task.api.d.ts +5 -47
- 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 +3 -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 +140 -0
- package/dist/trigger/trigger.api.d.ts.map +1 -0
- 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 +87 -0
- package/dist/trigger/trigger.interface.d.ts.map +1 -0
- package/dist/trigger/trigger.utils.d.ts +6 -0
- package/dist/trigger/trigger.utils.d.ts.map +1 -0
- 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 +91 -61
- package/src/browser.ts +165 -0
- package/src/command/command.api.ts +20 -18
- 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/index.ts +2 -79
- package/src/link/link.api.ts +28 -30
- package/src/link/link.interface.ts +4 -5
- 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 +481 -0
- package/src/node/node.api.ts +12 -11
- 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 +153 -0
- 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 +54 -39
- package/src/repo/repo.api.ts +5 -5
- package/src/repo/repo.interface.ts +1 -2
- package/src/repo/repo.script-loader.ts +16 -20
- 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 +31 -0
- package/src/shared/log/log-manager.ts +112 -121
- 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 +109 -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 +123 -0
- 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 +45 -0
- package/src/task/local-task-registry.ts +115 -36
- package/src/task/task-manager.ts +101 -113
- package/src/task/task-node.ts +302 -0
- package/src/task/task-post-validated.api.ts +47 -0
- package/src/task/task-post.api.ts +99 -0
- package/src/task/task-queue.ts +18 -0
- package/src/task/task-repo-context.ts +4 -1
- package/src/task/task-repo-validation.ts +169 -0
- package/src/task/task.api.ts +68 -92
- package/src/task/task.constant.ts +4 -0
- package/src/task/task.interface.ts +6 -7
- package/src/trigger/trigger-manager.ts +287 -0
- package/src/trigger/trigger-node.ts +80 -0
- package/src/trigger/trigger.api.ts +166 -0
- package/src/trigger/trigger.constant.ts +10 -0
- package/src/trigger/trigger.interface.ts +100 -0
- package/src/trigger/trigger.utils.ts +56 -0
- 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 -42
- 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-manager.d.ts +0 -48
- package/dist/node/node-manager.d.ts.map +0 -1
- package/dist/node/node-manager.js +0 -619
- package/dist/node/node-manager.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/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 -156
- 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 -17
- package/dist/shared/log/create-api-logger.d.ts.map +0 -1
- package/dist/shared/log/create-api-logger.js +0 -15
- package/dist/shared/log/create-api-logger.js.map +0 -1
- package/dist/shared/log/log-manager.js +0 -218
- package/dist/shared/log/log-manager.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/local-task-registry.js +0 -153
- package/dist/task/local-task-registry.js.map +0 -1
- package/dist/task/task-manager.js +0 -217
- package/dist/task/task-manager.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.api.js +0 -351
- 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/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-manager.ts +0 -673
- package/src/node/node-task.preset.ts +0 -13
- 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 -25
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { isCreateTargetAlreadyExistsError } from "../../core.api";
|
|
2
|
+
import { postLogListCreate } from "../../list/list.api";
|
|
3
|
+
import { CategoryList } from "../../list/list.interface";
|
|
4
|
+
import type { LogEntry } from "./log-manager";
|
|
5
|
+
import { LOG_PERSIST_LOADER_KEY } from "./log-persist.config";
|
|
6
|
+
import type { BuildLogListDraftInput, LogListDraft } from "./log-persist.interface";
|
|
7
|
+
import { persistLogger } from "./log-persist-logger";
|
|
8
|
+
|
|
9
|
+
export function estimateEntriesBytes(entries: LogEntry[]): number {
|
|
10
|
+
if (entries.length === 0) {
|
|
11
|
+
return 0;
|
|
12
|
+
}
|
|
13
|
+
try {
|
|
14
|
+
return Buffer.byteLength(JSON.stringify(entries), "utf8");
|
|
15
|
+
} catch {
|
|
16
|
+
return entries.length * 512;
|
|
17
|
+
}
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
export function buildLogListDraft(input: BuildLogListDraftInput): LogListDraft {
|
|
21
|
+
const { service, process, lane, idempotencyKey, entries } = input;
|
|
22
|
+
const first = entries[0];
|
|
23
|
+
const last = entries[entries.length - 1];
|
|
24
|
+
|
|
25
|
+
return {
|
|
26
|
+
name: `${service}:${process}`,
|
|
27
|
+
value: idempotencyKey,
|
|
28
|
+
category: CategoryList.LIST,
|
|
29
|
+
tagList: ["log", lane, service],
|
|
30
|
+
details: {
|
|
31
|
+
manifestVersion: 1,
|
|
32
|
+
loaderKey: LOG_PERSIST_LOADER_KEY,
|
|
33
|
+
meta: JSON.stringify({
|
|
34
|
+
service,
|
|
35
|
+
process,
|
|
36
|
+
pid: globalThis.process.pid,
|
|
37
|
+
lane,
|
|
38
|
+
count: entries.length,
|
|
39
|
+
from: first?.timestamp ?? null,
|
|
40
|
+
to: last?.timestamp ?? null,
|
|
41
|
+
flushedAt: Date.now(),
|
|
42
|
+
idempotencyKey,
|
|
43
|
+
}),
|
|
44
|
+
preview: first?.message ?? "",
|
|
45
|
+
items: entries,
|
|
46
|
+
},
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
|
|
50
|
+
async function withTimeout<T>(promise: Promise<T>, timeoutMs: number, label: string): Promise<T> {
|
|
51
|
+
let timer: ReturnType<typeof setTimeout> | null = null;
|
|
52
|
+
try {
|
|
53
|
+
return await Promise.race([
|
|
54
|
+
promise,
|
|
55
|
+
new Promise<T>((_resolve, reject) => {
|
|
56
|
+
timer = setTimeout(() => {
|
|
57
|
+
reject(new Error(`${label} timed out after ${timeoutMs}ms`));
|
|
58
|
+
}, timeoutMs);
|
|
59
|
+
}),
|
|
60
|
+
]);
|
|
61
|
+
} finally {
|
|
62
|
+
if (timer != null) {
|
|
63
|
+
clearTimeout(timer);
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}
|
|
67
|
+
|
|
68
|
+
export async function postLogBatch(draft: LogListDraft, postTimeoutMs: number): Promise<void> {
|
|
69
|
+
try {
|
|
70
|
+
const result = await withTimeout(
|
|
71
|
+
postLogListCreate({
|
|
72
|
+
name: draft.name,
|
|
73
|
+
value: draft.value,
|
|
74
|
+
category: draft.category,
|
|
75
|
+
details: draft.details,
|
|
76
|
+
}),
|
|
77
|
+
postTimeoutMs,
|
|
78
|
+
"postLogListCreate",
|
|
79
|
+
);
|
|
80
|
+
|
|
81
|
+
if (!result.success) {
|
|
82
|
+
const message = result.error?.message ?? "postLogListCreate failed";
|
|
83
|
+
persistLogger.error("post log batch failed", {
|
|
84
|
+
idempotencyKey: draft.value,
|
|
85
|
+
name: draft.name,
|
|
86
|
+
error: message,
|
|
87
|
+
});
|
|
88
|
+
throw new Error(message);
|
|
89
|
+
}
|
|
90
|
+
} catch (error) {
|
|
91
|
+
if (isCreateTargetAlreadyExistsError(error)) {
|
|
92
|
+
persistLogger.error("post log batch idempotent duplicate — treating as success", {
|
|
93
|
+
idempotencyKey: draft.value,
|
|
94
|
+
name: draft.name,
|
|
95
|
+
});
|
|
96
|
+
return;
|
|
97
|
+
}
|
|
98
|
+
throw error;
|
|
99
|
+
}
|
|
100
|
+
}
|
|
101
|
+
|
|
102
|
+
/** Take a prefix of entries that fits within maxBytes. */
|
|
103
|
+
export function takeEntriesWithinBytes(entries: LogEntry[], maxBytes: number): LogEntry[] {
|
|
104
|
+
if (entries.length === 0) {
|
|
105
|
+
return [];
|
|
106
|
+
}
|
|
107
|
+
|
|
108
|
+
const taken: LogEntry[] = [];
|
|
109
|
+
for (const entry of entries) {
|
|
110
|
+
const candidate = [...taken, entry];
|
|
111
|
+
if (taken.length > 0 && estimateEntriesBytes(candidate) > maxBytes) {
|
|
112
|
+
break;
|
|
113
|
+
}
|
|
114
|
+
taken.push(entry);
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
const result = taken.length > 0 ? taken : [entries[0]];
|
|
118
|
+
if (result.length < entries.length) {
|
|
119
|
+
persistLogger.warn("trimmed batch to maxBytes", {
|
|
120
|
+
requested: entries.length,
|
|
121
|
+
taken: result.length,
|
|
122
|
+
maxBytes,
|
|
123
|
+
takenBytes: estimateEntriesBytes(result),
|
|
124
|
+
});
|
|
125
|
+
}
|
|
126
|
+
|
|
127
|
+
return result;
|
|
128
|
+
}
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import type { LogEntry } from "./log-manager";
|
|
2
|
+
|
|
3
|
+
type LogPersistOfferFn = (entry: LogEntry) => void;
|
|
4
|
+
|
|
5
|
+
let offerFn: LogPersistOfferFn | null = null;
|
|
6
|
+
|
|
7
|
+
export function registerLogPersistOffer(fn: LogPersistOfferFn | null): void {
|
|
8
|
+
offerFn = fn;
|
|
9
|
+
}
|
|
10
|
+
|
|
11
|
+
export function offerToLogPersist(entry: LogEntry): void {
|
|
12
|
+
offerFn?.(entry);
|
|
13
|
+
}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { createLogger } from "./create-logger";
|
|
2
|
+
|
|
3
|
+
/** User-facing / lifecycle logs — may be persisted like normal app logs. */
|
|
4
|
+
export const LOG_PERSIST_TOPIC = "log-persist";
|
|
5
|
+
|
|
6
|
+
/** Operational logs from the persist pipeline — never re-offered to avoid feedback loops. */
|
|
7
|
+
export const LOG_PERSIST_INTERNAL_TOPIC = "log-persist-internal";
|
|
8
|
+
|
|
9
|
+
const logger = createLogger({ module: "log-persist" });
|
|
10
|
+
|
|
11
|
+
export function isLogPersistInternalTopic(topic: string | undefined): boolean {
|
|
12
|
+
return topic === LOG_PERSIST_INTERNAL_TOPIC;
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
type PersistLogData = Record<string, unknown>;
|
|
16
|
+
|
|
17
|
+
function write(level: "debug" | "info" | "warn" | "error", message: string, data?: PersistLogData): void {
|
|
18
|
+
logger[level](message, {
|
|
19
|
+
topic: LOG_PERSIST_INTERNAL_TOPIC,
|
|
20
|
+
...(data != null ? { data } : {}),
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
export const persistLogger = {
|
|
25
|
+
debug: (message: string, data?: PersistLogData) => write("debug", message, data),
|
|
26
|
+
info: (message: string, data?: PersistLogData) => write("info", message, data),
|
|
27
|
+
warn: (message: string, data?: PersistLogData) => write("warn", message, data),
|
|
28
|
+
error: (message: string, data?: PersistLogData) => write("error", message, data),
|
|
29
|
+
};
|
|
30
|
+
|
|
31
|
+
export function patchPersistLoggerScope(labels: Record<string, string>): void {
|
|
32
|
+
logger.resetScope({ labels });
|
|
33
|
+
}
|
|
@@ -0,0 +1,109 @@
|
|
|
1
|
+
import { join } from "node:path";
|
|
2
|
+
import { createJsonFileStateStore } from "../../node/fs/json-state-store";
|
|
3
|
+
import type { LogPersistProcessRecord, LogPersistRegistryState } from "./log-persist.interface";
|
|
4
|
+
import { persistLogger } from "./log-persist-logger";
|
|
5
|
+
|
|
6
|
+
const DEFAULT_REGISTRY: LogPersistRegistryState = {
|
|
7
|
+
updatedAt: new Date(0).toISOString(),
|
|
8
|
+
service: "",
|
|
9
|
+
processes: {},
|
|
10
|
+
};
|
|
11
|
+
|
|
12
|
+
const stores = new Map<string, ReturnType<typeof createJsonFileStateStore<LogPersistRegistryState, "processes">>>();
|
|
13
|
+
|
|
14
|
+
function storeFor(filePath: string) {
|
|
15
|
+
let store = stores.get(filePath);
|
|
16
|
+
if (store == null) {
|
|
17
|
+
store = createJsonFileStateStore<LogPersistRegistryState, "processes">({
|
|
18
|
+
filePath,
|
|
19
|
+
defaultState: DEFAULT_REGISTRY,
|
|
20
|
+
nestedKeys: ["processes"],
|
|
21
|
+
updatedAtKey: "updatedAt",
|
|
22
|
+
});
|
|
23
|
+
stores.set(filePath, store);
|
|
24
|
+
}
|
|
25
|
+
return store;
|
|
26
|
+
}
|
|
27
|
+
|
|
28
|
+
export function defaultLogPersistRegistryPath(registryDir: string): string {
|
|
29
|
+
return join(registryDir, "log-persist-registry.json");
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
export async function registerLogPersistProcess(input: {
|
|
33
|
+
registryFilePath: string;
|
|
34
|
+
service: string;
|
|
35
|
+
process: string;
|
|
36
|
+
}): Promise<void> {
|
|
37
|
+
const now = new Date().toISOString();
|
|
38
|
+
const record: LogPersistProcessRecord = {
|
|
39
|
+
pid: process.pid,
|
|
40
|
+
enabledAt: now,
|
|
41
|
+
lastHeartbeatAt: now,
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
await storeFor(input.registryFilePath).write({
|
|
45
|
+
service: input.service,
|
|
46
|
+
processes: {
|
|
47
|
+
[input.process]: record,
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
|
|
51
|
+
persistLogger.info("registry process registered", {
|
|
52
|
+
registryFilePath: input.registryFilePath,
|
|
53
|
+
service: input.service,
|
|
54
|
+
process: input.process,
|
|
55
|
+
pid: record.pid,
|
|
56
|
+
});
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export async function heartbeatLogPersistProcess(input: { registryFilePath: string; process: string }): Promise<void> {
|
|
60
|
+
const current = await storeFor(input.registryFilePath).read();
|
|
61
|
+
const existing = current.processes[input.process];
|
|
62
|
+
if (existing == null) {
|
|
63
|
+
persistLogger.warn("registry heartbeat skipped — process not registered", {
|
|
64
|
+
registryFilePath: input.registryFilePath,
|
|
65
|
+
process: input.process,
|
|
66
|
+
});
|
|
67
|
+
return;
|
|
68
|
+
}
|
|
69
|
+
|
|
70
|
+
await storeFor(input.registryFilePath).write({
|
|
71
|
+
processes: {
|
|
72
|
+
[input.process]: {
|
|
73
|
+
...existing,
|
|
74
|
+
lastHeartbeatAt: new Date().toISOString(),
|
|
75
|
+
},
|
|
76
|
+
},
|
|
77
|
+
});
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
export async function unregisterLogPersistProcess(input: { registryFilePath: string; process: string }): Promise<void> {
|
|
81
|
+
const current = await storeFor(input.registryFilePath).read();
|
|
82
|
+
const existing = current.processes[input.process];
|
|
83
|
+
if (existing == null) {
|
|
84
|
+
persistLogger.warn("registry unregister skipped — process not found", {
|
|
85
|
+
registryFilePath: input.registryFilePath,
|
|
86
|
+
process: input.process,
|
|
87
|
+
});
|
|
88
|
+
return;
|
|
89
|
+
}
|
|
90
|
+
|
|
91
|
+
await storeFor(input.registryFilePath).write({
|
|
92
|
+
processes: {
|
|
93
|
+
[input.process]: {
|
|
94
|
+
...existing,
|
|
95
|
+
pid: 0,
|
|
96
|
+
lastHeartbeatAt: new Date(0).toISOString(),
|
|
97
|
+
},
|
|
98
|
+
},
|
|
99
|
+
});
|
|
100
|
+
|
|
101
|
+
persistLogger.info("registry process unregistered", {
|
|
102
|
+
registryFilePath: input.registryFilePath,
|
|
103
|
+
process: input.process,
|
|
104
|
+
});
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
export async function readLogPersistRegistry(registryFilePath: string): Promise<LogPersistRegistryState> {
|
|
108
|
+
return storeFor(registryFilePath).read();
|
|
109
|
+
}
|
|
@@ -0,0 +1,97 @@
|
|
|
1
|
+
import { envBool, envInt, envMs } from "../../node/env/env-parsers";
|
|
2
|
+
import type { LogPersistConfig } from "./log-persist.interface";
|
|
3
|
+
|
|
4
|
+
export const LOG_PERSIST_LOADER_KEY = "LogBatch.0";
|
|
5
|
+
|
|
6
|
+
export const DEFAULT_LOG_PERSIST_CONFIG: LogPersistConfig = {
|
|
7
|
+
fast: {
|
|
8
|
+
maxBufferEntries: 500,
|
|
9
|
+
},
|
|
10
|
+
medium: {
|
|
11
|
+
debounceMs: 5_000,
|
|
12
|
+
maxEntries: 20,
|
|
13
|
+
maxBytes: 512 * 1024,
|
|
14
|
+
maxBufferEntries: 1_000,
|
|
15
|
+
},
|
|
16
|
+
slow: {
|
|
17
|
+
maxEntries: 400,
|
|
18
|
+
maxBytes: 512 * 1024,
|
|
19
|
+
maxAgeMs: 120_000,
|
|
20
|
+
maxBufferEntries: 2_000,
|
|
21
|
+
},
|
|
22
|
+
postTimeoutMs: 30_000,
|
|
23
|
+
shutdownDrainTimeoutMs: 15_000,
|
|
24
|
+
};
|
|
25
|
+
|
|
26
|
+
export function resolveLogPersistConfig(partial?: Partial<LogPersistConfig>): LogPersistConfig {
|
|
27
|
+
const defaults = DEFAULT_LOG_PERSIST_CONFIG;
|
|
28
|
+
return {
|
|
29
|
+
fast: { ...defaults.fast, ...partial?.fast },
|
|
30
|
+
medium: { ...defaults.medium, ...partial?.medium },
|
|
31
|
+
slow: { ...defaults.slow, ...partial?.slow },
|
|
32
|
+
postTimeoutMs: partial?.postTimeoutMs ?? defaults.postTimeoutMs,
|
|
33
|
+
shutdownDrainTimeoutMs: partial?.shutdownDrainTimeoutMs ?? defaults.shutdownDrainTimeoutMs,
|
|
34
|
+
};
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
export function logPersistEnabledFromEnv(env: NodeJS.ProcessEnv = process.env): boolean {
|
|
38
|
+
return envBool("LOG_PERSIST_ENABLED", false, env);
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
export function logPersistServiceFromEnv(env: NodeJS.ProcessEnv = process.env): string | undefined {
|
|
42
|
+
const raw = env.LOG_PERSIST_SERVICE?.trim();
|
|
43
|
+
return raw != null && raw !== "" ? raw : undefined;
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
export function logPersistProcessFromEnv(env: NodeJS.ProcessEnv = process.env): string | undefined {
|
|
47
|
+
const raw = env.LOG_PERSIST_PROCESS?.trim();
|
|
48
|
+
return raw != null && raw !== "" ? raw : undefined;
|
|
49
|
+
}
|
|
50
|
+
|
|
51
|
+
export function logPersistRegistryDirFromEnv(env: NodeJS.ProcessEnv = process.env): string | undefined {
|
|
52
|
+
const configured = env.LOG_PERSIST_REGISTRY_DIR?.trim();
|
|
53
|
+
if (configured != null && configured !== "") {
|
|
54
|
+
return configured;
|
|
55
|
+
}
|
|
56
|
+
const runtime = env.RUNTIME_DATA_DIR?.trim();
|
|
57
|
+
return runtime != null && runtime !== "" ? runtime : undefined;
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
export function logPersistConfigFromEnv(env: NodeJS.ProcessEnv = process.env): LogPersistConfig {
|
|
61
|
+
return resolveLogPersistConfig({
|
|
62
|
+
fast: {
|
|
63
|
+
maxBufferEntries: envInt("LOG_FAST_MAX_BUFFER_ENTRIES", DEFAULT_LOG_PERSIST_CONFIG.fast.maxBufferEntries, {
|
|
64
|
+
env,
|
|
65
|
+
min: 1,
|
|
66
|
+
}),
|
|
67
|
+
},
|
|
68
|
+
medium: {
|
|
69
|
+
debounceMs: envMs("LOG_MEDIUM_DEBOUNCE_MS", DEFAULT_LOG_PERSIST_CONFIG.medium.debounceMs, { env }),
|
|
70
|
+
maxEntries: envInt("LOG_MEDIUM_MAX_ENTRIES", DEFAULT_LOG_PERSIST_CONFIG.medium.maxEntries, {
|
|
71
|
+
env,
|
|
72
|
+
min: 1,
|
|
73
|
+
}),
|
|
74
|
+
maxBytes: envInt("LOG_MEDIUM_MAX_BYTES", DEFAULT_LOG_PERSIST_CONFIG.medium.maxBytes, { env, min: 1 }),
|
|
75
|
+
maxBufferEntries: envInt(
|
|
76
|
+
"LOG_MEDIUM_MAX_BUFFER_ENTRIES",
|
|
77
|
+
DEFAULT_LOG_PERSIST_CONFIG.medium.maxBufferEntries,
|
|
78
|
+
{ env, min: 1 },
|
|
79
|
+
),
|
|
80
|
+
},
|
|
81
|
+
slow: {
|
|
82
|
+
maxEntries: envInt("LOG_SLOW_MAX_ENTRIES", DEFAULT_LOG_PERSIST_CONFIG.slow.maxEntries, { env, min: 1 }),
|
|
83
|
+
maxBytes: envInt("LOG_SLOW_MAX_BYTES", DEFAULT_LOG_PERSIST_CONFIG.slow.maxBytes, { env, min: 1 }),
|
|
84
|
+
maxAgeMs: envMs("LOG_SLOW_MAX_AGE_MS", DEFAULT_LOG_PERSIST_CONFIG.slow.maxAgeMs, { env }),
|
|
85
|
+
maxBufferEntries: envInt("LOG_SLOW_MAX_BUFFER_ENTRIES", DEFAULT_LOG_PERSIST_CONFIG.slow.maxBufferEntries, {
|
|
86
|
+
env,
|
|
87
|
+
min: 1,
|
|
88
|
+
}),
|
|
89
|
+
},
|
|
90
|
+
postTimeoutMs: envMs("LOG_PERSIST_POST_TIMEOUT_MS", DEFAULT_LOG_PERSIST_CONFIG.postTimeoutMs, { env }),
|
|
91
|
+
shutdownDrainTimeoutMs: envMs(
|
|
92
|
+
"LOG_PERSIST_SHUTDOWN_DRAIN_MS",
|
|
93
|
+
DEFAULT_LOG_PERSIST_CONFIG.shutdownDrainTimeoutMs,
|
|
94
|
+
{ env },
|
|
95
|
+
),
|
|
96
|
+
});
|
|
97
|
+
}
|
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
import type { TargetDraft } from "../../core.interface";
|
|
2
|
+
import type { List } from "../../list/list.interface";
|
|
3
|
+
import type { LogEntry } from "./log-manager";
|
|
4
|
+
|
|
5
|
+
/** Persistence lane — maps to List tagList and flush policy. */
|
|
6
|
+
export type LogPersistLane = "fast" | "medium" | "slow";
|
|
7
|
+
|
|
8
|
+
export interface LogPersistFastConfig {
|
|
9
|
+
maxBufferEntries: number;
|
|
10
|
+
}
|
|
11
|
+
|
|
12
|
+
export interface LogPersistMediumConfig {
|
|
13
|
+
debounceMs: number;
|
|
14
|
+
maxEntries: number;
|
|
15
|
+
maxBytes: number;
|
|
16
|
+
maxBufferEntries: number;
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
export interface LogPersistSlowConfig {
|
|
20
|
+
maxEntries: number;
|
|
21
|
+
maxBytes: number;
|
|
22
|
+
maxAgeMs: number;
|
|
23
|
+
maxBufferEntries: number;
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
export interface LogPersistConfig {
|
|
27
|
+
fast: LogPersistFastConfig;
|
|
28
|
+
medium: LogPersistMediumConfig;
|
|
29
|
+
slow: LogPersistSlowConfig;
|
|
30
|
+
/** postListCreate / network ceiling per batch */
|
|
31
|
+
postTimeoutMs: number;
|
|
32
|
+
/** Graceful shutdown drain ceiling */
|
|
33
|
+
shutdownDrainTimeoutMs: number;
|
|
34
|
+
}
|
|
35
|
+
|
|
36
|
+
export interface EnableLogPersistOptions {
|
|
37
|
+
service: string;
|
|
38
|
+
process: string;
|
|
39
|
+
/** Shared registry file — all processes of one service use the same path. */
|
|
40
|
+
registryFilePath?: string;
|
|
41
|
+
config?: Partial<LogPersistConfig>;
|
|
42
|
+
}
|
|
43
|
+
|
|
44
|
+
export interface EnsureLogPersistFromEnvOptions {
|
|
45
|
+
/** Overrides LOG_PERSIST_PROCESS when set. */
|
|
46
|
+
process?: string;
|
|
47
|
+
/** Overrides LOG_PERSIST_SERVICE when set. */
|
|
48
|
+
service?: string;
|
|
49
|
+
registryFilePath?: string;
|
|
50
|
+
config?: Partial<LogPersistConfig>;
|
|
51
|
+
}
|
|
52
|
+
|
|
53
|
+
export interface LogPersistProcessRecord {
|
|
54
|
+
pid: number;
|
|
55
|
+
enabledAt: string;
|
|
56
|
+
lastHeartbeatAt: string;
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
export interface LogPersistRegistryState {
|
|
60
|
+
updatedAt: string;
|
|
61
|
+
service: string;
|
|
62
|
+
processes: Record<string, LogPersistProcessRecord>;
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
export interface LogPersistQueueStats {
|
|
66
|
+
fast: number;
|
|
67
|
+
fastRetry: number;
|
|
68
|
+
medium: number;
|
|
69
|
+
slow: number;
|
|
70
|
+
}
|
|
71
|
+
|
|
72
|
+
export interface LogPersistQueueBytesStats {
|
|
73
|
+
fast: number;
|
|
74
|
+
fastRetry: number;
|
|
75
|
+
medium: number;
|
|
76
|
+
slow: number;
|
|
77
|
+
}
|
|
78
|
+
|
|
79
|
+
export interface LogPersistStats {
|
|
80
|
+
enabled: boolean;
|
|
81
|
+
draining: boolean;
|
|
82
|
+
service: string | null;
|
|
83
|
+
process: string | null;
|
|
84
|
+
queues: LogPersistQueueStats;
|
|
85
|
+
queueBytes: LogPersistQueueBytesStats;
|
|
86
|
+
mediumDebouncePending: boolean;
|
|
87
|
+
laneFlushing: Record<LogPersistLane, boolean>;
|
|
88
|
+
consecutiveFailures: Record<LogPersistLane, number>;
|
|
89
|
+
config: LogPersistConfig;
|
|
90
|
+
lastFlushAt: Record<LogPersistLane, string | null>;
|
|
91
|
+
lastError: string | null;
|
|
92
|
+
lastErrorAt: string | null;
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
export interface WaitForLogPersistReadyOptions {
|
|
96
|
+
registryFilePath: string;
|
|
97
|
+
service: string;
|
|
98
|
+
expectedProcesses: string[];
|
|
99
|
+
timeoutMs?: number;
|
|
100
|
+
pollIntervalMs?: number;
|
|
101
|
+
/** Process heartbeat older than this is treated as missing. */
|
|
102
|
+
staleMs?: number;
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
export interface LogPersistReadySnapshot {
|
|
106
|
+
ok: boolean;
|
|
107
|
+
missing: string[];
|
|
108
|
+
stale: string[];
|
|
109
|
+
registered: string[];
|
|
110
|
+
}
|
|
111
|
+
|
|
112
|
+
export interface LogBatchMeta {
|
|
113
|
+
service: string;
|
|
114
|
+
process: string;
|
|
115
|
+
pid: number;
|
|
116
|
+
lane: LogPersistLane;
|
|
117
|
+
count: number;
|
|
118
|
+
from: number | null;
|
|
119
|
+
to: number | null;
|
|
120
|
+
flushedAt: number;
|
|
121
|
+
idempotencyKey: string;
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
export interface BuildLogListDraftInput {
|
|
125
|
+
service: string;
|
|
126
|
+
process: string;
|
|
127
|
+
lane: LogPersistLane;
|
|
128
|
+
idempotencyKey: string;
|
|
129
|
+
entries: LogEntry[];
|
|
130
|
+
}
|
|
131
|
+
|
|
132
|
+
export type LogListDraft = TargetDraft<List>;
|