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
package/src/core.interface.ts
CHANGED
|
@@ -1,76 +1,77 @@
|
|
|
1
|
-
import { PostgrestError } from "@supabase/supabase-js";
|
|
1
|
+
import type { PostgrestError } from "@supabase/supabase-js";
|
|
2
2
|
|
|
3
3
|
export interface Target {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
4
|
+
id: string;
|
|
5
|
+
category: string;
|
|
6
|
+
name: string;
|
|
7
|
+
value: string;
|
|
8
|
+
tagList: string[];
|
|
9
|
+
extra?: string;
|
|
10
|
+
details?: unknown;
|
|
11
|
+
created_at: string;
|
|
12
12
|
}
|
|
13
13
|
|
|
14
|
-
|
|
14
|
+
/** Target row before persistence — no `id` or `created_at`. */
|
|
15
|
+
export type TargetDraft<T extends Target> = Omit<T, "id" | "created_at">;
|
|
15
16
|
|
|
16
17
|
export enum StatusCode {
|
|
17
|
-
|
|
18
|
-
|
|
18
|
+
SUCCESS = 200,
|
|
19
|
+
ERROR = 400,
|
|
19
20
|
}
|
|
20
21
|
|
|
21
22
|
export interface SupabaseResponse<T = unknown> {
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
status_code: StatusCode;
|
|
24
|
+
success: boolean;
|
|
25
|
+
message?: string;
|
|
26
|
+
data?: T;
|
|
27
|
+
error?: {
|
|
28
|
+
message: string;
|
|
29
|
+
code?: string;
|
|
30
|
+
};
|
|
30
31
|
}
|
|
31
32
|
|
|
32
33
|
export const generateResponse = {
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
34
|
+
success<T>(data?: T, message?: string): SupabaseResponse<T> {
|
|
35
|
+
return {
|
|
36
|
+
status_code: StatusCode.SUCCESS,
|
|
37
|
+
success: true,
|
|
38
|
+
message,
|
|
39
|
+
data,
|
|
40
|
+
};
|
|
41
|
+
},
|
|
41
42
|
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
43
|
+
error(
|
|
44
|
+
message: string | { key: string; error: PostgrestError } | { key: string; error: string },
|
|
45
|
+
statusCode?: StatusCode,
|
|
46
|
+
code?: string,
|
|
47
|
+
): SupabaseResponse {
|
|
48
|
+
if (typeof message === "string") {
|
|
49
|
+
return {
|
|
50
|
+
status_code: statusCode ?? StatusCode.ERROR,
|
|
51
|
+
success: false,
|
|
52
|
+
error: {
|
|
53
|
+
message,
|
|
54
|
+
code,
|
|
55
|
+
},
|
|
56
|
+
};
|
|
57
|
+
}
|
|
58
|
+
if (typeof message?.error === "string") {
|
|
59
|
+
return {
|
|
60
|
+
status_code: statusCode ?? StatusCode.ERROR,
|
|
61
|
+
success: false,
|
|
62
|
+
error: {
|
|
63
|
+
message: `Error from ${message.key}: ${message.error}`,
|
|
64
|
+
code,
|
|
65
|
+
},
|
|
66
|
+
};
|
|
67
|
+
}
|
|
68
|
+
return {
|
|
69
|
+
status_code: statusCode ?? StatusCode.ERROR,
|
|
70
|
+
success: false,
|
|
71
|
+
error: {
|
|
72
|
+
message: `Error from ${message.key}: ${message?.error?.message}`,
|
|
73
|
+
code,
|
|
74
|
+
},
|
|
75
|
+
};
|
|
76
|
+
},
|
|
76
77
|
};
|
package/src/core.utils.ts
CHANGED
|
@@ -2,91 +2,91 @@ import { pick, pickBy } from "lodash-es";
|
|
|
2
2
|
|
|
3
3
|
/** True when running in a development build (Vite or Node). Defaults to false for safety. */
|
|
4
4
|
export function isDevEnvironment(): boolean {
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
5
|
+
if (typeof import.meta !== "undefined" && "env" in import.meta) {
|
|
6
|
+
const env = (import.meta as ImportMeta & { env?: { DEV?: boolean; MODE?: string } }).env;
|
|
7
|
+
if (env?.DEV === true || env?.MODE === "development") return true;
|
|
8
|
+
if (env?.DEV === false || env?.MODE === "production") return false;
|
|
9
|
+
}
|
|
10
|
+
if (typeof process !== "undefined" && process.env?.NODE_ENV) {
|
|
11
|
+
return process.env.NODE_ENV !== "production";
|
|
12
|
+
}
|
|
13
|
+
return false;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
16
|
export function logDev(...args: unknown[]): void {
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
if (isDevEnvironment()) {
|
|
18
|
+
console.log(...args);
|
|
19
|
+
}
|
|
20
20
|
}
|
|
21
21
|
|
|
22
22
|
export function logDevGroup(label: string, fn: () => void): void {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
23
|
+
if (!isDevEnvironment()) return;
|
|
24
|
+
console.group(label);
|
|
25
|
+
try {
|
|
26
|
+
fn();
|
|
27
|
+
} finally {
|
|
28
|
+
console.groupEnd();
|
|
29
|
+
}
|
|
30
30
|
}
|
|
31
31
|
|
|
32
32
|
/** Log internal details, then throw a sanitized error safe to expose to callers. */
|
|
33
33
|
export function handleSupabaseError(context: string, error: unknown, publicMessage?: string): never {
|
|
34
|
-
|
|
35
|
-
|
|
34
|
+
console.error(`[${context}] failed:`, error);
|
|
35
|
+
throw new Error(publicMessage ?? `[${context}] Operation failed`);
|
|
36
36
|
}
|
|
37
37
|
|
|
38
38
|
/** Raw payload -> Available data */
|
|
39
39
|
export abstract class BaseValidator<T extends object> {
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
40
|
+
protected requiredFields: (keyof T)[] = [];
|
|
41
|
+
protected optionalFields: (keyof T)[] = [];
|
|
42
|
+
protected ignoredFields: (keyof T)[] = [];
|
|
43
|
+
protected customValidators: ((val: T) => true | string)[] = [];
|
|
44
44
|
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
45
|
+
addCustomValidator(validator: (val: T) => true | string) {
|
|
46
|
+
this.customValidators.push(validator);
|
|
47
|
+
return this;
|
|
48
|
+
}
|
|
49
49
|
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
50
|
+
protected validateField(_field: keyof T, value: unknown): boolean {
|
|
51
|
+
// TODO now only empty check, later should add type checks
|
|
52
|
+
return value != null;
|
|
53
|
+
}
|
|
54
54
|
|
|
55
|
-
|
|
56
|
-
|
|
55
|
+
validate = (val: T): T => {
|
|
56
|
+
const errors: string[] = [];
|
|
57
57
|
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
58
|
+
// Step 1: Check required fields
|
|
59
|
+
this.requiredFields.forEach((field) => {
|
|
60
|
+
if (!this.validateField(field, val[field])) {
|
|
61
|
+
errors.push(`Missing required field: ${String(field)}`);
|
|
62
|
+
}
|
|
63
|
+
});
|
|
64
64
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
65
|
+
// Step 2: Run custom validators
|
|
66
|
+
this.customValidators.forEach((validator) => {
|
|
67
|
+
const result = validator(val);
|
|
68
|
+
if (result !== true) {
|
|
69
|
+
errors.push(`Custom validation failed ${result}`);
|
|
70
|
+
}
|
|
71
|
+
});
|
|
72
72
|
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
73
|
+
if (errors.length > 0) {
|
|
74
|
+
const errorCount = errors.length;
|
|
75
|
+
const errorList = errors.map((error, index) => ` ${index + 1}. ${error}`).join("\n");
|
|
76
76
|
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
77
|
+
throw new Error(
|
|
78
|
+
`[${this.constructor.name}] Validation failed (${errorCount} error${errorCount > 1 ? "s" : ""}):\n${errorList}`,
|
|
79
|
+
);
|
|
80
|
+
}
|
|
81
81
|
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
82
|
+
// Step 3: Pick required and optional fields
|
|
83
|
+
const required = pick(val, this.requiredFields);
|
|
84
|
+
const optional = pickBy(val, (value, key) => {
|
|
85
|
+
const typedKey = key as keyof T;
|
|
86
|
+
return this.optionalFields.includes(typedKey) && value != null;
|
|
87
|
+
}) as Partial<T>;
|
|
88
|
+
// TODO ignoredFields
|
|
89
89
|
|
|
90
|
-
|
|
91
|
-
|
|
90
|
+
return { ...required, ...optional } as T;
|
|
91
|
+
};
|
|
92
92
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Target } from "../core.interface";
|
|
1
|
+
import type { Target } from "../core.interface";
|
|
2
2
|
|
|
3
3
|
export enum CategoryIdea {
|
|
4
4
|
OPPORTUNITY = "opportunity",
|
|
@@ -17,7 +17,7 @@ export interface IdeaDetails {
|
|
|
17
17
|
reviewList: string[];
|
|
18
18
|
/** 切入點 */
|
|
19
19
|
point: string;
|
|
20
|
-
}
|
|
20
|
+
}
|
|
21
21
|
|
|
22
22
|
export enum Market {
|
|
23
23
|
NA = "NA",
|
|
@@ -25,4 +25,4 @@ export enum Market {
|
|
|
25
25
|
JP = "JP",
|
|
26
26
|
CN = "CN",
|
|
27
27
|
TW = "TW",
|
|
28
|
-
}
|
|
28
|
+
}
|
package/src/index.ts
CHANGED
|
@@ -1,79 +1,2 @@
|
|
|
1
|
-
|
|
2
|
-
export
|
|
3
|
-
export type { SupabaseClient } from "@supabase/supabase-js";
|
|
4
|
-
|
|
5
|
-
import { SupabaseInitializer } from "./supabase";
|
|
6
|
-
|
|
7
|
-
export const supabase = SupabaseInitializer.getInstance();
|
|
8
|
-
|
|
9
|
-
export * from "./core.api";
|
|
10
|
-
export * from "./core.interface";
|
|
11
|
-
export * from "./core.utils";
|
|
12
|
-
|
|
13
|
-
export * from "./auth/auth.api";
|
|
14
|
-
|
|
15
|
-
export * from "./feed/feed.interface";
|
|
16
|
-
export * from "./idea/idea.interface";
|
|
17
|
-
export * from "./link/link.interface";
|
|
18
|
-
|
|
19
|
-
export { CategoryParcel } from "./parcel/parcel.interface";
|
|
20
|
-
export type {
|
|
21
|
-
Parcel,
|
|
22
|
-
ParcelDetails,
|
|
23
|
-
Chunk,
|
|
24
|
-
LifecycleStatus as ParcelLifecycleStatus,
|
|
25
|
-
Lifecycle as ParcelLifecycle,
|
|
26
|
-
} from "./parcel/parcel.interface";
|
|
27
|
-
export { ParcelManager } from "./parcel/parcel-manager";
|
|
28
|
-
export type { StorageAdapter, ParcelTargetBase } from "./parcel/parcel-manager";
|
|
29
|
-
|
|
30
|
-
export * from "./file/file.interface";
|
|
31
|
-
export * from "./file/file.api";
|
|
32
|
-
export * from "./file/file-manager";
|
|
33
|
-
|
|
34
|
-
export * from "./file-list/file-list.interface";
|
|
35
|
-
export * from "./file-list/file-list.api";
|
|
36
|
-
|
|
37
|
-
export * from "./question-list/question-list.interface";
|
|
38
|
-
export * from "./question-list/question-list.api";
|
|
39
|
-
|
|
40
|
-
export * from "./review/review.interface";
|
|
41
|
-
export * from "./review/review.api";
|
|
42
|
-
|
|
43
|
-
export type { ReviewV2, ReviewV2Details, ReviewResult } from "./review-v2/review.interface";
|
|
44
|
-
export * from "./review-v2/review-setting.interface";
|
|
45
|
-
export { postReview as postReviewV2, PostReviewValidator as PostReviewV2Validator } from "./review-v2/apis/post-review.api";
|
|
46
|
-
export type { PostReviewPayload as PostReviewV2Payload } from "./review-v2/apis/post-review.api";
|
|
47
|
-
export * from "./review-v2/apis/post-review-setting.api";
|
|
48
|
-
|
|
49
|
-
export * from "./service/base.interface";
|
|
50
|
-
export * from "./service/service.interface";
|
|
51
|
-
export * from "./service/api.interface";
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
export * from "./link/link.interface";
|
|
55
|
-
export * from "./link/link.api";
|
|
56
|
-
|
|
57
|
-
export * from "./list/list.interface";
|
|
58
|
-
export * from "./list/list.api";
|
|
59
|
-
|
|
60
|
-
export * from "./word/word.interface";
|
|
61
|
-
|
|
62
|
-
export * from "./task/task.interface";
|
|
63
|
-
export * from "./task/task.api";
|
|
64
|
-
export { TaskManager } from "./task/task-manager";
|
|
65
|
-
export type {
|
|
66
|
-
RegisterTasksOptions,
|
|
67
|
-
RegisterTasksResult,
|
|
68
|
-
PrepareTaskResponse,
|
|
69
|
-
PrepareTaskParams,
|
|
70
|
-
PrepareTaskFailureReason,
|
|
71
|
-
} from "./task/task-manager";
|
|
72
|
-
|
|
73
|
-
export * from "./node/node.interface";
|
|
74
|
-
export * from "./node/node.api";
|
|
75
|
-
export { NodeManager } from "./node/node-manager";
|
|
76
|
-
|
|
77
|
-
export * from "./repo/repo.interface";
|
|
78
|
-
export * from "./repo/repo.api";
|
|
79
|
-
export { RepoManager } from "./repo/repo-manager";
|
|
1
|
+
/** @deprecated Use explicit entry — re-exports browser-safe API only. */
|
|
2
|
+
export * from "./browser";
|
package/src/link/link.api.ts
CHANGED
|
@@ -1,43 +1,41 @@
|
|
|
1
1
|
import { createTarget } from "../core.api";
|
|
2
2
|
import { BaseValidator } from "../core.utils";
|
|
3
|
-
import { Link, LinkDetails } from "./link.interface";
|
|
3
|
+
import type { Link, LinkDetails } from "./link.interface";
|
|
4
4
|
|
|
5
5
|
export interface PostLinkCreatePayload {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
name: Link["name"];
|
|
7
|
+
value: Link["value"];
|
|
8
|
+
category: Link["category"];
|
|
9
|
+
details: LinkDetails;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export class PostLinkValidator extends BaseValidator<PostLinkCreatePayload> {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
protected requiredFields: (keyof PostLinkCreatePayload)[] = ["name", "value", "category", "details"];
|
|
14
|
+
protected optionalFields: (keyof PostLinkCreatePayload)[] = [];
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
// Add custom
|
|
19
|
+
this.addCustomValidator((_val) => {
|
|
20
|
+
return true;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
-
|
|
26
|
-
|
|
27
25
|
export const postLinkCreate = async (payload: PostLinkCreatePayload) => {
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
26
|
+
return createTarget<Link, PostLinkCreatePayload>({
|
|
27
|
+
payload: payload,
|
|
28
|
+
validator: PostLinkValidator,
|
|
29
|
+
createFn: (validPayload) => {
|
|
30
|
+
const { name, value, category, details } = validPayload;
|
|
33
31
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
32
|
+
return {
|
|
33
|
+
name,
|
|
34
|
+
category,
|
|
35
|
+
value,
|
|
36
|
+
tagList: [],
|
|
37
|
+
details,
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
});
|
|
43
41
|
};
|
|
@@ -1,16 +1,16 @@
|
|
|
1
|
-
import { Target } from "../core.interface";
|
|
1
|
+
import type { Target } from "../core.interface";
|
|
2
2
|
|
|
3
3
|
export enum CategoryLink {
|
|
4
|
-
/** HTML by default */
|
|
5
4
|
LINK = "link",
|
|
6
5
|
}
|
|
7
6
|
|
|
8
7
|
export interface Link extends Target {
|
|
9
|
-
/**
|
|
8
|
+
/** Should be unique */
|
|
10
9
|
name: string;
|
|
11
10
|
/** URL */
|
|
12
11
|
value: string;
|
|
13
12
|
details: LinkDetails;
|
|
13
|
+
/** Only Link can own a custom category, like 'link-log' */
|
|
14
14
|
category: CategoryLink;
|
|
15
15
|
}
|
|
16
16
|
|
|
@@ -22,5 +22,4 @@ export interface LinkDetails {
|
|
|
22
22
|
/** How to render the link */
|
|
23
23
|
loaderKey: string;
|
|
24
24
|
original: unknown;
|
|
25
|
-
}
|
|
26
|
-
|
|
25
|
+
}
|
package/src/list/list.api.ts
CHANGED
|
@@ -1,43 +1,64 @@
|
|
|
1
1
|
import { createTarget } from "../core.api";
|
|
2
2
|
import { BaseValidator } from "../core.utils";
|
|
3
|
-
import { List, ListDetails } from "./list.interface";
|
|
3
|
+
import { CategoryList, type List, type ListDetails } from "./list.interface";
|
|
4
4
|
|
|
5
5
|
export interface PostListCreatePayload {
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
6
|
+
name: List["name"];
|
|
7
|
+
value: List["value"];
|
|
8
|
+
category: List["category"];
|
|
9
|
+
details: ListDetails;
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
export class PostListValidator extends BaseValidator<PostListCreatePayload> {
|
|
13
|
-
|
|
14
|
-
|
|
13
|
+
protected requiredFields: (keyof PostListCreatePayload)[] = ["name", "value", "category", "details"];
|
|
14
|
+
protected optionalFields: (keyof PostListCreatePayload)[] = [];
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
16
|
+
constructor() {
|
|
17
|
+
super();
|
|
18
|
+
// Add custom
|
|
19
|
+
this.addCustomValidator((_val) => {
|
|
20
|
+
return true;
|
|
21
|
+
});
|
|
22
|
+
}
|
|
23
23
|
}
|
|
24
24
|
|
|
25
|
+
export const postListCreate = async (payload: PostListCreatePayload) => {
|
|
26
|
+
return createTarget<List, PostListCreatePayload>({
|
|
27
|
+
payload: payload,
|
|
28
|
+
validator: PostListValidator,
|
|
29
|
+
createFn: (validPayload) => {
|
|
30
|
+
const { name, value, category, details } = validPayload;
|
|
25
31
|
|
|
32
|
+
return {
|
|
33
|
+
name,
|
|
34
|
+
category,
|
|
35
|
+
value,
|
|
36
|
+
tagList: [],
|
|
37
|
+
details,
|
|
38
|
+
};
|
|
39
|
+
},
|
|
40
|
+
});
|
|
41
|
+
};
|
|
26
42
|
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
43
|
+
/** Log batch create — idempotent on List.value (stable batch hash). */
|
|
44
|
+
export const postLogListCreate = async (payload: PostListCreatePayload) => {
|
|
45
|
+
return createTarget<List, PostListCreatePayload>({
|
|
46
|
+
payload,
|
|
47
|
+
validator: PostListValidator,
|
|
48
|
+
checkRedundancyFilterList: [
|
|
49
|
+
{ field: "category", operator: "eq", value: CategoryList.LIST },
|
|
50
|
+
{ field: "value", operator: "eq", value: payload.value },
|
|
51
|
+
],
|
|
52
|
+
createFn: (validPayload) => {
|
|
53
|
+
const { name, value, category, details } = validPayload;
|
|
33
54
|
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
55
|
+
return {
|
|
56
|
+
name,
|
|
57
|
+
category,
|
|
58
|
+
value,
|
|
59
|
+
tagList: [],
|
|
60
|
+
details,
|
|
61
|
+
};
|
|
62
|
+
},
|
|
63
|
+
});
|
|
43
64
|
};
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { Target
|
|
1
|
+
import type { Target } from "../core.interface";
|
|
2
2
|
|
|
3
3
|
export enum CategoryList {
|
|
4
4
|
LIST = "list",
|
|
@@ -19,6 +19,5 @@ export interface ListDetails {
|
|
|
19
19
|
preview: string;
|
|
20
20
|
/** How to render the List */
|
|
21
21
|
loaderKey: string;
|
|
22
|
-
items: Array<
|
|
23
|
-
}
|
|
24
|
-
|
|
22
|
+
items: Array<unknown>;
|
|
23
|
+
}
|