@futdevpro/nts-dynamo 1.15.64 → 1.15.68
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/.c8rc.json +26 -26
- package/.copilot/patterns.json +7 -7
- package/.cursor/rules/__assistant_guide.mdc +30 -30
- package/.cursor/rules/__main.mdc +64 -64
- package/.cursor/rules/_ag_backend-structure.mdc +85 -85
- package/.cursor/rules/_ag_backend.mdc +16 -16
- package/.cursor/rules/_ag_debug.mdc +7 -7
- package/.cursor/rules/_ag_documentation_writing_rules.mdc +372 -372
- package/.cursor/rules/_ag_file-refactoring.mdc +113 -113
- package/.cursor/rules/_ag_fixes_rules.mdc +5 -5
- package/.cursor/rules/_ag_frontend-structure.mdc +86 -86
- package/.cursor/rules/_ag_frontend.mdc +39 -39
- package/.cursor/rules/_ag_import-rules.mdc +44 -44
- package/.cursor/rules/_ag_naming.mdc +115 -115
- package/.cursor/rules/_ag_running_commands.mdc +4 -4
- package/.cursor/rules/_ag_server-controller.mdc +5 -5
- package/.cursor/rules/_ag_should-be.mdc +6 -6
- package/.cursor/rules/_ag_swearing.mdc +47 -47
- package/.cursor/rules/ai_development_guide.md +60 -60
- package/.cursor/rules/ai_directives.md +114 -114
- package/.cursor/rules/cursor-rules.md +160 -160
- package/.cursor/rules/default-command.mdc +464 -464
- package/.cursor/rules/error_code_pattern.md +39 -39
- package/.cursor/rules/saved rule mcp server use.md +15 -15
- package/.dynamo/pipeline.cicd.config.json +180 -180
- package/.dynamo/version-bump.config.json +5 -5
- package/.github/workflows/main.yml +438 -438
- package/.husky/pre-commit +3 -3
- package/.vscode/settings.json +10 -10
- package/HOWTO.md +15 -15
- package/LICENSE +21 -21
- package/README.md +678 -678
- package/__documentations/2026-04-28-logs-module.md +49 -49
- package/__documentations/2026-05-17-oai-compatible-providers.md +229 -229
- package/__documentations/2026-05-17-static-client-serving-howto.md +144 -144
- package/__documentations/2026-06-01-fr041-cors-middleware.md +96 -96
- package/__documentations/2026-06-01-fr047-p2p3-function-calling.md +81 -81
- package/__documentations/2026-06-15-fr193-memory-guard.md +73 -73
- package/__documentations/nts-integration-tests-2026-03-17.md +26 -26
- package/_specifications/BACKLOG.md +92 -92
- package/_specifications/TODO.md +15 -15
- package/_specifications/agent.md +138 -138
- package/build/_collections/archive.util.d.ts +12 -12
- package/build/_collections/archive.util.js +18 -18
- package/build/_collections/atlas-default-db-options.const.d.ts +2 -2
- package/build/_collections/atlas-default-db-options.const.js +9 -9
- package/build/_collections/default-fallback-cache-max-age.const.d.ts +2 -2
- package/build/_collections/default-fallback-cache-max-age.const.js +5 -5
- package/build/_collections/default-not-found-page.const.d.ts +5 -5
- package/build/_collections/default-not-found-page.const.js +24 -24
- package/build/_collections/default-socket-path.const.d.ts +2 -2
- package/build/_collections/default-socket-path.const.js +5 -5
- package/build/_collections/get-environment-settings.util.d.ts +2 -2
- package/build/_collections/get-environment-settings.util.js +43 -43
- package/build/_collections/global-settings.const.d.ts +6 -6
- package/build/_collections/global-settings.const.js +69 -69
- package/build/_collections/mongo-reconnect-guard.util.d.ts +73 -73
- package/build/_collections/mongo-reconnect-guard.util.js +110 -110
- package/build/_collections/star.controller.d.ts +7 -7
- package/build/_collections/star.controller.js +97 -97
- package/build/_enums/data-model-type.enum.d.ts +13 -13
- package/build/_enums/data-model-type.enum.js +17 -17
- package/build/_enums/data-service-function.enum.d.ts +18 -18
- package/build/_enums/data-service-function.enum.js +24 -24
- package/build/_enums/predefined-data-types.enum.d.ts +15 -15
- package/build/_enums/predefined-data-types.enum.js +19 -19
- package/build/_enums/route-security.enum.d.ts +11 -11
- package/build/_enums/route-security.enum.js +15 -15
- package/build/_models/control-models/api-call-params.control-model.d.ts +79 -79
- package/build/_models/control-models/api-call-params.control-model.js +101 -101
- package/build/_models/control-models/app-ext-system-controls.control-model.d.ts +6 -6
- package/build/_models/control-models/app-ext-system-controls.control-model.js +10 -10
- package/build/_models/control-models/app-params.control-model.d.ts +51 -51
- package/build/_models/control-models/app-params.control-model.js +119 -119
- package/build/_models/control-models/app-system-controls.control-model.d.ts +7 -7
- package/build/_models/control-models/app-system-controls.control-model.js +11 -11
- package/build/_models/control-models/endpoint-params.control-model.d.ts +114 -114
- package/build/_models/control-models/endpoint-params.control-model.js +442 -442
- package/build/_models/control-models/http-settings.control-model.d.ts +17 -17
- package/build/_models/control-models/http-settings.control-model.js +34 -34
- package/build/_models/control-models/system-control.control-model.d.ts +5 -5
- package/build/_models/control-models/system-control.control-model.js +11 -11
- package/build/_models/interfaces/certification-settings.interface.d.ts +5 -5
- package/build/_models/interfaces/certification-settings.interface.js +2 -2
- package/build/_models/interfaces/compare-data-options.interface.d.ts +26 -26
- package/build/_models/interfaces/compare-data-options.interface.js +2 -2
- package/build/_models/interfaces/compare-data-result.interface.d.ts +12 -12
- package/build/_models/interfaces/compare-data-result.interface.js +2 -2
- package/build/_models/interfaces/cors-settings.interface.d.ts +51 -51
- package/build/_models/interfaces/cors-settings.interface.js +2 -2
- package/build/_models/interfaces/environment-settings.interface.d.ts +34 -34
- package/build/_models/interfaces/environment-settings.interface.js +2 -2
- package/build/_models/interfaces/global-log-settings.interface.d.ts +145 -145
- package/build/_models/interfaces/global-log-settings.interface.js +2 -2
- package/build/_models/interfaces/global-service-settings.interface.d.ts +30 -30
- package/build/_models/interfaces/global-service-settings.interface.js +2 -2
- package/build/_models/interfaces/global-settings.interface.d.ts +161 -161
- package/build/_models/interfaces/global-settings.interface.js +2 -2
- package/build/_models/interfaces/routing-module-settings.interface.d.ts +19 -19
- package/build/_models/interfaces/routing-module-settings.interface.js +2 -2
- package/build/_models/interfaces/static-client-settings.interface.d.ts +28 -28
- package/build/_models/interfaces/static-client-settings.interface.js +2 -2
- package/build/_models/types/db-update.type.d.ts +129 -129
- package/build/_models/types/db-update.type.js +2 -2
- package/build/_modules/admin-auth/_models/admin-api-key-config.interface.d.ts +31 -31
- package/build/_modules/admin-auth/_models/admin-api-key-config.interface.js +2 -2
- package/build/_modules/admin-auth/admin-api-key.auth-service.d.ts +89 -89
- package/build/_modules/admin-auth/admin-api-key.auth-service.js +194 -194
- package/build/_modules/admin-auth/index.d.ts +2 -2
- package/build/_modules/admin-auth/index.js +5 -5
- package/build/_modules/ai/_models/ai-input-interfaces.d.ts +53 -53
- package/build/_modules/ai/_models/ai-input-interfaces.js +5 -5
- package/build/_modules/ai/_models/ai-test-generation-result.interface.d.ts +16 -16
- package/build/_modules/ai/_models/ai-test-generation-result.interface.js +2 -2
- package/build/_modules/ai/_models/interfaces/dynts-ai-cost-event-callback.interface.d.ts +13 -13
- package/build/_modules/ai/_models/interfaces/dynts-ai-cost-event-callback.interface.js +2 -2
- package/build/_modules/ai/_models/interfaces/dynts-ai-cost-event.interface.d.ts +49 -49
- package/build/_modules/ai/_models/interfaces/dynts-ai-cost-event.interface.js +2 -2
- package/build/_modules/ai/_modules/anthropic/_services/aai-user-key.control-service.d.ts +35 -35
- package/build/_modules/ai/_modules/anthropic/_services/aai-user-key.control-service.js +117 -117
- package/build/_modules/ai/_modules/anthropic/index.d.ts +2 -2
- package/build/_modules/ai/_modules/anthropic/index.js +7 -7
- package/build/_modules/ai/_modules/document-ai/_collections/dai-chunking.util.d.ts +84 -84
- package/build/_modules/ai/_modules/document-ai/_collections/dai-chunking.util.js +467 -467
- package/build/_modules/ai/_modules/document-ai/_collections/dai-code-chunking.util.d.ts +109 -109
- package/build/_modules/ai/_modules/document-ai/_collections/dai-code-chunking.util.js +418 -418
- package/build/_modules/ai/_modules/document-ai/_collections/dai-document.util.d.ts +28 -28
- package/build/_modules/ai/_modules/document-ai/_collections/dai-document.util.js +73 -73
- package/build/_modules/ai/_modules/document-ai/_enums/dai-compare-result-type.enum.d.ts +6 -6
- package/build/_modules/ai/_modules/document-ai/_enums/dai-compare-result-type.enum.js +10 -10
- package/build/_modules/ai/_modules/document-ai/_models/data-models/dai-doc-chunk.data-model.d.ts +51 -51
- package/build/_modules/ai/_modules/document-ai/_models/data-models/dai-doc-chunk.data-model.js +132 -132
- package/build/_modules/ai/_modules/document-ai/_models/data-models/dai-doc-page.data-model.d.ts +47 -47
- package/build/_modules/ai/_modules/document-ai/_models/data-models/dai-doc-page.data-model.js +136 -136
- package/build/_modules/ai/_modules/document-ai/_models/data-models/dai-document.data-model.d.ts +17 -17
- package/build/_modules/ai/_modules/document-ai/_models/data-models/dai-document.data-model.js +76 -76
- package/build/_modules/ai/_modules/document-ai/_models/interfaces/dai-code-chunk.interface.d.ts +49 -49
- package/build/_modules/ai/_modules/document-ai/_models/interfaces/dai-code-chunk.interface.js +2 -2
- package/build/_modules/ai/_modules/document-ai/_models/interfaces/dai-doc-chunk-compare-result.interface.d.ts +8 -8
- package/build/_modules/ai/_modules/document-ai/_models/interfaces/dai-doc-chunk-compare-result.interface.js +2 -2
- package/build/_modules/ai/_modules/document-ai/_models/interfaces/dai-doc-page-compare-result.interface.d.ts +11 -11
- package/build/_modules/ai/_modules/document-ai/_models/interfaces/dai-doc-page-compare-result.interface.js +2 -2
- package/build/_modules/ai/_modules/document-ai/_models/interfaces/dai-document-compare-result.interface.d.ts +12 -12
- package/build/_modules/ai/_modules/document-ai/_models/interfaces/dai-document-compare-result.interface.js +2 -2
- package/build/_modules/ai/_modules/document-ai/index.d.ts +12 -12
- package/build/_modules/ai/_modules/document-ai/index.js +27 -27
- package/build/_modules/ai/_modules/fdp-ai/_services/fdpai-user-key.control-service.d.ts +34 -34
- package/build/_modules/ai/_modules/fdp-ai/_services/fdpai-user-key.control-service.js +128 -128
- package/build/_modules/ai/_modules/fdp-ai/index.d.ts +2 -2
- package/build/_modules/ai/_modules/fdp-ai/index.js +7 -7
- package/build/_modules/ai/_modules/open-ai/_collections/oai-global-settings.const.d.ts +2 -2
- package/build/_modules/ai/_modules/open-ai/_collections/oai-global-settings.const.js +8 -8
- package/build/_modules/ai/_modules/open-ai/_collections/oai-llm-predefined-requests-hu.conts.d.ts +2 -2
- package/build/_modules/ai/_modules/open-ai/_collections/oai-llm-predefined-requests-hu.conts.js +74 -74
- package/build/_modules/ai/_modules/open-ai/_collections/oai-llm-predefined-requests.conts.d.ts +2 -2
- package/build/_modules/ai/_modules/open-ai/_collections/oai-llm-predefined-requests.conts.js +67 -67
- package/build/_modules/ai/_modules/open-ai/_enums/oai-gpt-message-role.enum.js +42 -42
- package/build/_modules/ai/_modules/open-ai/_models/interfaces/oai-global-settings.interface.d.ts +5 -5
- package/build/_modules/ai/_modules/open-ai/_models/interfaces/oai-global-settings.interface.js +2 -2
- package/build/_modules/ai/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.js +6 -6
- package/build/_modules/ai/_modules/open-ai/_models/interfaces/oai-llm-predefined-requests.interface.d.ts +51 -51
- package/build/_modules/ai/_modules/open-ai/_models/interfaces/oai-llm-predefined-requests.interface.js +2 -2
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-chunk-data.service.d.ts +21 -21
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-chunk-data.service.js +187 -187
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-page.data-service.d.ts +26 -26
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-page.data-service.js +278 -278
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-document.data-service.d.ts +22 -22
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-document.data-service.js +322 -322
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-vector-data.service.d.ts +119 -119
- package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-vector-data.service.js +480 -480
- package/build/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.d.ts +25 -25
- package/build/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.js +103 -103
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.d.ts +169 -169
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.js +479 -479
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.d.ts +201 -201
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.js +579 -579
- package/build/_modules/ai/_modules/open-ai/_services/oai-user-key.control-service.d.ts +39 -39
- package/build/_modules/ai/_modules/open-ai/_services/oai-user-key.control-service.js +110 -110
- package/build/_modules/ai/_modules/open-ai/index.d.ts +14 -14
- package/build/_modules/ai/_modules/open-ai/index.js +55 -55
- package/build/_modules/ai/_services/ai-embedding-mock.service.d.ts +80 -80
- package/build/_modules/ai/_services/ai-embedding-mock.service.js +166 -166
- package/build/_modules/ai/_services/ai-embedding-provider.registry.d.ts +51 -51
- package/build/_modules/ai/_services/ai-embedding-provider.registry.js +78 -78
- package/build/_modules/ai/_services/ai-embedding.service-base.d.ts +41 -41
- package/build/_modules/ai/_services/ai-embedding.service-base.js +11 -11
- package/build/_modules/ai/_services/ai-llm-chat.service-base.d.ts +39 -39
- package/build/_modules/ai/_services/ai-llm-chat.service-base.js +11 -11
- package/build/_modules/ai/_services/ai-llm.service-base.d.ts +132 -132
- package/build/_modules/ai/_services/ai-llm.service-base.js +313 -313
- package/build/_modules/ai/_services/ai-provider.service-base.d.ts +46 -46
- package/build/_modules/ai/_services/ai-provider.service-base.js +43 -43
- package/build/_modules/ai/_services/ai-user-key.service-base.d.ts +44 -44
- package/build/_modules/ai/_services/ai-user-key.service-base.js +14 -14
- package/build/_modules/ai/_services/lmstudio-embedding.control-service.d.ts +110 -110
- package/build/_modules/ai/_services/lmstudio-embedding.control-service.js +297 -297
- package/build/_modules/ai/index.d.ts +13 -13
- package/build/_modules/ai/index.js +22 -22
- package/build/_modules/assistant/_collections/ass-global-settings.const.d.ts +2 -2
- package/build/_modules/assistant/_collections/ass-global-settings.const.js +14 -14
- package/build/_modules/assistant/_collections/ass.util.d.ts +15 -15
- package/build/_modules/assistant/_collections/ass.util.js +42 -42
- package/build/_modules/assistant/_models/ass-global-settings.interface.d.ts +13 -13
- package/build/_modules/assistant/_models/ass-global-settings.interface.js +2 -2
- package/build/_modules/assistant/_services/ass-io.control-service.d.ts +19 -19
- package/build/_modules/assistant/_services/ass-io.control-service.js +57 -57
- package/build/_modules/assistant/_services/ass-main.control-service.d.ts +32 -32
- package/build/_modules/assistant/_services/ass-main.control-service.js +65 -65
- package/build/_modules/assistant/index.d.ts +6 -6
- package/build/_modules/assistant/index.js +18 -18
- package/build/_modules/bot/_collections/bot-default-commands.const.d.ts +2 -2
- package/build/_modules/bot/_collections/bot-default-commands.const.js +13 -13
- package/build/_modules/bot/_collections/bot-global-settings.const.d.ts +2 -2
- package/build/_modules/bot/_collections/bot-global-settings.const.js +31 -31
- package/build/_modules/bot/_models/bot-channel-wrapper.interface.d.ts +25 -25
- package/build/_modules/bot/_models/bot-channel-wrapper.interface.js +38 -38
- package/build/_modules/bot/_models/bot-command.interface.d.ts +7 -7
- package/build/_modules/bot/_models/bot-command.interface.js +2 -2
- package/build/_modules/bot/_models/bot-global-settings.interface.d.ts +85 -85
- package/build/_modules/bot/_models/bot-global-settings.interface.js +2 -2
- package/build/_modules/bot/_models/bot-last-mention-date.interface.d.ts +6 -6
- package/build/_modules/bot/_models/bot-last-mention-date.interface.js +2 -2
- package/build/_modules/bot/_models/bot-last-message-date.interface.d.ts +5 -5
- package/build/_modules/bot/_models/bot-last-message-date.interface.js +2 -2
- package/build/_modules/bot/_models/bot-message-wrapper.interface.d.ts +37 -37
- package/build/_modules/bot/_models/bot-message-wrapper.interface.js +54 -54
- package/build/_modules/bot/_models/bot-user-wrapper.interface.d.ts +23 -23
- package/build/_modules/bot/_models/bot-user-wrapper.interface.js +28 -28
- package/build/_modules/bot/_modules/discord-bot/_models/dib-platform.types.js +10 -10
- package/build/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.control-service.d.ts +69 -69
- package/build/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.control-service.js +497 -497
- package/build/_modules/bot/_modules/discord-bot/index.d.ts +1 -1
- package/build/_modules/bot/_modules/discord-bot/index.js +12 -12
- package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb-operations.util.d.ts +16 -16
- package/build/_modules/bot/_modules/dynamo-bot/_collections/dyb-operations.util.js +42 -42
- package/build/_modules/bot/_modules/dynamo-bot/_models/dyb-platform.types.d.ts +9 -9
- package/build/_modules/bot/_modules/dynamo-bot/_models/dyb-platform.types.js +2 -2
- package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.control-service.d.ts +59 -59
- package/build/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.control-service.js +349 -349
- package/build/_modules/bot/_modules/dynamo-bot/index.d.ts +3 -3
- package/build/_modules/bot/_modules/dynamo-bot/index.js +15 -15
- package/build/_modules/bot/_modules/slack-bot/_models/slb-platform.types.d.ts +6 -6
- package/build/_modules/bot/_modules/slack-bot/_models/slb-platform.types.js +2 -2
- package/build/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.control-service.d.ts +56 -56
- package/build/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.control-service.js +137 -137
- package/build/_modules/bot/_modules/slack-bot/index.d.ts +2 -2
- package/build/_modules/bot/_modules/slack-bot/index.js +12 -12
- package/build/_modules/bot/_modules/teams-bot/_models/teb-platform.types.d.ts +6 -6
- package/build/_modules/bot/_modules/teams-bot/_models/teb-platform.types.js +2 -2
- package/build/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.control-service.d.ts +56 -56
- package/build/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.control-service.js +137 -137
- package/build/_modules/bot/_modules/teams-bot/index.d.ts +2 -2
- package/build/_modules/bot/_modules/teams-bot/index.js +12 -12
- package/build/_modules/bot/_services/bot-commands.control-service.d.ts +12 -12
- package/build/_modules/bot/_services/bot-commands.control-service.js +117 -117
- package/build/_modules/bot/_services/bot-io.control-service.d.ts +23 -23
- package/build/_modules/bot/_services/bot-io.control-service.js +226 -226
- package/build/_modules/bot/_services/bot-main.control-service.d.ts +35 -35
- package/build/_modules/bot/_services/bot-main.control-service.js +195 -195
- package/build/_modules/bot/_services/bot-messaging-provider.service-base.d.ts +71 -71
- package/build/_modules/bot/_services/bot-messaging-provider.service-base.js +15 -15
- package/build/_modules/bot/_services/bot-routines.control-service.d.ts +13 -13
- package/build/_modules/bot/_services/bot-routines.control-service.js +59 -59
- package/build/_modules/bot/index.d.ts +17 -17
- package/build/_modules/bot/index.js +36 -36
- package/build/_modules/custom-data/custom-data.controller.d.ts +5 -5
- package/build/_modules/custom-data/custom-data.controller.js +56 -56
- package/build/_modules/custom-data/custom-data.data-service.d.ts +5 -5
- package/build/_modules/custom-data/custom-data.data-service.js +11 -11
- package/build/_modules/custom-data/get-custom-data-routing-module.util.d.ts +3 -3
- package/build/_modules/custom-data/get-custom-data-routing-module.util.js +16 -16
- package/build/_modules/custom-data/index.d.ts +4 -4
- package/build/_modules/custom-data/index.js +9 -9
- package/build/_modules/data-readers/_collections/dynts-sqlite-reader.util.d.ts +58 -58
- package/build/_modules/data-readers/_collections/dynts-sqlite-reader.util.js +168 -168
- package/build/_modules/data-readers/_models/interfaces/dynts-sqlite-reader.interface.d.ts +31 -31
- package/build/_modules/data-readers/_models/interfaces/dynts-sqlite-reader.interface.js +7 -7
- package/build/_modules/data-readers/index.d.ts +2 -2
- package/build/_modules/data-readers/index.js +10 -10
- package/build/_modules/defaults/_collections/default-endpoints.util.d.ts +248 -248
- package/build/_modules/defaults/_collections/default-endpoints.util.js +386 -386
- package/build/_modules/defaults/_models/default-user.data-model.d.ts +19 -19
- package/build/_modules/defaults/_models/default-user.data-model.js +72 -72
- package/build/_modules/defaults/_services/default-auth.service.d.ts +50 -50
- package/build/_modules/defaults/_services/default-auth.service.js +158 -158
- package/build/_modules/defaults/_services/default-socket-events.service.d.ts +23 -23
- package/build/_modules/defaults/_services/default-socket-events.service.js +60 -60
- package/build/_modules/defaults/_services/default-user.data-service.d.ts +24 -24
- package/build/_modules/defaults/_services/default-user.data-service.js +87 -87
- package/build/_modules/defaults/index.d.ts +5 -5
- package/build/_modules/defaults/index.js +17 -17
- package/build/_modules/discord-assistant/_collections/dias-global-settings.const.d.ts +2 -2
- package/build/_modules/discord-assistant/_collections/dias-global-settings.const.js +16 -16
- package/build/_modules/discord-assistant/_collections/dias.util.d.ts +31 -31
- package/build/_modules/discord-assistant/_collections/dias.util.js +85 -85
- package/build/_modules/discord-assistant/_models/dias-global-settings.interface.d.ts +17 -17
- package/build/_modules/discord-assistant/_models/dias-global-settings.interface.js +2 -2
- package/build/_modules/discord-assistant/_models/dias-knowledge.data-model.d.ts +8 -8
- package/build/_modules/discord-assistant/_models/dias-knowledge.data-model.js +46 -46
- package/build/_modules/discord-assistant/_services/dias-chunk.data-service.d.ts +17 -17
- package/build/_modules/discord-assistant/_services/dias-chunk.data-service.js +123 -123
- package/build/_modules/discord-assistant/_services/dias-io.control-service.d.ts +10 -10
- package/build/_modules/discord-assistant/_services/dias-io.control-service.js +49 -49
- package/build/_modules/discord-assistant/_services/dias-main.control-service.d.ts +3 -3
- package/build/_modules/discord-assistant/_services/dias-main.control-service.js +7 -7
- package/build/_modules/discord-assistant/_services/dias.service-base.d.ts +18 -18
- package/build/_modules/discord-assistant/_services/dias.service-base.js +46 -46
- package/build/_modules/discord-assistant/index.d.ts +11 -11
- package/build/_modules/discord-assistant/index.js +24 -24
- package/build/_modules/discord-assistant-voiced/_services/dias-discord-bot.control-service.d.ts +3 -3
- package/build/_modules/discord-assistant-voiced/_services/dias-discord-bot.control-service.js +7 -7
- package/build/_modules/discord-assistant-voiced/index.d.ts +2 -2
- package/build/_modules/discord-assistant-voiced/index.js +28 -28
- package/build/_modules/discord-bot/_collections/dibo-default-commands.const.d.ts +2 -2
- package/build/_modules/discord-bot/_collections/dibo-default-commands.const.js +12 -12
- package/build/_modules/discord-bot/_collections/dibo-global-settings.conts.d.ts +2 -2
- package/build/_modules/discord-bot/_collections/dibo-global-settings.conts.js +43 -43
- package/build/_modules/discord-bot/_collections/dibo-operations.util.d.ts +22 -22
- package/build/_modules/discord-bot/_collections/dibo-operations.util.js +275 -275
- package/build/_modules/discord-bot/_models/dibo-command.interface.d.ts +7 -7
- package/build/_modules/discord-bot/_models/dibo-command.interface.js +2 -2
- package/build/_modules/discord-bot/_models/dibo-global-settings.interface.d.ts +87 -87
- package/build/_modules/discord-bot/_models/dibo-global-settings.interface.js +2 -2
- package/build/_modules/discord-bot/_models/dibo-last-mention-date.inteface.d.ts +6 -6
- package/build/_modules/discord-bot/_models/dibo-last-mention-date.inteface.js +2 -2
- package/build/_modules/discord-bot/_models/dibo-last-message-date.interface.d.ts +5 -5
- package/build/_modules/discord-bot/_models/dibo-last-message-date.interface.js +2 -2
- package/build/_modules/discord-bot/_services/dibo-commands.control-service.d.ts +11 -11
- package/build/_modules/discord-bot/_services/dibo-commands.control-service.js +109 -109
- package/build/_modules/discord-bot/_services/dibo-io.control-service.d.ts +21 -21
- package/build/_modules/discord-bot/_services/dibo-io.control-service.js +218 -218
- package/build/_modules/discord-bot/_services/dibo-main.control-service.d.ts +89 -89
- package/build/_modules/discord-bot/_services/dibo-main.control-service.js +363 -363
- package/build/_modules/discord-bot/_services/dibo-routines.control-service.d.ts +13 -13
- package/build/_modules/discord-bot/_services/dibo-routines.control-service.js +73 -73
- package/build/_modules/discord-bot/index.d.ts +11 -11
- package/build/_modules/discord-bot/index.js +30 -30
- package/build/_modules/local-vector-search/_enums/lvs-search-mode.enum.d.ts +34 -34
- package/build/_modules/local-vector-search/_enums/lvs-search-mode.enum.js +38 -38
- package/build/_modules/local-vector-search/_models/data-models/lvs-vector-persist.data-model.d.ts +35 -35
- package/build/_modules/local-vector-search/_models/data-models/lvs-vector-persist.data-model.js +53 -53
- package/build/_modules/local-vector-search/_models/lvs-search-result.interface.d.ts +16 -16
- package/build/_modules/local-vector-search/_models/lvs-search-result.interface.js +2 -2
- package/build/_modules/local-vector-search/_services/lvs-bm25.util.d.ts +88 -88
- package/build/_modules/local-vector-search/_services/lvs-bm25.util.js +189 -189
- package/build/_modules/local-vector-search/_services/lvs-doc-chunk-data.service.d.ts +26 -26
- package/build/_modules/local-vector-search/_services/lvs-doc-chunk-data.service.js +197 -197
- package/build/_modules/local-vector-search/_services/lvs-local-vector-search.data-service.d.ts +145 -145
- package/build/_modules/local-vector-search/_services/lvs-local-vector-search.data-service.js +294 -294
- package/build/_modules/local-vector-search/_services/lvs-persistent-vector-pool.control-service.d.ts +69 -69
- package/build/_modules/local-vector-search/_services/lvs-persistent-vector-pool.control-service.js +122 -122
- package/build/_modules/local-vector-search/_services/lvs-vector-persist.data-service.d.ts +42 -42
- package/build/_modules/local-vector-search/_services/lvs-vector-persist.data-service.js +71 -71
- package/build/_modules/local-vector-search/_services/lvs-vector-pool.control-service.d.ts +70 -70
- package/build/_modules/local-vector-search/_services/lvs-vector-pool.control-service.js +181 -181
- package/build/_modules/local-vector-search/index.d.ts +8 -8
- package/build/_modules/local-vector-search/index.js +15 -15
- package/build/_modules/logs/_models/file-log-entry.interface.d.ts +13 -13
- package/build/_modules/logs/_models/file-log-entry.interface.js +2 -2
- package/build/_modules/logs/_models/file-log-read-result.interface.d.ts +35 -35
- package/build/_modules/logs/_models/file-log-read-result.interface.js +2 -2
- package/build/_modules/logs/file-log.service.d.ts +132 -132
- package/build/_modules/logs/file-log.service.js +444 -444
- package/build/_modules/logs/file-logs.controller.d.ts +40 -40
- package/build/_modules/logs/file-logs.controller.js +138 -138
- package/build/_modules/logs/get-file-logs-routing-module.util.d.ts +31 -31
- package/build/_modules/logs/get-file-logs-routing-module.util.js +37 -37
- package/build/_modules/logs/get-logs-routing-module.util.d.ts +18 -18
- package/build/_modules/logs/get-logs-routing-module.util.js +31 -31
- package/build/_modules/logs/index.d.ts +8 -8
- package/build/_modules/logs/index.js +15 -15
- package/build/_modules/logs/log-buffer.service.d.ts +37 -37
- package/build/_modules/logs/log-buffer.service.js +96 -96
- package/build/_modules/logs/logs.controller.d.ts +26 -26
- package/build/_modules/logs/logs.controller.js +89 -89
- package/build/_modules/logs/logs.service.d.ts +39 -39
- package/build/_modules/logs/logs.service.js +96 -96
- package/build/_modules/mcp/_models/interfaces/dynts-mcp.interface.d.ts +108 -108
- package/build/_modules/mcp/_models/interfaces/dynts-mcp.interface.js +13 -13
- package/build/_modules/mcp/_services/dynts-mcp-server.service-base.d.ts +70 -70
- package/build/_modules/mcp/_services/dynts-mcp-server.service-base.js +98 -98
- package/build/_modules/mcp/_services/dynts-mcp.adapter.d.ts +56 -56
- package/build/_modules/mcp/_services/dynts-mcp.adapter.js +138 -138
- package/build/_modules/mcp/index.d.ts +3 -3
- package/build/_modules/mcp/index.js +12 -12
- package/build/_modules/messaging/_collections/get-messaging-routing-module.util.d.ts +7 -7
- package/build/_modules/messaging/_collections/get-messaging-routing-module.util.js +20 -20
- package/build/_modules/messaging/_collections/msg-global-settings.const.d.ts +5 -5
- package/build/_modules/messaging/_collections/msg-global-settings.const.js +22 -22
- package/build/_modules/messaging/_collections/msg.util.d.ts +24 -24
- package/build/_modules/messaging/_collections/msg.util.js +62 -62
- package/build/_modules/messaging/_models/msg-global-settings.interface.d.ts +28 -28
- package/build/_modules/messaging/_models/msg-global-settings.interface.js +2 -2
- package/build/_modules/messaging/_services/msg-conversation.data-service.d.ts +28 -28
- package/build/_modules/messaging/_services/msg-conversation.data-service.js +109 -109
- package/build/_modules/messaging/_services/msg-events.service.d.ts +61 -61
- package/build/_modules/messaging/_services/msg-events.service.js +203 -203
- package/build/_modules/messaging/_services/msg-integration.control-service.js +180 -180
- package/build/_modules/messaging/_services/msg-main.control-service.d.ts +62 -62
- package/build/_modules/messaging/_services/msg-main.control-service.js +428 -428
- package/build/_modules/messaging/_services/msg-message.data-service.d.ts +28 -28
- package/build/_modules/messaging/_services/msg-message.data-service.js +103 -103
- package/build/_modules/messaging/_services/msg.controller.d.ts +12 -12
- package/build/_modules/messaging/_services/msg.controller.js +256 -256
- package/build/_modules/messaging/index.d.ts +10 -10
- package/build/_modules/messaging/index.js +27 -27
- package/build/_modules/mock/app-extended-server.mock.d.ts +41 -41
- package/build/_modules/mock/app-extended-server.mock.js +169 -169
- package/build/_modules/mock/app-integration-test.mock.d.ts +19 -19
- package/build/_modules/mock/app-integration-test.mock.js +45 -45
- package/build/_modules/mock/app-params.mock.d.ts +2 -2
- package/build/_modules/mock/app-params.mock.js +9 -9
- package/build/_modules/mock/app-server.mock.d.ts +41 -41
- package/build/_modules/mock/app-server.mock.js +148 -148
- package/build/_modules/mock/auth-service.mock.d.ts +10 -10
- package/build/_modules/mock/auth-service.mock.js +19 -19
- package/build/_modules/mock/controller.mock.d.ts +5 -5
- package/build/_modules/mock/controller.mock.js +14 -14
- package/build/_modules/mock/data-model.mock.d.ts +26 -26
- package/build/_modules/mock/data-model.mock.js +72 -72
- package/build/_modules/mock/email-service-collection.mock.d.ts +7 -7
- package/build/_modules/mock/email-service-collection.mock.js +12 -12
- package/build/_modules/mock/email-service.mock.d.ts +4 -4
- package/build/_modules/mock/email-service.mock.js +20 -20
- package/build/_modules/mock/endpoint.mock.d.ts +8 -8
- package/build/_modules/mock/endpoint.mock.js +79 -79
- package/build/_modules/mock/socket-client.mock.d.ts +9 -9
- package/build/_modules/mock/socket-client.mock.js +38 -38
- package/build/_modules/mock/socket-server.mock.d.ts +15 -15
- package/build/_modules/mock/socket-server.mock.js +32 -32
- package/build/_modules/oauth2/_routes/oauth2.controller.d.ts +16 -16
- package/build/_modules/oauth2/_routes/oauth2.controller.js +96 -96
- package/build/_modules/oauth2/_services/oauth2.auth-service.d.ts +30 -30
- package/build/_modules/oauth2/_services/oauth2.auth-service.js +215 -215
- package/build/_modules/oauth2/_services/oauth2.control-service.d.ts +132 -132
- package/build/_modules/oauth2/_services/oauth2.control-service.js +576 -576
- package/build/_modules/oauth2/index.d.ts +3 -3
- package/build/_modules/oauth2/index.js +14 -14
- package/build/_modules/rate-limit/_models/rate-limit-config.interface.d.ts +61 -61
- package/build/_modules/rate-limit/_models/rate-limit-config.interface.js +2 -2
- package/build/_modules/rate-limit/_models/rate-limit-policy.interface.d.ts +15 -15
- package/build/_modules/rate-limit/_models/rate-limit-policy.interface.js +2 -2
- package/build/_modules/rate-limit/index.d.ts +3 -3
- package/build/_modules/rate-limit/index.js +5 -5
- package/build/_modules/rate-limit/rate-limit.middleware.d.ts +132 -132
- package/build/_modules/rate-limit/rate-limit.middleware.js +289 -289
- package/build/_modules/scoped-config/_enums/dynts-scoped-config-level.enum.d.ts +18 -18
- package/build/_modules/scoped-config/_enums/dynts-scoped-config-level.enum.js +22 -22
- package/build/_modules/scoped-config/_models/data-models/dynts-scoped-config.data-model.d.ts +43 -43
- package/build/_modules/scoped-config/_models/data-models/dynts-scoped-config.data-model.js +67 -67
- package/build/_modules/scoped-config/_models/interfaces/dynts-scoped-config.interface.d.ts +88 -88
- package/build/_modules/scoped-config/_models/interfaces/dynts-scoped-config.interface.js +11 -11
- package/build/_modules/scoped-config/_services/dynts-scoped-config.control-service.d.ts +83 -83
- package/build/_modules/scoped-config/_services/dynts-scoped-config.control-service.js +219 -219
- package/build/_modules/scoped-config/_services/dynts-scoped-config.data-service.d.ts +53 -53
- package/build/_modules/scoped-config/_services/dynts-scoped-config.data-service.js +75 -75
- package/build/_modules/scoped-config/index.d.ts +5 -5
- package/build/_modules/scoped-config/index.js +14 -14
- package/build/_modules/server/errors/errors.control-service.d.ts +21 -19
- package/build/_modules/server/errors/errors.control-service.d.ts.map +1 -1
- package/build/_modules/server/errors/errors.control-service.js +10 -10
- package/build/_modules/server/errors/errors.control-service.js.map +1 -1
- package/build/_modules/server/errors/errors.controller.d.ts +100 -99
- package/build/_modules/server/errors/errors.controller.d.ts.map +1 -1
- package/build/_modules/server/errors/errors.controller.js +355 -313
- package/build/_modules/server/errors/errors.controller.js.map +1 -1
- package/build/_modules/server/errors/errors.data-service.d.ts +64 -47
- package/build/_modules/server/errors/errors.data-service.d.ts.map +1 -1
- package/build/_modules/server/errors/errors.data-service.js +628 -552
- package/build/_modules/server/errors/errors.data-service.js.map +1 -1
- package/build/_modules/server/index.d.ts +7 -7
- package/build/_modules/server/index.js +26 -26
- package/build/_modules/server/server-status/server-status-snapshot.control-service.d.ts +4 -4
- package/build/_modules/server/server-status/server-status-snapshot.control-service.js +7 -7
- package/build/_modules/server/server-status/server-status-snapshot.data-service.d.ts +6 -6
- package/build/_modules/server/server-status/server-status-snapshot.data-service.js +22 -22
- package/build/_modules/server/server-status/server-status.control-service.d.ts +74 -74
- package/build/_modules/server/server-status/server-status.control-service.js +234 -234
- package/build/_modules/server/server-status/server-status.controller.d.ts +84 -84
- package/build/_modules/server/server-status/server-status.controller.js +172 -172
- package/build/_modules/socket/_enums/socket-security.enum.d.ts +10 -10
- package/build/_modules/socket/_enums/socket-security.enum.js +14 -14
- package/build/_modules/socket/_models/socket-client-service-params.control-model.d.ts +8 -8
- package/build/_modules/socket/_models/socket-client-service-params.control-model.js +16 -16
- package/build/_modules/socket/_models/socket-presence.control-model.d.ts +25 -25
- package/build/_modules/socket/_models/socket-presence.control-model.js +139 -139
- package/build/_modules/socket/_models/socket-server-service-params.control-model.d.ts +12 -12
- package/build/_modules/socket/_models/socket-server-service-params.control-model.js +20 -20
- package/build/_modules/socket/_services/socket-client.service.d.ts +37 -37
- package/build/_modules/socket/_services/socket-client.service.js +196 -196
- package/build/_modules/socket/_services/socket-server.service.d.ts +94 -94
- package/build/_modules/socket/_services/socket-server.service.js +689 -689
- package/build/_modules/socket/app-extended.server.d.ts +145 -145
- package/build/_modules/socket/app-extended.server.js +506 -506
- package/build/_modules/socket/index.d.ts +8 -8
- package/build/_modules/socket/index.js +35 -35
- package/build/_modules/test/get-test-routing-module.util.d.ts +3 -3
- package/build/_modules/test/get-test-routing-module.util.js +16 -16
- package/build/_modules/test/index.d.ts +3 -3
- package/build/_modules/test/index.js +11 -11
- package/build/_modules/test/test.controller.d.ts +5 -5
- package/build/_modules/test/test.controller.js +103 -103
- package/build/_modules/usage/get-usage-routing-module.util.d.ts +3 -3
- package/build/_modules/usage/get-usage-routing-module.util.js +16 -16
- package/build/_modules/usage/index.d.ts +4 -4
- package/build/_modules/usage/index.js +13 -13
- package/build/_modules/usage/usage.controller.d.ts +6 -6
- package/build/_modules/usage/usage.controller.js +95 -95
- package/build/_modules/usage/usage.data-service.d.ts +17 -17
- package/build/_modules/usage/usage.data-service.js +135 -135
- package/build/_services/base/api.service-base.d.ts +9 -9
- package/build/_services/base/api.service-base.js +46 -46
- package/build/_services/base/archive-data.service.d.ts +25 -25
- package/build/_services/base/archive-data.service.js +140 -140
- package/build/_services/base/data.service.d.ts +381 -381
- package/build/_services/base/data.service.js +2068 -2068
- package/build/_services/base/db.service.d.ts +393 -393
- package/build/_services/base/db.service.js +1256 -1256
- package/build/_services/base/singleton.service-base.d.ts +8 -8
- package/build/_services/base/singleton.service-base.js +21 -21
- package/build/_services/base/singleton.service.d.ts +11 -11
- package/build/_services/base/singleton.service.js +31 -31
- package/build/_services/core/api.service.d.ts +45 -45
- package/build/_services/core/api.service.js +436 -436
- package/build/_services/core/auth.service.d.ts +129 -129
- package/build/_services/core/auth.service.js +59 -59
- package/build/_services/core/email.service.d.ts +77 -77
- package/build/_services/core/email.service.js +489 -489
- package/build/_services/core/global.service.d.ts +76 -76
- package/build/_services/core/global.service.js +370 -370
- package/build/_services/core/memory-guard.service.d.ts +110 -110
- package/build/_services/core/memory-guard.service.js +197 -197
- package/build/_services/core/service-collection.service.d.ts +4 -4
- package/build/_services/core/service-collection.service.js +7 -7
- package/build/_services/route/controller.service.d.ts +124 -124
- package/build/_services/route/controller.service.js +95 -95
- package/build/_services/route/routing-module.service.d.ts +80 -80
- package/build/_services/route/routing-module.service.js +250 -250
- package/build/_services/server/app.server.d.ts +352 -352
- package/build/_services/server/app.server.js +1323 -1323
- package/build/_services/shared.static-service.d.ts +36 -36
- package/build/_services/shared.static-service.js +72 -72
- package/build/index.d.ts +43 -43
- package/build/index.js +80 -80
- package/eslint.config.js +3 -3
- package/nodemon.json +24 -24
- package/package.json +416 -417
- package/pnpm-workspace.yaml +5 -5
- package/scripts/run-coverage-tests.js +28 -28
- package/spec/support/helpers/spec-reporter-loader.js +359 -359
- package/spec/support/helpers/ts-node-helper.js +93 -93
- package/spec/support/jasmine.coverage.json +24 -24
- package/spec/support/jasmine.json +24 -24
- package/src/_collections/archive.util.spec.ts +57 -57
- package/src/_collections/archive.util.ts +18 -18
- package/src/_collections/atlas-default-db-options.const.ts +9 -9
- package/src/_collections/default-fallback-cache-max-age.const.spec.ts +11 -11
- package/src/_collections/default-fallback-cache-max-age.const.ts +2 -2
- package/src/_collections/default-not-found-page.const.spec.ts +19 -19
- package/src/_collections/default-not-found-page.const.ts +22 -22
- package/src/_collections/default-socket-path.const.spec.ts +12 -12
- package/src/_collections/default-socket-path.const.ts +2 -2
- package/src/_collections/get-environment-settings.util.spec.ts +210 -210
- package/src/_collections/get-environment-settings.util.ts +48 -48
- package/src/_collections/global-settings.const.ts +89 -89
- package/src/_collections/mongo-reconnect-guard.util.spec.ts +52 -52
- package/src/_collections/mongo-reconnect-guard.util.ts +172 -172
- package/src/_collections/sample.env +21 -21
- package/src/_collections/star.controller.spec.ts +224 -224
- package/src/_collections/star.controller.ts +129 -129
- package/src/_enums/data-model-type.enum.ts +14 -14
- package/src/_enums/data-service-function.enum.ts +24 -24
- package/src/_enums/predefined-data-types.enum.ts +16 -16
- package/src/_enums/route-security.enum.ts +12 -12
- package/src/_models/control-models/api-call-params.control-model.spec.ts +152 -152
- package/src/_models/control-models/api-call-params.control-model.ts +142 -142
- package/src/_models/control-models/app-ext-system-controls.control-model.spec.ts +52 -52
- package/src/_models/control-models/app-ext-system-controls.control-model.ts +9 -9
- package/src/_models/control-models/app-params.control-model.spec.ts +225 -225
- package/src/_models/control-models/app-params.control-model.ts +136 -136
- package/src/_models/control-models/app-system-controls.control-model.spec.ts +31 -31
- package/src/_models/control-models/app-system-controls.control-model.ts +9 -9
- package/src/_models/control-models/endpoint-params.control-model.spec.ts +627 -627
- package/src/_models/control-models/endpoint-params.control-model.ts +627 -627
- package/src/_models/control-models/http-settings.control-model.spec.ts +77 -77
- package/src/_models/control-models/http-settings.control-model.ts +37 -37
- package/src/_models/control-models/system-control.control-model.spec.ts +27 -27
- package/src/_models/control-models/system-control.control-model.ts +12 -12
- package/src/_models/interfaces/certification-settings.interface.ts +7 -7
- package/src/_models/interfaces/compare-data-options.interface.ts +27 -27
- package/src/_models/interfaces/compare-data-result.interface.ts +12 -12
- package/src/_models/interfaces/cors-settings.interface.spec.ts +52 -52
- package/src/_models/interfaces/cors-settings.interface.ts +56 -56
- package/src/_models/interfaces/environment-settings.interface.ts +59 -59
- package/src/_models/interfaces/global-log-settings.interface.ts +171 -171
- package/src/_models/interfaces/global-service-settings.interface.ts +47 -47
- package/src/_models/interfaces/global-settings.interface.ts +185 -185
- package/src/_models/interfaces/routing-module-settings.interface.ts +21 -21
- package/src/_models/interfaces/static-client-settings.interface.spec.ts +29 -29
- package/src/_models/interfaces/static-client-settings.interface.ts +28 -28
- package/src/_models/types/db-update.type.ts +100 -100
- package/src/_modules/admin-auth/_models/admin-api-key-config.interface.ts +33 -33
- package/src/_modules/admin-auth/admin-api-key.auth-service.spec.ts +200 -200
- package/src/_modules/admin-auth/admin-api-key.auth-service.ts +220 -220
- package/src/_modules/admin-auth/index.ts +2 -2
- package/src/_modules/ai/_models/ai-input-interfaces.ts +117 -117
- package/src/_modules/ai/_models/ai-test-generation-result.interface.ts +16 -16
- package/src/_modules/ai/_models/interfaces/dynts-ai-cost-event-callback.interface.ts +14 -14
- package/src/_modules/ai/_models/interfaces/dynts-ai-cost-event.interface.ts +56 -56
- package/src/_modules/ai/_modules/anthropic/_services/aai-user-key.control-service.ts +138 -138
- package/src/_modules/ai/_modules/anthropic/index.ts +5 -5
- package/src/_modules/ai/_modules/document-ai/_collections/dai-chunking.util.spec.ts +242 -242
- package/src/_modules/ai/_modules/document-ai/_collections/dai-chunking.util.ts +639 -639
- package/src/_modules/ai/_modules/document-ai/_collections/dai-code-chunking.util.spec.ts +295 -295
- package/src/_modules/ai/_modules/document-ai/_collections/dai-code-chunking.util.ts +552 -552
- package/src/_modules/ai/_modules/document-ai/_collections/dai-document.util.spec.ts +209 -209
- package/src/_modules/ai/_modules/document-ai/_collections/dai-document.util.ts +85 -85
- package/src/_modules/ai/_modules/document-ai/_enums/dai-compare-result-type.enum.ts +7 -7
- package/src/_modules/ai/_modules/document-ai/_models/data-models/dai-doc-chunk.data-model.ts +146 -146
- package/src/_modules/ai/_modules/document-ai/_models/data-models/dai-doc-page.data-model.ts +162 -162
- package/src/_modules/ai/_modules/document-ai/_models/data-models/dai-document.data-model.ts +99 -99
- package/src/_modules/ai/_modules/document-ai/_models/interfaces/dai-code-chunk.interface.ts +68 -68
- package/src/_modules/ai/_modules/document-ai/_models/interfaces/dai-doc-chunk-compare-result.interface.ts +18 -18
- package/src/_modules/ai/_modules/document-ai/_models/interfaces/dai-doc-page-compare-result.interface.ts +19 -19
- package/src/_modules/ai/_modules/document-ai/_models/interfaces/dai-document-compare-result.interface.ts +25 -25
- package/src/_modules/ai/_modules/document-ai/index.ts +30 -30
- package/src/_modules/ai/_modules/fdp-ai/_services/fdpai-user-key.control-service.ts +189 -189
- package/src/_modules/ai/_modules/fdp-ai/index.ts +5 -5
- package/src/_modules/ai/_modules/open-ai/_collections/oai-global-settings.const.ts +9 -9
- package/src/_modules/ai/_modules/open-ai/_collections/oai-llm-predefined-requests-hu.conts.ts +82 -82
- package/src/_modules/ai/_modules/open-ai/_collections/oai-llm-predefined-requests.conts.ts +75 -75
- package/src/_modules/ai/_modules/open-ai/_enums/oai-gpt-message-role.enum.ts +45 -45
- package/src/_modules/ai/_modules/open-ai/_models/interfaces/oai-global-settings.interface.ts +7 -7
- package/src/_modules/ai/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.ts +7 -7
- package/src/_modules/ai/_modules/open-ai/_models/interfaces/oai-llm-predefined-requests.interface.ts +57 -57
- package/src/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-chunk-data.service.ts +292 -292
- package/src/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-page.data-service.ts +572 -572
- package/src/_modules/ai/_modules/open-ai/_services/data-services/oai-document.data-service.spec.ts +342 -342
- package/src/_modules/ai/_modules/open-ai/_services/data-services/oai-document.data-service.ts +435 -435
- package/src/_modules/ai/_modules/open-ai/_services/data-services/oai-vector-data.service.spec.ts +550 -550
- package/src/_modules/ai/_modules/open-ai/_services/data-services/oai-vector-data.service.ts +630 -630
- package/src/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.spec.ts +332 -332
- package/src/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.ts +132 -132
- package/src/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.spec.ts +462 -462
- package/src/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.ts +634 -634
- package/src/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.spec.ts +489 -489
- package/src/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.tools.spec.ts +173 -173
- package/src/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.ts +1033 -1033
- package/src/_modules/ai/_modules/open-ai/_services/oai-user-key.control-service.ts +157 -157
- package/src/_modules/ai/_modules/open-ai/index.ts +74 -74
- package/src/_modules/ai/_services/ai-embedding-mock.service.spec.ts +115 -115
- package/src/_modules/ai/_services/ai-embedding-mock.service.ts +233 -233
- package/src/_modules/ai/_services/ai-embedding-provider.registry.spec.ts +110 -110
- package/src/_modules/ai/_services/ai-embedding-provider.registry.ts +114 -114
- package/src/_modules/ai/_services/ai-embedding.service-base.spec.ts +98 -98
- package/src/_modules/ai/_services/ai-embedding.service-base.ts +48 -48
- package/src/_modules/ai/_services/ai-llm-chat.service-base.spec.ts +229 -229
- package/src/_modules/ai/_services/ai-llm-chat.service-base.ts +68 -68
- package/src/_modules/ai/_services/ai-llm.service-base.spec.ts +250 -250
- package/src/_modules/ai/_services/ai-llm.service-base.ts +519 -519
- package/src/_modules/ai/_services/ai-provider.service-base.spec.ts +158 -158
- package/src/_modules/ai/_services/ai-provider.service-base.ts +67 -67
- package/src/_modules/ai/_services/ai-user-key.service-base.ts +59 -59
- package/src/_modules/ai/_services/lmstudio-embedding.control-service.spec.ts +197 -197
- package/src/_modules/ai/_services/lmstudio-embedding.control-service.ts +399 -399
- package/src/_modules/ai/index.ts +23 -23
- package/src/_modules/assistant/_collections/ass-global-settings.const.ts +13 -13
- package/src/_modules/assistant/_collections/ass.util.spec.ts +176 -176
- package/src/_modules/assistant/_collections/ass.util.ts +50 -50
- package/src/_modules/assistant/_models/ass-global-settings.interface.ts +15 -15
- package/src/_modules/assistant/_services/ass-io.control-service.spec.ts +140 -140
- package/src/_modules/assistant/_services/ass-io.control-service.ts +74 -74
- package/src/_modules/assistant/_services/ass-main.control-service.spec.ts +192 -192
- package/src/_modules/assistant/_services/ass-main.control-service.ts +107 -107
- package/src/_modules/assistant/index.ts +19 -19
- package/src/_modules/bot/_collections/bot-default-commands.const.ts +12 -12
- package/src/_modules/bot/_collections/bot-global-settings.const.ts +39 -39
- package/src/_modules/bot/_models/bot-channel-wrapper.interface.ts +62 -62
- package/src/_modules/bot/_models/bot-command.interface.ts +8 -8
- package/src/_modules/bot/_models/bot-global-settings.interface.ts +96 -96
- package/src/_modules/bot/_models/bot-last-mention-date.interface.ts +6 -6
- package/src/_modules/bot/_models/bot-last-message-date.interface.ts +5 -5
- package/src/_modules/bot/_models/bot-message-wrapper.interface.ts +90 -90
- package/src/_modules/bot/_models/bot-user-wrapper.interface.ts +41 -41
- package/src/_modules/bot/_modules/discord-bot/_models/dib-platform.types.ts +9 -9
- package/src/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.control-service.spec.ts +431 -431
- package/src/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.control-service.ts +641 -641
- package/src/_modules/bot/_modules/discord-bot/index.ts +12 -12
- package/src/_modules/bot/_modules/dynamo-bot/_collections/dyb-operations.util.spec.ts +160 -160
- package/src/_modules/bot/_modules/dynamo-bot/_collections/dyb-operations.util.ts +55 -55
- package/src/_modules/bot/_modules/dynamo-bot/_models/dyb-platform.types.ts +15 -15
- package/src/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.control-service.spec.ts +374 -374
- package/src/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.control-service.ts +447 -447
- package/src/_modules/bot/_modules/dynamo-bot/index.ts +15 -15
- package/src/_modules/bot/_modules/slack-bot/_models/slb-platform.types.ts +9 -9
- package/src/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.control-service.spec.ts +344 -344
- package/src/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.control-service.ts +197 -197
- package/src/_modules/bot/_modules/slack-bot/index.ts +12 -12
- package/src/_modules/bot/_modules/teams-bot/_models/teb-platform.types.ts +9 -9
- package/src/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.control-service.spec.ts +345 -345
- package/src/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.control-service.ts +197 -197
- package/src/_modules/bot/_modules/teams-bot/index.ts +11 -11
- package/src/_modules/bot/_services/bot-commands.control-service.spec.ts +116 -116
- package/src/_modules/bot/_services/bot-commands.control-service.ts +158 -158
- package/src/_modules/bot/_services/bot-io.control-service.spec.ts +285 -285
- package/src/_modules/bot/_services/bot-io.control-service.ts +329 -329
- package/src/_modules/bot/_services/bot-main.control-service.spec.ts +208 -208
- package/src/_modules/bot/_services/bot-main.control-service.ts +489 -489
- package/src/_modules/bot/_services/bot-messaging-provider.service-base.spec.ts +349 -349
- package/src/_modules/bot/_services/bot-messaging-provider.service-base.ts +158 -158
- package/src/_modules/bot/_services/bot-routines.control-service.spec.ts +111 -111
- package/src/_modules/bot/_services/bot-routines.control-service.ts +78 -78
- package/src/_modules/bot/index.ts +37 -37
- package/src/_modules/custom-data/custom-data.controller.spec.ts +49 -49
- package/src/_modules/custom-data/custom-data.controller.ts +67 -67
- package/src/_modules/custom-data/custom-data.data-service.spec.ts +54 -54
- package/src/_modules/custom-data/custom-data.data-service.ts +21 -21
- package/src/_modules/custom-data/get-custom-data-routing-module.util.spec.ts +28 -28
- package/src/_modules/custom-data/get-custom-data-routing-module.util.ts +24 -24
- package/src/_modules/custom-data/index.ts +9 -9
- package/src/_modules/data-readers/_collections/dynts-sqlite-reader.util.spec.ts +176 -176
- package/src/_modules/data-readers/_collections/dynts-sqlite-reader.util.ts +203 -203
- package/src/_modules/data-readers/_models/interfaces/dynts-sqlite-reader.interface.ts +33 -33
- package/src/_modules/data-readers/index.ts +11 -11
- package/src/_modules/defaults/_collections/default-endpoints.util.ts +487 -487
- package/src/_modules/defaults/_models/default-user.data-model.ts +72 -72
- package/src/_modules/defaults/_services/default-auth.service.spec.ts +269 -269
- package/src/_modules/defaults/_services/default-auth.service.ts +177 -177
- package/src/_modules/defaults/_services/default-socket-events.service.spec.ts +42 -42
- package/src/_modules/defaults/_services/default-socket-events.service.ts +61 -61
- package/src/_modules/defaults/_services/default-user.data-service.spec.ts +187 -187
- package/src/_modules/defaults/_services/default-user.data-service.ts +98 -98
- package/src/_modules/defaults/index.ts +17 -17
- package/src/_modules/discord-assistant/_collections/dias-global-settings.const.ts +19 -19
- package/src/_modules/discord-assistant/_collections/dias.util.spec.ts +366 -366
- package/src/_modules/discord-assistant/_collections/dias.util.ts +132 -132
- package/src/_modules/discord-assistant/_models/dias-global-settings.interface.ts +19 -19
- package/src/_modules/discord-assistant/_models/dias-knowledge.data-model.ts +52 -52
- package/src/_modules/discord-assistant/_services/dias-chunk.data-service.ts +177 -177
- package/src/_modules/discord-assistant/_services/dias-io.control-service.spec.ts +108 -108
- package/src/_modules/discord-assistant/_services/dias-io.control-service.ts +69 -69
- package/src/_modules/discord-assistant/_services/dias-main.control-service.spec.ts +22 -22
- package/src/_modules/discord-assistant/_services/dias-main.control-service.ts +27 -27
- package/src/_modules/discord-assistant/_services/dias.service-base.spec.ts +195 -195
- package/src/_modules/discord-assistant/_services/dias.service-base.ts +76 -76
- package/src/_modules/discord-assistant/index.ts +38 -38
- package/src/_modules/discord-assistant-voiced/_services/dias-discord-bot.control-service.spec.ts +34 -34
- package/src/_modules/discord-assistant-voiced/_services/dias-discord-bot.control-service.ts +11 -11
- package/src/_modules/discord-assistant-voiced/index.ts +36 -36
- package/src/_modules/discord-bot/_collections/dibo-default-commands.const.ts +16 -16
- package/src/_modules/discord-bot/_collections/dibo-global-settings.conts.ts +55 -55
- package/src/_modules/discord-bot/_collections/dibo-operations.util.spec.ts +214 -214
- package/src/_modules/discord-bot/_collections/dibo-operations.util.ts +387 -387
- package/src/_modules/discord-bot/_models/dibo-command.interface.ts +12 -12
- package/src/_modules/discord-bot/_models/dibo-global-settings.interface.ts +98 -98
- package/src/_modules/discord-bot/_models/dibo-last-mention-date.inteface.ts +7 -7
- package/src/_modules/discord-bot/_models/dibo-last-message-date.interface.ts +6 -6
- package/src/_modules/discord-bot/_services/dibo-commands.control-service.spec.ts +154 -154
- package/src/_modules/discord-bot/_services/dibo-commands.control-service.ts +153 -153
- package/src/_modules/discord-bot/_services/dibo-io.control-service.spec.ts +264 -264
- package/src/_modules/discord-bot/_services/dibo-io.control-service.ts +306 -306
- package/src/_modules/discord-bot/_services/dibo-main.control-service.spec.ts +408 -408
- package/src/_modules/discord-bot/_services/dibo-main.control-service.ts +487 -487
- package/src/_modules/discord-bot/_services/dibo-routines.control-service.spec.ts +105 -105
- package/src/_modules/discord-bot/_services/dibo-routines.control-service.ts +97 -97
- package/src/_modules/discord-bot/index.ts +36 -36
- package/src/_modules/local-vector-search/_enums/lvs-search-mode.enum.ts +35 -35
- package/src/_modules/local-vector-search/_models/data-models/lvs-vector-persist.data-model.ts +60 -60
- package/src/_modules/local-vector-search/_models/lvs-search-result.interface.ts +17 -17
- package/src/_modules/local-vector-search/_services/lvs-bm25.util.spec.ts +159 -159
- package/src/_modules/local-vector-search/_services/lvs-bm25.util.ts +206 -206
- package/src/_modules/local-vector-search/_services/lvs-doc-chunk-data.service.spec.ts +418 -418
- package/src/_modules/local-vector-search/_services/lvs-doc-chunk-data.service.ts +276 -276
- package/src/_modules/local-vector-search/_services/lvs-local-vector-search.data-service.spec.ts +480 -480
- package/src/_modules/local-vector-search/_services/lvs-local-vector-search.data-service.ts +416 -416
- package/src/_modules/local-vector-search/_services/lvs-persistent-vector-pool.control-service.spec.ts +198 -198
- package/src/_modules/local-vector-search/_services/lvs-persistent-vector-pool.control-service.ts +150 -150
- package/src/_modules/local-vector-search/_services/lvs-vector-persist.data-service.spec.ts +167 -167
- package/src/_modules/local-vector-search/_services/lvs-vector-persist.data-service.ts +108 -108
- package/src/_modules/local-vector-search/_services/lvs-vector-pool.control-service.spec.ts +393 -393
- package/src/_modules/local-vector-search/_services/lvs-vector-pool.control-service.ts +220 -220
- package/src/_modules/local-vector-search/index.ts +16 -16
- package/src/_modules/logs/_models/file-log-entry.interface.ts +13 -13
- package/src/_modules/logs/_models/file-log-read-result.interface.ts +37 -37
- package/src/_modules/logs/file-log.service.spec.ts +341 -341
- package/src/_modules/logs/file-log.service.ts +466 -466
- package/src/_modules/logs/file-logs.controller.spec.ts +245 -245
- package/src/_modules/logs/file-logs.controller.ts +165 -165
- package/src/_modules/logs/get-file-logs-routing-module.util.ts +51 -51
- package/src/_modules/logs/get-logs-routing-module.util.ts +36 -36
- package/src/_modules/logs/index.ts +11 -11
- package/src/_modules/logs/log-buffer.service.ts +101 -101
- package/src/_modules/logs/logs.controller.ts +109 -109
- package/src/_modules/logs/logs.service.ts +100 -100
- package/src/_modules/mcp/_models/interfaces/dynts-mcp.interface.ts +111 -111
- package/src/_modules/mcp/_services/dynts-mcp-server.service-base.spec.ts +151 -151
- package/src/_modules/mcp/_services/dynts-mcp-server.service-base.ts +125 -125
- package/src/_modules/mcp/_services/dynts-mcp.adapter.ts +168 -168
- package/src/_modules/mcp/index.ts +13 -13
- package/src/_modules/messaging/README.md +354 -354
- package/src/_modules/messaging/_collections/get-messaging-routing-module.util.ts +26 -26
- package/src/_modules/messaging/_collections/msg-global-settings.const.ts +22 -22
- package/src/_modules/messaging/_collections/msg.util.spec.ts +226 -226
- package/src/_modules/messaging/_collections/msg.util.ts +83 -83
- package/src/_modules/messaging/_models/msg-global-settings.interface.ts +37 -37
- package/src/_modules/messaging/_services/msg-conversation.data-service.ts +146 -146
- package/src/_modules/messaging/_services/msg-events.service.spec.ts +219 -219
- package/src/_modules/messaging/_services/msg-events.service.ts +267 -267
- package/src/_modules/messaging/_services/msg-integration.control-service.ts +179 -179
- package/src/_modules/messaging/_services/msg-main.control-service.spec.ts +147 -147
- package/src/_modules/messaging/_services/msg-main.control-service.ts +571 -571
- package/src/_modules/messaging/_services/msg-message.data-service.ts +129 -129
- package/src/_modules/messaging/_services/msg.controller.spec.ts +201 -201
- package/src/_modules/messaging/_services/msg.controller.ts +370 -370
- package/src/_modules/messaging/index.ts +30 -30
- package/src/_modules/mock/app-extended-server.mock.ts +201 -201
- package/src/_modules/mock/app-integration-test.mock.ts +51 -51
- package/src/_modules/mock/app-params.mock.spec.ts +21 -21
- package/src/_modules/mock/app-params.mock.ts +9 -9
- package/src/_modules/mock/app-server.mock.ts +188 -188
- package/src/_modules/mock/auth-service.mock.spec.ts +47 -47
- package/src/_modules/mock/auth-service.mock.ts +28 -28
- package/src/_modules/mock/controller.mock.spec.ts +26 -26
- package/src/_modules/mock/controller.mock.ts +16 -16
- package/src/_modules/mock/data-model.mock.spec.ts +111 -111
- package/src/_modules/mock/data-model.mock.ts +82 -82
- package/src/_modules/mock/email-service-collection.mock.spec.ts +24 -24
- package/src/_modules/mock/email-service-collection.mock.ts +15 -15
- package/src/_modules/mock/email-service.mock.spec.ts +17 -17
- package/src/_modules/mock/email-service.mock.ts +20 -20
- package/src/_modules/mock/email-template.mock.html +14 -14
- package/src/_modules/mock/endpoint.mock.ts +91 -91
- package/src/_modules/mock/socket-client.mock.spec.ts +40 -40
- package/src/_modules/mock/socket-client.mock.ts +45 -45
- package/src/_modules/mock/socket-server.mock.spec.ts +44 -44
- package/src/_modules/mock/socket-server.mock.ts +46 -46
- package/src/_modules/oauth2/_routes/oauth2.controller.spec.ts +107 -107
- package/src/_modules/oauth2/_routes/oauth2.controller.ts +98 -98
- package/src/_modules/oauth2/_services/oauth2.auth-service.spec.ts +254 -254
- package/src/_modules/oauth2/_services/oauth2.auth-service.ts +232 -232
- package/src/_modules/oauth2/_services/oauth2.control-service.spec.ts +585 -585
- package/src/_modules/oauth2/_services/oauth2.control-service.ts +653 -653
- package/src/_modules/oauth2/index.ts +17 -17
- package/src/_modules/rate-limit/_models/rate-limit-config.interface.ts +69 -69
- package/src/_modules/rate-limit/_models/rate-limit-policy.interface.ts +16 -16
- package/src/_modules/rate-limit/index.ts +3 -3
- package/src/_modules/rate-limit/rate-limit.middleware.spec.ts +264 -264
- package/src/_modules/rate-limit/rate-limit.middleware.ts +343 -343
- package/src/_modules/scoped-config/_enums/dynts-scoped-config-level.enum.ts +22 -22
- package/src/_modules/scoped-config/_models/data-models/dynts-scoped-config.data-model.ts +82 -82
- package/src/_modules/scoped-config/_models/interfaces/dynts-scoped-config.interface.ts +107 -107
- package/src/_modules/scoped-config/_services/dynts-scoped-config.control-service.spec.ts +312 -312
- package/src/_modules/scoped-config/_services/dynts-scoped-config.control-service.ts +311 -311
- package/src/_modules/scoped-config/_services/dynts-scoped-config.data-service.spec.ts +123 -123
- package/src/_modules/scoped-config/_services/dynts-scoped-config.data-service.ts +108 -108
- package/src/_modules/scoped-config/index.ts +17 -17
- package/src/_modules/server/errors/errors.control-service.spec.ts +246 -238
- package/src/_modules/server/errors/errors.control-service.ts +100 -85
- package/src/_modules/server/errors/errors.controller.spec.ts +249 -241
- package/src/_modules/server/errors/errors.controller.ts +489 -431
- package/src/_modules/server/errors/errors.data-service.spec.ts +480 -361
- package/src/_modules/server/errors/errors.data-service.ts +816 -722
- package/src/_modules/server/index.ts +30 -30
- package/src/_modules/server/server-status/server-status-snapshot.control-service.spec.ts +70 -70
- package/src/_modules/server/server-status/server-status-snapshot.control-service.ts +17 -17
- package/src/_modules/server/server-status/server-status-snapshot.data-service.spec.ts +77 -77
- package/src/_modules/server/server-status/server-status-snapshot.data-service.ts +37 -37
- package/src/_modules/server/server-status/server-status.control-service.spec.ts +584 -576
- package/src/_modules/server/server-status/server-status.control-service.ts +396 -396
- package/src/_modules/server/server-status/server-status.controller.spec.ts +248 -240
- package/src/_modules/server/server-status/server-status.controller.ts +253 -253
- package/src/_modules/socket/_enums/socket-security.enum.ts +11 -11
- package/src/_modules/socket/_models/socket-client-service-params.control-model.spec.ts +32 -32
- package/src/_modules/socket/_models/socket-client-service-params.control-model.ts +22 -22
- package/src/_modules/socket/_models/socket-presence.control-model.spec.ts +164 -164
- package/src/_modules/socket/_models/socket-presence.control-model.ts +210 -210
- package/src/_modules/socket/_models/socket-server-service-params.control-model.spec.ts +46 -46
- package/src/_modules/socket/_models/socket-server-service-params.control-model.ts +22 -22
- package/src/_modules/socket/_services/socket-client.service.spec.ts +15 -15
- package/src/_modules/socket/_services/socket-client.service.ts +260 -260
- package/src/_modules/socket/_services/socket-server.service.spec.ts +11 -11
- package/src/_modules/socket/_services/socket-server.service.ts +1068 -1068
- package/src/_modules/socket/app-extended.integration.spec.ts +85 -85
- package/src/_modules/socket/app-extended.server.ts +630 -630
- package/src/_modules/socket/index.ts +42 -42
- package/src/_modules/test/get-test-routing-module.util.spec.ts +28 -28
- package/src/_modules/test/get-test-routing-module.util.ts +23 -23
- package/src/_modules/test/index.ts +11 -11
- package/src/_modules/test/test.controller.spec.ts +72 -72
- package/src/_modules/test/test.controller.ts +115 -115
- package/src/_modules/usage/get-usage-routing-module.util.ts +22 -22
- package/src/_modules/usage/index.ts +15 -15
- package/src/_modules/usage/usage.controller.spec.ts +81 -81
- package/src/_modules/usage/usage.controller.ts +126 -126
- package/src/_modules/usage/usage.data-service.spec.ts +332 -332
- package/src/_modules/usage/usage.data-service.ts +185 -185
- package/src/_services/base/api.service-base.spec.ts +125 -125
- package/src/_services/base/api.service-base.ts +74 -74
- package/src/_services/base/archive-data.service.spec.ts +196 -196
- package/src/_services/base/archive-data.service.ts +216 -216
- package/src/_services/base/data.service.spec.ts +674 -674
- package/src/_services/base/data.service.ts +2719 -2719
- package/src/_services/base/db.service.spec.ts +73 -73
- package/src/_services/base/db.service.ts +1575 -1575
- package/src/_services/base/singleton.service-base.spec.ts +28 -28
- package/src/_services/base/singleton.service-base.ts +24 -24
- package/src/_services/base/singleton.service.spec.ts +114 -114
- package/src/_services/base/singleton.service.ts +38 -38
- package/src/_services/core/api.service.spec.ts +140 -140
- package/src/_services/core/api.service.ts +607 -607
- package/src/_services/core/auth.service.spec.ts +159 -159
- package/src/_services/core/auth.service.ts +174 -174
- package/src/_services/core/email.service.spec.ts +85 -85
- package/src/_services/core/email.service.ts +742 -742
- package/src/_services/core/global.service.spec.ts +292 -292
- package/src/_services/core/global.service.ts +475 -475
- package/src/_services/core/memory-guard.service.spec.ts +165 -165
- package/src/_services/core/memory-guard.service.ts +281 -281
- package/src/_services/core/service-collection.service.spec.ts +46 -46
- package/src/_services/core/service-collection.service.ts +6 -6
- package/src/_services/route/controller.service.spec.ts +53 -53
- package/src/_services/route/controller.service.ts +148 -148
- package/src/_services/route/routing-module.service.spec.ts +98 -98
- package/src/_services/route/routing-module.service.ts +330 -330
- package/src/_services/server/app.server.ts +1747 -1747
- package/src/_services/shared.static-service.spec.ts +99 -99
- package/src/_services/shared.static-service.ts +78 -78
- package/src/index.ts +96 -96
- package/tsconfig.app.json +12 -12
- package/tsconfig.json +42 -42
- package/.dynamo/logs/cicd-pipeline/output.log +0 -2771
- package/.dynamo/logs/cicd-pipeline/status.json +0 -94
|
@@ -1,674 +1,674 @@
|
|
|
1
|
-
|
|
2
|
-
import { DyNTS_DataService } from './data.service';
|
|
3
|
-
import { DyNTS_DBService } from './db.service';
|
|
4
|
-
import { DyNTS_GlobalService } from '../core/global.service';
|
|
5
|
-
import { DyNTS_ArchiveDataService } from './archive-data.service';
|
|
6
|
-
import { DyFM_Metadata, DyFM_DataModel_Params, DyFM_Error, DyFM_DBFilter, DyFM_SearchQuery, DyFM_BasicProperty_Type, DyFM_EnvironmentFlag } from '@futdevpro/fsm-dynamo';
|
|
7
|
-
import { DyNTS_global_settings } from '../../_collections/global-settings.const';
|
|
8
|
-
|
|
9
|
-
// Initialize global settings before any test runs
|
|
10
|
-
beforeAll(() => {
|
|
11
|
-
if (!DyNTS_global_settings.systemShortCodeName) {
|
|
12
|
-
(DyNTS_global_settings as any).systemShortCodeName = 'TEST';
|
|
13
|
-
}
|
|
14
|
-
if (!DyNTS_global_settings.env_settings) {
|
|
15
|
-
(DyNTS_global_settings as any).env_settings = {
|
|
16
|
-
environment: DyFM_EnvironmentFlag.local,
|
|
17
|
-
};
|
|
18
|
-
}
|
|
19
|
-
});
|
|
20
|
-
|
|
21
|
-
class TestMetadata extends DyFM_Metadata {
|
|
22
|
-
name: string;
|
|
23
|
-
email?: string;
|
|
24
|
-
userId?: string;
|
|
25
|
-
}
|
|
26
|
-
|
|
27
|
-
const testDataParams = new DyFM_DataModel_Params<TestMetadata>({
|
|
28
|
-
dataName: 'test_data',
|
|
29
|
-
properties: {
|
|
30
|
-
name: {
|
|
31
|
-
key: 'name',
|
|
32
|
-
type: DyFM_BasicProperty_Type.string,
|
|
33
|
-
required: true,
|
|
34
|
-
},
|
|
35
|
-
email: {
|
|
36
|
-
key: 'email',
|
|
37
|
-
type: DyFM_BasicProperty_Type.string,
|
|
38
|
-
},
|
|
39
|
-
userId: {
|
|
40
|
-
key: 'userId',
|
|
41
|
-
type: DyFM_BasicProperty_Type.string,
|
|
42
|
-
dependencyDataName: 'user_data',
|
|
43
|
-
},
|
|
44
|
-
},
|
|
45
|
-
});
|
|
46
|
-
|
|
47
|
-
describe('| DyNTS_DataService', () => {
|
|
48
|
-
let mockDBService: jasmine.SpyObj<DyNTS_DBService<TestMetadata>>;
|
|
49
|
-
let service: DyNTS_DataService<TestMetadata>;
|
|
50
|
-
let testData: TestMetadata;
|
|
51
|
-
|
|
52
|
-
beforeEach(() => {
|
|
53
|
-
testData = new TestMetadata({
|
|
54
|
-
_id: 'test-id-123',
|
|
55
|
-
name: 'Test Name',
|
|
56
|
-
email: 'test@example.com',
|
|
57
|
-
} as TestMetadata);
|
|
58
|
-
|
|
59
|
-
mockDBService = jasmine.createSpyObj('DyNTS_DBService', [
|
|
60
|
-
'getAll',
|
|
61
|
-
'getDataById',
|
|
62
|
-
'getDataListByIds',
|
|
63
|
-
'getDataByDependencyId',
|
|
64
|
-
'getDataListByDependencyIds',
|
|
65
|
-
'getDataListByDependencyId',
|
|
66
|
-
'findOne',
|
|
67
|
-
'find',
|
|
68
|
-
'updateOne',
|
|
69
|
-
'createData',
|
|
70
|
-
'modifyData',
|
|
71
|
-
'markDeletedById',
|
|
72
|
-
'trueDeleteDataById',
|
|
73
|
-
'trueDeleteAllData',
|
|
74
|
-
'restoreDeletedById',
|
|
75
|
-
]);
|
|
76
|
-
|
|
77
|
-
spyOn(DyNTS_GlobalService, 'getDBService').and.returnValue(mockDBService);
|
|
78
|
-
spyOn(DyNTS_GlobalService, 'getDBServiceByKey').and.returnValue(mockDBService);
|
|
79
|
-
|
|
80
|
-
service = new DyNTS_DataService<TestMetadata>(
|
|
81
|
-
testData,
|
|
82
|
-
testDataParams,
|
|
83
|
-
'test-issuer'
|
|
84
|
-
);
|
|
85
|
-
});
|
|
86
|
-
|
|
87
|
-
it('| should create service instance', () => {
|
|
88
|
-
expect(service).toBeDefined();
|
|
89
|
-
expect(service.data).toBe(testData);
|
|
90
|
-
expect(service.dataParams).toBe(testDataParams);
|
|
91
|
-
expect(service.issuer).toBe('test-issuer');
|
|
92
|
-
expect(service.dataDBService).toBe(mockDBService);
|
|
93
|
-
});
|
|
94
|
-
|
|
95
|
-
it('| should set service name from constructor', () => {
|
|
96
|
-
expect(service.serviceName).toBe('DyNTS_DataService');
|
|
97
|
-
});
|
|
98
|
-
|
|
99
|
-
it('| should have default error messages', () => {
|
|
100
|
-
expect(service.defaultErrorUserMsg).toContain('Data Service Error');
|
|
101
|
-
expect(service.defaultValidationErrorUserMsg).toContain('Validation Error');
|
|
102
|
-
});
|
|
103
|
-
|
|
104
|
-
it('| should throw error when DB service not found', () => {
|
|
105
|
-
(DyNTS_GlobalService.getDBService as jasmine.Spy).and.throwError('DB Service not found');
|
|
106
|
-
|
|
107
|
-
expect(() => {
|
|
108
|
-
new DyNTS_DataService<TestMetadata>(testData, testDataParams, 'test-issuer');
|
|
109
|
-
}).toThrow();
|
|
110
|
-
});
|
|
111
|
-
|
|
112
|
-
describe('| getAll', () => {
|
|
113
|
-
it('| should get all data from database', async () => {
|
|
114
|
-
const mockDataList = [testData, { ...testData, _id: 'test-id-456' }];
|
|
115
|
-
mockDBService.getAll.and.returnValue(Promise.resolve(mockDataList));
|
|
116
|
-
|
|
117
|
-
const result = await service.getAll();
|
|
118
|
-
|
|
119
|
-
expect(result).toEqual(mockDataList);
|
|
120
|
-
expect(service.dataList).toEqual(mockDataList);
|
|
121
|
-
expect(mockDBService.getAll).toHaveBeenCalled();
|
|
122
|
-
});
|
|
123
|
-
|
|
124
|
-
it('| should not set to service when dontSetToService is true', async () => {
|
|
125
|
-
const mockDataList = [testData];
|
|
126
|
-
mockDBService.getAll.and.returnValue(Promise.resolve(mockDataList));
|
|
127
|
-
|
|
128
|
-
const result = await service.getAll(true);
|
|
129
|
-
|
|
130
|
-
expect(result).toEqual(mockDataList);
|
|
131
|
-
expect(service.dataList).not.toEqual(mockDataList);
|
|
132
|
-
});
|
|
133
|
-
});
|
|
134
|
-
|
|
135
|
-
describe('| getDataById', () => {
|
|
136
|
-
it('| should get data by id', async () => {
|
|
137
|
-
mockDBService.getDataById.and.returnValue(Promise.resolve(testData));
|
|
138
|
-
|
|
139
|
-
const result = await service.getDataById('test-id-123');
|
|
140
|
-
|
|
141
|
-
expect(result).toBe(testData);
|
|
142
|
-
expect(service.data).toBe(testData);
|
|
143
|
-
expect(mockDBService.getDataById).toHaveBeenCalledWith('test-id-123');
|
|
144
|
-
});
|
|
145
|
-
|
|
146
|
-
it('| should use data._id when id not provided', async () => {
|
|
147
|
-
mockDBService.getDataById.and.returnValue(Promise.resolve(testData));
|
|
148
|
-
|
|
149
|
-
const result = await service.getDataById();
|
|
150
|
-
|
|
151
|
-
expect(mockDBService.getDataById).toHaveBeenCalledWith('test-id-123');
|
|
152
|
-
});
|
|
153
|
-
|
|
154
|
-
it('| should throw error when id is missing', async () => {
|
|
155
|
-
service.data = new TestMetadata({});
|
|
156
|
-
|
|
157
|
-
await expectAsync(
|
|
158
|
-
service.getDataById()
|
|
159
|
-
).toBeRejected();
|
|
160
|
-
});
|
|
161
|
-
|
|
162
|
-
it('| should load from archive when not found and archive enabled', async () => {
|
|
163
|
-
service.haveArchiveDataService = true;
|
|
164
|
-
mockDBService.getDataById.and.returnValue(Promise.resolve(null));
|
|
165
|
-
const mockArchiveService = jasmine.createSpyObj('DyNTS_ArchiveDataService', ['getDataByOriginalId']);
|
|
166
|
-
mockArchiveService.getDataByOriginalId.and.returnValue(Promise.resolve(testData));
|
|
167
|
-
spyOn(service, 'getArchiveDataService').and.returnValue(mockArchiveService);
|
|
168
|
-
|
|
169
|
-
const result = await service.getDataById('test-id-123');
|
|
170
|
-
|
|
171
|
-
expect(result).toBe(testData);
|
|
172
|
-
expect(mockArchiveService.getDataByOriginalId).toHaveBeenCalled();
|
|
173
|
-
});
|
|
174
|
-
|
|
175
|
-
it('| should not load from archive when skipArchiveLoad is true', async () => {
|
|
176
|
-
service.haveArchiveDataService = true;
|
|
177
|
-
mockDBService.getDataById.and.returnValue(Promise.resolve(null));
|
|
178
|
-
spyOn(service, 'getArchiveDataService');
|
|
179
|
-
|
|
180
|
-
const result = await service.getDataById('test-id-123', false, true);
|
|
181
|
-
|
|
182
|
-
expect(result).toBeNull();
|
|
183
|
-
expect(service.getArchiveDataService).not.toHaveBeenCalled();
|
|
184
|
-
});
|
|
185
|
-
});
|
|
186
|
-
|
|
187
|
-
describe('| getDataByIds', () => {
|
|
188
|
-
it('| should get data by ids', async () => {
|
|
189
|
-
const ids = ['id-1', 'id-2'];
|
|
190
|
-
const mockDataList = [testData, { ...testData, _id: 'id-2' }];
|
|
191
|
-
mockDBService.find.and.returnValue(Promise.resolve(mockDataList));
|
|
192
|
-
|
|
193
|
-
const result = await service.getDataByIds(ids);
|
|
194
|
-
|
|
195
|
-
expect(result).toEqual(mockDataList);
|
|
196
|
-
expect(mockDBService.find).toHaveBeenCalledWith({ _id: { $in: ids } });
|
|
197
|
-
});
|
|
198
|
-
|
|
199
|
-
it('| should throw error when ids is missing', async () => {
|
|
200
|
-
await expectAsync(
|
|
201
|
-
service.getDataByIds(null as any)
|
|
202
|
-
).toBeRejected();
|
|
203
|
-
});
|
|
204
|
-
|
|
205
|
-
it('| should return empty array when ids is empty array', async () => {
|
|
206
|
-
const result = await service.getDataByIds([]);
|
|
207
|
-
|
|
208
|
-
expect(result).toEqual([]);
|
|
209
|
-
});
|
|
210
|
-
});
|
|
211
|
-
|
|
212
|
-
describe('| getDataListByIds', () => {
|
|
213
|
-
it('| should get data list by ids', async () => {
|
|
214
|
-
const ids = ['id-1', 'id-2'];
|
|
215
|
-
const mockDataList = [testData, { ...testData, _id: 'id-2' }];
|
|
216
|
-
mockDBService.getDataListByIds.and.returnValue(Promise.resolve(mockDataList));
|
|
217
|
-
|
|
218
|
-
const result = await service.getDataListByIds(ids);
|
|
219
|
-
|
|
220
|
-
expect(result).toEqual(mockDataList);
|
|
221
|
-
expect(service.dataList).toEqual(mockDataList);
|
|
222
|
-
});
|
|
223
|
-
});
|
|
224
|
-
|
|
225
|
-
describe('| getDataByDependencyId', () => {
|
|
226
|
-
it('| should get data by dependency id', async () => {
|
|
227
|
-
const dependencyData = { ...testData, userId: 'user-123' };
|
|
228
|
-
mockDBService.getDataByDependencyId.and.returnValue(Promise.resolve(dependencyData));
|
|
229
|
-
|
|
230
|
-
const result = await service.getDataByDependencyId('user-123');
|
|
231
|
-
|
|
232
|
-
expect(result).toBe(dependencyData);
|
|
233
|
-
expect(service.data).toBe(dependencyData);
|
|
234
|
-
});
|
|
235
|
-
|
|
236
|
-
it('| should throw error when dependency settings not configured', async () => {
|
|
237
|
-
const serviceWithoutDeps = new DyNTS_DataService<TestMetadata>(
|
|
238
|
-
testData,
|
|
239
|
-
new DyFM_DataModel_Params<TestMetadata>({
|
|
240
|
-
dataName: 'test_data',
|
|
241
|
-
properties: { name: { key: 'name', type: DyFM_BasicProperty_Type.string } },
|
|
242
|
-
}),
|
|
243
|
-
'test-issuer'
|
|
244
|
-
);
|
|
245
|
-
|
|
246
|
-
await expectAsync(
|
|
247
|
-
serviceWithoutDeps.getDataByDependencyId('user-123')
|
|
248
|
-
).toBeRejected();
|
|
249
|
-
});
|
|
250
|
-
});
|
|
251
|
-
|
|
252
|
-
describe('| findData', () => {
|
|
253
|
-
it('| should find data by filter', async () => {
|
|
254
|
-
const filter: DyFM_DBFilter<TestMetadata> = { email: 'test@example.com' };
|
|
255
|
-
mockDBService.findOne.and.returnValue(Promise.resolve(testData));
|
|
256
|
-
|
|
257
|
-
const result = await service.findData(filter);
|
|
258
|
-
|
|
259
|
-
expect(result).toBe(testData);
|
|
260
|
-
expect(service.data).toBe(testData);
|
|
261
|
-
expect(mockDBService.findOne).toHaveBeenCalledWith(filter);
|
|
262
|
-
});
|
|
263
|
-
});
|
|
264
|
-
|
|
265
|
-
describe('| findDataList', () => {
|
|
266
|
-
it('| should find data list by filter', async () => {
|
|
267
|
-
const filter: DyFM_DBFilter<TestMetadata> = { name: 'Test' };
|
|
268
|
-
const mockDataList = [testData];
|
|
269
|
-
mockDBService.find.and.returnValue(Promise.resolve(mockDataList));
|
|
270
|
-
|
|
271
|
-
const result = await service.findDataList(filter);
|
|
272
|
-
|
|
273
|
-
expect(result).toEqual(mockDataList);
|
|
274
|
-
expect(service.dataList).toEqual(mockDataList);
|
|
275
|
-
});
|
|
276
|
-
});
|
|
277
|
-
|
|
278
|
-
describe('| updateData', () => {
|
|
279
|
-
it('| should update data by filterBy', async () => {
|
|
280
|
-
const filter: DyFM_DBFilter<TestMetadata> = { email: 'test@example.com' };
|
|
281
|
-
const update = { name: 'Updated Name' };
|
|
282
|
-
mockDBService.updateOne.and.returnValue(Promise.resolve());
|
|
283
|
-
|
|
284
|
-
await service.updateData({ filterBy: filter, update });
|
|
285
|
-
|
|
286
|
-
expect(mockDBService.updateOne).toHaveBeenCalledWith(
|
|
287
|
-
filter,
|
|
288
|
-
update,
|
|
289
|
-
'test-issuer',
|
|
290
|
-
undefined
|
|
291
|
-
);
|
|
292
|
-
});
|
|
293
|
-
|
|
294
|
-
it('| should update data by data._id', async () => {
|
|
295
|
-
const update = { name: 'Updated Name' };
|
|
296
|
-
mockDBService.updateOne.and.returnValue(Promise.resolve());
|
|
297
|
-
|
|
298
|
-
await service.updateData({ update });
|
|
299
|
-
|
|
300
|
-
expect(mockDBService.updateOne).toHaveBeenCalledWith(
|
|
301
|
-
{ _id: 'test-id-123' } as any,
|
|
302
|
-
update,
|
|
303
|
-
'test-issuer',
|
|
304
|
-
undefined
|
|
305
|
-
);
|
|
306
|
-
});
|
|
307
|
-
|
|
308
|
-
it('| should throw error when no usable parameter provided', async () => {
|
|
309
|
-
service.data = new TestMetadata({});
|
|
310
|
-
const update = { name: 'Updated Name' };
|
|
311
|
-
|
|
312
|
-
await expectAsync(
|
|
313
|
-
service.updateData({ update })
|
|
314
|
-
).toBeRejected();
|
|
315
|
-
});
|
|
316
|
-
});
|
|
317
|
-
|
|
318
|
-
describe('| saveData', () => {
|
|
319
|
-
it('| should modify existing data when _id is present', async () => {
|
|
320
|
-
const existingData = { ...testData, name: 'Updated Name' };
|
|
321
|
-
mockDBService.getDataById.and.returnValue(Promise.resolve(testData));
|
|
322
|
-
mockDBService.modifyData.and.returnValue(Promise.resolve(existingData));
|
|
323
|
-
spyOn(service, 'validateForSave').and.returnValue(Promise.resolve());
|
|
324
|
-
|
|
325
|
-
const result = await service.saveData(existingData);
|
|
326
|
-
|
|
327
|
-
expect(result).toBe(existingData);
|
|
328
|
-
expect(mockDBService.modifyData).toHaveBeenCalled();
|
|
329
|
-
});
|
|
330
|
-
|
|
331
|
-
it('| should throw error when data with _id does not exist', async () => {
|
|
332
|
-
const dataWithId = { ...testData, _id: 'non-existent-id' };
|
|
333
|
-
mockDBService.getDataById.and.returnValue(Promise.resolve(null));
|
|
334
|
-
spyOn(service, 'validateForSave').and.returnValue(Promise.resolve());
|
|
335
|
-
|
|
336
|
-
await expectAsync(
|
|
337
|
-
service.saveData(dataWithId)
|
|
338
|
-
).toBeRejected();
|
|
339
|
-
});
|
|
340
|
-
});
|
|
341
|
-
|
|
342
|
-
describe('| deleteData', () => {
|
|
343
|
-
it('| should delete data by id', async () => {
|
|
344
|
-
mockDBService.getDataById.and.returnValue(Promise.resolve(testData));
|
|
345
|
-
mockDBService.markDeletedById.and.returnValue(Promise.resolve());
|
|
346
|
-
|
|
347
|
-
await service.deleteData('test-id-123');
|
|
348
|
-
|
|
349
|
-
expect(mockDBService.markDeletedById).toHaveBeenCalledWith('test-id-123', 'test-issuer');
|
|
350
|
-
});
|
|
351
|
-
|
|
352
|
-
it('| should use data._id when id not provided', async () => {
|
|
353
|
-
mockDBService.getDataById.and.returnValue(Promise.resolve(testData));
|
|
354
|
-
mockDBService.markDeletedById.and.returnValue(Promise.resolve());
|
|
355
|
-
|
|
356
|
-
await service.deleteData();
|
|
357
|
-
|
|
358
|
-
expect(mockDBService.markDeletedById).toHaveBeenCalledWith('test-id-123', 'test-issuer');
|
|
359
|
-
});
|
|
360
|
-
|
|
361
|
-
it('| should throw error when id is missing', async () => {
|
|
362
|
-
service.data = new TestMetadata({});
|
|
363
|
-
|
|
364
|
-
await expectAsync(
|
|
365
|
-
service.deleteData()
|
|
366
|
-
).toBeRejected();
|
|
367
|
-
});
|
|
368
|
-
|
|
369
|
-
it('| should archive data when archive service enabled', async () => {
|
|
370
|
-
service.haveArchiveDataService = true;
|
|
371
|
-
mockDBService.getDataById.and.returnValue(Promise.resolve(testData));
|
|
372
|
-
mockDBService.trueDeleteDataById.and.returnValue(Promise.resolve());
|
|
373
|
-
const mockArchiveService = jasmine.createSpyObj('DyNTS_ArchiveDataService', ['saveData']);
|
|
374
|
-
mockArchiveService.saveData.and.returnValue(Promise.resolve());
|
|
375
|
-
spyOn(service, 'getArchiveDataService').and.returnValue(mockArchiveService);
|
|
376
|
-
|
|
377
|
-
await service.deleteData('test-id-123');
|
|
378
|
-
|
|
379
|
-
expect(mockDBService.trueDeleteDataById).toHaveBeenCalled();
|
|
380
|
-
expect(mockArchiveService.saveData).toHaveBeenCalled();
|
|
381
|
-
});
|
|
382
|
-
|
|
383
|
-
it('| should permanently delete when absolute is true', async () => {
|
|
384
|
-
mockDBService.getDataById.and.returnValue(Promise.resolve(testData));
|
|
385
|
-
mockDBService.trueDeleteDataById.and.returnValue(Promise.resolve());
|
|
386
|
-
|
|
387
|
-
await service.deleteData('test-id-123', true);
|
|
388
|
-
|
|
389
|
-
expect(mockDBService.trueDeleteDataById).toHaveBeenCalledWith('test-id-123');
|
|
390
|
-
});
|
|
391
|
-
});
|
|
392
|
-
|
|
393
|
-
describe('| deleteAllData', () => {
|
|
394
|
-
it('| should delete all data', async () => {
|
|
395
|
-
const mockDataList = [testData, { ...testData, _id: 'id-2' }];
|
|
396
|
-
mockDBService.getAll.and.returnValue(Promise.resolve(mockDataList));
|
|
397
|
-
mockDBService.markDeletedById.and.returnValue(Promise.resolve());
|
|
398
|
-
|
|
399
|
-
await service.deleteAllData();
|
|
400
|
-
|
|
401
|
-
expect(mockDBService.markDeletedById).toHaveBeenCalledTimes(2);
|
|
402
|
-
});
|
|
403
|
-
|
|
404
|
-
it('| should archive all data when archive service enabled', async () => {
|
|
405
|
-
service.haveArchiveDataService = true;
|
|
406
|
-
const mockDataList = [testData];
|
|
407
|
-
mockDBService.getAll.and.returnValue(Promise.resolve(mockDataList));
|
|
408
|
-
mockDBService.trueDeleteAllData.and.returnValue(Promise.resolve());
|
|
409
|
-
const mockArchiveService = jasmine.createSpyObj('DyNTS_ArchiveDataService', ['saveData']);
|
|
410
|
-
mockArchiveService.saveData.and.returnValue(Promise.resolve());
|
|
411
|
-
spyOn(service, 'getArchiveDataService').and.returnValue(mockArchiveService);
|
|
412
|
-
|
|
413
|
-
await service.deleteAllData();
|
|
414
|
-
|
|
415
|
-
expect(mockDBService.trueDeleteAllData).toHaveBeenCalled();
|
|
416
|
-
expect(mockArchiveService.saveData).toHaveBeenCalled();
|
|
417
|
-
});
|
|
418
|
-
});
|
|
419
|
-
|
|
420
|
-
describe('| searchData', () => {
|
|
421
|
-
it('| should search data with query', async () => {
|
|
422
|
-
const query: DyFM_SearchQuery<TestMetadata> = {
|
|
423
|
-
filterBy: { name: 'Test' },
|
|
424
|
-
page: 0,
|
|
425
|
-
pageSize: 10,
|
|
426
|
-
sortBy: [{ key: 'name', order: 1 }],
|
|
427
|
-
};
|
|
428
|
-
const mockDataList = [testData];
|
|
429
|
-
spyOn(service, 'sortAndFilterDataList').and.returnValue(Promise.resolve({
|
|
430
|
-
results: mockDataList,
|
|
431
|
-
totalItems: 1,
|
|
432
|
-
}));
|
|
433
|
-
|
|
434
|
-
const result = await service.searchData(query);
|
|
435
|
-
|
|
436
|
-
expect(result.results).toEqual(mockDataList);
|
|
437
|
-
expect(service.sortAndFilterDataList).toHaveBeenCalledWith(query, undefined);
|
|
438
|
-
});
|
|
439
|
-
|
|
440
|
-
it('| should apply pagination', async () => {
|
|
441
|
-
const query: DyFM_SearchQuery<TestMetadata> = {
|
|
442
|
-
page: 1,
|
|
443
|
-
pageSize: 2,
|
|
444
|
-
};
|
|
445
|
-
const mockResults = [
|
|
446
|
-
testData,
|
|
447
|
-
{ ...testData, _id: 'id-2' },
|
|
448
|
-
{ ...testData, _id: 'id-3' },
|
|
449
|
-
];
|
|
450
|
-
spyOn(service, 'sortAndFilterDataList').and.returnValue(Promise.resolve({
|
|
451
|
-
results: mockResults,
|
|
452
|
-
totalItems: 3,
|
|
453
|
-
}));
|
|
454
|
-
|
|
455
|
-
const result = await service.searchData(query);
|
|
456
|
-
|
|
457
|
-
expect(result.results.length).toBe(1);
|
|
458
|
-
expect(result.results[0]._id).toBe('id-3');
|
|
459
|
-
});
|
|
460
|
-
});
|
|
461
|
-
|
|
462
|
-
describe('| getArchiveDataService', () => {
|
|
463
|
-
it('| should throw error when not implemented', () => {
|
|
464
|
-
expect(() => {
|
|
465
|
-
service.getArchiveDataService();
|
|
466
|
-
}).toThrow();
|
|
467
|
-
});
|
|
468
|
-
});
|
|
469
|
-
|
|
470
|
-
describe('| getDependencyDataDBService', () => {
|
|
471
|
-
it('| should get dependency DB service when configured', () => {
|
|
472
|
-
const depService = service.getDependencyDataDBService('user_data');
|
|
473
|
-
|
|
474
|
-
expect(depService).toBeDefined();
|
|
475
|
-
});
|
|
476
|
-
|
|
477
|
-
it('| should throw error when service key not set', () => {
|
|
478
|
-
const serviceWithoutDeps = new DyNTS_DataService<TestMetadata>(
|
|
479
|
-
testData,
|
|
480
|
-
new DyFM_DataModel_Params<TestMetadata>({
|
|
481
|
-
dataName: 'test_data',
|
|
482
|
-
properties: { name: { key: 'name', type: DyFM_BasicProperty_Type.string } },
|
|
483
|
-
}),
|
|
484
|
-
'test-issuer'
|
|
485
|
-
);
|
|
486
|
-
|
|
487
|
-
expect(() => {
|
|
488
|
-
serviceWithoutDeps.getDependencyDataDBService();
|
|
489
|
-
}).toThrow();
|
|
490
|
-
});
|
|
491
|
-
});
|
|
492
|
-
|
|
493
|
-
// ════════════════════════════════════════════════════════════════════════
|
|
494
|
-
// FR-001 — Generic compareData()
|
|
495
|
-
// ════════════════════════════════════════════════════════════════════════
|
|
496
|
-
|
|
497
|
-
describe('| compareData() — FR-001', (): void => {
|
|
498
|
-
let svc: DyNTS_DataService<TestMetadata>;
|
|
499
|
-
|
|
500
|
-
beforeEach((): void => {
|
|
501
|
-
// Re-use existing TestMetadata + testDataParams.
|
|
502
|
-
const t: TestMetadata = new TestMetadata();
|
|
503
|
-
svc = new DyNTS_DataService<TestMetadata>(t, testDataParams, 'test-issuer');
|
|
504
|
-
});
|
|
505
|
-
|
|
506
|
-
it('| equal POJO returns { result: "equal" } — sin changedFields', (): void => {
|
|
507
|
-
const a: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice', email: 'a@x' });
|
|
508
|
-
const b: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice', email: 'a@x' });
|
|
509
|
-
const r = svc.compareData(a, b);
|
|
510
|
-
expect(r.result).toBe('equal');
|
|
511
|
-
expect(r.changedFields).toBeUndefined();
|
|
512
|
-
});
|
|
513
|
-
|
|
514
|
-
it('| modified single field — changedFields tartalmazza azt', (): void => {
|
|
515
|
-
const a: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice', email: 'a@x' });
|
|
516
|
-
const b: TestMetadata = Object.assign(new TestMetadata(), { name: 'bob', email: 'a@x' });
|
|
517
|
-
const r = svc.compareData(a, b);
|
|
518
|
-
expect(r.result).toBe('modified');
|
|
519
|
-
expect(r.changedFields).toEqual(['name']);
|
|
520
|
-
});
|
|
521
|
-
|
|
522
|
-
it('| modified multi-field — changedFields TELJES listat ad (nem early-return)', (): void => {
|
|
523
|
-
const a: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice', email: 'a@x', userId: 'u1' });
|
|
524
|
-
const b: TestMetadata = Object.assign(new TestMetadata(), { name: 'bob', email: 'b@y', userId: 'u2' });
|
|
525
|
-
const r = svc.compareData(a, b);
|
|
526
|
-
expect(r.result).toBe('modified');
|
|
527
|
-
expect(r.changedFields?.sort()).toEqual(['email', 'name', 'userId'] as any);
|
|
528
|
-
});
|
|
529
|
-
|
|
530
|
-
it('| auto-discovery SKIP-eli a metadata fields-et (_id, __created, __lastModified)', (): void => {
|
|
531
|
-
const now: Date = new Date();
|
|
532
|
-
const a: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice', _id: 'X', __created: now, __lastModified: now });
|
|
533
|
-
const b: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice', _id: 'Y', __created: new Date(2000, 0, 1), __lastModified: new Date(2001, 0, 1) });
|
|
534
|
-
const r = svc.compareData(a, b);
|
|
535
|
-
expect(r.result).toBe('equal');
|
|
536
|
-
});
|
|
537
|
-
|
|
538
|
-
it('| explicit fields override — KIFEJEZETT _id-val VIZSGALJA a skip-listet is', (): void => {
|
|
539
|
-
const a: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice', _id: 'X' });
|
|
540
|
-
const b: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice', _id: 'Y' });
|
|
541
|
-
const r = svc.compareData(a, b, { fields: ['_id' as keyof TestMetadata] });
|
|
542
|
-
expect(r.result).toBe('modified');
|
|
543
|
-
expect(r.changedFields).toEqual(['_id' as keyof TestMetadata]);
|
|
544
|
-
});
|
|
545
|
-
|
|
546
|
-
it('| explicit fields scope-szukit — csak a listazott fields szamit', (): void => {
|
|
547
|
-
const a: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice', email: 'a@x' });
|
|
548
|
-
const b: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice', email: 'b@y' });
|
|
549
|
-
const r = svc.compareData(a, b, { fields: ['name'] });
|
|
550
|
-
expect(r.result).toBe('equal'); // email change ignored, only 'name' checked
|
|
551
|
-
});
|
|
552
|
-
|
|
553
|
-
it('| customComparator override (case-insensitive string)', (): void => {
|
|
554
|
-
const a: TestMetadata = Object.assign(new TestMetadata(), { name: 'Alice' });
|
|
555
|
-
const b: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice' });
|
|
556
|
-
const r = svc.compareData(a, b, {
|
|
557
|
-
customComparators: { name: (x: string, y: string) => x.toLowerCase() === y.toLowerCase() },
|
|
558
|
-
});
|
|
559
|
-
expect(r.result).toBe('equal');
|
|
560
|
-
});
|
|
561
|
-
|
|
562
|
-
it('| customComparator — array-set-equality eltero sorrendre', (): void => {
|
|
563
|
-
class WithArr extends DyFM_Metadata {
|
|
564
|
-
name?: string;
|
|
565
|
-
tags?: string[];
|
|
566
|
-
}
|
|
567
|
-
const arrSvc = new DyNTS_DataService<WithArr>(
|
|
568
|
-
new WithArr(),
|
|
569
|
-
new DyFM_DataModel_Params<WithArr>({
|
|
570
|
-
dataName: 'with_arr',
|
|
571
|
-
properties: { name: { key: 'name', type: DyFM_BasicProperty_Type.string } },
|
|
572
|
-
}),
|
|
573
|
-
'test-issuer',
|
|
574
|
-
);
|
|
575
|
-
const a: WithArr = Object.assign(new WithArr(), { name: 'x', tags: ['a', 'b', 'c'] });
|
|
576
|
-
const b: WithArr = Object.assign(new WithArr(), { name: 'x', tags: ['c', 'b', 'a'] });
|
|
577
|
-
const r = arrSvc.compareData(a, b, {
|
|
578
|
-
customComparators: {
|
|
579
|
-
tags: (x: string[], y: string[]) => {
|
|
580
|
-
const s: Set<string> = new Set<string>(x);
|
|
581
|
-
return y.length === x.length && y.every((v: string) => s.has(v));
|
|
582
|
-
},
|
|
583
|
-
},
|
|
584
|
-
});
|
|
585
|
-
expect(r.result).toBe('equal');
|
|
586
|
-
});
|
|
587
|
-
|
|
588
|
-
it('| deep-equal: Date instances ugyanazon time-stamp-pel equal-nek szamitanak', (): void => {
|
|
589
|
-
class WithDate extends DyFM_Metadata {
|
|
590
|
-
when?: Date;
|
|
591
|
-
}
|
|
592
|
-
const dateSvc = new DyNTS_DataService<WithDate>(
|
|
593
|
-
new WithDate(),
|
|
594
|
-
new DyFM_DataModel_Params<WithDate>({
|
|
595
|
-
dataName: 'with_date',
|
|
596
|
-
properties: {},
|
|
597
|
-
}),
|
|
598
|
-
'test-issuer',
|
|
599
|
-
);
|
|
600
|
-
const t: number = 1_700_000_000_000;
|
|
601
|
-
const a: WithDate = Object.assign(new WithDate(), { when: new Date(t) });
|
|
602
|
-
const b: WithDate = Object.assign(new WithDate(), { when: new Date(t) });
|
|
603
|
-
expect(dateSvc.compareData(a, b).result).toBe('equal');
|
|
604
|
-
});
|
|
605
|
-
|
|
606
|
-
it('| deep-equal: nested object', (): void => {
|
|
607
|
-
class WithNested extends DyFM_Metadata {
|
|
608
|
-
nested?: { a: number; b: { c: string } };
|
|
609
|
-
}
|
|
610
|
-
const nSvc = new DyNTS_DataService<WithNested>(
|
|
611
|
-
new WithNested(),
|
|
612
|
-
new DyFM_DataModel_Params<WithNested>({ dataName: 'with_nested', properties: {} }),
|
|
613
|
-
'test-issuer',
|
|
614
|
-
);
|
|
615
|
-
const a: WithNested = Object.assign(new WithNested(), { nested: { a: 1, b: { c: 'x' } } });
|
|
616
|
-
const b: WithNested = Object.assign(new WithNested(), { nested: { a: 1, b: { c: 'x' } } });
|
|
617
|
-
const c: WithNested = Object.assign(new WithNested(), { nested: { a: 1, b: { c: 'y' } } });
|
|
618
|
-
expect(nSvc.compareData(a, b).result).toBe('equal');
|
|
619
|
-
expect(nSvc.compareData(a, c).result).toBe('modified');
|
|
620
|
-
});
|
|
621
|
-
|
|
622
|
-
it('| deep-equal: array index-szerinti compare (eltero sorrend → modified default-ban)', (): void => {
|
|
623
|
-
class WithArr2 extends DyFM_Metadata {
|
|
624
|
-
items?: number[];
|
|
625
|
-
}
|
|
626
|
-
const aSvc = new DyNTS_DataService<WithArr2>(
|
|
627
|
-
new WithArr2(),
|
|
628
|
-
new DyFM_DataModel_Params<WithArr2>({ dataName: 'with_arr2', properties: {} }),
|
|
629
|
-
'test-issuer',
|
|
630
|
-
);
|
|
631
|
-
const a: WithArr2 = Object.assign(new WithArr2(), { items: [1, 2, 3] });
|
|
632
|
-
const b: WithArr2 = Object.assign(new WithArr2(), { items: [1, 2, 3] });
|
|
633
|
-
const c: WithArr2 = Object.assign(new WithArr2(), { items: [3, 2, 1] });
|
|
634
|
-
expect(aSvc.compareData(a, b).result).toBe('equal');
|
|
635
|
-
expect(aSvc.compareData(a, c).result).toBe('modified');
|
|
636
|
-
});
|
|
637
|
-
|
|
638
|
-
it('| throw 400 ha newData null', (): void => {
|
|
639
|
-
const b: TestMetadata = Object.assign(new TestMetadata(), { name: 'x' });
|
|
640
|
-
let thrown: any = null;
|
|
641
|
-
try { svc.compareData(null as any, b); } catch (e) { thrown = e; }
|
|
642
|
-
expect(thrown).not.toBeNull();
|
|
643
|
-
expect(DyFM_Error.getErrorStatus(thrown)).toBe(400);
|
|
644
|
-
expect(DyFM_Error.getErrorCode(thrown)).toContain('DyNTS-DS0-CD1');
|
|
645
|
-
});
|
|
646
|
-
|
|
647
|
-
it('| throw 400 ha oldData undefined', (): void => {
|
|
648
|
-
const a: TestMetadata = Object.assign(new TestMetadata(), { name: 'x' });
|
|
649
|
-
let thrown: any = null;
|
|
650
|
-
try { svc.compareData(a, undefined as any); } catch (e) { thrown = e; }
|
|
651
|
-
expect(thrown).not.toBeNull();
|
|
652
|
-
expect(DyFM_Error.getErrorStatus(thrown)).toBe(400);
|
|
653
|
-
});
|
|
654
|
-
|
|
655
|
-
it('| throw 400 ha options.fields ures array', (): void => {
|
|
656
|
-
const a: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice' });
|
|
657
|
-
const b: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice' });
|
|
658
|
-
let thrown: any = null;
|
|
659
|
-
try { svc.compareData(a, b, { fields: [] }); } catch (e) { thrown = e; }
|
|
660
|
-
expect(thrown).not.toBeNull();
|
|
661
|
-
expect(DyFM_Error.getErrorStatus(thrown)).toBe(400);
|
|
662
|
-
expect(DyFM_Error.getErrorCode(thrown)).toContain('DyNTS-DS0-CD2');
|
|
663
|
-
});
|
|
664
|
-
|
|
665
|
-
it('| asymmetric keys: ha az egyik objektum-bol hianyzik a key, modified-nek szamit', (): void => {
|
|
666
|
-
const a: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice', email: 'a@x' });
|
|
667
|
-
const b: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice' }); // no email
|
|
668
|
-
const r = svc.compareData(a, b);
|
|
669
|
-
expect(r.result).toBe('modified');
|
|
670
|
-
expect(r.changedFields).toEqual(['email']);
|
|
671
|
-
});
|
|
672
|
-
});
|
|
673
|
-
});
|
|
674
|
-
|
|
1
|
+
|
|
2
|
+
import { DyNTS_DataService } from './data.service';
|
|
3
|
+
import { DyNTS_DBService } from './db.service';
|
|
4
|
+
import { DyNTS_GlobalService } from '../core/global.service';
|
|
5
|
+
import { DyNTS_ArchiveDataService } from './archive-data.service';
|
|
6
|
+
import { DyFM_Metadata, DyFM_DataModel_Params, DyFM_Error, DyFM_DBFilter, DyFM_SearchQuery, DyFM_BasicProperty_Type, DyFM_EnvironmentFlag } from '@futdevpro/fsm-dynamo';
|
|
7
|
+
import { DyNTS_global_settings } from '../../_collections/global-settings.const';
|
|
8
|
+
|
|
9
|
+
// Initialize global settings before any test runs
|
|
10
|
+
beforeAll(() => {
|
|
11
|
+
if (!DyNTS_global_settings.systemShortCodeName) {
|
|
12
|
+
(DyNTS_global_settings as any).systemShortCodeName = 'TEST';
|
|
13
|
+
}
|
|
14
|
+
if (!DyNTS_global_settings.env_settings) {
|
|
15
|
+
(DyNTS_global_settings as any).env_settings = {
|
|
16
|
+
environment: DyFM_EnvironmentFlag.local,
|
|
17
|
+
};
|
|
18
|
+
}
|
|
19
|
+
});
|
|
20
|
+
|
|
21
|
+
class TestMetadata extends DyFM_Metadata {
|
|
22
|
+
name: string;
|
|
23
|
+
email?: string;
|
|
24
|
+
userId?: string;
|
|
25
|
+
}
|
|
26
|
+
|
|
27
|
+
const testDataParams = new DyFM_DataModel_Params<TestMetadata>({
|
|
28
|
+
dataName: 'test_data',
|
|
29
|
+
properties: {
|
|
30
|
+
name: {
|
|
31
|
+
key: 'name',
|
|
32
|
+
type: DyFM_BasicProperty_Type.string,
|
|
33
|
+
required: true,
|
|
34
|
+
},
|
|
35
|
+
email: {
|
|
36
|
+
key: 'email',
|
|
37
|
+
type: DyFM_BasicProperty_Type.string,
|
|
38
|
+
},
|
|
39
|
+
userId: {
|
|
40
|
+
key: 'userId',
|
|
41
|
+
type: DyFM_BasicProperty_Type.string,
|
|
42
|
+
dependencyDataName: 'user_data',
|
|
43
|
+
},
|
|
44
|
+
},
|
|
45
|
+
});
|
|
46
|
+
|
|
47
|
+
describe('| DyNTS_DataService', () => {
|
|
48
|
+
let mockDBService: jasmine.SpyObj<DyNTS_DBService<TestMetadata>>;
|
|
49
|
+
let service: DyNTS_DataService<TestMetadata>;
|
|
50
|
+
let testData: TestMetadata;
|
|
51
|
+
|
|
52
|
+
beforeEach(() => {
|
|
53
|
+
testData = new TestMetadata({
|
|
54
|
+
_id: 'test-id-123',
|
|
55
|
+
name: 'Test Name',
|
|
56
|
+
email: 'test@example.com',
|
|
57
|
+
} as TestMetadata);
|
|
58
|
+
|
|
59
|
+
mockDBService = jasmine.createSpyObj('DyNTS_DBService', [
|
|
60
|
+
'getAll',
|
|
61
|
+
'getDataById',
|
|
62
|
+
'getDataListByIds',
|
|
63
|
+
'getDataByDependencyId',
|
|
64
|
+
'getDataListByDependencyIds',
|
|
65
|
+
'getDataListByDependencyId',
|
|
66
|
+
'findOne',
|
|
67
|
+
'find',
|
|
68
|
+
'updateOne',
|
|
69
|
+
'createData',
|
|
70
|
+
'modifyData',
|
|
71
|
+
'markDeletedById',
|
|
72
|
+
'trueDeleteDataById',
|
|
73
|
+
'trueDeleteAllData',
|
|
74
|
+
'restoreDeletedById',
|
|
75
|
+
]);
|
|
76
|
+
|
|
77
|
+
spyOn(DyNTS_GlobalService, 'getDBService').and.returnValue(mockDBService);
|
|
78
|
+
spyOn(DyNTS_GlobalService, 'getDBServiceByKey').and.returnValue(mockDBService);
|
|
79
|
+
|
|
80
|
+
service = new DyNTS_DataService<TestMetadata>(
|
|
81
|
+
testData,
|
|
82
|
+
testDataParams,
|
|
83
|
+
'test-issuer'
|
|
84
|
+
);
|
|
85
|
+
});
|
|
86
|
+
|
|
87
|
+
it('| should create service instance', () => {
|
|
88
|
+
expect(service).toBeDefined();
|
|
89
|
+
expect(service.data).toBe(testData);
|
|
90
|
+
expect(service.dataParams).toBe(testDataParams);
|
|
91
|
+
expect(service.issuer).toBe('test-issuer');
|
|
92
|
+
expect(service.dataDBService).toBe(mockDBService);
|
|
93
|
+
});
|
|
94
|
+
|
|
95
|
+
it('| should set service name from constructor', () => {
|
|
96
|
+
expect(service.serviceName).toBe('DyNTS_DataService');
|
|
97
|
+
});
|
|
98
|
+
|
|
99
|
+
it('| should have default error messages', () => {
|
|
100
|
+
expect(service.defaultErrorUserMsg).toContain('Data Service Error');
|
|
101
|
+
expect(service.defaultValidationErrorUserMsg).toContain('Validation Error');
|
|
102
|
+
});
|
|
103
|
+
|
|
104
|
+
it('| should throw error when DB service not found', () => {
|
|
105
|
+
(DyNTS_GlobalService.getDBService as jasmine.Spy).and.throwError('DB Service not found');
|
|
106
|
+
|
|
107
|
+
expect(() => {
|
|
108
|
+
new DyNTS_DataService<TestMetadata>(testData, testDataParams, 'test-issuer');
|
|
109
|
+
}).toThrow();
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
describe('| getAll', () => {
|
|
113
|
+
it('| should get all data from database', async () => {
|
|
114
|
+
const mockDataList = [testData, { ...testData, _id: 'test-id-456' }];
|
|
115
|
+
mockDBService.getAll.and.returnValue(Promise.resolve(mockDataList));
|
|
116
|
+
|
|
117
|
+
const result = await service.getAll();
|
|
118
|
+
|
|
119
|
+
expect(result).toEqual(mockDataList);
|
|
120
|
+
expect(service.dataList).toEqual(mockDataList);
|
|
121
|
+
expect(mockDBService.getAll).toHaveBeenCalled();
|
|
122
|
+
});
|
|
123
|
+
|
|
124
|
+
it('| should not set to service when dontSetToService is true', async () => {
|
|
125
|
+
const mockDataList = [testData];
|
|
126
|
+
mockDBService.getAll.and.returnValue(Promise.resolve(mockDataList));
|
|
127
|
+
|
|
128
|
+
const result = await service.getAll(true);
|
|
129
|
+
|
|
130
|
+
expect(result).toEqual(mockDataList);
|
|
131
|
+
expect(service.dataList).not.toEqual(mockDataList);
|
|
132
|
+
});
|
|
133
|
+
});
|
|
134
|
+
|
|
135
|
+
describe('| getDataById', () => {
|
|
136
|
+
it('| should get data by id', async () => {
|
|
137
|
+
mockDBService.getDataById.and.returnValue(Promise.resolve(testData));
|
|
138
|
+
|
|
139
|
+
const result = await service.getDataById('test-id-123');
|
|
140
|
+
|
|
141
|
+
expect(result).toBe(testData);
|
|
142
|
+
expect(service.data).toBe(testData);
|
|
143
|
+
expect(mockDBService.getDataById).toHaveBeenCalledWith('test-id-123');
|
|
144
|
+
});
|
|
145
|
+
|
|
146
|
+
it('| should use data._id when id not provided', async () => {
|
|
147
|
+
mockDBService.getDataById.and.returnValue(Promise.resolve(testData));
|
|
148
|
+
|
|
149
|
+
const result = await service.getDataById();
|
|
150
|
+
|
|
151
|
+
expect(mockDBService.getDataById).toHaveBeenCalledWith('test-id-123');
|
|
152
|
+
});
|
|
153
|
+
|
|
154
|
+
it('| should throw error when id is missing', async () => {
|
|
155
|
+
service.data = new TestMetadata({});
|
|
156
|
+
|
|
157
|
+
await expectAsync(
|
|
158
|
+
service.getDataById()
|
|
159
|
+
).toBeRejected();
|
|
160
|
+
});
|
|
161
|
+
|
|
162
|
+
it('| should load from archive when not found and archive enabled', async () => {
|
|
163
|
+
service.haveArchiveDataService = true;
|
|
164
|
+
mockDBService.getDataById.and.returnValue(Promise.resolve(null));
|
|
165
|
+
const mockArchiveService = jasmine.createSpyObj('DyNTS_ArchiveDataService', ['getDataByOriginalId']);
|
|
166
|
+
mockArchiveService.getDataByOriginalId.and.returnValue(Promise.resolve(testData));
|
|
167
|
+
spyOn(service, 'getArchiveDataService').and.returnValue(mockArchiveService);
|
|
168
|
+
|
|
169
|
+
const result = await service.getDataById('test-id-123');
|
|
170
|
+
|
|
171
|
+
expect(result).toBe(testData);
|
|
172
|
+
expect(mockArchiveService.getDataByOriginalId).toHaveBeenCalled();
|
|
173
|
+
});
|
|
174
|
+
|
|
175
|
+
it('| should not load from archive when skipArchiveLoad is true', async () => {
|
|
176
|
+
service.haveArchiveDataService = true;
|
|
177
|
+
mockDBService.getDataById.and.returnValue(Promise.resolve(null));
|
|
178
|
+
spyOn(service, 'getArchiveDataService');
|
|
179
|
+
|
|
180
|
+
const result = await service.getDataById('test-id-123', false, true);
|
|
181
|
+
|
|
182
|
+
expect(result).toBeNull();
|
|
183
|
+
expect(service.getArchiveDataService).not.toHaveBeenCalled();
|
|
184
|
+
});
|
|
185
|
+
});
|
|
186
|
+
|
|
187
|
+
describe('| getDataByIds', () => {
|
|
188
|
+
it('| should get data by ids', async () => {
|
|
189
|
+
const ids = ['id-1', 'id-2'];
|
|
190
|
+
const mockDataList = [testData, { ...testData, _id: 'id-2' }];
|
|
191
|
+
mockDBService.find.and.returnValue(Promise.resolve(mockDataList));
|
|
192
|
+
|
|
193
|
+
const result = await service.getDataByIds(ids);
|
|
194
|
+
|
|
195
|
+
expect(result).toEqual(mockDataList);
|
|
196
|
+
expect(mockDBService.find).toHaveBeenCalledWith({ _id: { $in: ids } });
|
|
197
|
+
});
|
|
198
|
+
|
|
199
|
+
it('| should throw error when ids is missing', async () => {
|
|
200
|
+
await expectAsync(
|
|
201
|
+
service.getDataByIds(null as any)
|
|
202
|
+
).toBeRejected();
|
|
203
|
+
});
|
|
204
|
+
|
|
205
|
+
it('| should return empty array when ids is empty array', async () => {
|
|
206
|
+
const result = await service.getDataByIds([]);
|
|
207
|
+
|
|
208
|
+
expect(result).toEqual([]);
|
|
209
|
+
});
|
|
210
|
+
});
|
|
211
|
+
|
|
212
|
+
describe('| getDataListByIds', () => {
|
|
213
|
+
it('| should get data list by ids', async () => {
|
|
214
|
+
const ids = ['id-1', 'id-2'];
|
|
215
|
+
const mockDataList = [testData, { ...testData, _id: 'id-2' }];
|
|
216
|
+
mockDBService.getDataListByIds.and.returnValue(Promise.resolve(mockDataList));
|
|
217
|
+
|
|
218
|
+
const result = await service.getDataListByIds(ids);
|
|
219
|
+
|
|
220
|
+
expect(result).toEqual(mockDataList);
|
|
221
|
+
expect(service.dataList).toEqual(mockDataList);
|
|
222
|
+
});
|
|
223
|
+
});
|
|
224
|
+
|
|
225
|
+
describe('| getDataByDependencyId', () => {
|
|
226
|
+
it('| should get data by dependency id', async () => {
|
|
227
|
+
const dependencyData = { ...testData, userId: 'user-123' };
|
|
228
|
+
mockDBService.getDataByDependencyId.and.returnValue(Promise.resolve(dependencyData));
|
|
229
|
+
|
|
230
|
+
const result = await service.getDataByDependencyId('user-123');
|
|
231
|
+
|
|
232
|
+
expect(result).toBe(dependencyData);
|
|
233
|
+
expect(service.data).toBe(dependencyData);
|
|
234
|
+
});
|
|
235
|
+
|
|
236
|
+
it('| should throw error when dependency settings not configured', async () => {
|
|
237
|
+
const serviceWithoutDeps = new DyNTS_DataService<TestMetadata>(
|
|
238
|
+
testData,
|
|
239
|
+
new DyFM_DataModel_Params<TestMetadata>({
|
|
240
|
+
dataName: 'test_data',
|
|
241
|
+
properties: { name: { key: 'name', type: DyFM_BasicProperty_Type.string } },
|
|
242
|
+
}),
|
|
243
|
+
'test-issuer'
|
|
244
|
+
);
|
|
245
|
+
|
|
246
|
+
await expectAsync(
|
|
247
|
+
serviceWithoutDeps.getDataByDependencyId('user-123')
|
|
248
|
+
).toBeRejected();
|
|
249
|
+
});
|
|
250
|
+
});
|
|
251
|
+
|
|
252
|
+
describe('| findData', () => {
|
|
253
|
+
it('| should find data by filter', async () => {
|
|
254
|
+
const filter: DyFM_DBFilter<TestMetadata> = { email: 'test@example.com' };
|
|
255
|
+
mockDBService.findOne.and.returnValue(Promise.resolve(testData));
|
|
256
|
+
|
|
257
|
+
const result = await service.findData(filter);
|
|
258
|
+
|
|
259
|
+
expect(result).toBe(testData);
|
|
260
|
+
expect(service.data).toBe(testData);
|
|
261
|
+
expect(mockDBService.findOne).toHaveBeenCalledWith(filter);
|
|
262
|
+
});
|
|
263
|
+
});
|
|
264
|
+
|
|
265
|
+
describe('| findDataList', () => {
|
|
266
|
+
it('| should find data list by filter', async () => {
|
|
267
|
+
const filter: DyFM_DBFilter<TestMetadata> = { name: 'Test' };
|
|
268
|
+
const mockDataList = [testData];
|
|
269
|
+
mockDBService.find.and.returnValue(Promise.resolve(mockDataList));
|
|
270
|
+
|
|
271
|
+
const result = await service.findDataList(filter);
|
|
272
|
+
|
|
273
|
+
expect(result).toEqual(mockDataList);
|
|
274
|
+
expect(service.dataList).toEqual(mockDataList);
|
|
275
|
+
});
|
|
276
|
+
});
|
|
277
|
+
|
|
278
|
+
describe('| updateData', () => {
|
|
279
|
+
it('| should update data by filterBy', async () => {
|
|
280
|
+
const filter: DyFM_DBFilter<TestMetadata> = { email: 'test@example.com' };
|
|
281
|
+
const update = { name: 'Updated Name' };
|
|
282
|
+
mockDBService.updateOne.and.returnValue(Promise.resolve());
|
|
283
|
+
|
|
284
|
+
await service.updateData({ filterBy: filter, update });
|
|
285
|
+
|
|
286
|
+
expect(mockDBService.updateOne).toHaveBeenCalledWith(
|
|
287
|
+
filter,
|
|
288
|
+
update,
|
|
289
|
+
'test-issuer',
|
|
290
|
+
undefined
|
|
291
|
+
);
|
|
292
|
+
});
|
|
293
|
+
|
|
294
|
+
it('| should update data by data._id', async () => {
|
|
295
|
+
const update = { name: 'Updated Name' };
|
|
296
|
+
mockDBService.updateOne.and.returnValue(Promise.resolve());
|
|
297
|
+
|
|
298
|
+
await service.updateData({ update });
|
|
299
|
+
|
|
300
|
+
expect(mockDBService.updateOne).toHaveBeenCalledWith(
|
|
301
|
+
{ _id: 'test-id-123' } as any,
|
|
302
|
+
update,
|
|
303
|
+
'test-issuer',
|
|
304
|
+
undefined
|
|
305
|
+
);
|
|
306
|
+
});
|
|
307
|
+
|
|
308
|
+
it('| should throw error when no usable parameter provided', async () => {
|
|
309
|
+
service.data = new TestMetadata({});
|
|
310
|
+
const update = { name: 'Updated Name' };
|
|
311
|
+
|
|
312
|
+
await expectAsync(
|
|
313
|
+
service.updateData({ update })
|
|
314
|
+
).toBeRejected();
|
|
315
|
+
});
|
|
316
|
+
});
|
|
317
|
+
|
|
318
|
+
describe('| saveData', () => {
|
|
319
|
+
it('| should modify existing data when _id is present', async () => {
|
|
320
|
+
const existingData = { ...testData, name: 'Updated Name' };
|
|
321
|
+
mockDBService.getDataById.and.returnValue(Promise.resolve(testData));
|
|
322
|
+
mockDBService.modifyData.and.returnValue(Promise.resolve(existingData));
|
|
323
|
+
spyOn(service, 'validateForSave').and.returnValue(Promise.resolve());
|
|
324
|
+
|
|
325
|
+
const result = await service.saveData(existingData);
|
|
326
|
+
|
|
327
|
+
expect(result).toBe(existingData);
|
|
328
|
+
expect(mockDBService.modifyData).toHaveBeenCalled();
|
|
329
|
+
});
|
|
330
|
+
|
|
331
|
+
it('| should throw error when data with _id does not exist', async () => {
|
|
332
|
+
const dataWithId = { ...testData, _id: 'non-existent-id' };
|
|
333
|
+
mockDBService.getDataById.and.returnValue(Promise.resolve(null));
|
|
334
|
+
spyOn(service, 'validateForSave').and.returnValue(Promise.resolve());
|
|
335
|
+
|
|
336
|
+
await expectAsync(
|
|
337
|
+
service.saveData(dataWithId)
|
|
338
|
+
).toBeRejected();
|
|
339
|
+
});
|
|
340
|
+
});
|
|
341
|
+
|
|
342
|
+
describe('| deleteData', () => {
|
|
343
|
+
it('| should delete data by id', async () => {
|
|
344
|
+
mockDBService.getDataById.and.returnValue(Promise.resolve(testData));
|
|
345
|
+
mockDBService.markDeletedById.and.returnValue(Promise.resolve());
|
|
346
|
+
|
|
347
|
+
await service.deleteData('test-id-123');
|
|
348
|
+
|
|
349
|
+
expect(mockDBService.markDeletedById).toHaveBeenCalledWith('test-id-123', 'test-issuer');
|
|
350
|
+
});
|
|
351
|
+
|
|
352
|
+
it('| should use data._id when id not provided', async () => {
|
|
353
|
+
mockDBService.getDataById.and.returnValue(Promise.resolve(testData));
|
|
354
|
+
mockDBService.markDeletedById.and.returnValue(Promise.resolve());
|
|
355
|
+
|
|
356
|
+
await service.deleteData();
|
|
357
|
+
|
|
358
|
+
expect(mockDBService.markDeletedById).toHaveBeenCalledWith('test-id-123', 'test-issuer');
|
|
359
|
+
});
|
|
360
|
+
|
|
361
|
+
it('| should throw error when id is missing', async () => {
|
|
362
|
+
service.data = new TestMetadata({});
|
|
363
|
+
|
|
364
|
+
await expectAsync(
|
|
365
|
+
service.deleteData()
|
|
366
|
+
).toBeRejected();
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
it('| should archive data when archive service enabled', async () => {
|
|
370
|
+
service.haveArchiveDataService = true;
|
|
371
|
+
mockDBService.getDataById.and.returnValue(Promise.resolve(testData));
|
|
372
|
+
mockDBService.trueDeleteDataById.and.returnValue(Promise.resolve());
|
|
373
|
+
const mockArchiveService = jasmine.createSpyObj('DyNTS_ArchiveDataService', ['saveData']);
|
|
374
|
+
mockArchiveService.saveData.and.returnValue(Promise.resolve());
|
|
375
|
+
spyOn(service, 'getArchiveDataService').and.returnValue(mockArchiveService);
|
|
376
|
+
|
|
377
|
+
await service.deleteData('test-id-123');
|
|
378
|
+
|
|
379
|
+
expect(mockDBService.trueDeleteDataById).toHaveBeenCalled();
|
|
380
|
+
expect(mockArchiveService.saveData).toHaveBeenCalled();
|
|
381
|
+
});
|
|
382
|
+
|
|
383
|
+
it('| should permanently delete when absolute is true', async () => {
|
|
384
|
+
mockDBService.getDataById.and.returnValue(Promise.resolve(testData));
|
|
385
|
+
mockDBService.trueDeleteDataById.and.returnValue(Promise.resolve());
|
|
386
|
+
|
|
387
|
+
await service.deleteData('test-id-123', true);
|
|
388
|
+
|
|
389
|
+
expect(mockDBService.trueDeleteDataById).toHaveBeenCalledWith('test-id-123');
|
|
390
|
+
});
|
|
391
|
+
});
|
|
392
|
+
|
|
393
|
+
describe('| deleteAllData', () => {
|
|
394
|
+
it('| should delete all data', async () => {
|
|
395
|
+
const mockDataList = [testData, { ...testData, _id: 'id-2' }];
|
|
396
|
+
mockDBService.getAll.and.returnValue(Promise.resolve(mockDataList));
|
|
397
|
+
mockDBService.markDeletedById.and.returnValue(Promise.resolve());
|
|
398
|
+
|
|
399
|
+
await service.deleteAllData();
|
|
400
|
+
|
|
401
|
+
expect(mockDBService.markDeletedById).toHaveBeenCalledTimes(2);
|
|
402
|
+
});
|
|
403
|
+
|
|
404
|
+
it('| should archive all data when archive service enabled', async () => {
|
|
405
|
+
service.haveArchiveDataService = true;
|
|
406
|
+
const mockDataList = [testData];
|
|
407
|
+
mockDBService.getAll.and.returnValue(Promise.resolve(mockDataList));
|
|
408
|
+
mockDBService.trueDeleteAllData.and.returnValue(Promise.resolve());
|
|
409
|
+
const mockArchiveService = jasmine.createSpyObj('DyNTS_ArchiveDataService', ['saveData']);
|
|
410
|
+
mockArchiveService.saveData.and.returnValue(Promise.resolve());
|
|
411
|
+
spyOn(service, 'getArchiveDataService').and.returnValue(mockArchiveService);
|
|
412
|
+
|
|
413
|
+
await service.deleteAllData();
|
|
414
|
+
|
|
415
|
+
expect(mockDBService.trueDeleteAllData).toHaveBeenCalled();
|
|
416
|
+
expect(mockArchiveService.saveData).toHaveBeenCalled();
|
|
417
|
+
});
|
|
418
|
+
});
|
|
419
|
+
|
|
420
|
+
describe('| searchData', () => {
|
|
421
|
+
it('| should search data with query', async () => {
|
|
422
|
+
const query: DyFM_SearchQuery<TestMetadata> = {
|
|
423
|
+
filterBy: { name: 'Test' },
|
|
424
|
+
page: 0,
|
|
425
|
+
pageSize: 10,
|
|
426
|
+
sortBy: [{ key: 'name', order: 1 }],
|
|
427
|
+
};
|
|
428
|
+
const mockDataList = [testData];
|
|
429
|
+
spyOn(service, 'sortAndFilterDataList').and.returnValue(Promise.resolve({
|
|
430
|
+
results: mockDataList,
|
|
431
|
+
totalItems: 1,
|
|
432
|
+
}));
|
|
433
|
+
|
|
434
|
+
const result = await service.searchData(query);
|
|
435
|
+
|
|
436
|
+
expect(result.results).toEqual(mockDataList);
|
|
437
|
+
expect(service.sortAndFilterDataList).toHaveBeenCalledWith(query, undefined);
|
|
438
|
+
});
|
|
439
|
+
|
|
440
|
+
it('| should apply pagination', async () => {
|
|
441
|
+
const query: DyFM_SearchQuery<TestMetadata> = {
|
|
442
|
+
page: 1,
|
|
443
|
+
pageSize: 2,
|
|
444
|
+
};
|
|
445
|
+
const mockResults = [
|
|
446
|
+
testData,
|
|
447
|
+
{ ...testData, _id: 'id-2' },
|
|
448
|
+
{ ...testData, _id: 'id-3' },
|
|
449
|
+
];
|
|
450
|
+
spyOn(service, 'sortAndFilterDataList').and.returnValue(Promise.resolve({
|
|
451
|
+
results: mockResults,
|
|
452
|
+
totalItems: 3,
|
|
453
|
+
}));
|
|
454
|
+
|
|
455
|
+
const result = await service.searchData(query);
|
|
456
|
+
|
|
457
|
+
expect(result.results.length).toBe(1);
|
|
458
|
+
expect(result.results[0]._id).toBe('id-3');
|
|
459
|
+
});
|
|
460
|
+
});
|
|
461
|
+
|
|
462
|
+
describe('| getArchiveDataService', () => {
|
|
463
|
+
it('| should throw error when not implemented', () => {
|
|
464
|
+
expect(() => {
|
|
465
|
+
service.getArchiveDataService();
|
|
466
|
+
}).toThrow();
|
|
467
|
+
});
|
|
468
|
+
});
|
|
469
|
+
|
|
470
|
+
describe('| getDependencyDataDBService', () => {
|
|
471
|
+
it('| should get dependency DB service when configured', () => {
|
|
472
|
+
const depService = service.getDependencyDataDBService('user_data');
|
|
473
|
+
|
|
474
|
+
expect(depService).toBeDefined();
|
|
475
|
+
});
|
|
476
|
+
|
|
477
|
+
it('| should throw error when service key not set', () => {
|
|
478
|
+
const serviceWithoutDeps = new DyNTS_DataService<TestMetadata>(
|
|
479
|
+
testData,
|
|
480
|
+
new DyFM_DataModel_Params<TestMetadata>({
|
|
481
|
+
dataName: 'test_data',
|
|
482
|
+
properties: { name: { key: 'name', type: DyFM_BasicProperty_Type.string } },
|
|
483
|
+
}),
|
|
484
|
+
'test-issuer'
|
|
485
|
+
);
|
|
486
|
+
|
|
487
|
+
expect(() => {
|
|
488
|
+
serviceWithoutDeps.getDependencyDataDBService();
|
|
489
|
+
}).toThrow();
|
|
490
|
+
});
|
|
491
|
+
});
|
|
492
|
+
|
|
493
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
494
|
+
// FR-001 — Generic compareData()
|
|
495
|
+
// ════════════════════════════════════════════════════════════════════════
|
|
496
|
+
|
|
497
|
+
describe('| compareData() — FR-001', (): void => {
|
|
498
|
+
let svc: DyNTS_DataService<TestMetadata>;
|
|
499
|
+
|
|
500
|
+
beforeEach((): void => {
|
|
501
|
+
// Re-use existing TestMetadata + testDataParams.
|
|
502
|
+
const t: TestMetadata = new TestMetadata();
|
|
503
|
+
svc = new DyNTS_DataService<TestMetadata>(t, testDataParams, 'test-issuer');
|
|
504
|
+
});
|
|
505
|
+
|
|
506
|
+
it('| equal POJO returns { result: "equal" } — sin changedFields', (): void => {
|
|
507
|
+
const a: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice', email: 'a@x' });
|
|
508
|
+
const b: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice', email: 'a@x' });
|
|
509
|
+
const r = svc.compareData(a, b);
|
|
510
|
+
expect(r.result).toBe('equal');
|
|
511
|
+
expect(r.changedFields).toBeUndefined();
|
|
512
|
+
});
|
|
513
|
+
|
|
514
|
+
it('| modified single field — changedFields tartalmazza azt', (): void => {
|
|
515
|
+
const a: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice', email: 'a@x' });
|
|
516
|
+
const b: TestMetadata = Object.assign(new TestMetadata(), { name: 'bob', email: 'a@x' });
|
|
517
|
+
const r = svc.compareData(a, b);
|
|
518
|
+
expect(r.result).toBe('modified');
|
|
519
|
+
expect(r.changedFields).toEqual(['name']);
|
|
520
|
+
});
|
|
521
|
+
|
|
522
|
+
it('| modified multi-field — changedFields TELJES listat ad (nem early-return)', (): void => {
|
|
523
|
+
const a: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice', email: 'a@x', userId: 'u1' });
|
|
524
|
+
const b: TestMetadata = Object.assign(new TestMetadata(), { name: 'bob', email: 'b@y', userId: 'u2' });
|
|
525
|
+
const r = svc.compareData(a, b);
|
|
526
|
+
expect(r.result).toBe('modified');
|
|
527
|
+
expect(r.changedFields?.sort()).toEqual(['email', 'name', 'userId'] as any);
|
|
528
|
+
});
|
|
529
|
+
|
|
530
|
+
it('| auto-discovery SKIP-eli a metadata fields-et (_id, __created, __lastModified)', (): void => {
|
|
531
|
+
const now: Date = new Date();
|
|
532
|
+
const a: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice', _id: 'X', __created: now, __lastModified: now });
|
|
533
|
+
const b: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice', _id: 'Y', __created: new Date(2000, 0, 1), __lastModified: new Date(2001, 0, 1) });
|
|
534
|
+
const r = svc.compareData(a, b);
|
|
535
|
+
expect(r.result).toBe('equal');
|
|
536
|
+
});
|
|
537
|
+
|
|
538
|
+
it('| explicit fields override — KIFEJEZETT _id-val VIZSGALJA a skip-listet is', (): void => {
|
|
539
|
+
const a: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice', _id: 'X' });
|
|
540
|
+
const b: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice', _id: 'Y' });
|
|
541
|
+
const r = svc.compareData(a, b, { fields: ['_id' as keyof TestMetadata] });
|
|
542
|
+
expect(r.result).toBe('modified');
|
|
543
|
+
expect(r.changedFields).toEqual(['_id' as keyof TestMetadata]);
|
|
544
|
+
});
|
|
545
|
+
|
|
546
|
+
it('| explicit fields scope-szukit — csak a listazott fields szamit', (): void => {
|
|
547
|
+
const a: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice', email: 'a@x' });
|
|
548
|
+
const b: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice', email: 'b@y' });
|
|
549
|
+
const r = svc.compareData(a, b, { fields: ['name'] });
|
|
550
|
+
expect(r.result).toBe('equal'); // email change ignored, only 'name' checked
|
|
551
|
+
});
|
|
552
|
+
|
|
553
|
+
it('| customComparator override (case-insensitive string)', (): void => {
|
|
554
|
+
const a: TestMetadata = Object.assign(new TestMetadata(), { name: 'Alice' });
|
|
555
|
+
const b: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice' });
|
|
556
|
+
const r = svc.compareData(a, b, {
|
|
557
|
+
customComparators: { name: (x: string, y: string) => x.toLowerCase() === y.toLowerCase() },
|
|
558
|
+
});
|
|
559
|
+
expect(r.result).toBe('equal');
|
|
560
|
+
});
|
|
561
|
+
|
|
562
|
+
it('| customComparator — array-set-equality eltero sorrendre', (): void => {
|
|
563
|
+
class WithArr extends DyFM_Metadata {
|
|
564
|
+
name?: string;
|
|
565
|
+
tags?: string[];
|
|
566
|
+
}
|
|
567
|
+
const arrSvc = new DyNTS_DataService<WithArr>(
|
|
568
|
+
new WithArr(),
|
|
569
|
+
new DyFM_DataModel_Params<WithArr>({
|
|
570
|
+
dataName: 'with_arr',
|
|
571
|
+
properties: { name: { key: 'name', type: DyFM_BasicProperty_Type.string } },
|
|
572
|
+
}),
|
|
573
|
+
'test-issuer',
|
|
574
|
+
);
|
|
575
|
+
const a: WithArr = Object.assign(new WithArr(), { name: 'x', tags: ['a', 'b', 'c'] });
|
|
576
|
+
const b: WithArr = Object.assign(new WithArr(), { name: 'x', tags: ['c', 'b', 'a'] });
|
|
577
|
+
const r = arrSvc.compareData(a, b, {
|
|
578
|
+
customComparators: {
|
|
579
|
+
tags: (x: string[], y: string[]) => {
|
|
580
|
+
const s: Set<string> = new Set<string>(x);
|
|
581
|
+
return y.length === x.length && y.every((v: string) => s.has(v));
|
|
582
|
+
},
|
|
583
|
+
},
|
|
584
|
+
});
|
|
585
|
+
expect(r.result).toBe('equal');
|
|
586
|
+
});
|
|
587
|
+
|
|
588
|
+
it('| deep-equal: Date instances ugyanazon time-stamp-pel equal-nek szamitanak', (): void => {
|
|
589
|
+
class WithDate extends DyFM_Metadata {
|
|
590
|
+
when?: Date;
|
|
591
|
+
}
|
|
592
|
+
const dateSvc = new DyNTS_DataService<WithDate>(
|
|
593
|
+
new WithDate(),
|
|
594
|
+
new DyFM_DataModel_Params<WithDate>({
|
|
595
|
+
dataName: 'with_date',
|
|
596
|
+
properties: {},
|
|
597
|
+
}),
|
|
598
|
+
'test-issuer',
|
|
599
|
+
);
|
|
600
|
+
const t: number = 1_700_000_000_000;
|
|
601
|
+
const a: WithDate = Object.assign(new WithDate(), { when: new Date(t) });
|
|
602
|
+
const b: WithDate = Object.assign(new WithDate(), { when: new Date(t) });
|
|
603
|
+
expect(dateSvc.compareData(a, b).result).toBe('equal');
|
|
604
|
+
});
|
|
605
|
+
|
|
606
|
+
it('| deep-equal: nested object', (): void => {
|
|
607
|
+
class WithNested extends DyFM_Metadata {
|
|
608
|
+
nested?: { a: number; b: { c: string } };
|
|
609
|
+
}
|
|
610
|
+
const nSvc = new DyNTS_DataService<WithNested>(
|
|
611
|
+
new WithNested(),
|
|
612
|
+
new DyFM_DataModel_Params<WithNested>({ dataName: 'with_nested', properties: {} }),
|
|
613
|
+
'test-issuer',
|
|
614
|
+
);
|
|
615
|
+
const a: WithNested = Object.assign(new WithNested(), { nested: { a: 1, b: { c: 'x' } } });
|
|
616
|
+
const b: WithNested = Object.assign(new WithNested(), { nested: { a: 1, b: { c: 'x' } } });
|
|
617
|
+
const c: WithNested = Object.assign(new WithNested(), { nested: { a: 1, b: { c: 'y' } } });
|
|
618
|
+
expect(nSvc.compareData(a, b).result).toBe('equal');
|
|
619
|
+
expect(nSvc.compareData(a, c).result).toBe('modified');
|
|
620
|
+
});
|
|
621
|
+
|
|
622
|
+
it('| deep-equal: array index-szerinti compare (eltero sorrend → modified default-ban)', (): void => {
|
|
623
|
+
class WithArr2 extends DyFM_Metadata {
|
|
624
|
+
items?: number[];
|
|
625
|
+
}
|
|
626
|
+
const aSvc = new DyNTS_DataService<WithArr2>(
|
|
627
|
+
new WithArr2(),
|
|
628
|
+
new DyFM_DataModel_Params<WithArr2>({ dataName: 'with_arr2', properties: {} }),
|
|
629
|
+
'test-issuer',
|
|
630
|
+
);
|
|
631
|
+
const a: WithArr2 = Object.assign(new WithArr2(), { items: [1, 2, 3] });
|
|
632
|
+
const b: WithArr2 = Object.assign(new WithArr2(), { items: [1, 2, 3] });
|
|
633
|
+
const c: WithArr2 = Object.assign(new WithArr2(), { items: [3, 2, 1] });
|
|
634
|
+
expect(aSvc.compareData(a, b).result).toBe('equal');
|
|
635
|
+
expect(aSvc.compareData(a, c).result).toBe('modified');
|
|
636
|
+
});
|
|
637
|
+
|
|
638
|
+
it('| throw 400 ha newData null', (): void => {
|
|
639
|
+
const b: TestMetadata = Object.assign(new TestMetadata(), { name: 'x' });
|
|
640
|
+
let thrown: any = null;
|
|
641
|
+
try { svc.compareData(null as any, b); } catch (e) { thrown = e; }
|
|
642
|
+
expect(thrown).not.toBeNull();
|
|
643
|
+
expect(DyFM_Error.getErrorStatus(thrown)).toBe(400);
|
|
644
|
+
expect(DyFM_Error.getErrorCode(thrown)).toContain('DyNTS-DS0-CD1');
|
|
645
|
+
});
|
|
646
|
+
|
|
647
|
+
it('| throw 400 ha oldData undefined', (): void => {
|
|
648
|
+
const a: TestMetadata = Object.assign(new TestMetadata(), { name: 'x' });
|
|
649
|
+
let thrown: any = null;
|
|
650
|
+
try { svc.compareData(a, undefined as any); } catch (e) { thrown = e; }
|
|
651
|
+
expect(thrown).not.toBeNull();
|
|
652
|
+
expect(DyFM_Error.getErrorStatus(thrown)).toBe(400);
|
|
653
|
+
});
|
|
654
|
+
|
|
655
|
+
it('| throw 400 ha options.fields ures array', (): void => {
|
|
656
|
+
const a: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice' });
|
|
657
|
+
const b: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice' });
|
|
658
|
+
let thrown: any = null;
|
|
659
|
+
try { svc.compareData(a, b, { fields: [] }); } catch (e) { thrown = e; }
|
|
660
|
+
expect(thrown).not.toBeNull();
|
|
661
|
+
expect(DyFM_Error.getErrorStatus(thrown)).toBe(400);
|
|
662
|
+
expect(DyFM_Error.getErrorCode(thrown)).toContain('DyNTS-DS0-CD2');
|
|
663
|
+
});
|
|
664
|
+
|
|
665
|
+
it('| asymmetric keys: ha az egyik objektum-bol hianyzik a key, modified-nek szamit', (): void => {
|
|
666
|
+
const a: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice', email: 'a@x' });
|
|
667
|
+
const b: TestMetadata = Object.assign(new TestMetadata(), { name: 'alice' }); // no email
|
|
668
|
+
const r = svc.compareData(a, b);
|
|
669
|
+
expect(r.result).toBe('modified');
|
|
670
|
+
expect(r.changedFields).toEqual(['email']);
|
|
671
|
+
});
|
|
672
|
+
});
|
|
673
|
+
});
|
|
674
|
+
|