@futdevpro/nts-dynamo 1.15.157 → 1.15.160
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +17 -17
- package/build/_modules/privacy-lifecycle/_models/privacy-export-artifact.interface.d.ts +71 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-export-artifact.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-export-artifact.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-export-artifact.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/index.d.ts +3 -0
- package/build/_modules/privacy-lifecycle/index.d.ts.map +1 -1
- package/build/_modules/privacy-lifecycle/index.js +5 -1
- package/build/_modules/privacy-lifecycle/index.js.map +1 -1
- package/build/_modules/privacy-lifecycle/privacy-export-artifact.control-service.d.ts +48 -0
- package/build/_modules/privacy-lifecycle/privacy-export-artifact.control-service.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/privacy-export-artifact.control-service.js +332 -0
- package/build/_modules/privacy-lifecycle/privacy-export-artifact.control-service.js.map +1 -0
- package/build/_modules/privacy-lifecycle/privacy-export-artifact.mongo-store.d.ts +25 -0
- package/build/_modules/privacy-lifecycle/privacy-export-artifact.mongo-store.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/privacy-export-artifact.mongo-store.js +126 -0
- package/build/_modules/privacy-lifecycle/privacy-export-artifact.mongo-store.js.map +1 -0
- package/package.json +11 -4
- package/.c8rc.json +0 -26
- package/.copilot/patterns.json +0 -8
- package/.cursor/rules/__assistant_guide.mdc +0 -30
- package/.cursor/rules/__main.mdc +0 -64
- package/.cursor/rules/_ag_backend-structure.mdc +0 -86
- package/.cursor/rules/_ag_backend.mdc +0 -16
- package/.cursor/rules/_ag_debug.mdc +0 -8
- package/.cursor/rules/_ag_documentation_writing_rules.mdc +0 -372
- package/.cursor/rules/_ag_file-refactoring.mdc +0 -113
- package/.cursor/rules/_ag_fixes_rules.mdc +0 -6
- package/.cursor/rules/_ag_frontend-structure.mdc +0 -87
- package/.cursor/rules/_ag_frontend.mdc +0 -40
- package/.cursor/rules/_ag_import-rules.mdc +0 -45
- package/.cursor/rules/_ag_naming.mdc +0 -116
- package/.cursor/rules/_ag_running_commands.mdc +0 -5
- package/.cursor/rules/_ag_server-controller.mdc +0 -6
- package/.cursor/rules/_ag_should-be.mdc +0 -7
- package/.cursor/rules/_ag_swearing.mdc +0 -47
- package/.cursor/rules/ai_development_guide.md +0 -61
- package/.cursor/rules/ai_directives.md +0 -114
- package/.cursor/rules/cursor-rules.md +0 -160
- package/.cursor/rules/default-command.mdc +0 -465
- package/.cursor/rules/error_code_pattern.md +0 -40
- package/.cursor/rules/saved rule mcp server use.md +0 -16
- package/.dynamo/pipeline.cicd.config.json +0 -190
- package/.dynamo/version-bump.config.json +0 -5
- package/.github/workflows/main.yml +0 -438
- package/.husky/pre-commit +0 -3
- package/.vscode/settings.json +0 -11
- package/BuildPackage.bat +0 -1
- package/HOWTO.md +0 -15
- package/__documentations/2026-04-28-logs-module.md +0 -49
- package/__documentations/2026-05-17-oai-compatible-providers.md +0 -229
- package/__documentations/2026-05-17-static-client-serving-howto.md +0 -144
- package/__documentations/2026-06-01-fr041-cors-middleware.md +0 -96
- package/__documentations/2026-06-01-fr047-p2p3-function-calling.md +0 -81
- package/__documentations/2026-06-15-fr193-memory-guard.md +0 -73
- package/__documentations/2026-08-08-fr292-app-version-header.md +0 -38
- package/__documentations/2026-08-14-field-encryption-mongoose-document-spread.md +0 -124
- package/__documentations/2026-08-18-artifact-compiler.md +0 -46
- package/__documentations/2026-08-18-mongo-transaction-control-service.md +0 -82
- package/__documentations/2026-08-18-standalone-account-security-and-privacy-bedrock.md +0 -132
- package/__documentations/2026-08-21-distributed-rate-limit-bfr-ctm-010.md +0 -59
- package/__documentations/2026-08-22-bfr-ctm-018-content-free-endpoint-errors.md +0 -54
- package/__documentations/2026-08-22-bfr-ctm-020-content-free-request-telemetry.md +0 -65
- package/__documentations/2026-08-22-content-free-process-error-boundary.md +0 -111
- package/__documentations/2026-08-22-npm-token-state-classifier.md +0 -92
- package/__documentations/nts-integration-tests-2026-03-17.md +0 -26
- package/__documentations/plans/BEDROCK-HYPERPLAN.md +0 -95
- package/_specifications/BACKLOG.md +0 -92
- package/_specifications/TODO.md +0 -15
- package/_specifications/agent.md +0 -138
- package/eslint.config.js +0 -3
- package/nodemon.json +0 -24
- package/pnpm-workspace.yaml +0 -6
- package/scripts/_seed-out/aim-seed.fixtures.ts +0 -161
- package/scripts/_seed-out/image-raw.json +0 -1
- package/scripts/_seed-out/llm-expand-raw.json +0 -60
- package/scripts/_seed-out/sample-image.png +0 -0
- package/scripts/_seed-out/seed-raw.json +0 -153
- package/scripts/ai-fixture-seed.js +0 -126
- package/scripts/run-coverage-tests.js +0 -28
- package/spec/support/helpers/spec-reporter-loader.js +0 -359
- package/spec/support/helpers/ts-node-helper.js +0 -93
- package/spec/support/jasmine.coverage.json +0 -24
- package/spec/support/jasmine.json +0 -24
- package/src/_assets/dynamo-nts-logo-128.png +0 -0
- package/src/_assets/dynamo-nts-logo-256.png +0 -0
- package/src/_assets/dynamo-nts-logo-512.png +0 -0
- package/src/_assets/dynamo-nts-logo-64.png +0 -0
- package/src/_collections/app-version-header.util.spec.ts +0 -108
- package/src/_collections/app-version-header.util.ts +0 -74
- package/src/_collections/archive-service-registry.const.ts +0 -21
- package/src/_collections/archive.util.spec.ts +0 -57
- package/src/_collections/archive.util.ts +0 -18
- package/src/_collections/atlas-default-db-options.const.ts +0 -10
- package/src/_collections/client-safe-error.util.spec.ts +0 -151
- package/src/_collections/client-safe-error.util.ts +0 -107
- package/src/_collections/default-fallback-cache-max-age.const.spec.ts +0 -11
- package/src/_collections/default-fallback-cache-max-age.const.ts +0 -2
- package/src/_collections/default-not-found-page.const.spec.ts +0 -19
- package/src/_collections/default-not-found-page.const.ts +0 -22
- package/src/_collections/default-socket-path.const.spec.ts +0 -12
- package/src/_collections/default-socket-path.const.ts +0 -2
- package/src/_collections/field-encryption.util.spec.ts +0 -195
- package/src/_collections/field-encryption.util.ts +0 -222
- package/src/_collections/get-environment-settings.util.spec.ts +0 -210
- package/src/_collections/get-environment-settings.util.ts +0 -49
- package/src/_collections/global-settings.const.ts +0 -126
- package/src/_collections/load-shed.util.spec.ts +0 -62
- package/src/_collections/load-shed.util.ts +0 -51
- package/src/_collections/mongo-reconnect-guard.util.spec.ts +0 -52
- package/src/_collections/mongo-reconnect-guard.util.ts +0 -172
- package/src/_collections/npm-token-check.util.spec.ts +0 -218
- package/src/_collections/npm-token-check.util.ts +0 -327
- package/src/_collections/sample.env +0 -21
- package/src/_collections/security-headers.util.spec.ts +0 -98
- package/src/_collections/security-headers.util.ts +0 -96
- package/src/_collections/signed-url.util.spec.ts +0 -198
- package/src/_collections/signed-url.util.ts +0 -170
- package/src/_collections/star.controller.spec.ts +0 -224
- package/src/_collections/star.controller.ts +0 -130
- package/src/_collections/static-cache-control.util.spec.ts +0 -47
- package/src/_collections/static-cache-control.util.ts +0 -25
- package/src/_enums/data-model-type.enum.ts +0 -14
- package/src/_enums/data-service-function.enum.ts +0 -24
- package/src/_enums/predefined-data-types.enum.ts +0 -17
- package/src/_enums/route-security.enum.ts +0 -12
- package/src/_models/control-models/api-call-params.control-model.spec.ts +0 -152
- package/src/_models/control-models/api-call-params.control-model.ts +0 -142
- package/src/_models/control-models/app-ext-system-controls.control-model.spec.ts +0 -52
- package/src/_models/control-models/app-ext-system-controls.control-model.ts +0 -9
- package/src/_models/control-models/app-params.control-model.spec.ts +0 -229
- package/src/_models/control-models/app-params.control-model.ts +0 -137
- package/src/_models/control-models/app-system-controls.control-model.spec.ts +0 -31
- package/src/_models/control-models/app-system-controls.control-model.ts +0 -9
- package/src/_models/control-models/endpoint-params.control-model.spec.ts +0 -754
- package/src/_models/control-models/endpoint-params.control-model.ts +0 -575
- package/src/_models/control-models/http-settings.control-model.spec.ts +0 -77
- package/src/_models/control-models/http-settings.control-model.ts +0 -37
- package/src/_models/control-models/system-control.control-model.spec.ts +0 -27
- package/src/_models/control-models/system-control.control-model.ts +0 -12
- package/src/_models/data-models/schema-migration.data-model.ts +0 -50
- package/src/_models/interfaces/app-version-header-settings.interface.ts +0 -17
- package/src/_models/interfaces/certification-settings.interface.ts +0 -7
- package/src/_models/interfaces/compare-data-options.interface.ts +0 -27
- package/src/_models/interfaces/compare-data-result.interface.ts +0 -12
- package/src/_models/interfaces/cors-settings.interface.spec.ts +0 -52
- package/src/_models/interfaces/cors-settings.interface.ts +0 -56
- package/src/_models/interfaces/db-query-options.interface.ts +0 -33
- package/src/_models/interfaces/environment-settings.interface.ts +0 -59
- package/src/_models/interfaces/global-log-settings.interface.ts +0 -171
- package/src/_models/interfaces/global-service-settings.interface.ts +0 -47
- package/src/_models/interfaces/global-settings.interface.ts +0 -294
- package/src/_models/interfaces/migration-entry.interface.ts +0 -19
- package/src/_models/interfaces/mongo-transaction-settings.interface.ts +0 -9
- package/src/_models/interfaces/request-telemetry-settings.interface.ts +0 -9
- package/src/_models/interfaces/request-telemetry-snapshot.interface.ts +0 -30
- package/src/_models/interfaces/routing-module-settings.interface.ts +0 -21
- package/src/_models/interfaces/security-headers-settings.interface.ts +0 -50
- package/src/_models/interfaces/signed-url-verify-result.interface.ts +0 -13
- package/src/_models/interfaces/static-client-settings.interface.spec.ts +0 -29
- package/src/_models/interfaces/static-client-settings.interface.ts +0 -36
- package/src/_models/types/db-update.type.ts +0 -100
- package/src/_modules/account-security/_enums/account-challenge-purpose.type-enum.ts +0 -5
- package/src/_modules/account-security/_enums/account-refresh-token-state.type-enum.ts +0 -6
- package/src/_modules/account-security/_enums/account-session-state.type-enum.ts +0 -6
- package/src/_modules/account-security/_models/account-challenge-adapter.interface.ts +0 -17
- package/src/_modules/account-security/_models/account-challenge-issued.interface.ts +0 -6
- package/src/_modules/account-security/_models/account-challenge-record.interface.ts +0 -13
- package/src/_modules/account-security/_models/account-challenge-result.interface.ts +0 -8
- package/src/_modules/account-security/_models/account-challenge-settings.interface.ts +0 -9
- package/src/_modules/account-security/_models/account-password-policy.interface.ts +0 -11
- package/src/_modules/account-security/_models/account-password-verification.interface.ts +0 -5
- package/src/_modules/account-security/_models/account-refresh-token-record.interface.ts +0 -13
- package/src/_modules/account-security/_models/account-session-adapter.interface.ts +0 -19
- package/src/_modules/account-security/_models/account-session-claims.interface.ts +0 -7
- package/src/_modules/account-security/_models/account-session-context.interface.ts +0 -6
- package/src/_modules/account-security/_models/account-session-create.interface.ts +0 -8
- package/src/_modules/account-security/_models/account-session-record.interface.ts +0 -21
- package/src/_modules/account-security/_models/account-session-rotate.interface.ts +0 -11
- package/src/_modules/account-security/_models/account-session-settings.interface.ts +0 -11
- package/src/_modules/account-security/_models/account-session-token-pair.interface.ts +0 -8
- package/src/_modules/account-security/_models/account-session-view.interface.ts +0 -13
- package/src/_modules/account-security/account-challenge.control-service.spec.ts +0 -195
- package/src/_modules/account-security/account-challenge.control-service.ts +0 -164
- package/src/_modules/account-security/account-password.control-service.spec.ts +0 -96
- package/src/_modules/account-security/account-password.control-service.ts +0 -288
- package/src/_modules/account-security/account-session.control-service.spec.ts +0 -294
- package/src/_modules/account-security/account-session.control-service.ts +0 -376
- package/src/_modules/account-security/index.ts +0 -31
- package/src/_modules/admin-auth/_models/admin-api-key-config.interface.ts +0 -33
- package/src/_modules/admin-auth/admin-api-key.auth-service.spec.ts +0 -200
- package/src/_modules/admin-auth/admin-api-key.auth-service.ts +0 -220
- package/src/_modules/admin-auth/index.ts +0 -2
- package/src/_modules/ai/_collections/ai-model-config-validator.util.spec.ts +0 -150
- package/src/_modules/ai/_collections/ai-model-config-validator.util.ts +0 -131
- package/src/_modules/ai/_collections/ai-provider-error.util.ts +0 -144
- package/src/_modules/ai/_models/ai-input-interfaces.ts +0 -117
- package/src/_modules/ai/_models/ai-test-generation-result.interface.ts +0 -16
- package/src/_modules/ai/_models/interfaces/dynts-ai-cost-event-callback.interface.ts +0 -14
- package/src/_modules/ai/_models/interfaces/dynts-ai-cost-event.interface.ts +0 -56
- package/src/_modules/ai/_models/interfaces/dynts-ai-provider-error.interface.ts +0 -16
- package/src/_modules/ai/_modules/ai-mock/_collections/aim-default-collection.util.spec.ts +0 -72
- package/src/_modules/ai/_modules/ai-mock/_collections/aim-default-collection.util.ts +0 -71
- package/src/_modules/ai/_modules/ai-mock/_collections/aim-fixture-match.util.spec.ts +0 -57
- package/src/_modules/ai/_modules/ai-mock/_collections/aim-fixture-match.util.ts +0 -60
- package/src/_modules/ai/_modules/ai-mock/_collections/aim-fixture-serializer.util.spec.ts +0 -56
- package/src/_modules/ai/_modules/ai-mock/_collections/aim-fixture-serializer.util.ts +0 -117
- package/src/_modules/ai/_modules/ai-mock/_enums/aim-modality.enum.ts +0 -28
- package/src/_modules/ai/_modules/ai-mock/_models/interfaces/aim-call-input.interface.ts +0 -14
- package/src/_modules/ai/_modules/ai-mock/_models/interfaces/aim-error.interface.ts +0 -11
- package/src/_modules/ai/_modules/ai-mock/_models/interfaces/aim-fixture.interface.ts +0 -30
- package/src/_modules/ai/_modules/ai-mock/_models/interfaces/aim-request.interface.ts +0 -19
- package/src/_modules/ai/_modules/ai-mock/_models/interfaces/aim-service-collection.interface.ts +0 -20
- package/src/_modules/ai/_modules/ai-mock/_services/ai-embedding-mock.service.spec.ts +0 -115
- package/src/_modules/ai/_modules/ai-mock/_services/ai-embedding-mock.service.ts +0 -233
- package/src/_modules/ai/_modules/ai-mock/_services/aim-fixture-harness.service.spec.ts +0 -134
- package/src/_modules/ai/_modules/ai-mock/_services/aim-fixture-harness.service.ts +0 -127
- package/src/_modules/ai/_modules/ai-mock/_services/aim-fixture-pipeline.spec.ts +0 -105
- package/src/_modules/ai/_modules/ai-mock/_services/aim-fixture-store.service.spec.ts +0 -50
- package/src/_modules/ai/_modules/ai-mock/_services/aim-fixture-store.service.ts +0 -65
- package/src/_modules/ai/_modules/ai-mock/_services/aim-integration-proof.spec.ts +0 -92
- package/src/_modules/ai/_modules/ai-mock/_services/aim-mock.service.spec.ts +0 -112
- package/src/_modules/ai/_modules/ai-mock/_services/aim-mock.service.ts +0 -155
- package/src/_modules/ai/_modules/ai-mock/fixtures/aim-text.fixtures.ts +0 -649
- package/src/_modules/ai/_modules/ai-mock/index.ts +0 -47
- package/src/_modules/ai/_modules/anthropic/_services/aai-user-key.control-service.ts +0 -138
- package/src/_modules/ai/_modules/anthropic/index.ts +0 -5
- package/src/_modules/ai/_modules/document-ai/_collections/dai-chunking.util.spec.ts +0 -242
- package/src/_modules/ai/_modules/document-ai/_collections/dai-chunking.util.ts +0 -639
- package/src/_modules/ai/_modules/document-ai/_collections/dai-code-chunking.util.spec.ts +0 -295
- package/src/_modules/ai/_modules/document-ai/_collections/dai-code-chunking.util.ts +0 -552
- package/src/_modules/ai/_modules/document-ai/_collections/dai-document.util.spec.ts +0 -209
- package/src/_modules/ai/_modules/document-ai/_collections/dai-document.util.ts +0 -85
- package/src/_modules/ai/_modules/document-ai/_enums/dai-compare-result-type.enum.ts +0 -8
- package/src/_modules/ai/_modules/document-ai/_models/data-models/dai-doc-chunk.data-model.ts +0 -146
- package/src/_modules/ai/_modules/document-ai/_models/data-models/dai-doc-page.data-model.ts +0 -163
- package/src/_modules/ai/_modules/document-ai/_models/data-models/dai-document.data-model.ts +0 -100
- package/src/_modules/ai/_modules/document-ai/_models/interfaces/dai-code-chunk.interface.ts +0 -68
- package/src/_modules/ai/_modules/document-ai/_models/interfaces/dai-doc-chunk-compare-result.interface.ts +0 -18
- package/src/_modules/ai/_modules/document-ai/_models/interfaces/dai-doc-page-compare-result.interface.ts +0 -19
- package/src/_modules/ai/_modules/document-ai/_models/interfaces/dai-document-compare-result.interface.ts +0 -25
- package/src/_modules/ai/_modules/document-ai/index.ts +0 -30
- package/src/_modules/ai/_modules/fdp-ai/_services/fdpai-user-key.control-service.ts +0 -189
- package/src/_modules/ai/_modules/fdp-ai/index.ts +0 -5
- package/src/_modules/ai/_modules/open-ai/_collections/oai-global-settings.const.ts +0 -9
- package/src/_modules/ai/_modules/open-ai/_collections/oai-llm-predefined-requests-hu.conts.ts +0 -83
- package/src/_modules/ai/_modules/open-ai/_collections/oai-llm-predefined-requests.conts.ts +0 -76
- package/src/_modules/ai/_modules/open-ai/_enums/oai-gpt-message-role.enum.ts +0 -45
- package/src/_modules/ai/_modules/open-ai/_models/interfaces/oai-global-settings.interface.ts +0 -8
- package/src/_modules/ai/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.ts +0 -7
- package/src/_modules/ai/_modules/open-ai/_models/interfaces/oai-llm-predefined-requests.interface.ts +0 -57
- package/src/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-chunk-data.service.ts +0 -293
- package/src/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-page.data-service.ts +0 -572
- package/src/_modules/ai/_modules/open-ai/_services/data-services/oai-document.data-service.spec.ts +0 -342
- package/src/_modules/ai/_modules/open-ai/_services/data-services/oai-document.data-service.ts +0 -435
- package/src/_modules/ai/_modules/open-ai/_services/data-services/oai-vector-data.service.spec.ts +0 -550
- package/src/_modules/ai/_modules/open-ai/_services/data-services/oai-vector-data.service.ts +0 -631
- package/src/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.spec.ts +0 -332
- package/src/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.ts +0 -132
- package/src/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.spec.ts +0 -462
- package/src/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.ts +0 -635
- package/src/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.spec.ts +0 -489
- package/src/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.tools.spec.ts +0 -173
- package/src/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.ts +0 -1085
- package/src/_modules/ai/_modules/open-ai/_services/oai-user-key.control-service.ts +0 -157
- package/src/_modules/ai/_modules/open-ai/index.ts +0 -74
- package/src/_modules/ai/_services/ai-embedding-provider.registry.spec.ts +0 -110
- package/src/_modules/ai/_services/ai-embedding-provider.registry.ts +0 -114
- package/src/_modules/ai/_services/ai-embedding.service-base.spec.ts +0 -98
- package/src/_modules/ai/_services/ai-embedding.service-base.ts +0 -48
- package/src/_modules/ai/_services/ai-llm-chat.service-base.spec.ts +0 -229
- package/src/_modules/ai/_services/ai-llm-chat.service-base.ts +0 -68
- package/src/_modules/ai/_services/ai-llm.service-base.reconciler.spec.ts +0 -133
- package/src/_modules/ai/_services/ai-llm.service-base.spec.ts +0 -250
- package/src/_modules/ai/_services/ai-llm.service-base.ts +0 -599
- package/src/_modules/ai/_services/ai-provider.service-base.spec.ts +0 -158
- package/src/_modules/ai/_services/ai-provider.service-base.ts +0 -67
- package/src/_modules/ai/_services/ai-user-key.service-base.ts +0 -59
- package/src/_modules/ai/_services/lmstudio-embedding.control-service.spec.ts +0 -197
- package/src/_modules/ai/_services/lmstudio-embedding.control-service.ts +0 -399
- package/src/_modules/ai/index.ts +0 -33
- package/src/_modules/artifact-compiler/_enums/artifact-compile-outcome.type-enum.ts +0 -5
- package/src/_modules/artifact-compiler/_enums/artifact-compile-stage.type-enum.ts +0 -8
- package/src/_modules/artifact-compiler/_enums/artifact-retry-class.type-enum.ts +0 -6
- package/src/_modules/artifact-compiler/_models/artifact-compile.interface.ts +0 -35
- package/src/_modules/artifact-compiler/artifact-compiler.control-service.spec.ts +0 -151
- package/src/_modules/artifact-compiler/artifact-compiler.control-service.ts +0 -356
- package/src/_modules/artifact-compiler/index.ts +0 -9
- package/src/_modules/assistant/_collections/ass-global-settings.const.ts +0 -13
- package/src/_modules/assistant/_collections/ass.util.spec.ts +0 -176
- package/src/_modules/assistant/_collections/ass.util.ts +0 -50
- package/src/_modules/assistant/_models/ass-global-settings.interface.ts +0 -15
- package/src/_modules/assistant/_services/ass-io.control-service.spec.ts +0 -140
- package/src/_modules/assistant/_services/ass-io.control-service.ts +0 -74
- package/src/_modules/assistant/_services/ass-main.control-service.spec.ts +0 -192
- package/src/_modules/assistant/_services/ass-main.control-service.ts +0 -107
- package/src/_modules/assistant/index.ts +0 -19
- package/src/_modules/bot/_collections/bot-default-commands.const.ts +0 -12
- package/src/_modules/bot/_collections/bot-global-settings.const.ts +0 -39
- package/src/_modules/bot/_models/bot-channel-wrapper.interface.ts +0 -62
- package/src/_modules/bot/_models/bot-command.interface.ts +0 -8
- package/src/_modules/bot/_models/bot-global-settings.interface.ts +0 -96
- package/src/_modules/bot/_models/bot-last-mention-date.interface.ts +0 -6
- package/src/_modules/bot/_models/bot-last-message-date.interface.ts +0 -5
- package/src/_modules/bot/_models/bot-message-wrapper.interface.ts +0 -90
- package/src/_modules/bot/_models/bot-user-wrapper.interface.ts +0 -41
- package/src/_modules/bot/_modules/discord-bot/_models/dib-platform.types.ts +0 -10
- package/src/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.control-service.spec.ts +0 -431
- package/src/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.control-service.ts +0 -641
- package/src/_modules/bot/_modules/discord-bot/index.ts +0 -12
- package/src/_modules/bot/_modules/dynamo-bot/_collections/dyb-operations.util.spec.ts +0 -160
- package/src/_modules/bot/_modules/dynamo-bot/_collections/dyb-operations.util.ts +0 -55
- package/src/_modules/bot/_modules/dynamo-bot/_models/dyb-platform.types.ts +0 -15
- package/src/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.control-service.spec.ts +0 -374
- package/src/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.control-service.ts +0 -447
- package/src/_modules/bot/_modules/dynamo-bot/index.ts +0 -15
- package/src/_modules/bot/_modules/slack-bot/_models/slb-platform.types.ts +0 -9
- package/src/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.control-service.spec.ts +0 -344
- package/src/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.control-service.ts +0 -197
- package/src/_modules/bot/_modules/slack-bot/index.ts +0 -12
- package/src/_modules/bot/_modules/teams-bot/_models/teb-platform.types.ts +0 -9
- package/src/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.control-service.spec.ts +0 -345
- package/src/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.control-service.ts +0 -197
- package/src/_modules/bot/_modules/teams-bot/index.ts +0 -11
- package/src/_modules/bot/_services/bot-commands.control-service.spec.ts +0 -116
- package/src/_modules/bot/_services/bot-commands.control-service.ts +0 -158
- package/src/_modules/bot/_services/bot-io.control-service.spec.ts +0 -285
- package/src/_modules/bot/_services/bot-io.control-service.ts +0 -329
- package/src/_modules/bot/_services/bot-main.control-service.spec.ts +0 -208
- package/src/_modules/bot/_services/bot-main.control-service.ts +0 -489
- package/src/_modules/bot/_services/bot-messaging-provider.service-base.spec.ts +0 -349
- package/src/_modules/bot/_services/bot-messaging-provider.service-base.ts +0 -158
- package/src/_modules/bot/_services/bot-routines.control-service.spec.ts +0 -111
- package/src/_modules/bot/_services/bot-routines.control-service.ts +0 -78
- package/src/_modules/bot/index.ts +0 -37
- package/src/_modules/custom-data/custom-data.controller.spec.ts +0 -49
- package/src/_modules/custom-data/custom-data.controller.ts +0 -67
- package/src/_modules/custom-data/custom-data.data-service.spec.ts +0 -54
- package/src/_modules/custom-data/custom-data.data-service.ts +0 -22
- package/src/_modules/custom-data/get-custom-data-routing-module.util.spec.ts +0 -28
- package/src/_modules/custom-data/get-custom-data-routing-module.util.ts +0 -24
- package/src/_modules/custom-data/index.ts +0 -9
- package/src/_modules/data-readers/_collections/dynts-sqlite-reader.util.spec.ts +0 -176
- package/src/_modules/data-readers/_collections/dynts-sqlite-reader.util.ts +0 -203
- package/src/_modules/data-readers/_models/interfaces/dynts-sqlite-reader.interface.ts +0 -33
- package/src/_modules/data-readers/index.ts +0 -11
- package/src/_modules/defaults/_collections/default-endpoints.util.ts +0 -487
- package/src/_modules/defaults/_models/default-user.data-model.ts +0 -72
- package/src/_modules/defaults/_services/default-auth.service.spec.ts +0 -269
- package/src/_modules/defaults/_services/default-auth.service.ts +0 -177
- package/src/_modules/defaults/_services/default-socket-events.service.spec.ts +0 -42
- package/src/_modules/defaults/_services/default-socket-events.service.ts +0 -61
- package/src/_modules/defaults/_services/default-user.data-service.spec.ts +0 -187
- package/src/_modules/defaults/_services/default-user.data-service.ts +0 -98
- package/src/_modules/defaults/index.ts +0 -17
- package/src/_modules/discord-assistant/_collections/dias-global-settings.const.ts +0 -19
- package/src/_modules/discord-assistant/_collections/dias.util.spec.ts +0 -366
- package/src/_modules/discord-assistant/_collections/dias.util.ts +0 -133
- package/src/_modules/discord-assistant/_models/dias-global-settings.interface.ts +0 -20
- package/src/_modules/discord-assistant/_models/dias-knowledge.data-model.ts +0 -53
- package/src/_modules/discord-assistant/_services/dias-chunk.data-service.ts +0 -177
- package/src/_modules/discord-assistant/_services/dias-io.control-service.spec.ts +0 -108
- package/src/_modules/discord-assistant/_services/dias-io.control-service.ts +0 -69
- package/src/_modules/discord-assistant/_services/dias-main.control-service.spec.ts +0 -22
- package/src/_modules/discord-assistant/_services/dias-main.control-service.ts +0 -27
- package/src/_modules/discord-assistant/_services/dias.service-base.spec.ts +0 -195
- package/src/_modules/discord-assistant/_services/dias.service-base.ts +0 -77
- package/src/_modules/discord-assistant/index.ts +0 -38
- package/src/_modules/discord-assistant-voiced/_services/dias-discord-bot.control-service.spec.ts +0 -34
- package/src/_modules/discord-assistant-voiced/_services/dias-discord-bot.control-service.ts +0 -11
- package/src/_modules/discord-assistant-voiced/index.ts +0 -36
- package/src/_modules/discord-bot/_collections/dibo-default-commands.const.ts +0 -17
- package/src/_modules/discord-bot/_collections/dibo-global-settings.conts.ts +0 -56
- package/src/_modules/discord-bot/_collections/dibo-operations.util.spec.ts +0 -214
- package/src/_modules/discord-bot/_collections/dibo-operations.util.ts +0 -387
- package/src/_modules/discord-bot/_models/dibo-command.interface.ts +0 -12
- package/src/_modules/discord-bot/_models/dibo-global-settings.interface.ts +0 -98
- package/src/_modules/discord-bot/_models/dibo-last-mention-date.inteface.ts +0 -8
- package/src/_modules/discord-bot/_models/dibo-last-message-date.interface.ts +0 -6
- package/src/_modules/discord-bot/_services/dibo-commands.control-service.spec.ts +0 -154
- package/src/_modules/discord-bot/_services/dibo-commands.control-service.ts +0 -153
- package/src/_modules/discord-bot/_services/dibo-io.control-service.spec.ts +0 -264
- package/src/_modules/discord-bot/_services/dibo-io.control-service.ts +0 -306
- package/src/_modules/discord-bot/_services/dibo-main.control-service.spec.ts +0 -408
- package/src/_modules/discord-bot/_services/dibo-main.control-service.ts +0 -488
- package/src/_modules/discord-bot/_services/dibo-routines.control-service.spec.ts +0 -105
- package/src/_modules/discord-bot/_services/dibo-routines.control-service.ts +0 -97
- package/src/_modules/discord-bot/index.ts +0 -36
- package/src/_modules/local-vector-search/_enums/lvs-search-mode.enum.ts +0 -35
- package/src/_modules/local-vector-search/_models/data-models/lvs-vector-persist.data-model.ts +0 -60
- package/src/_modules/local-vector-search/_models/lvs-search-result.interface.ts +0 -17
- package/src/_modules/local-vector-search/_services/lvs-bm25.util.spec.ts +0 -159
- package/src/_modules/local-vector-search/_services/lvs-bm25.util.ts +0 -206
- package/src/_modules/local-vector-search/_services/lvs-doc-chunk-data.service.spec.ts +0 -418
- package/src/_modules/local-vector-search/_services/lvs-doc-chunk-data.service.ts +0 -276
- package/src/_modules/local-vector-search/_services/lvs-local-vector-search.data-service.spec.ts +0 -480
- package/src/_modules/local-vector-search/_services/lvs-local-vector-search.data-service.ts +0 -416
- package/src/_modules/local-vector-search/_services/lvs-persistent-vector-pool.control-service.spec.ts +0 -214
- package/src/_modules/local-vector-search/_services/lvs-persistent-vector-pool.control-service.ts +0 -186
- package/src/_modules/local-vector-search/_services/lvs-vector-persist.data-service.spec.ts +0 -167
- package/src/_modules/local-vector-search/_services/lvs-vector-persist.data-service.ts +0 -130
- package/src/_modules/local-vector-search/_services/lvs-vector-pool.control-service.spec.ts +0 -509
- package/src/_modules/local-vector-search/_services/lvs-vector-pool.control-service.ts +0 -323
- package/src/_modules/local-vector-search/index.ts +0 -17
- package/src/_modules/logs/_models/file-log-entry.interface.ts +0 -13
- package/src/_modules/logs/_models/file-log-read-result.interface.ts +0 -37
- package/src/_modules/logs/file-log.service.spec.ts +0 -341
- package/src/_modules/logs/file-log.service.ts +0 -466
- package/src/_modules/logs/file-logs.controller.spec.ts +0 -245
- package/src/_modules/logs/file-logs.controller.ts +0 -165
- package/src/_modules/logs/get-file-logs-routing-module.util.ts +0 -51
- package/src/_modules/logs/get-logs-routing-module.util.ts +0 -36
- package/src/_modules/logs/index.ts +0 -11
- package/src/_modules/logs/log-buffer.service.ts +0 -101
- package/src/_modules/logs/logs.controller.ts +0 -109
- package/src/_modules/logs/logs.service.ts +0 -100
- package/src/_modules/mcp/_models/interfaces/dynts-mcp.interface.ts +0 -111
- package/src/_modules/mcp/_services/dynts-mcp-server.service-base.spec.ts +0 -151
- package/src/_modules/mcp/_services/dynts-mcp-server.service-base.ts +0 -125
- package/src/_modules/mcp/_services/dynts-mcp.adapter.ts +0 -168
- package/src/_modules/mcp/index.ts +0 -13
- package/src/_modules/messaging/README.md +0 -354
- package/src/_modules/messaging/_collections/get-messaging-routing-module.util.ts +0 -26
- package/src/_modules/messaging/_collections/msg-global-settings.const.ts +0 -22
- package/src/_modules/messaging/_collections/msg.util.spec.ts +0 -226
- package/src/_modules/messaging/_collections/msg.util.ts +0 -83
- package/src/_modules/messaging/_models/msg-global-settings.interface.ts +0 -37
- package/src/_modules/messaging/_services/msg-conversation.data-service.ts +0 -146
- package/src/_modules/messaging/_services/msg-events.service.spec.ts +0 -219
- package/src/_modules/messaging/_services/msg-events.service.ts +0 -267
- package/src/_modules/messaging/_services/msg-integration.control-service.ts +0 -180
- package/src/_modules/messaging/_services/msg-main.control-service.spec.ts +0 -147
- package/src/_modules/messaging/_services/msg-main.control-service.ts +0 -572
- package/src/_modules/messaging/_services/msg-message.data-service.ts +0 -129
- package/src/_modules/messaging/_services/msg.controller.spec.ts +0 -201
- package/src/_modules/messaging/_services/msg.controller.ts +0 -370
- package/src/_modules/messaging/index.ts +0 -30
- package/src/_modules/mock/app-extended-server.mock.ts +0 -201
- package/src/_modules/mock/app-integration-test.mock.ts +0 -51
- package/src/_modules/mock/app-params.mock.spec.ts +0 -21
- package/src/_modules/mock/app-params.mock.ts +0 -9
- package/src/_modules/mock/app-server.mock.ts +0 -188
- package/src/_modules/mock/auth-service.mock.spec.ts +0 -47
- package/src/_modules/mock/auth-service.mock.ts +0 -28
- package/src/_modules/mock/controller.mock.spec.ts +0 -26
- package/src/_modules/mock/controller.mock.ts +0 -16
- package/src/_modules/mock/data-model.mock.spec.ts +0 -111
- package/src/_modules/mock/data-model.mock.ts +0 -82
- package/src/_modules/mock/email-service-collection.mock.spec.ts +0 -24
- package/src/_modules/mock/email-service-collection.mock.ts +0 -15
- package/src/_modules/mock/email-service.mock.spec.ts +0 -17
- package/src/_modules/mock/email-service.mock.ts +0 -20
- package/src/_modules/mock/email-template.mock.html +0 -15
- package/src/_modules/mock/endpoint.mock.ts +0 -91
- package/src/_modules/mock/socket-client.mock.spec.ts +0 -40
- package/src/_modules/mock/socket-client.mock.ts +0 -45
- package/src/_modules/mock/socket-server.mock.spec.ts +0 -44
- package/src/_modules/mock/socket-server.mock.ts +0 -46
- package/src/_modules/oauth2/_routes/oauth2.controller.spec.ts +0 -107
- package/src/_modules/oauth2/_routes/oauth2.controller.ts +0 -99
- package/src/_modules/oauth2/_services/oauth2.auth-service.spec.ts +0 -254
- package/src/_modules/oauth2/_services/oauth2.auth-service.ts +0 -232
- package/src/_modules/oauth2/_services/oauth2.control-service.spec.ts +0 -585
- package/src/_modules/oauth2/_services/oauth2.control-service.ts +0 -654
- package/src/_modules/oauth2/index.ts +0 -17
- package/src/_modules/privacy-lifecycle/_enums/privacy-consent-decision.type-enum.ts +0 -5
- package/src/_modules/privacy-lifecycle/_enums/privacy-contributor-action.type-enum.ts +0 -10
- package/src/_modules/privacy-lifecycle/_enums/privacy-contributor-outcome.type-enum.ts +0 -7
- package/src/_modules/privacy-lifecycle/_enums/privacy-request-state.type-enum.ts +0 -15
- package/src/_modules/privacy-lifecycle/_enums/privacy-request.type-enum.ts +0 -9
- package/src/_modules/privacy-lifecycle/_models/privacy-consent-input.interface.ts +0 -12
- package/src/_modules/privacy-lifecycle/_models/privacy-consent-persistence-result.interface.ts +0 -7
- package/src/_modules/privacy-lifecycle/_models/privacy-consent-record.interface.ts +0 -15
- package/src/_modules/privacy-lifecycle/_models/privacy-consent-result.interface.ts +0 -7
- package/src/_modules/privacy-lifecycle/_models/privacy-consent-view.interface.ts +0 -13
- package/src/_modules/privacy-lifecycle/_models/privacy-contributor-context.interface.ts +0 -9
- package/src/_modules/privacy-lifecycle/_models/privacy-contributor-outcome.interface.ts +0 -14
- package/src/_modules/privacy-lifecycle/_models/privacy-contributor-plan.interface.ts +0 -8
- package/src/_modules/privacy-lifecycle/_models/privacy-contributor.interface.ts +0 -17
- package/src/_modules/privacy-lifecycle/_models/privacy-ledger-adapter.interface.ts +0 -21
- package/src/_modules/privacy-lifecycle/_models/privacy-ledger-result.interface.ts +0 -9
- package/src/_modules/privacy-lifecycle/_models/privacy-ledger-settings.interface.ts +0 -7
- package/src/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-input.interface.ts +0 -10
- package/src/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-persistence-result.interface.ts +0 -7
- package/src/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-result.interface.ts +0 -7
- package/src/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-view.interface.ts +0 -11
- package/src/_modules/privacy-lifecycle/_models/privacy-legal-acceptance.interface.ts +0 -13
- package/src/_modules/privacy-lifecycle/_models/privacy-lifecycle-adapter.interface.ts +0 -19
- package/src/_modules/privacy-lifecycle/_models/privacy-lifecycle-settings.interface.ts +0 -9
- package/src/_modules/privacy-lifecycle/_models/privacy-request-create-result.interface.ts +0 -7
- package/src/_modules/privacy-lifecycle/_models/privacy-request-open.interface.ts +0 -10
- package/src/_modules/privacy-lifecycle/_models/privacy-request-persistence-create-result.interface.ts +0 -7
- package/src/_modules/privacy-lifecycle/_models/privacy-request-record.interface.ts +0 -21
- package/src/_modules/privacy-lifecycle/_models/privacy-request-result.interface.ts +0 -8
- package/src/_modules/privacy-lifecycle/_models/privacy-request-view.interface.ts +0 -20
- package/src/_modules/privacy-lifecycle/index.ts +0 -40
- package/src/_modules/privacy-lifecycle/privacy-ledger.control-service.spec.ts +0 -206
- package/src/_modules/privacy-lifecycle/privacy-ledger.control-service.ts +0 -253
- package/src/_modules/privacy-lifecycle/privacy-lifecycle.control-service.spec.ts +0 -353
- package/src/_modules/privacy-lifecycle/privacy-lifecycle.control-service.ts +0 -586
- package/src/_modules/rate-limit/_enums/rate-limit-store-kind.type-enum.ts +0 -5
- package/src/_modules/rate-limit/_models/rate-limit-config.interface.ts +0 -82
- package/src/_modules/rate-limit/_models/rate-limit-consume-request.interface.ts +0 -9
- package/src/_modules/rate-limit/_models/rate-limit-consume-result.interface.ts +0 -6
- package/src/_modules/rate-limit/_models/rate-limit-policy.interface.ts +0 -16
- package/src/_modules/rate-limit/_models/rate-limit-store.interface.ts +0 -9
- package/src/_modules/rate-limit/index.ts +0 -8
- package/src/_modules/rate-limit/rate-limit-in-memory.store.ts +0 -91
- package/src/_modules/rate-limit/rate-limit.middleware.spec.ts +0 -488
- package/src/_modules/rate-limit/rate-limit.middleware.ts +0 -504
- package/src/_modules/scheduler/_models/scheduler-job.interface.ts +0 -35
- package/src/_modules/scheduler/get-scheduler-routing-module.util.ts +0 -33
- package/src/_modules/scheduler/index.ts +0 -8
- package/src/_modules/scheduler/scheduler.controller.spec.ts +0 -42
- package/src/_modules/scheduler/scheduler.controller.ts +0 -69
- package/src/_modules/scheduler/scheduler.service.spec.ts +0 -141
- package/src/_modules/scheduler/scheduler.service.ts +0 -176
- package/src/_modules/scoped-config/_enums/dynts-scoped-config-level.enum.ts +0 -22
- package/src/_modules/scoped-config/_models/data-models/dynts-scoped-config.data-model.ts +0 -82
- package/src/_modules/scoped-config/_models/interfaces/dynts-scoped-config.interface.ts +0 -107
- package/src/_modules/scoped-config/_services/dynts-scoped-config.control-service.spec.ts +0 -312
- package/src/_modules/scoped-config/_services/dynts-scoped-config.control-service.ts +0 -311
- package/src/_modules/scoped-config/_services/dynts-scoped-config.data-service.spec.ts +0 -123
- package/src/_modules/scoped-config/_services/dynts-scoped-config.data-service.ts +0 -108
- package/src/_modules/scoped-config/index.ts +0 -17
- package/src/_modules/server/errors/errors.control-service.spec.ts +0 -246
- package/src/_modules/server/errors/errors.control-service.ts +0 -100
- package/src/_modules/server/errors/errors.controller.spec.ts +0 -340
- package/src/_modules/server/errors/errors.controller.ts +0 -559
- package/src/_modules/server/errors/errors.data-service.spec.ts +0 -480
- package/src/_modules/server/errors/errors.data-service.ts +0 -867
- package/src/_modules/server/index.ts +0 -40
- package/src/_modules/server/safe-diagnostic/safe-diagnostic-cause.type-enum.ts +0 -8
- package/src/_modules/server/safe-diagnostic/safe-diagnostic-stage.type-enum.ts +0 -20
- package/src/_modules/server/safe-diagnostic/safe-diagnostic.control-service.spec.ts +0 -124
- package/src/_modules/server/safe-diagnostic/safe-diagnostic.control-service.ts +0 -99
- package/src/_modules/server/safe-diagnostic/safe-diagnostic.interface.ts +0 -20
- package/src/_modules/server/server-status/db-readiness-probe-code.type-enum.ts +0 -13
- package/src/_modules/server/server-status/db-readiness-probe-stage.type-enum.ts +0 -7
- package/src/_modules/server/server-status/db-readiness-probe.control-service.spec.ts +0 -235
- package/src/_modules/server/server-status/db-readiness-probe.control-service.ts +0 -158
- package/src/_modules/server/server-status/db-readiness-probe.interface.ts +0 -20
- package/src/_modules/server/server-status/server-status-snapshot.control-service.spec.ts +0 -70
- package/src/_modules/server/server-status/server-status-snapshot.control-service.ts +0 -17
- package/src/_modules/server/server-status/server-status-snapshot.data-service.spec.ts +0 -77
- package/src/_modules/server/server-status/server-status-snapshot.data-service.ts +0 -37
- package/src/_modules/server/server-status/server-status.control-service.spec.ts +0 -672
- package/src/_modules/server/server-status/server-status.control-service.ts +0 -491
- package/src/_modules/server/server-status/server-status.controller.spec.ts +0 -276
- package/src/_modules/server/server-status/server-status.controller.ts +0 -336
- package/src/_modules/socket/_enums/socket-security.enum.ts +0 -11
- package/src/_modules/socket/_models/socket-client-service-params.control-model.spec.ts +0 -32
- package/src/_modules/socket/_models/socket-client-service-params.control-model.ts +0 -22
- package/src/_modules/socket/_models/socket-presence.control-model.spec.ts +0 -165
- package/src/_modules/socket/_models/socket-presence.control-model.ts +0 -211
- package/src/_modules/socket/_models/socket-server-service-params.control-model.spec.ts +0 -69
- package/src/_modules/socket/_models/socket-server-service-params.control-model.ts +0 -33
- package/src/_modules/socket/_services/socket-client.service.spec.ts +0 -15
- package/src/_modules/socket/_services/socket-client.service.ts +0 -260
- package/src/_modules/socket/_services/socket-server.service.spec.ts +0 -272
- package/src/_modules/socket/_services/socket-server.service.ts +0 -1037
- package/src/_modules/socket/app-extended.integration.spec.ts +0 -85
- package/src/_modules/socket/app-extended.server.ts +0 -648
- package/src/_modules/socket/index.ts +0 -42
- package/src/_modules/test/get-test-routing-module.util.spec.ts +0 -28
- package/src/_modules/test/get-test-routing-module.util.ts +0 -23
- package/src/_modules/test/index.ts +0 -12
- package/src/_modules/test/test.controller.spec.ts +0 -72
- package/src/_modules/test/test.controller.ts +0 -115
- package/src/_modules/test-email-sink/_collections/test-email-pattern.const.ts +0 -10
- package/src/_modules/test-email-sink/_models/data-models/dynts-sent-test-mail.data-model.ts +0 -41
- package/src/_modules/test-email-sink/_services/dynts-test-email-sink.service.spec.ts +0 -112
- package/src/_modules/test-email-sink/_services/dynts-test-email-sink.service.ts +0 -141
- package/src/_modules/test-email-sink/get-sent-mail-routing-module.util.ts +0 -29
- package/src/_modules/test-email-sink/index.ts +0 -11
- package/src/_modules/test-email-sink/test-email-sink.controller.ts +0 -83
- package/src/_modules/usage/get-usage-routing-module.util.ts +0 -23
- package/src/_modules/usage/index.ts +0 -15
- package/src/_modules/usage/usage.controller.spec.ts +0 -106
- package/src/_modules/usage/usage.controller.ts +0 -140
- package/src/_modules/usage/usage.data-service.spec.ts +0 -332
- package/src/_modules/usage/usage.data-service.ts +0 -185
- package/src/_services/base/api.service-base.spec.ts +0 -125
- package/src/_services/base/api.service-base.ts +0 -75
- package/src/_services/base/archive-data.service.spec.ts +0 -209
- package/src/_services/base/archive-data.service.ts +0 -228
- package/src/_services/base/data.service.spec.ts +0 -784
- package/src/_services/base/data.service.ts +0 -2792
- package/src/_services/base/db.service.encryption.spec.ts +0 -76
- package/src/_services/base/db.service.spec.ts +0 -160
- package/src/_services/base/db.service.ts +0 -1698
- package/src/_services/base/singleton.service-base.spec.ts +0 -28
- package/src/_services/base/singleton.service-base.ts +0 -24
- package/src/_services/base/singleton.service.spec.ts +0 -114
- package/src/_services/base/singleton.service.ts +0 -38
- package/src/_services/core/api.service.spec.ts +0 -187
- package/src/_services/core/api.service.ts +0 -627
- package/src/_services/core/auth.service.spec.ts +0 -159
- package/src/_services/core/auth.service.ts +0 -174
- package/src/_services/core/collection-growth-monitor.service.spec.ts +0 -119
- package/src/_services/core/collection-growth-monitor.service.ts +0 -234
- package/src/_services/core/db-stats.service.ts +0 -104
- package/src/_services/core/diagnostics.service.spec.ts +0 -44
- package/src/_services/core/diagnostics.service.ts +0 -158
- package/src/_services/core/email.service.spec.ts +0 -85
- package/src/_services/core/email.service.ts +0 -757
- package/src/_services/core/event-loop-diag.service.spec.ts +0 -22
- package/src/_services/core/event-loop-diag.service.ts +0 -144
- package/src/_services/core/global.service.spec.ts +0 -292
- package/src/_services/core/global.service.ts +0 -488
- package/src/_services/core/memory-guard.service.spec.ts +0 -245
- package/src/_services/core/memory-guard.service.ts +0 -481
- package/src/_services/core/migration-runner.service.spec.ts +0 -91
- package/src/_services/core/migration-runner.service.ts +0 -106
- package/src/_services/core/mongo-transaction.control-service.spec.ts +0 -165
- package/src/_services/core/mongo-transaction.control-service.ts +0 -148
- package/src/_services/core/request-hunter.service.spec.ts +0 -124
- package/src/_services/core/request-hunter.service.ts +0 -157
- package/src/_services/core/request-telemetry.control-service.spec.ts +0 -217
- package/src/_services/core/request-telemetry.control-service.ts +0 -381
- package/src/_services/core/service-collection.service.spec.ts +0 -46
- package/src/_services/core/service-collection.service.ts +0 -6
- package/src/_services/route/controller.service.spec.ts +0 -53
- package/src/_services/route/controller.service.ts +0 -148
- package/src/_services/route/routing-module.service.spec.ts +0 -98
- package/src/_services/route/routing-module.service.ts +0 -339
- package/src/_services/server/app-safe-diagnostic.spec.ts +0 -124
- package/src/_services/server/app.server-retention.spec.ts +0 -106
- package/src/_services/server/app.server.ts +0 -1979
- package/src/_services/shared.static-service.spec.ts +0 -133
- package/src/_services/shared.static-service.ts +0 -107
- package/src/index.ts +0 -120
- package/tsconfig.app.json +0 -12
- package/tsconfig.json +0 -42
|
@@ -1,159 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { DyNTS_AuthService } from './auth.service';
|
|
3
|
-
import { Request } from 'express';
|
|
4
|
-
import { DyFM_Error } from '@futdevpro/fsm-dynamo';
|
|
5
|
-
import { DyNTS_global_settings } from '../../_collections/global-settings.const';
|
|
6
|
-
|
|
7
|
-
class TestAuthService extends DyNTS_AuthService {
|
|
8
|
-
static getInstance(): TestAuthService {
|
|
9
|
-
return TestAuthService.getSingletonInstance();
|
|
10
|
-
}
|
|
11
|
-
|
|
12
|
-
authenticate_token = async (req: Request, res: any): Promise<void> => {
|
|
13
|
-
// Mock implementation
|
|
14
|
-
};
|
|
15
|
-
|
|
16
|
-
authenticate_tokenSelf = async (req: Request, res: any): Promise<void> => {
|
|
17
|
-
// Mock implementation
|
|
18
|
-
};
|
|
19
|
-
|
|
20
|
-
authenticate_tokenPerm_accUsageData = async (req: Request, res: any): Promise<void> => {
|
|
21
|
-
// Mock implementation
|
|
22
|
-
};
|
|
23
|
-
|
|
24
|
-
getIssuerFromRequest(req: Request): string {
|
|
25
|
-
return 'test-issuer';
|
|
26
|
-
}
|
|
27
|
-
|
|
28
|
-
getUsernameFromRequest(req: Request): string {
|
|
29
|
-
return 'test-user';
|
|
30
|
-
}
|
|
31
|
-
}
|
|
32
|
-
|
|
33
|
-
describe('| DyNTS_AuthService', () => {
|
|
34
|
-
let service: TestAuthService;
|
|
35
|
-
|
|
36
|
-
beforeEach(() => {
|
|
37
|
-
service = TestAuthService.getInstance();
|
|
38
|
-
});
|
|
39
|
-
|
|
40
|
-
it('| should be a singleton instance', () => {
|
|
41
|
-
const instance1 = TestAuthService.getInstance();
|
|
42
|
-
const instance2 = TestAuthService.getInstance();
|
|
43
|
-
|
|
44
|
-
expect(instance1).toBe(instance2);
|
|
45
|
-
expect(instance1).toBeInstanceOf(TestAuthService);
|
|
46
|
-
});
|
|
47
|
-
|
|
48
|
-
it('| should have default service name', () => {
|
|
49
|
-
expect(service.serviceName).toBe('AuthService');
|
|
50
|
-
});
|
|
51
|
-
|
|
52
|
-
it('| should have default error user message', () => {
|
|
53
|
-
expect(service.defaultErrorUserMsg).toBeDefined();
|
|
54
|
-
expect(service.defaultErrorUserMsg).toContain('Auth Error');
|
|
55
|
-
});
|
|
56
|
-
|
|
57
|
-
describe('| getTokenFromRequest', () => {
|
|
58
|
-
it('| should extract token from authorization header', () => {
|
|
59
|
-
const req = {
|
|
60
|
-
headers: {
|
|
61
|
-
authorization: 'Bearer test-token-123',
|
|
62
|
-
},
|
|
63
|
-
} as any as Request;
|
|
64
|
-
|
|
65
|
-
const result = service.getTokenFromRequest(req);
|
|
66
|
-
|
|
67
|
-
expect(result).toBe('test-token-123');
|
|
68
|
-
});
|
|
69
|
-
|
|
70
|
-
it('| should throw error when authorization header is missing', () => {
|
|
71
|
-
const req = {
|
|
72
|
-
headers: {},
|
|
73
|
-
} as any as Request;
|
|
74
|
-
|
|
75
|
-
expect(() => {
|
|
76
|
-
service.getTokenFromRequest(req);
|
|
77
|
-
}).toThrow();
|
|
78
|
-
});
|
|
79
|
-
|
|
80
|
-
it('| should throw error when authorization header is null', () => {
|
|
81
|
-
const req = {
|
|
82
|
-
headers: {
|
|
83
|
-
authorization: null,
|
|
84
|
-
},
|
|
85
|
-
} as any as Request;
|
|
86
|
-
|
|
87
|
-
expect(() => {
|
|
88
|
-
service.getTokenFromRequest(req);
|
|
89
|
-
}).toThrow();
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
it('| should throw error when token is missing from header', () => {
|
|
93
|
-
const req = {
|
|
94
|
-
headers: {
|
|
95
|
-
authorization: 'Bearer ',
|
|
96
|
-
},
|
|
97
|
-
} as any as Request;
|
|
98
|
-
|
|
99
|
-
expect(() => {
|
|
100
|
-
service.getTokenFromRequest(req);
|
|
101
|
-
}).toThrow();
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
it('| should throw error when authorization header does not contain Bearer', () => {
|
|
105
|
-
const req = {
|
|
106
|
-
headers: {
|
|
107
|
-
authorization: 'InvalidFormat token',
|
|
108
|
-
},
|
|
109
|
-
} as any as Request;
|
|
110
|
-
|
|
111
|
-
const result = service.getTokenFromRequest(req);
|
|
112
|
-
|
|
113
|
-
expect(result).toBe('token');
|
|
114
|
-
});
|
|
115
|
-
|
|
116
|
-
it('| should handle token with spaces correctly', () => {
|
|
117
|
-
const req = {
|
|
118
|
-
headers: {
|
|
119
|
-
authorization: 'Bearer token-with-spaces',
|
|
120
|
-
},
|
|
121
|
-
} as any as Request;
|
|
122
|
-
|
|
123
|
-
const result = service.getTokenFromRequest(req);
|
|
124
|
-
|
|
125
|
-
expect(result).toBe('token-with-spaces');
|
|
126
|
-
});
|
|
127
|
-
|
|
128
|
-
it('| should include error code in thrown error', () => {
|
|
129
|
-
const req = {
|
|
130
|
-
headers: {},
|
|
131
|
-
} as any as Request;
|
|
132
|
-
|
|
133
|
-
try {
|
|
134
|
-
service.getTokenFromRequest(req);
|
|
135
|
-
fail('Should have thrown an error');
|
|
136
|
-
} catch (error) {
|
|
137
|
-
expect(error).toBeInstanceOf(DyFM_Error);
|
|
138
|
-
expect((error as DyFM_Error)._errorCode).toContain('DyNTS-AS0-GT0');
|
|
139
|
-
}
|
|
140
|
-
});
|
|
141
|
-
|
|
142
|
-
it('| should include confidential content in error when header missing', () => {
|
|
143
|
-
const req = {
|
|
144
|
-
headers: {
|
|
145
|
-
'x-custom-header': 'value',
|
|
146
|
-
},
|
|
147
|
-
} as any as Request;
|
|
148
|
-
|
|
149
|
-
try {
|
|
150
|
-
service.getTokenFromRequest(req);
|
|
151
|
-
fail('Should have thrown an error');
|
|
152
|
-
} catch (error) {
|
|
153
|
-
expect(error).toBeInstanceOf(DyFM_Error);
|
|
154
|
-
expect((error as DyFM_Error).confidentialContent).toBeDefined();
|
|
155
|
-
}
|
|
156
|
-
});
|
|
157
|
-
});
|
|
158
|
-
});
|
|
159
|
-
|
|
@@ -1,174 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import { Request, Response } from 'express';
|
|
3
|
-
|
|
4
|
-
import { DyFM_Error } from '@futdevpro/fsm-dynamo';
|
|
5
|
-
|
|
6
|
-
import { DyNTS_SingletonService } from '../base/singleton.service';
|
|
7
|
-
import { DyNTS_global_settings } from '../../_collections/global-settings.const';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* Extend this class as an Auth Service implementation
|
|
11
|
-
*
|
|
12
|
-
* You should use singleton instance getting function by implementing a
|
|
13
|
-
* static getInstance() function
|
|
14
|
-
* @example
|
|
15
|
-
* export class AuthService extends DyNTS_AuthService {
|
|
16
|
-
*
|
|
17
|
-
* static getInstance(): AuthService {
|
|
18
|
-
* return AuthService.getSingletonInstance();
|
|
19
|
-
* }
|
|
20
|
-
* ...
|
|
21
|
-
*/
|
|
22
|
-
export abstract class DyNTS_AuthService extends DyNTS_SingletonService {
|
|
23
|
-
|
|
24
|
-
readonly serviceName: string = 'AuthService';
|
|
25
|
-
|
|
26
|
-
override readonly defaultErrorUserMsg =
|
|
27
|
-
`We encountered an unhandled Auth Error, ` +
|
|
28
|
-
`\nplease contact the responsible development team.`;
|
|
29
|
-
|
|
30
|
-
/**
|
|
31
|
-
* this function returns the 'authorization' header from the Request,
|
|
32
|
-
* or throws error, if its missing
|
|
33
|
-
*
|
|
34
|
-
* @param req
|
|
35
|
-
* @returns
|
|
36
|
-
*/
|
|
37
|
-
getTokenFromRequest(req: Request): string {
|
|
38
|
-
const authHeader = req?.headers?.['authorization'];
|
|
39
|
-
|
|
40
|
-
if (!authHeader) {
|
|
41
|
-
throw new DyFM_Error({
|
|
42
|
-
status: 401,
|
|
43
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-GT0`,
|
|
44
|
-
addECToUserMsg: true,
|
|
45
|
-
message: 'AuthHeader missing!',
|
|
46
|
-
userMessage: this.defaultErrorUserMsg,
|
|
47
|
-
issuerService: this.serviceName,
|
|
48
|
-
confidentialContent: { headers: req?.headers },
|
|
49
|
-
});
|
|
50
|
-
}
|
|
51
|
-
|
|
52
|
-
const token = authHeader.split(' ')[1];
|
|
53
|
-
|
|
54
|
-
if (!token) {
|
|
55
|
-
throw new DyFM_Error({
|
|
56
|
-
status: 401,
|
|
57
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-GT1`,
|
|
58
|
-
addECToUserMsg: true,
|
|
59
|
-
message: 'Token missing!',
|
|
60
|
-
userMessage: this.defaultErrorUserMsg,
|
|
61
|
-
issuerService: this.serviceName,
|
|
62
|
-
confidentialContent: { headers: req?.headers },
|
|
63
|
-
});
|
|
64
|
-
}
|
|
65
|
-
|
|
66
|
-
return token;
|
|
67
|
-
}
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* You need to implement a token validation logic,
|
|
71
|
-
* when if the token is invalid, or the authentication fails, it sends or throws an error
|
|
72
|
-
*
|
|
73
|
-
* @example
|
|
74
|
-
*
|
|
75
|
-
* async authenticateToken(req: Request, res: Response, next: NextFunction) {
|
|
76
|
-
* try {
|
|
77
|
-
* let token = AuthService.getTokenFromRequest(req);
|
|
78
|
-
* token = await AuthService.verifyToken(token);
|
|
79
|
-
*
|
|
80
|
-
* DyFM_Log.success('token authenticated');
|
|
81
|
-
* res.setHeader('authorization', `Bearer ${token}`);
|
|
82
|
-
* next();
|
|
83
|
-
* } catch (error) {
|
|
84
|
-
* error = new DyFM_Error({
|
|
85
|
-
* status: 401,
|
|
86
|
-
* message: `authenticateToken (WB-ERROR)`,
|
|
87
|
-
* addECToUserMsg: true,
|
|
88
|
-
* userMessage: `Authorization failed.`,
|
|
89
|
-
* error
|
|
90
|
-
* });
|
|
91
|
-
* DyFM_Log.error(error?.message, error);
|
|
92
|
-
*
|
|
93
|
-
* res.status(error.status);
|
|
94
|
-
* res.send(error);
|
|
95
|
-
* }
|
|
96
|
-
* }
|
|
97
|
-
* */
|
|
98
|
-
abstract authenticate_token: (req: Request, res: Response) => Promise<void>;
|
|
99
|
-
|
|
100
|
-
/**
|
|
101
|
-
* You need to implement a token validation logic,
|
|
102
|
-
* when if the token is invalid, or the authentication fails, it sends or throws an error
|
|
103
|
-
*
|
|
104
|
-
* @param req
|
|
105
|
-
* @param res
|
|
106
|
-
* @param next
|
|
107
|
-
*
|
|
108
|
-
* @example
|
|
109
|
-
*
|
|
110
|
-
* async authenticate_tokenSelf(req: Request, res: Response, next: NextFunction): Promise<void> {
|
|
111
|
-
* try {
|
|
112
|
-
* let token = AuthService.getTokenFromRequest(req);
|
|
113
|
-
* token = await AuthService.verifyTokenSelf(token, req?.params?.userId);
|
|
114
|
-
* DyFM_Log.success('selftoken authenticated');
|
|
115
|
-
*
|
|
116
|
-
* res.setHeader('authorization', `Bearer ${token}`);
|
|
117
|
-
* next();
|
|
118
|
-
* } catch (error) {
|
|
119
|
-
* error = new DyFM_Error({
|
|
120
|
-
* status: 401,
|
|
121
|
-
* message: `authenticate_tokenSelf (WB-ERROR)`,
|
|
122
|
-
* addECToUserMsg: true,
|
|
123
|
-
* userMessage: `Authorization failed.`,
|
|
124
|
-
* error
|
|
125
|
-
* });
|
|
126
|
-
* DyFM_Log.error(error?.message, error);
|
|
127
|
-
*
|
|
128
|
-
* res.status(error.status);
|
|
129
|
-
* res.send(error);
|
|
130
|
-
* }
|
|
131
|
-
* }
|
|
132
|
-
*
|
|
133
|
-
*/
|
|
134
|
-
abstract authenticate_tokenSelf: (req: Request, res: Response) => Promise<void>;
|
|
135
|
-
|
|
136
|
-
/**
|
|
137
|
-
* Authenticate Token for Permission to Access UsageData
|
|
138
|
-
* @param req
|
|
139
|
-
* @param res
|
|
140
|
-
* @param next
|
|
141
|
-
*
|
|
142
|
-
* @example
|
|
143
|
-
* You need to implement a token validation logic,
|
|
144
|
-
* when if the token is invalid, or the authentication fails, it sends or throws an error
|
|
145
|
-
*
|
|
146
|
-
* async authTokenPermAccUsageData(req: Request, res: Response, next: NextFunction): Promise<void> {
|
|
147
|
-
* AuthService.authTokenAndPerm(req, res, next, Permission.accessUsageData);
|
|
148
|
-
* }
|
|
149
|
-
*/
|
|
150
|
-
abstract authenticate_tokenPerm_accUsageData: (req: Request, res: Response) => Promise<void>;
|
|
151
|
-
|
|
152
|
-
/**
|
|
153
|
-
* The DynamoNTS System is using this to get issuer, that will be set on DBServices
|
|
154
|
-
* Don't throw error in this function, since it will be used in every request
|
|
155
|
-
* @param req
|
|
156
|
-
*
|
|
157
|
-
* @example
|
|
158
|
-
* getAccountIdFromRequest(req: Request): string {
|
|
159
|
-
* try {
|
|
160
|
-
* const authHeader = req.headers['authorization'];
|
|
161
|
-
* const token = authHeader.split(' ')[1];
|
|
162
|
-
* return this.getAccountIdFromToken(token);
|
|
163
|
-
* } catch {
|
|
164
|
-
* return undefined;
|
|
165
|
-
* }
|
|
166
|
-
* }
|
|
167
|
-
*/
|
|
168
|
-
abstract getIssuerFromRequest(req: Request): string;
|
|
169
|
-
/**
|
|
170
|
-
* Basic Module: UsageModule uses this function
|
|
171
|
-
* @param req
|
|
172
|
-
*/
|
|
173
|
-
abstract getUsernameFromRequest(req: Request): string;
|
|
174
|
-
}
|
|
@@ -1,119 +0,0 @@
|
|
|
1
|
-
import { DyNTS_CollectionGrowthAlert, DyNTS_CollectionGrowthMonitor } from './collection-growth-monitor.service';
|
|
2
|
-
|
|
3
|
-
/**
|
|
4
|
-
* FR-258 / SR-4 — unit tests for the pure growth-evaluation core
|
|
5
|
-
* (`DyNTS_CollectionGrowthMonitor.evaluateGrowth`). No I/O, no timers — covers size-threshold,
|
|
6
|
-
* growth-rate, both/neither, and the first-poll (no prior snapshot) edge cases.
|
|
7
|
-
*/
|
|
8
|
-
describe('| DyNTS_CollectionGrowthMonitor.evaluateGrowth (FR-258 / SR-4)', () => {
|
|
9
|
-
|
|
10
|
-
const SIZE_THRESHOLD: number = 250000;
|
|
11
|
-
const GROWTH_PCT: number = 50;
|
|
12
|
-
|
|
13
|
-
function kinds(alerts: DyNTS_CollectionGrowthAlert[]): string[] {
|
|
14
|
-
return alerts.map((a: DyNTS_CollectionGrowthAlert): string => a.kind).sort();
|
|
15
|
-
}
|
|
16
|
-
|
|
17
|
-
it('| under threshold + no prior snapshot → no alerts', () => {
|
|
18
|
-
const alerts: DyNTS_CollectionGrowthAlert[] =
|
|
19
|
-
DyNTS_CollectionGrowthMonitor.evaluateGrowth('logs', 100, undefined, SIZE_THRESHOLD, GROWTH_PCT);
|
|
20
|
-
expect(alerts).toEqual([]);
|
|
21
|
-
});
|
|
22
|
-
|
|
23
|
-
it('| over size threshold → a "size" alert with the right detail', () => {
|
|
24
|
-
const alerts: DyNTS_CollectionGrowthAlert[] =
|
|
25
|
-
DyNTS_CollectionGrowthMonitor.evaluateGrowth('cdp_report_details_archiveds', 300000, undefined, SIZE_THRESHOLD, GROWTH_PCT);
|
|
26
|
-
expect(kinds(alerts)).toEqual(['size']);
|
|
27
|
-
expect(alerts[0].dataName).toBe('cdp_report_details_archiveds');
|
|
28
|
-
expect(alerts[0].detail).toEqual({ collection: 'cdp_report_details_archiveds', docCount: 300000, threshold: SIZE_THRESHOLD, retentionDays: null });
|
|
29
|
-
});
|
|
30
|
-
|
|
31
|
-
it('| exactly AT the threshold → no size alert (strictly greater)', () => {
|
|
32
|
-
const alerts: DyNTS_CollectionGrowthAlert[] =
|
|
33
|
-
DyNTS_CollectionGrowthMonitor.evaluateGrowth('logs', SIZE_THRESHOLD, undefined, SIZE_THRESHOLD, GROWTH_PCT);
|
|
34
|
-
expect(alerts).toEqual([]);
|
|
35
|
-
});
|
|
36
|
-
|
|
37
|
-
it('| grew more than the growth-rate % since last poll → a "growth" alert', () => {
|
|
38
|
-
const alerts: DyNTS_CollectionGrowthAlert[] =
|
|
39
|
-
DyNTS_CollectionGrowthMonitor.evaluateGrowth('pipeline_jobs', 200, { docCount: 100, atMs: 0 }, SIZE_THRESHOLD, GROWTH_PCT);
|
|
40
|
-
expect(kinds(alerts)).toEqual(['growth']);
|
|
41
|
-
expect(alerts[0].detail).toEqual({ collection: 'pipeline_jobs', oldCount: 100, newCount: 200, growthPct: 100 });
|
|
42
|
-
});
|
|
43
|
-
|
|
44
|
-
it('| grew LESS than the growth-rate % → no growth alert', () => {
|
|
45
|
-
const alerts: DyNTS_CollectionGrowthAlert[] =
|
|
46
|
-
DyNTS_CollectionGrowthMonitor.evaluateGrowth('logs', 110, { docCount: 100, atMs: 0 }, SIZE_THRESHOLD, GROWTH_PCT);
|
|
47
|
-
expect(alerts).toEqual([]);
|
|
48
|
-
});
|
|
49
|
-
|
|
50
|
-
it('| both over-threshold AND fast-growth → BOTH alerts', () => {
|
|
51
|
-
const alerts: DyNTS_CollectionGrowthAlert[] =
|
|
52
|
-
DyNTS_CollectionGrowthMonitor.evaluateGrowth('big', 400000, { docCount: 100000, atMs: 0 }, SIZE_THRESHOLD, GROWTH_PCT);
|
|
53
|
-
expect(kinds(alerts)).toEqual(['growth', 'size']);
|
|
54
|
-
});
|
|
55
|
-
|
|
56
|
-
it('| prior snapshot with zero docCount → no growth alert (avoid divide-by-zero)', () => {
|
|
57
|
-
const alerts: DyNTS_CollectionGrowthAlert[] =
|
|
58
|
-
DyNTS_CollectionGrowthMonitor.evaluateGrowth('fresh', 5000, { docCount: 0, atMs: 0 }, SIZE_THRESHOLD, GROWTH_PCT);
|
|
59
|
-
expect(alerts).toEqual([]);
|
|
60
|
-
});
|
|
61
|
-
|
|
62
|
-
it('| shrinking collection (negative growth) → no growth alert', () => {
|
|
63
|
-
const alerts: DyNTS_CollectionGrowthAlert[] =
|
|
64
|
-
DyNTS_CollectionGrowthMonitor.evaluateGrowth('pruned', 50, { docCount: 100, atMs: 0 }, SIZE_THRESHOLD, GROWTH_PCT);
|
|
65
|
-
expect(alerts).toEqual([]);
|
|
66
|
-
});
|
|
67
|
-
});
|
|
68
|
-
|
|
69
|
-
/**
|
|
70
|
-
* FR-311 spec — a size-riasztas RETENTION-TUDATOS tanacsa.
|
|
71
|
-
*
|
|
72
|
-
* MIERT SZAMIT (elesbol jott, 2026-08-19): az overseer `ov_secret_audit` kollekcioja 253 617
|
|
73
|
-
* dokumentumnal jart, es a monitor azt tanacsolta, hogy "Consider declaring `retention` on this
|
|
74
|
-
* model" — HOLOTT a modell MAR deklaral `retention: { retentionDays: 365 }`-ot. Az operator tehat
|
|
75
|
-
* orankent kapott egy olyan feladatot, ami mar KESZ volt, ráadásul az error-tarba is elmentve.
|
|
76
|
-
*
|
|
77
|
-
* A ket helyzet KULONBOZO teendot kiván:
|
|
78
|
-
* - nincs retention -> deklaralj egyet,
|
|
79
|
-
* - VAN retention -> az ablak tul hosszu, vagy a novekedes gyorsabb a TTL-nel.
|
|
80
|
-
*/
|
|
81
|
-
describe('| FR-311 — retention-tudatos size-riasztas', () => {
|
|
82
|
-
const SIZE_T: number = 250000;
|
|
83
|
-
const GROWTH_P: number = 50;
|
|
84
|
-
|
|
85
|
-
it('| retention NELKUL a deklaralasra szolit fel (valtozatlan viselkedes)', () => {
|
|
86
|
-
const alerts = DyNTS_CollectionGrowthMonitor.evaluateGrowth('logs', 300000, undefined, SIZE_T, GROWTH_P);
|
|
87
|
-
expect(alerts.length).toBe(1);
|
|
88
|
-
expect(alerts[0].message).toContain('Consider declaring');
|
|
89
|
-
expect(alerts[0].detail.retentionDays).toBeNull();
|
|
90
|
-
});
|
|
91
|
-
|
|
92
|
-
/** A VALODI eset: 365 napos retention mellett is 253 617 dokumentum. */
|
|
93
|
-
it('| deklaralt retention mellett NEM a deklaralast ajanlja, hanem az ablak szukiteset', () => {
|
|
94
|
-
const alerts = DyNTS_CollectionGrowthMonitor.evaluateGrowth(
|
|
95
|
-
'ov_secret_audit', 253617, undefined, SIZE_T, GROWTH_P, 365 * 86400,
|
|
96
|
-
);
|
|
97
|
-
expect(alerts.length).toBe(1);
|
|
98
|
-
expect(alerts[0].message).not.toContain('Consider declaring');
|
|
99
|
-
expect(alerts[0].message).toContain('DESPITE');
|
|
100
|
-
expect(alerts[0].message).toContain('365 day(s)');
|
|
101
|
-
expect(alerts[0].detail.retentionDays).toBe(365);
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
it('| a napra kerekites ttlSeconds-bol is helyes', () => {
|
|
105
|
-
const alerts = DyNTS_CollectionGrowthMonitor.evaluateGrowth('x', 300000, undefined, SIZE_T, GROWTH_P, 14 * 86400);
|
|
106
|
-
expect(alerts[0].message).toContain('14 day(s)');
|
|
107
|
-
expect(alerts[0].detail.retentionDays).toBe(14);
|
|
108
|
-
});
|
|
109
|
-
|
|
110
|
-
/** A retention a GROWTH-riasztast nem erinti — az fuggetlen jelzes marad. */
|
|
111
|
-
it('| a growth-riasztas szoveget a retention NEM valtoztatja', () => {
|
|
112
|
-
const alerts = DyNTS_CollectionGrowthMonitor.evaluateGrowth(
|
|
113
|
-
'y', 400000, { docCount: 100000, atMs: 0 }, SIZE_T, GROWTH_P, 30 * 86400,
|
|
114
|
-
);
|
|
115
|
-
const growth = alerts.find((a) => a.kind === 'growth');
|
|
116
|
-
expect(growth).toBeDefined();
|
|
117
|
-
expect(growth!.message).toContain('fast unbounded growth');
|
|
118
|
-
});
|
|
119
|
-
});
|
|
@@ -1,234 +0,0 @@
|
|
|
1
|
-
import {
|
|
2
|
-
DyFM_Error, DyFM_ErrorLevel, DyFM_Log, DyFM_RetentionSettings, DyFM_resolveRetentionTtlSeconds,
|
|
3
|
-
} from '@futdevpro/fsm-dynamo';
|
|
4
|
-
|
|
5
|
-
import { DyNTS_global_settings } from '../../_collections/global-settings.const';
|
|
6
|
-
import { DyNTS_SingletonServiceBase } from '../base/singleton.service-base';
|
|
7
|
-
import { DyNTS_GlobalService } from './global.service';
|
|
8
|
-
|
|
9
|
-
/**
|
|
10
|
-
* FR-258 / SR-4 — Collection Growth Monitor (proactive companion to DyNTS_MemoryGuard).
|
|
11
|
-
*
|
|
12
|
-
* The MemoryGuard is REACTIVE: it fires when the heap is already near OOM. This monitor is
|
|
13
|
-
* PROACTIVE: it periodically samples each registered collection's document count (via the cheap,
|
|
14
|
-
* scan-free `estimatedDocumentCount()`) and raises a warning into the Errors-sink BEFORE a bloated
|
|
15
|
-
* collection can be loaded into heap and GC-thrash the process (the 2026-06-23 overseer incident:
|
|
16
|
-
* `cdp_report_details_archiveds` reached 3 GB / `pipeline_jobs` 2 GB, unbounded).
|
|
17
|
-
*
|
|
18
|
-
* It pairs with SR-1/SR-2 (declarative retention TTL): TTL keeps collections bounded; this monitor
|
|
19
|
-
* surfaces the ones that AREN'T (no retention declared, or growing faster than retention prunes) so
|
|
20
|
-
* an operator can add `retention` before it becomes an OOM. Pure observation — never deletes.
|
|
21
|
-
*
|
|
22
|
-
* Like the MemoryGuard it is a singleton, idempotent, fully non-fatal (a monitoring layer must never
|
|
23
|
-
* crash a server), and its timer is `unref()`-ed so it can't keep the process alive on its own.
|
|
24
|
-
*/
|
|
25
|
-
export interface DyNTS_CollectionGrowthMonitor_Config {
|
|
26
|
-
/** Master switch. Default: `DyNTS_global_settings.collectionGrowthMonitor.enabled` (true). */
|
|
27
|
-
enabled?: boolean;
|
|
28
|
-
/** Poll cadence in ms. Default: 300000 (5 min) — collection growth is slow, no need to poll often. */
|
|
29
|
-
pollIntervalMs?: number;
|
|
30
|
-
/** Warn when a collection's document count exceeds this. Default: 250000. */
|
|
31
|
-
sizeThresholdDocCount?: number;
|
|
32
|
-
/** Warn when a collection grew by more than this percent since the previous poll. Default: 50. */
|
|
33
|
-
growthRateThresholdPct?: number;
|
|
34
|
-
/** Re-alert cooldown per collection per alert-kind, in ms (anti-flood). Default: 3600000 (1 h). */
|
|
35
|
-
reAlertCooldownMs?: number;
|
|
36
|
-
}
|
|
37
|
-
|
|
38
|
-
/** One growth finding to surface to the Errors-sink. */
|
|
39
|
-
export interface DyNTS_CollectionGrowthAlert {
|
|
40
|
-
kind: 'size' | 'growth';
|
|
41
|
-
dataName: string;
|
|
42
|
-
message: string;
|
|
43
|
-
detail: Record<string, unknown>;
|
|
44
|
-
}
|
|
45
|
-
|
|
46
|
-
interface CollectionSnapshot {
|
|
47
|
-
docCount: number;
|
|
48
|
-
atMs: number;
|
|
49
|
-
}
|
|
50
|
-
|
|
51
|
-
export class DyNTS_CollectionGrowthMonitor extends DyNTS_SingletonServiceBase {
|
|
52
|
-
|
|
53
|
-
static getInstance(): DyNTS_CollectionGrowthMonitor {
|
|
54
|
-
return DyNTS_CollectionGrowthMonitor.getSingletonInstance() as DyNTS_CollectionGrowthMonitor;
|
|
55
|
-
}
|
|
56
|
-
|
|
57
|
-
private timer: ReturnType<typeof setInterval> | null = null;
|
|
58
|
-
private installed: boolean = false;
|
|
59
|
-
|
|
60
|
-
// Resolved (effective) config — filled at install().
|
|
61
|
-
private pollIntervalMs: number = 300000;
|
|
62
|
-
private sizeThresholdDocCount: number = 250000;
|
|
63
|
-
private growthRateThresholdPct: number = 50;
|
|
64
|
-
private reAlertCooldownMs: number = 3600000;
|
|
65
|
-
|
|
66
|
-
private readonly lastSnapshotByCollection: Map<string, CollectionSnapshot> = new Map();
|
|
67
|
-
/** Last time we alerted, keyed by `${dataName}:${kind}` — for the anti-flood cooldown. */
|
|
68
|
-
private readonly lastAlertAtByKey: Map<string, number> = new Map();
|
|
69
|
-
|
|
70
|
-
protected constructor() {
|
|
71
|
-
super();
|
|
72
|
-
}
|
|
73
|
-
|
|
74
|
-
/**
|
|
75
|
-
* Start the monitor. Idempotent (a second call is a no-op). `config` overrides
|
|
76
|
-
* `DyNTS_global_settings.collectionGrowthMonitor`, which overrides the built-in defaults. NEVER
|
|
77
|
-
* throws — every error is try/catch-ed and descriptively logged.
|
|
78
|
-
*/
|
|
79
|
-
install(config?: DyNTS_CollectionGrowthMonitor_Config): void {
|
|
80
|
-
if (this.installed) { return; }
|
|
81
|
-
|
|
82
|
-
try {
|
|
83
|
-
const g: NonNullable<typeof DyNTS_global_settings.collectionGrowthMonitor> =
|
|
84
|
-
DyNTS_global_settings.collectionGrowthMonitor ?? { enabled: true };
|
|
85
|
-
|
|
86
|
-
if (!(config?.enabled ?? g.enabled ?? true)) { return; }
|
|
87
|
-
|
|
88
|
-
this.pollIntervalMs = config?.pollIntervalMs ?? g.pollIntervalMs ?? 300000;
|
|
89
|
-
this.sizeThresholdDocCount = config?.sizeThresholdDocCount ?? g.sizeThresholdDocCount ?? 250000;
|
|
90
|
-
this.growthRateThresholdPct = config?.growthRateThresholdPct ?? g.growthRateThresholdPct ?? 50;
|
|
91
|
-
this.reAlertCooldownMs = config?.reAlertCooldownMs ?? g.reAlertCooldownMs ?? 3600000;
|
|
92
|
-
|
|
93
|
-
this.installed = true;
|
|
94
|
-
this.timer = setInterval((): void => { void this.poll(); }, this.pollIntervalMs);
|
|
95
|
-
if (typeof this.timer.unref === 'function') { this.timer.unref(); }
|
|
96
|
-
|
|
97
|
-
DyFM_Log.info(
|
|
98
|
-
`[DyNTS_CollectionGrowthMonitor] installed — poll ${Math.round(this.pollIntervalMs / 1000)}s, ` +
|
|
99
|
-
`size-threshold ${this.sizeThresholdDocCount} docs, growth-rate ${this.growthRateThresholdPct}%/poll`,
|
|
100
|
-
);
|
|
101
|
-
} catch (err: unknown) {
|
|
102
|
-
DyFM_Log.warn('[DyNTS_CollectionGrowthMonitor] install failed (non-fatal):', err);
|
|
103
|
-
}
|
|
104
|
-
}
|
|
105
|
-
|
|
106
|
-
/**
|
|
107
|
-
* Pure decision core (unit-tested): given a fresh count + the previous snapshot, return the alerts
|
|
108
|
-
* to raise. NEVER does I/O. A `size` alert fires when `count > sizeThreshold`; a `growth` alert
|
|
109
|
-
* fires when the collection grew by more than `growthRatePct` since the last snapshot (needs a
|
|
110
|
-
* non-zero previous count).
|
|
111
|
-
*/
|
|
112
|
-
static evaluateGrowth(
|
|
113
|
-
dataName: string,
|
|
114
|
-
count: number,
|
|
115
|
-
last: CollectionSnapshot | undefined,
|
|
116
|
-
sizeThreshold: number,
|
|
117
|
-
growthRatePct: number,
|
|
118
|
-
retentionTtlSec?: number,
|
|
119
|
-
): DyNTS_CollectionGrowthAlert[] {
|
|
120
|
-
const alerts: DyNTS_CollectionGrowthAlert[] = [];
|
|
121
|
-
|
|
122
|
-
if (count > sizeThreshold) {
|
|
123
|
-
// FR-311 — RETENTION-TUDATOS tanacs. A korabbi uzenet FELTETEL NELKUL azt ajanlotta, hogy
|
|
124
|
-
// "declare `retention`" — akkor is, ha a modell MAR deklaralt egyet. Elesben (2026-08-19,
|
|
125
|
-
// overseer `ov_secret_audit`, 253 617 dokumentum) ez oda vezetett, hogy az operator olyat
|
|
126
|
-
// kapott feladatul, ami mar KESZ volt, orankent ujra, az error-tarba is elmentve. A ket eset
|
|
127
|
-
// KULONBOZO teendot kiván, ezert kulon is kell mondani oket.
|
|
128
|
-
const retentionDays: number | null = retentionTtlSec === undefined
|
|
129
|
-
? null
|
|
130
|
-
: Math.round(retentionTtlSec / 86400);
|
|
131
|
-
alerts.push({
|
|
132
|
-
kind: 'size',
|
|
133
|
-
dataName: dataName,
|
|
134
|
-
message: retentionDays === null
|
|
135
|
-
? `Collection "${dataName}" has ${count} documents (> ${sizeThreshold} threshold) — ` +
|
|
136
|
-
`unbounded-growth risk. Consider declaring \`retention\` on this model (FR-258 / SR-1).`
|
|
137
|
-
: `Collection "${dataName}" has ${count} documents (> ${sizeThreshold} threshold) DESPITE a ` +
|
|
138
|
-
`declared retention of ~${retentionDays} day(s) — the window is too long, or growth outpaces ` +
|
|
139
|
-
`the TTL. Shorten \`retention\` or reduce the write-rate (FR-258 / SR-1).`,
|
|
140
|
-
detail: {
|
|
141
|
-
collection: dataName, docCount: count, threshold: sizeThreshold,
|
|
142
|
-
retentionDays: retentionDays,
|
|
143
|
-
},
|
|
144
|
-
});
|
|
145
|
-
}
|
|
146
|
-
|
|
147
|
-
if (last && last.docCount > 0) {
|
|
148
|
-
const growthPct: number = ((count - last.docCount) / last.docCount) * 100;
|
|
149
|
-
if (growthPct > growthRatePct) {
|
|
150
|
-
alerts.push({
|
|
151
|
-
kind: 'growth',
|
|
152
|
-
dataName: dataName,
|
|
153
|
-
message:
|
|
154
|
-
`Collection "${dataName}" grew ${Math.round(growthPct)}% since the last poll ` +
|
|
155
|
-
`(${last.docCount} → ${count} docs) — fast unbounded growth.`,
|
|
156
|
-
detail: { collection: dataName, oldCount: last.docCount, newCount: count, growthPct: Math.round(growthPct) },
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
|
|
161
|
-
return alerts;
|
|
162
|
-
}
|
|
163
|
-
|
|
164
|
-
/**
|
|
165
|
-
* One poll cycle: sample every registered collection's `estimatedDocumentCount()` (scan-free) and
|
|
166
|
-
* raise cooldown-gated warnings. Fully non-fatal — a failure on one collection never aborts the rest.
|
|
167
|
-
*/
|
|
168
|
-
private async poll(): Promise<void> {
|
|
169
|
-
try {
|
|
170
|
-
const services: ReturnType<typeof DyNTS_GlobalService.getAllDBServices> = DyNTS_GlobalService.getAllDBServices();
|
|
171
|
-
const nowMs: number = Date.now();
|
|
172
|
-
|
|
173
|
-
for (const service of services) {
|
|
174
|
-
const dataName: string | undefined = service?.dataParams?.dataName;
|
|
175
|
-
const model: { estimatedDocumentCount?: () => Promise<number> } | undefined =
|
|
176
|
-
service?.dataModel as unknown as { estimatedDocumentCount?: () => Promise<number> };
|
|
177
|
-
if (!dataName || !model || typeof model.estimatedDocumentCount !== 'function') { continue; }
|
|
178
|
-
|
|
179
|
-
try {
|
|
180
|
-
const count: number = await model.estimatedDocumentCount();
|
|
181
|
-
const last: CollectionSnapshot | undefined = this.lastSnapshotByCollection.get(dataName);
|
|
182
|
-
|
|
183
|
-
// FR-311 — a modell SAJAT retention-deklaraciojat visszük be a dontesbe. A feloldas az
|
|
184
|
-
// fsm-dynamo SSOT-resolvereval megy (`ttlSeconds` > `retentionDays`, ervenytelen ertek
|
|
185
|
-
// elutasitva) — NEM ujraimplementalva, kulonben ketfele igazsag lenne rola.
|
|
186
|
-
const retentionTtlSec: number | undefined = DyFM_resolveRetentionTtlSeconds(
|
|
187
|
-
service?.dataParams?.retention as DyFM_RetentionSettings | undefined,
|
|
188
|
-
);
|
|
189
|
-
const alerts: DyNTS_CollectionGrowthAlert[] = DyNTS_CollectionGrowthMonitor.evaluateGrowth(
|
|
190
|
-
dataName, count, last, this.sizeThresholdDocCount, this.growthRateThresholdPct, retentionTtlSec,
|
|
191
|
-
);
|
|
192
|
-
for (const alert of alerts) {
|
|
193
|
-
this.emitAlert(alert, nowMs);
|
|
194
|
-
}
|
|
195
|
-
|
|
196
|
-
this.lastSnapshotByCollection.set(dataName, { docCount: count, atMs: nowMs });
|
|
197
|
-
} catch (collErr: unknown) {
|
|
198
|
-
DyFM_Log.warn(
|
|
199
|
-
`[DyNTS_CollectionGrowthMonitor] poll for "${dataName}" failed (non-fatal): ` +
|
|
200
|
-
`${collErr instanceof Error ? collErr.message : String(collErr)}`,
|
|
201
|
-
);
|
|
202
|
-
}
|
|
203
|
-
}
|
|
204
|
-
} catch (err: unknown) {
|
|
205
|
-
DyFM_Log.warn('[DyNTS_CollectionGrowthMonitor] poll failed (non-fatal):', err);
|
|
206
|
-
}
|
|
207
|
-
}
|
|
208
|
-
|
|
209
|
-
/** Raise one alert to the Errors-sink, gated by the per-(collection,kind) cooldown to avoid flooding. */
|
|
210
|
-
private emitAlert(alert: DyNTS_CollectionGrowthAlert, nowMs: number): void {
|
|
211
|
-
const key: string = `${alert.dataName}:${alert.kind}`;
|
|
212
|
-
const lastAt: number | undefined = this.lastAlertAtByKey.get(key);
|
|
213
|
-
if (lastAt !== undefined && nowMs - lastAt < this.reAlertCooldownMs) { return; }
|
|
214
|
-
this.lastAlertAtByKey.set(key, nowMs);
|
|
215
|
-
|
|
216
|
-
DyFM_Log.warn(`[DyNTS_CollectionGrowthMonitor] ${alert.message}`);
|
|
217
|
-
DyNTS_GlobalService.globalErrorHandler?.(
|
|
218
|
-
new DyFM_Error({
|
|
219
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName ?? 'DyNTS'}|DyNTS-CGM-${alert.kind === 'size' ? 'SIZE' : 'GROWTH'}`,
|
|
220
|
-
message: alert.message,
|
|
221
|
-
level: DyFM_ErrorLevel.warning,
|
|
222
|
-
additionalContent: alert.detail,
|
|
223
|
-
}),
|
|
224
|
-
);
|
|
225
|
-
}
|
|
226
|
-
|
|
227
|
-
/** Test-only teardown: stop the timer + clear state so specs don't leak between runs. */
|
|
228
|
-
_teardownForTesting(): void {
|
|
229
|
-
if (this.timer) { clearInterval(this.timer); this.timer = null; }
|
|
230
|
-
this.installed = false;
|
|
231
|
-
this.lastSnapshotByCollection.clear();
|
|
232
|
-
this.lastAlertAtByKey.clear();
|
|
233
|
-
}
|
|
234
|
-
}
|