@futdevpro/nts-dynamo 1.15.156 → 1.15.160
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +17 -17
- package/build/_collections/app-version-header.util.d.ts +41 -41
- package/build/_collections/app-version-header.util.js +66 -66
- package/build/_collections/archive-service-registry.const.d.ts +15 -15
- package/build/_collections/archive-service-registry.const.js +14 -14
- 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/client-safe-error.util.d.ts +38 -38
- package/build/_collections/client-safe-error.util.js +96 -96
- 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/field-encryption.util.d.ts +85 -85
- package/build/_collections/field-encryption.util.js +192 -192
- 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 +104 -104
- package/build/_collections/load-shed.util.d.ts +15 -15
- package/build/_collections/load-shed.util.js +42 -42
- package/build/_collections/mongo-reconnect-guard.util.d.ts +73 -73
- package/build/_collections/mongo-reconnect-guard.util.js +110 -110
- package/build/_collections/npm-token-check.util.d.ts +138 -138
- package/build/_collections/npm-token-check.util.js +301 -301
- package/build/_collections/security-headers.util.d.ts +16 -16
- package/build/_collections/security-headers.util.js +77 -77
- package/build/_collections/signed-url.util.d.ts +84 -84
- package/build/_collections/signed-url.util.js +145 -145
- package/build/_collections/star.controller.d.ts +7 -7
- package/build/_collections/star.controller.js +97 -97
- package/build/_collections/static-cache-control.util.d.ts +17 -17
- package/build/_collections/static-cache-control.util.js +23 -23
- 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 +118 -118
- 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 +125 -125
- package/build/_models/control-models/endpoint-params.control-model.js +409 -409
- 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/data-models/schema-migration.data-model.d.ts +28 -28
- package/build/_models/data-models/schema-migration.data-model.js +46 -46
- package/build/_models/interfaces/app-version-header-settings.interface.d.ts +16 -16
- package/build/_models/interfaces/app-version-header-settings.interface.js +2 -2
- 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/db-query-options.interface.d.ts +32 -32
- package/build/_models/interfaces/db-query-options.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 +265 -265
- package/build/_models/interfaces/global-settings.interface.js +2 -2
- package/build/_models/interfaces/migration-entry.interface.d.ts +19 -19
- package/build/_models/interfaces/migration-entry.interface.js +2 -2
- package/build/_models/interfaces/mongo-transaction-settings.interface.d.ts +8 -8
- package/build/_models/interfaces/mongo-transaction-settings.interface.js +2 -2
- package/build/_models/interfaces/request-telemetry-settings.interface.d.ts +10 -0
- package/build/_models/interfaces/request-telemetry-settings.interface.d.ts.map +1 -0
- package/build/_models/interfaces/request-telemetry-settings.interface.js +3 -0
- package/build/_models/interfaces/request-telemetry-settings.interface.js.map +1 -0
- package/build/_models/interfaces/request-telemetry-snapshot.interface.d.ts +29 -0
- package/build/_models/interfaces/request-telemetry-snapshot.interface.d.ts.map +1 -0
- package/build/_models/interfaces/request-telemetry-snapshot.interface.js +3 -0
- package/build/_models/interfaces/request-telemetry-snapshot.interface.js.map +1 -0
- 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/security-headers-settings.interface.d.ts +41 -41
- package/build/_models/interfaces/security-headers-settings.interface.js +2 -2
- package/build/_models/interfaces/signed-url-verify-result.interface.d.ts +13 -13
- package/build/_models/interfaces/signed-url-verify-result.interface.js +2 -2
- package/build/_models/interfaces/static-client-settings.interface.d.ts +36 -36
- 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/account-security/_enums/account-challenge-purpose.type-enum.d.ts +5 -5
- package/build/_modules/account-security/_enums/account-challenge-purpose.type-enum.js +9 -9
- package/build/_modules/account-security/_enums/account-refresh-token-state.type-enum.d.ts +6 -6
- package/build/_modules/account-security/_enums/account-refresh-token-state.type-enum.js +10 -10
- package/build/_modules/account-security/_enums/account-session-state.type-enum.d.ts +6 -6
- package/build/_modules/account-security/_enums/account-session-state.type-enum.js +10 -10
- package/build/_modules/account-security/_models/account-challenge-adapter.interface.d.ts +8 -8
- package/build/_modules/account-security/_models/account-challenge-adapter.interface.js +2 -2
- package/build/_modules/account-security/_models/account-challenge-issued.interface.d.ts +6 -6
- package/build/_modules/account-security/_models/account-challenge-issued.interface.js +2 -2
- package/build/_modules/account-security/_models/account-challenge-record.interface.d.ts +12 -12
- package/build/_modules/account-security/_models/account-challenge-record.interface.js +2 -2
- package/build/_modules/account-security/_models/account-challenge-result.interface.d.ts +7 -7
- package/build/_modules/account-security/_models/account-challenge-result.interface.js +2 -2
- package/build/_modules/account-security/_models/account-challenge-settings.interface.d.ts +8 -8
- package/build/_modules/account-security/_models/account-challenge-settings.interface.js +2 -2
- package/build/_modules/account-security/_models/account-password-policy.interface.d.ts +11 -11
- package/build/_modules/account-security/_models/account-password-policy.interface.js +2 -2
- package/build/_modules/account-security/_models/account-password-verification.interface.d.ts +5 -5
- package/build/_modules/account-security/_models/account-password-verification.interface.js +2 -2
- package/build/_modules/account-security/_models/account-refresh-token-record.interface.d.ts +12 -12
- package/build/_modules/account-security/_models/account-refresh-token-record.interface.js +2 -2
- package/build/_modules/account-security/_models/account-session-adapter.interface.d.ts +18 -18
- package/build/_modules/account-security/_models/account-session-adapter.interface.js +2 -2
- package/build/_modules/account-security/_models/account-session-claims.interface.d.ts +7 -7
- package/build/_modules/account-security/_models/account-session-claims.interface.js +2 -2
- package/build/_modules/account-security/_models/account-session-context.interface.d.ts +6 -6
- package/build/_modules/account-security/_models/account-session-context.interface.js +2 -2
- package/build/_modules/account-security/_models/account-session-create.interface.d.ts +7 -7
- package/build/_modules/account-security/_models/account-session-create.interface.js +2 -2
- package/build/_modules/account-security/_models/account-session-record.interface.d.ts +20 -20
- package/build/_modules/account-security/_models/account-session-record.interface.js +2 -2
- package/build/_modules/account-security/_models/account-session-rotate.interface.d.ts +10 -10
- package/build/_modules/account-security/_models/account-session-rotate.interface.js +2 -2
- package/build/_modules/account-security/_models/account-session-settings.interface.d.ts +10 -10
- package/build/_modules/account-security/_models/account-session-settings.interface.js +2 -2
- package/build/_modules/account-security/_models/account-session-token-pair.interface.d.ts +8 -8
- package/build/_modules/account-security/_models/account-session-token-pair.interface.js +2 -2
- package/build/_modules/account-security/_models/account-session-view.interface.d.ts +12 -12
- package/build/_modules/account-security/_models/account-session-view.interface.js +2 -2
- package/build/_modules/account-security/account-challenge.control-service.d.ts +23 -23
- package/build/_modules/account-security/account-challenge.control-service.js +116 -116
- package/build/_modules/account-security/account-password.control-service.d.ts +23 -23
- package/build/_modules/account-security/account-password.control-service.js +213 -213
- package/build/_modules/account-security/account-session.control-service.d.ts +38 -38
- package/build/_modules/account-security/account-session.control-service.js +276 -276
- package/build/_modules/account-security/index.d.ts +23 -23
- package/build/_modules/account-security/index.js +15 -15
- 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/_collections/ai-model-config-validator.util.d.ts +31 -31
- package/build/_modules/ai/_collections/ai-model-config-validator.util.js +94 -94
- package/build/_modules/ai/_collections/ai-provider-error.util.d.ts +43 -43
- package/build/_modules/ai/_collections/ai-provider-error.util.js +120 -120
- 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/_models/interfaces/dynts-ai-provider-error.interface.d.ts +16 -16
- package/build/_modules/ai/_models/interfaces/dynts-ai-provider-error.interface.js +2 -2
- package/build/_modules/ai/_modules/ai-mock/_collections/aim-default-collection.util.d.ts +22 -22
- package/build/_modules/ai/_modules/ai-mock/_collections/aim-default-collection.util.js +51 -51
- package/build/_modules/ai/_modules/ai-mock/_collections/aim-fixture-match.util.d.ts +33 -33
- package/build/_modules/ai/_modules/ai-mock/_collections/aim-fixture-match.util.js +55 -55
- package/build/_modules/ai/_modules/ai-mock/_collections/aim-fixture-serializer.util.d.ts +40 -40
- package/build/_modules/ai/_modules/ai-mock/_collections/aim-fixture-serializer.util.js +89 -89
- package/build/_modules/ai/_modules/ai-mock/_enums/aim-modality.enum.d.ts +27 -27
- package/build/_modules/ai/_modules/ai-mock/_enums/aim-modality.enum.js +28 -28
- package/build/_modules/ai/_modules/ai-mock/_models/interfaces/aim-call-input.interface.d.ts +14 -14
- package/build/_modules/ai/_modules/ai-mock/_models/interfaces/aim-call-input.interface.js +2 -2
- package/build/_modules/ai/_modules/ai-mock/_models/interfaces/aim-error.interface.d.ts +10 -10
- package/build/_modules/ai/_modules/ai-mock/_models/interfaces/aim-error.interface.js +2 -2
- package/build/_modules/ai/_modules/ai-mock/_models/interfaces/aim-fixture.interface.d.ts +29 -29
- package/build/_modules/ai/_modules/ai-mock/_models/interfaces/aim-fixture.interface.js +2 -2
- package/build/_modules/ai/_modules/ai-mock/_models/interfaces/aim-request.interface.d.ts +18 -18
- package/build/_modules/ai/_modules/ai-mock/_models/interfaces/aim-request.interface.js +2 -2
- package/build/_modules/ai/_modules/ai-mock/_models/interfaces/aim-service-collection.interface.d.ts +18 -18
- package/build/_modules/ai/_modules/ai-mock/_models/interfaces/aim-service-collection.interface.js +2 -2
- package/build/_modules/ai/_modules/ai-mock/_services/ai-embedding-mock.service.d.ts +80 -80
- package/build/_modules/ai/_modules/ai-mock/_services/ai-embedding-mock.service.js +166 -166
- package/build/_modules/ai/_modules/ai-mock/_services/aim-fixture-harness.service.d.ts +47 -47
- package/build/_modules/ai/_modules/ai-mock/_services/aim-fixture-harness.service.js +103 -103
- package/build/_modules/ai/_modules/ai-mock/_services/aim-fixture-store.service.d.ts +34 -34
- package/build/_modules/ai/_modules/ai-mock/_services/aim-fixture-store.service.js +59 -59
- package/build/_modules/ai/_modules/ai-mock/_services/aim-mock.service.d.ts +73 -73
- package/build/_modules/ai/_modules/ai-mock/_services/aim-mock.service.js +133 -133
- package/build/_modules/ai/_modules/ai-mock/fixtures/aim-text.fixtures.d.ts +8 -8
- package/build/_modules/ai/_modules/ai-mock/fixtures/aim-text.fixtures.js +650 -650
- package/build/_modules/ai/_modules/ai-mock/index.d.ts +14 -14
- package/build/_modules/ai/_modules/ai-mock/index.js +42 -42
- 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 +229 -229
- package/build/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.js +617 -617
- 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-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 +148 -148
- package/build/_modules/ai/_services/ai-llm.service-base.js +378 -378
- 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 +16 -16
- package/build/_modules/ai/index.js +30 -30
- package/build/_modules/artifact-compiler/_enums/artifact-compile-outcome.type-enum.d.ts +5 -5
- package/build/_modules/artifact-compiler/_enums/artifact-compile-outcome.type-enum.js +9 -9
- package/build/_modules/artifact-compiler/_enums/artifact-compile-stage.type-enum.d.ts +8 -8
- package/build/_modules/artifact-compiler/_enums/artifact-compile-stage.type-enum.js +12 -12
- package/build/_modules/artifact-compiler/_enums/artifact-retry-class.type-enum.d.ts +6 -6
- package/build/_modules/artifact-compiler/_enums/artifact-retry-class.type-enum.js +10 -10
- package/build/_modules/artifact-compiler/_models/artifact-compile.interface.d.ts +32 -32
- package/build/_modules/artifact-compiler/_models/artifact-compile.interface.js +2 -2
- package/build/_modules/artifact-compiler/artifact-compiler.control-service.d.ts +36 -36
- package/build/_modules/artifact-compiler/artifact-compiler.control-service.js +273 -273
- package/build/_modules/artifact-compiler/index.d.ts +5 -5
- package/build/_modules/artifact-compiler/index.js +11 -11
- 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 +74 -74
- package/build/_modules/local-vector-search/_services/lvs-persistent-vector-pool.control-service.js +152 -152
- package/build/_modules/local-vector-search/_services/lvs-vector-persist.data-service.d.ts +51 -51
- package/build/_modules/local-vector-search/_services/lvs-vector-persist.data-service.js +83 -83
- package/build/_modules/local-vector-search/_services/lvs-vector-pool.control-service.d.ts +99 -99
- package/build/_modules/local-vector-search/_services/lvs-vector-pool.control-service.js +276 -276
- 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/privacy-lifecycle/_enums/privacy-consent-decision.type-enum.d.ts +5 -5
- package/build/_modules/privacy-lifecycle/_enums/privacy-consent-decision.type-enum.js +9 -9
- package/build/_modules/privacy-lifecycle/_enums/privacy-contributor-action.type-enum.d.ts +10 -10
- package/build/_modules/privacy-lifecycle/_enums/privacy-contributor-action.type-enum.js +14 -14
- package/build/_modules/privacy-lifecycle/_enums/privacy-contributor-outcome.type-enum.d.ts +7 -7
- package/build/_modules/privacy-lifecycle/_enums/privacy-contributor-outcome.type-enum.js +11 -11
- package/build/_modules/privacy-lifecycle/_enums/privacy-request-state.type-enum.d.ts +15 -15
- package/build/_modules/privacy-lifecycle/_enums/privacy-request-state.type-enum.js +19 -19
- package/build/_modules/privacy-lifecycle/_enums/privacy-request.type-enum.d.ts +9 -9
- package/build/_modules/privacy-lifecycle/_enums/privacy-request.type-enum.js +13 -13
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-input.interface.d.ts +11 -11
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-input.interface.js +2 -2
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-persistence-result.interface.d.ts +6 -6
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-persistence-result.interface.js +2 -2
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-record.interface.d.ts +14 -14
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-record.interface.js +2 -2
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-result.interface.d.ts +6 -6
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-result.interface.js +2 -2
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-view.interface.d.ts +12 -12
- package/build/_modules/privacy-lifecycle/_models/privacy-consent-view.interface.js +2 -2
- package/build/_modules/privacy-lifecycle/_models/privacy-contributor-context.interface.d.ts +8 -8
- package/build/_modules/privacy-lifecycle/_models/privacy-contributor-context.interface.js +2 -2
- package/build/_modules/privacy-lifecycle/_models/privacy-contributor-outcome.interface.d.ts +13 -13
- package/build/_modules/privacy-lifecycle/_models/privacy-contributor-outcome.interface.js +2 -2
- package/build/_modules/privacy-lifecycle/_models/privacy-contributor-plan.interface.d.ts +7 -7
- package/build/_modules/privacy-lifecycle/_models/privacy-contributor-plan.interface.js +2 -2
- package/build/_modules/privacy-lifecycle/_models/privacy-contributor.interface.d.ts +10 -10
- package/build/_modules/privacy-lifecycle/_models/privacy-contributor.interface.js +2 -2
- package/build/_modules/privacy-lifecycle/_models/privacy-export-artifact.interface.d.ts +71 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-export-artifact.interface.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-export-artifact.interface.js +3 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-export-artifact.interface.js.map +1 -0
- package/build/_modules/privacy-lifecycle/_models/privacy-ledger-adapter.interface.d.ts +12 -12
- package/build/_modules/privacy-lifecycle/_models/privacy-ledger-adapter.interface.js +2 -2
- package/build/_modules/privacy-lifecycle/_models/privacy-ledger-result.interface.d.ts +8 -8
- package/build/_modules/privacy-lifecycle/_models/privacy-ledger-result.interface.js +2 -2
- package/build/_modules/privacy-lifecycle/_models/privacy-ledger-settings.interface.d.ts +6 -6
- package/build/_modules/privacy-lifecycle/_models/privacy-ledger-settings.interface.js +2 -2
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-input.interface.d.ts +10 -10
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-input.interface.js +2 -2
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-persistence-result.interface.d.ts +6 -6
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-persistence-result.interface.js +2 -2
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-result.interface.d.ts +6 -6
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-result.interface.js +2 -2
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-view.interface.d.ts +11 -11
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-view.interface.js +2 -2
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance.interface.d.ts +13 -13
- package/build/_modules/privacy-lifecycle/_models/privacy-legal-acceptance.interface.js +2 -2
- package/build/_modules/privacy-lifecycle/_models/privacy-lifecycle-adapter.interface.d.ts +14 -14
- package/build/_modules/privacy-lifecycle/_models/privacy-lifecycle-adapter.interface.js +2 -2
- package/build/_modules/privacy-lifecycle/_models/privacy-lifecycle-settings.interface.d.ts +8 -8
- package/build/_modules/privacy-lifecycle/_models/privacy-lifecycle-settings.interface.js +2 -2
- package/build/_modules/privacy-lifecycle/_models/privacy-request-create-result.interface.d.ts +6 -6
- package/build/_modules/privacy-lifecycle/_models/privacy-request-create-result.interface.js +2 -2
- package/build/_modules/privacy-lifecycle/_models/privacy-request-open.interface.d.ts +9 -9
- package/build/_modules/privacy-lifecycle/_models/privacy-request-open.interface.js +2 -2
- package/build/_modules/privacy-lifecycle/_models/privacy-request-persistence-create-result.interface.d.ts +6 -6
- package/build/_modules/privacy-lifecycle/_models/privacy-request-persistence-create-result.interface.js +2 -2
- package/build/_modules/privacy-lifecycle/_models/privacy-request-record.interface.d.ts +20 -20
- package/build/_modules/privacy-lifecycle/_models/privacy-request-record.interface.js +2 -2
- package/build/_modules/privacy-lifecycle/_models/privacy-request-result.interface.d.ts +7 -7
- package/build/_modules/privacy-lifecycle/_models/privacy-request-result.interface.js +2 -2
- package/build/_modules/privacy-lifecycle/_models/privacy-request-view.interface.d.ts +19 -19
- package/build/_modules/privacy-lifecycle/_models/privacy-request-view.interface.js +2 -2
- package/build/_modules/privacy-lifecycle/index.d.ts +35 -32
- package/build/_modules/privacy-lifecycle/index.d.ts.map +1 -1
- package/build/_modules/privacy-lifecycle/index.js +21 -17
- package/build/_modules/privacy-lifecycle/index.js.map +1 -1
- package/build/_modules/privacy-lifecycle/privacy-export-artifact.control-service.d.ts +48 -0
- package/build/_modules/privacy-lifecycle/privacy-export-artifact.control-service.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/privacy-export-artifact.control-service.js +332 -0
- package/build/_modules/privacy-lifecycle/privacy-export-artifact.control-service.js.map +1 -0
- package/build/_modules/privacy-lifecycle/privacy-export-artifact.mongo-store.d.ts +25 -0
- package/build/_modules/privacy-lifecycle/privacy-export-artifact.mongo-store.d.ts.map +1 -0
- package/build/_modules/privacy-lifecycle/privacy-export-artifact.mongo-store.js +126 -0
- package/build/_modules/privacy-lifecycle/privacy-export-artifact.mongo-store.js.map +1 -0
- package/build/_modules/privacy-lifecycle/privacy-ledger.control-service.d.ts +27 -27
- package/build/_modules/privacy-lifecycle/privacy-ledger.control-service.js +167 -167
- package/build/_modules/privacy-lifecycle/privacy-lifecycle.control-service.d.ts +41 -41
- package/build/_modules/privacy-lifecycle/privacy-lifecycle.control-service.js +363 -363
- package/build/_modules/rate-limit/_enums/rate-limit-store-kind.type-enum.d.ts +5 -5
- package/build/_modules/rate-limit/_enums/rate-limit-store-kind.type-enum.js +9 -9
- package/build/_modules/rate-limit/_models/rate-limit-config.interface.d.ts +70 -70
- package/build/_modules/rate-limit/_models/rate-limit-config.interface.js +2 -2
- package/build/_modules/rate-limit/_models/rate-limit-consume-request.interface.d.ts +8 -8
- package/build/_modules/rate-limit/_models/rate-limit-consume-request.interface.js +2 -2
- package/build/_modules/rate-limit/_models/rate-limit-consume-result.interface.d.ts +6 -6
- package/build/_modules/rate-limit/_models/rate-limit-consume-result.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/_models/rate-limit-store.interface.d.ts +8 -8
- package/build/_modules/rate-limit/_models/rate-limit-store.interface.js +2 -2
- package/build/_modules/rate-limit/index.d.ts +8 -8
- package/build/_modules/rate-limit/index.js +9 -9
- package/build/_modules/rate-limit/rate-limit-in-memory.store.d.ts +18 -18
- package/build/_modules/rate-limit/rate-limit-in-memory.store.js +70 -70
- package/build/_modules/rate-limit/rate-limit.middleware.d.ts +68 -68
- package/build/_modules/rate-limit/rate-limit.middleware.js +378 -378
- package/build/_modules/scheduler/_models/scheduler-job.interface.d.ts +33 -33
- package/build/_modules/scheduler/_models/scheduler-job.interface.js +2 -2
- package/build/_modules/scheduler/get-scheduler-routing-module.util.d.ts +17 -17
- package/build/_modules/scheduler/get-scheduler-routing-module.util.js +30 -30
- package/build/_modules/scheduler/index.d.ts +4 -4
- package/build/_modules/scheduler/index.js +9 -9
- package/build/_modules/scheduler/scheduler.controller.d.ts +24 -24
- package/build/_modules/scheduler/scheduler.controller.js +53 -53
- package/build/_modules/scheduler/scheduler.service.d.ts +53 -53
- package/build/_modules/scheduler/scheduler.service.js +163 -163
- 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 -21
- package/build/_modules/server/errors/errors.control-service.js +10 -10
- package/build/_modules/server/errors/errors.controller.d.ts +144 -144
- package/build/_modules/server/errors/errors.controller.js +404 -404
- package/build/_modules/server/errors/errors.data-service.d.ts +70 -70
- package/build/_modules/server/errors/errors.data-service.js +677 -677
- package/build/_modules/server/index.d.ts +15 -15
- package/build/_modules/server/index.js +35 -35
- package/build/_modules/server/safe-diagnostic/safe-diagnostic-cause.type-enum.d.ts +8 -8
- package/build/_modules/server/safe-diagnostic/safe-diagnostic-cause.type-enum.js +12 -12
- package/build/_modules/server/safe-diagnostic/safe-diagnostic-stage.type-enum.d.ts +20 -20
- package/build/_modules/server/safe-diagnostic/safe-diagnostic-stage.type-enum.js +24 -24
- package/build/_modules/server/safe-diagnostic/safe-diagnostic.control-service.d.ts +18 -18
- package/build/_modules/server/safe-diagnostic/safe-diagnostic.control-service.js +82 -82
- package/build/_modules/server/safe-diagnostic/safe-diagnostic.interface.d.ts +18 -18
- package/build/_modules/server/safe-diagnostic/safe-diagnostic.interface.js +2 -2
- package/build/_modules/server/server-status/db-readiness-probe-code.type-enum.d.ts +13 -13
- package/build/_modules/server/server-status/db-readiness-probe-code.type-enum.js +17 -17
- package/build/_modules/server/server-status/db-readiness-probe-stage.type-enum.d.ts +7 -7
- package/build/_modules/server/server-status/db-readiness-probe-stage.type-enum.js +11 -11
- package/build/_modules/server/server-status/db-readiness-probe.control-service.d.ts +13 -13
- package/build/_modules/server/server-status/db-readiness-probe.control-service.js +125 -125
- package/build/_modules/server/server-status/db-readiness-probe.interface.d.ts +17 -17
- package/build/_modules/server/server-status/db-readiness-probe.interface.js +2 -2
- 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 +111 -111
- package/build/_modules/server/server-status/server-status.control-service.js +302 -302
- package/build/_modules/server/server-status/server-status.controller.d.ts +92 -92
- package/build/_modules/server/server-status/server-status.controller.js +253 -253
- 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 +140 -140
- package/build/_modules/socket/_models/socket-server-service-params.control-model.d.ts +22 -22
- package/build/_modules/socket/_models/socket-server-service-params.control-model.js +31 -31
- 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 +98 -98
- package/build/_modules/socket/_services/socket-server.service.js +673 -673
- package/build/_modules/socket/app-extended.server.d.ts +145 -145
- package/build/_modules/socket/app-extended.server.js +521 -521
- 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/test-email-sink/_collections/test-email-pattern.const.d.ts +10 -10
- package/build/_modules/test-email-sink/_collections/test-email-pattern.const.js +13 -13
- package/build/_modules/test-email-sink/_models/data-models/dynts-sent-test-mail.data-model.d.ts +21 -21
- package/build/_modules/test-email-sink/_models/data-models/dynts-sent-test-mail.data-model.js +38 -38
- package/build/_modules/test-email-sink/_services/dynts-test-email-sink.service.d.ts +49 -49
- package/build/_modules/test-email-sink/_services/dynts-test-email-sink.service.js +117 -117
- package/build/_modules/test-email-sink/get-sent-mail-routing-module.util.d.ts +14 -14
- package/build/_modules/test-email-sink/get-sent-mail-routing-module.util.js +26 -26
- package/build/_modules/test-email-sink/index.d.ts +11 -11
- package/build/_modules/test-email-sink/index.js +14 -14
- package/build/_modules/test-email-sink/test-email-sink.controller.d.ts +23 -23
- package/build/_modules/test-email-sink/test-email-sink.controller.js +66 -66
- 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 +105 -105
- 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 +151 -151
- package/build/_services/base/data.service.d.ts +402 -402
- package/build/_services/base/data.service.js +2131 -2131
- package/build/_services/base/db.service.d.ts +424 -424
- package/build/_services/base/db.service.js +1356 -1356
- 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 +456 -456
- package/build/_services/core/auth.service.d.ts +129 -129
- package/build/_services/core/auth.service.js +59 -59
- package/build/_services/core/collection-growth-monitor.service.d.ts +76 -76
- package/build/_services/core/collection-growth-monitor.service.js +165 -165
- package/build/_services/core/db-stats.service.d.ts +33 -33
- package/build/_services/core/db-stats.service.js +64 -64
- package/build/_services/core/diagnostics.service.d.ts +42 -42
- package/build/_services/core/diagnostics.service.js +121 -121
- package/build/_services/core/email.service.d.ts +77 -77
- package/build/_services/core/email.service.js +503 -503
- package/build/_services/core/event-loop-diag.service.d.ts +49 -49
- package/build/_services/core/event-loop-diag.service.js +106 -106
- package/build/_services/core/global.service.d.ts +83 -83
- package/build/_services/core/global.service.js +386 -386
- package/build/_services/core/memory-guard.service.d.ts +166 -166
- package/build/_services/core/memory-guard.service.js +369 -369
- package/build/_services/core/migration-runner.service.d.ts +39 -39
- package/build/_services/core/migration-runner.service.js +74 -74
- package/build/_services/core/mongo-transaction.control-service.d.ts +18 -18
- package/build/_services/core/mongo-transaction.control-service.js +94 -94
- package/build/_services/core/request-hunter.service.d.ts +73 -73
- package/build/_services/core/request-hunter.service.js +122 -122
- package/build/_services/core/request-telemetry.control-service.d.ts +51 -0
- package/build/_services/core/request-telemetry.control-service.d.ts.map +1 -0
- package/build/_services/core/request-telemetry.control-service.js +286 -0
- package/build/_services/core/request-telemetry.control-service.js.map +1 -0
- 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.d.ts.map +1 -1
- package/build/_services/route/routing-module.service.js +253 -250
- package/build/_services/route/routing-module.service.js.map +1 -1
- package/build/_services/server/app.server.d.ts +434 -429
- package/build/_services/server/app.server.d.ts.map +1 -1
- package/build/_services/server/app.server.js +1239 -1226
- package/build/_services/server/app.server.js.map +1 -1
- package/build/_services/shared.static-service.d.ts +43 -43
- package/build/_services/shared.static-service.js +92 -92
- package/build/index.d.ts +66 -63
- package/build/index.d.ts.map +1 -1
- package/build/index.js +104 -101
- package/build/index.js.map +1 -1
- package/package.json +11 -4
- package/.c8rc.json +0 -26
- package/.copilot/patterns.json +0 -8
- package/.cursor/rules/__assistant_guide.mdc +0 -30
- package/.cursor/rules/__main.mdc +0 -64
- package/.cursor/rules/_ag_backend-structure.mdc +0 -86
- package/.cursor/rules/_ag_backend.mdc +0 -16
- package/.cursor/rules/_ag_debug.mdc +0 -8
- package/.cursor/rules/_ag_documentation_writing_rules.mdc +0 -372
- package/.cursor/rules/_ag_file-refactoring.mdc +0 -113
- package/.cursor/rules/_ag_fixes_rules.mdc +0 -6
- package/.cursor/rules/_ag_frontend-structure.mdc +0 -87
- package/.cursor/rules/_ag_frontend.mdc +0 -40
- package/.cursor/rules/_ag_import-rules.mdc +0 -45
- package/.cursor/rules/_ag_naming.mdc +0 -116
- package/.cursor/rules/_ag_running_commands.mdc +0 -5
- package/.cursor/rules/_ag_server-controller.mdc +0 -6
- package/.cursor/rules/_ag_should-be.mdc +0 -7
- package/.cursor/rules/_ag_swearing.mdc +0 -47
- package/.cursor/rules/ai_development_guide.md +0 -61
- package/.cursor/rules/ai_directives.md +0 -114
- package/.cursor/rules/cursor-rules.md +0 -160
- package/.cursor/rules/default-command.mdc +0 -465
- package/.cursor/rules/error_code_pattern.md +0 -40
- package/.cursor/rules/saved rule mcp server use.md +0 -16
- package/.dynamo/pipeline.cicd.config.json +0 -190
- package/.dynamo/version-bump.config.json +0 -5
- package/.github/workflows/main.yml +0 -438
- package/.husky/pre-commit +0 -3
- package/.vscode/settings.json +0 -11
- package/BuildPackage.bat +0 -1
- package/HOWTO.md +0 -15
- package/__documentations/2026-04-28-logs-module.md +0 -49
- package/__documentations/2026-05-17-oai-compatible-providers.md +0 -229
- package/__documentations/2026-05-17-static-client-serving-howto.md +0 -144
- package/__documentations/2026-06-01-fr041-cors-middleware.md +0 -96
- package/__documentations/2026-06-01-fr047-p2p3-function-calling.md +0 -81
- package/__documentations/2026-06-15-fr193-memory-guard.md +0 -73
- package/__documentations/2026-08-08-fr292-app-version-header.md +0 -38
- package/__documentations/2026-08-14-field-encryption-mongoose-document-spread.md +0 -124
- package/__documentations/2026-08-18-artifact-compiler.md +0 -46
- package/__documentations/2026-08-18-mongo-transaction-control-service.md +0 -82
- package/__documentations/2026-08-18-standalone-account-security-and-privacy-bedrock.md +0 -132
- package/__documentations/2026-08-21-distributed-rate-limit-bfr-ctm-010.md +0 -59
- package/__documentations/2026-08-22-bfr-ctm-018-content-free-endpoint-errors.md +0 -54
- package/__documentations/2026-08-22-content-free-process-error-boundary.md +0 -111
- package/__documentations/2026-08-22-npm-token-state-classifier.md +0 -92
- package/__documentations/nts-integration-tests-2026-03-17.md +0 -26
- package/__documentations/plans/BEDROCK-HYPERPLAN.md +0 -95
- package/_specifications/BACKLOG.md +0 -92
- package/_specifications/TODO.md +0 -15
- package/_specifications/agent.md +0 -138
- package/eslint.config.js +0 -3
- package/nodemon.json +0 -24
- package/pnpm-workspace.yaml +0 -6
- package/scripts/_seed-out/aim-seed.fixtures.ts +0 -161
- package/scripts/_seed-out/image-raw.json +0 -1
- package/scripts/_seed-out/llm-expand-raw.json +0 -60
- package/scripts/_seed-out/sample-image.png +0 -0
- package/scripts/_seed-out/seed-raw.json +0 -153
- package/scripts/ai-fixture-seed.js +0 -126
- package/scripts/run-coverage-tests.js +0 -28
- package/spec/support/helpers/spec-reporter-loader.js +0 -359
- package/spec/support/helpers/ts-node-helper.js +0 -93
- package/spec/support/jasmine.coverage.json +0 -24
- package/spec/support/jasmine.json +0 -24
- package/src/_assets/dynamo-nts-logo-128.png +0 -0
- package/src/_assets/dynamo-nts-logo-256.png +0 -0
- package/src/_assets/dynamo-nts-logo-512.png +0 -0
- package/src/_assets/dynamo-nts-logo-64.png +0 -0
- package/src/_collections/app-version-header.util.spec.ts +0 -108
- package/src/_collections/app-version-header.util.ts +0 -74
- package/src/_collections/archive-service-registry.const.ts +0 -21
- package/src/_collections/archive.util.spec.ts +0 -57
- package/src/_collections/archive.util.ts +0 -18
- package/src/_collections/atlas-default-db-options.const.ts +0 -10
- package/src/_collections/client-safe-error.util.spec.ts +0 -151
- package/src/_collections/client-safe-error.util.ts +0 -107
- package/src/_collections/default-fallback-cache-max-age.const.spec.ts +0 -11
- package/src/_collections/default-fallback-cache-max-age.const.ts +0 -2
- package/src/_collections/default-not-found-page.const.spec.ts +0 -19
- package/src/_collections/default-not-found-page.const.ts +0 -22
- package/src/_collections/default-socket-path.const.spec.ts +0 -12
- package/src/_collections/default-socket-path.const.ts +0 -2
- package/src/_collections/field-encryption.util.spec.ts +0 -195
- package/src/_collections/field-encryption.util.ts +0 -222
- package/src/_collections/get-environment-settings.util.spec.ts +0 -210
- package/src/_collections/get-environment-settings.util.ts +0 -49
- package/src/_collections/global-settings.const.ts +0 -126
- package/src/_collections/load-shed.util.spec.ts +0 -62
- package/src/_collections/load-shed.util.ts +0 -51
- package/src/_collections/mongo-reconnect-guard.util.spec.ts +0 -52
- package/src/_collections/mongo-reconnect-guard.util.ts +0 -172
- package/src/_collections/npm-token-check.util.spec.ts +0 -218
- package/src/_collections/npm-token-check.util.ts +0 -327
- package/src/_collections/sample.env +0 -21
- package/src/_collections/security-headers.util.spec.ts +0 -98
- package/src/_collections/security-headers.util.ts +0 -96
- package/src/_collections/signed-url.util.spec.ts +0 -198
- package/src/_collections/signed-url.util.ts +0 -170
- package/src/_collections/star.controller.spec.ts +0 -224
- package/src/_collections/star.controller.ts +0 -130
- package/src/_collections/static-cache-control.util.spec.ts +0 -47
- package/src/_collections/static-cache-control.util.ts +0 -25
- package/src/_enums/data-model-type.enum.ts +0 -14
- package/src/_enums/data-service-function.enum.ts +0 -24
- package/src/_enums/predefined-data-types.enum.ts +0 -17
- package/src/_enums/route-security.enum.ts +0 -12
- package/src/_models/control-models/api-call-params.control-model.spec.ts +0 -152
- package/src/_models/control-models/api-call-params.control-model.ts +0 -142
- package/src/_models/control-models/app-ext-system-controls.control-model.spec.ts +0 -52
- package/src/_models/control-models/app-ext-system-controls.control-model.ts +0 -9
- package/src/_models/control-models/app-params.control-model.spec.ts +0 -229
- package/src/_models/control-models/app-params.control-model.ts +0 -137
- package/src/_models/control-models/app-system-controls.control-model.spec.ts +0 -31
- package/src/_models/control-models/app-system-controls.control-model.ts +0 -9
- package/src/_models/control-models/endpoint-params.control-model.spec.ts +0 -754
- package/src/_models/control-models/endpoint-params.control-model.ts +0 -575
- package/src/_models/control-models/http-settings.control-model.spec.ts +0 -77
- package/src/_models/control-models/http-settings.control-model.ts +0 -37
- package/src/_models/control-models/system-control.control-model.spec.ts +0 -27
- package/src/_models/control-models/system-control.control-model.ts +0 -12
- package/src/_models/data-models/schema-migration.data-model.ts +0 -50
- package/src/_models/interfaces/app-version-header-settings.interface.ts +0 -17
- package/src/_models/interfaces/certification-settings.interface.ts +0 -7
- package/src/_models/interfaces/compare-data-options.interface.ts +0 -27
- package/src/_models/interfaces/compare-data-result.interface.ts +0 -12
- package/src/_models/interfaces/cors-settings.interface.spec.ts +0 -52
- package/src/_models/interfaces/cors-settings.interface.ts +0 -56
- package/src/_models/interfaces/db-query-options.interface.ts +0 -33
- package/src/_models/interfaces/environment-settings.interface.ts +0 -59
- package/src/_models/interfaces/global-log-settings.interface.ts +0 -171
- package/src/_models/interfaces/global-service-settings.interface.ts +0 -47
- package/src/_models/interfaces/global-settings.interface.ts +0 -294
- package/src/_models/interfaces/migration-entry.interface.ts +0 -19
- package/src/_models/interfaces/mongo-transaction-settings.interface.ts +0 -9
- package/src/_models/interfaces/routing-module-settings.interface.ts +0 -21
- package/src/_models/interfaces/security-headers-settings.interface.ts +0 -50
- package/src/_models/interfaces/signed-url-verify-result.interface.ts +0 -13
- package/src/_models/interfaces/static-client-settings.interface.spec.ts +0 -29
- package/src/_models/interfaces/static-client-settings.interface.ts +0 -36
- package/src/_models/types/db-update.type.ts +0 -100
- package/src/_modules/account-security/_enums/account-challenge-purpose.type-enum.ts +0 -5
- package/src/_modules/account-security/_enums/account-refresh-token-state.type-enum.ts +0 -6
- package/src/_modules/account-security/_enums/account-session-state.type-enum.ts +0 -6
- package/src/_modules/account-security/_models/account-challenge-adapter.interface.ts +0 -17
- package/src/_modules/account-security/_models/account-challenge-issued.interface.ts +0 -6
- package/src/_modules/account-security/_models/account-challenge-record.interface.ts +0 -13
- package/src/_modules/account-security/_models/account-challenge-result.interface.ts +0 -8
- package/src/_modules/account-security/_models/account-challenge-settings.interface.ts +0 -9
- package/src/_modules/account-security/_models/account-password-policy.interface.ts +0 -11
- package/src/_modules/account-security/_models/account-password-verification.interface.ts +0 -5
- package/src/_modules/account-security/_models/account-refresh-token-record.interface.ts +0 -13
- package/src/_modules/account-security/_models/account-session-adapter.interface.ts +0 -19
- package/src/_modules/account-security/_models/account-session-claims.interface.ts +0 -7
- package/src/_modules/account-security/_models/account-session-context.interface.ts +0 -6
- package/src/_modules/account-security/_models/account-session-create.interface.ts +0 -8
- package/src/_modules/account-security/_models/account-session-record.interface.ts +0 -21
- package/src/_modules/account-security/_models/account-session-rotate.interface.ts +0 -11
- package/src/_modules/account-security/_models/account-session-settings.interface.ts +0 -11
- package/src/_modules/account-security/_models/account-session-token-pair.interface.ts +0 -8
- package/src/_modules/account-security/_models/account-session-view.interface.ts +0 -13
- package/src/_modules/account-security/account-challenge.control-service.spec.ts +0 -195
- package/src/_modules/account-security/account-challenge.control-service.ts +0 -164
- package/src/_modules/account-security/account-password.control-service.spec.ts +0 -96
- package/src/_modules/account-security/account-password.control-service.ts +0 -288
- package/src/_modules/account-security/account-session.control-service.spec.ts +0 -294
- package/src/_modules/account-security/account-session.control-service.ts +0 -376
- package/src/_modules/account-security/index.ts +0 -31
- package/src/_modules/admin-auth/_models/admin-api-key-config.interface.ts +0 -33
- package/src/_modules/admin-auth/admin-api-key.auth-service.spec.ts +0 -200
- package/src/_modules/admin-auth/admin-api-key.auth-service.ts +0 -220
- package/src/_modules/admin-auth/index.ts +0 -2
- package/src/_modules/ai/_collections/ai-model-config-validator.util.spec.ts +0 -150
- package/src/_modules/ai/_collections/ai-model-config-validator.util.ts +0 -131
- package/src/_modules/ai/_collections/ai-provider-error.util.ts +0 -144
- package/src/_modules/ai/_models/ai-input-interfaces.ts +0 -117
- package/src/_modules/ai/_models/ai-test-generation-result.interface.ts +0 -16
- package/src/_modules/ai/_models/interfaces/dynts-ai-cost-event-callback.interface.ts +0 -14
- package/src/_modules/ai/_models/interfaces/dynts-ai-cost-event.interface.ts +0 -56
- package/src/_modules/ai/_models/interfaces/dynts-ai-provider-error.interface.ts +0 -16
- package/src/_modules/ai/_modules/ai-mock/_collections/aim-default-collection.util.spec.ts +0 -72
- package/src/_modules/ai/_modules/ai-mock/_collections/aim-default-collection.util.ts +0 -71
- package/src/_modules/ai/_modules/ai-mock/_collections/aim-fixture-match.util.spec.ts +0 -57
- package/src/_modules/ai/_modules/ai-mock/_collections/aim-fixture-match.util.ts +0 -60
- package/src/_modules/ai/_modules/ai-mock/_collections/aim-fixture-serializer.util.spec.ts +0 -56
- package/src/_modules/ai/_modules/ai-mock/_collections/aim-fixture-serializer.util.ts +0 -117
- package/src/_modules/ai/_modules/ai-mock/_enums/aim-modality.enum.ts +0 -28
- package/src/_modules/ai/_modules/ai-mock/_models/interfaces/aim-call-input.interface.ts +0 -14
- package/src/_modules/ai/_modules/ai-mock/_models/interfaces/aim-error.interface.ts +0 -11
- package/src/_modules/ai/_modules/ai-mock/_models/interfaces/aim-fixture.interface.ts +0 -30
- package/src/_modules/ai/_modules/ai-mock/_models/interfaces/aim-request.interface.ts +0 -19
- package/src/_modules/ai/_modules/ai-mock/_models/interfaces/aim-service-collection.interface.ts +0 -20
- package/src/_modules/ai/_modules/ai-mock/_services/ai-embedding-mock.service.spec.ts +0 -115
- package/src/_modules/ai/_modules/ai-mock/_services/ai-embedding-mock.service.ts +0 -233
- package/src/_modules/ai/_modules/ai-mock/_services/aim-fixture-harness.service.spec.ts +0 -134
- package/src/_modules/ai/_modules/ai-mock/_services/aim-fixture-harness.service.ts +0 -127
- package/src/_modules/ai/_modules/ai-mock/_services/aim-fixture-pipeline.spec.ts +0 -105
- package/src/_modules/ai/_modules/ai-mock/_services/aim-fixture-store.service.spec.ts +0 -50
- package/src/_modules/ai/_modules/ai-mock/_services/aim-fixture-store.service.ts +0 -65
- package/src/_modules/ai/_modules/ai-mock/_services/aim-integration-proof.spec.ts +0 -92
- package/src/_modules/ai/_modules/ai-mock/_services/aim-mock.service.spec.ts +0 -112
- package/src/_modules/ai/_modules/ai-mock/_services/aim-mock.service.ts +0 -155
- package/src/_modules/ai/_modules/ai-mock/fixtures/aim-text.fixtures.ts +0 -649
- package/src/_modules/ai/_modules/ai-mock/index.ts +0 -47
- package/src/_modules/ai/_modules/anthropic/_services/aai-user-key.control-service.ts +0 -138
- package/src/_modules/ai/_modules/anthropic/index.ts +0 -5
- package/src/_modules/ai/_modules/document-ai/_collections/dai-chunking.util.spec.ts +0 -242
- package/src/_modules/ai/_modules/document-ai/_collections/dai-chunking.util.ts +0 -639
- package/src/_modules/ai/_modules/document-ai/_collections/dai-code-chunking.util.spec.ts +0 -295
- package/src/_modules/ai/_modules/document-ai/_collections/dai-code-chunking.util.ts +0 -552
- package/src/_modules/ai/_modules/document-ai/_collections/dai-document.util.spec.ts +0 -209
- package/src/_modules/ai/_modules/document-ai/_collections/dai-document.util.ts +0 -85
- package/src/_modules/ai/_modules/document-ai/_enums/dai-compare-result-type.enum.ts +0 -8
- package/src/_modules/ai/_modules/document-ai/_models/data-models/dai-doc-chunk.data-model.ts +0 -146
- package/src/_modules/ai/_modules/document-ai/_models/data-models/dai-doc-page.data-model.ts +0 -163
- package/src/_modules/ai/_modules/document-ai/_models/data-models/dai-document.data-model.ts +0 -100
- package/src/_modules/ai/_modules/document-ai/_models/interfaces/dai-code-chunk.interface.ts +0 -68
- package/src/_modules/ai/_modules/document-ai/_models/interfaces/dai-doc-chunk-compare-result.interface.ts +0 -18
- package/src/_modules/ai/_modules/document-ai/_models/interfaces/dai-doc-page-compare-result.interface.ts +0 -19
- package/src/_modules/ai/_modules/document-ai/_models/interfaces/dai-document-compare-result.interface.ts +0 -25
- package/src/_modules/ai/_modules/document-ai/index.ts +0 -30
- package/src/_modules/ai/_modules/fdp-ai/_services/fdpai-user-key.control-service.ts +0 -189
- package/src/_modules/ai/_modules/fdp-ai/index.ts +0 -5
- package/src/_modules/ai/_modules/open-ai/_collections/oai-global-settings.const.ts +0 -9
- package/src/_modules/ai/_modules/open-ai/_collections/oai-llm-predefined-requests-hu.conts.ts +0 -83
- package/src/_modules/ai/_modules/open-ai/_collections/oai-llm-predefined-requests.conts.ts +0 -76
- package/src/_modules/ai/_modules/open-ai/_enums/oai-gpt-message-role.enum.ts +0 -45
- package/src/_modules/ai/_modules/open-ai/_models/interfaces/oai-global-settings.interface.ts +0 -8
- package/src/_modules/ai/_modules/open-ai/_models/interfaces/oai-gpt-message.interface.ts +0 -7
- package/src/_modules/ai/_modules/open-ai/_models/interfaces/oai-llm-predefined-requests.interface.ts +0 -57
- package/src/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-chunk-data.service.ts +0 -293
- package/src/_modules/ai/_modules/open-ai/_services/data-services/oai-doc-page.data-service.ts +0 -572
- package/src/_modules/ai/_modules/open-ai/_services/data-services/oai-document.data-service.spec.ts +0 -342
- package/src/_modules/ai/_modules/open-ai/_services/data-services/oai-document.data-service.ts +0 -435
- package/src/_modules/ai/_modules/open-ai/_services/data-services/oai-vector-data.service.spec.ts +0 -550
- package/src/_modules/ai/_modules/open-ai/_services/data-services/oai-vector-data.service.ts +0 -631
- package/src/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.spec.ts +0 -332
- package/src/_modules/ai/_modules/open-ai/_services/oai-embedding.control-service.ts +0 -132
- package/src/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.spec.ts +0 -462
- package/src/_modules/ai/_modules/open-ai/_services/oai-llm-chat.service-base.ts +0 -635
- package/src/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.spec.ts +0 -489
- package/src/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.tools.spec.ts +0 -173
- package/src/_modules/ai/_modules/open-ai/_services/oai-llm.service-base.ts +0 -1085
- package/src/_modules/ai/_modules/open-ai/_services/oai-user-key.control-service.ts +0 -157
- package/src/_modules/ai/_modules/open-ai/index.ts +0 -74
- package/src/_modules/ai/_services/ai-embedding-provider.registry.spec.ts +0 -110
- package/src/_modules/ai/_services/ai-embedding-provider.registry.ts +0 -114
- package/src/_modules/ai/_services/ai-embedding.service-base.spec.ts +0 -98
- package/src/_modules/ai/_services/ai-embedding.service-base.ts +0 -48
- package/src/_modules/ai/_services/ai-llm-chat.service-base.spec.ts +0 -229
- package/src/_modules/ai/_services/ai-llm-chat.service-base.ts +0 -68
- package/src/_modules/ai/_services/ai-llm.service-base.reconciler.spec.ts +0 -133
- package/src/_modules/ai/_services/ai-llm.service-base.spec.ts +0 -250
- package/src/_modules/ai/_services/ai-llm.service-base.ts +0 -599
- package/src/_modules/ai/_services/ai-provider.service-base.spec.ts +0 -158
- package/src/_modules/ai/_services/ai-provider.service-base.ts +0 -67
- package/src/_modules/ai/_services/ai-user-key.service-base.ts +0 -59
- package/src/_modules/ai/_services/lmstudio-embedding.control-service.spec.ts +0 -197
- package/src/_modules/ai/_services/lmstudio-embedding.control-service.ts +0 -399
- package/src/_modules/ai/index.ts +0 -33
- package/src/_modules/artifact-compiler/_enums/artifact-compile-outcome.type-enum.ts +0 -5
- package/src/_modules/artifact-compiler/_enums/artifact-compile-stage.type-enum.ts +0 -8
- package/src/_modules/artifact-compiler/_enums/artifact-retry-class.type-enum.ts +0 -6
- package/src/_modules/artifact-compiler/_models/artifact-compile.interface.ts +0 -35
- package/src/_modules/artifact-compiler/artifact-compiler.control-service.spec.ts +0 -151
- package/src/_modules/artifact-compiler/artifact-compiler.control-service.ts +0 -356
- package/src/_modules/artifact-compiler/index.ts +0 -9
- package/src/_modules/assistant/_collections/ass-global-settings.const.ts +0 -13
- package/src/_modules/assistant/_collections/ass.util.spec.ts +0 -176
- package/src/_modules/assistant/_collections/ass.util.ts +0 -50
- package/src/_modules/assistant/_models/ass-global-settings.interface.ts +0 -15
- package/src/_modules/assistant/_services/ass-io.control-service.spec.ts +0 -140
- package/src/_modules/assistant/_services/ass-io.control-service.ts +0 -74
- package/src/_modules/assistant/_services/ass-main.control-service.spec.ts +0 -192
- package/src/_modules/assistant/_services/ass-main.control-service.ts +0 -107
- package/src/_modules/assistant/index.ts +0 -19
- package/src/_modules/bot/_collections/bot-default-commands.const.ts +0 -12
- package/src/_modules/bot/_collections/bot-global-settings.const.ts +0 -39
- package/src/_modules/bot/_models/bot-channel-wrapper.interface.ts +0 -62
- package/src/_modules/bot/_models/bot-command.interface.ts +0 -8
- package/src/_modules/bot/_models/bot-global-settings.interface.ts +0 -96
- package/src/_modules/bot/_models/bot-last-mention-date.interface.ts +0 -6
- package/src/_modules/bot/_models/bot-last-message-date.interface.ts +0 -5
- package/src/_modules/bot/_models/bot-message-wrapper.interface.ts +0 -90
- package/src/_modules/bot/_models/bot-user-wrapper.interface.ts +0 -41
- package/src/_modules/bot/_modules/discord-bot/_models/dib-platform.types.ts +0 -10
- package/src/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.control-service.spec.ts +0 -431
- package/src/_modules/bot/_modules/discord-bot/_services/dib-messaging-provider.control-service.ts +0 -641
- package/src/_modules/bot/_modules/discord-bot/index.ts +0 -12
- package/src/_modules/bot/_modules/dynamo-bot/_collections/dyb-operations.util.spec.ts +0 -160
- package/src/_modules/bot/_modules/dynamo-bot/_collections/dyb-operations.util.ts +0 -55
- package/src/_modules/bot/_modules/dynamo-bot/_models/dyb-platform.types.ts +0 -15
- package/src/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.control-service.spec.ts +0 -374
- package/src/_modules/bot/_modules/dynamo-bot/_services/dyb-messaging-provider.control-service.ts +0 -447
- package/src/_modules/bot/_modules/dynamo-bot/index.ts +0 -15
- package/src/_modules/bot/_modules/slack-bot/_models/slb-platform.types.ts +0 -9
- package/src/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.control-service.spec.ts +0 -344
- package/src/_modules/bot/_modules/slack-bot/_services/slb-messaging-provider.control-service.ts +0 -197
- package/src/_modules/bot/_modules/slack-bot/index.ts +0 -12
- package/src/_modules/bot/_modules/teams-bot/_models/teb-platform.types.ts +0 -9
- package/src/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.control-service.spec.ts +0 -345
- package/src/_modules/bot/_modules/teams-bot/_services/teb-messaging-provider.control-service.ts +0 -197
- package/src/_modules/bot/_modules/teams-bot/index.ts +0 -11
- package/src/_modules/bot/_services/bot-commands.control-service.spec.ts +0 -116
- package/src/_modules/bot/_services/bot-commands.control-service.ts +0 -158
- package/src/_modules/bot/_services/bot-io.control-service.spec.ts +0 -285
- package/src/_modules/bot/_services/bot-io.control-service.ts +0 -329
- package/src/_modules/bot/_services/bot-main.control-service.spec.ts +0 -208
- package/src/_modules/bot/_services/bot-main.control-service.ts +0 -489
- package/src/_modules/bot/_services/bot-messaging-provider.service-base.spec.ts +0 -349
- package/src/_modules/bot/_services/bot-messaging-provider.service-base.ts +0 -158
- package/src/_modules/bot/_services/bot-routines.control-service.spec.ts +0 -111
- package/src/_modules/bot/_services/bot-routines.control-service.ts +0 -78
- package/src/_modules/bot/index.ts +0 -37
- package/src/_modules/custom-data/custom-data.controller.spec.ts +0 -49
- package/src/_modules/custom-data/custom-data.controller.ts +0 -67
- package/src/_modules/custom-data/custom-data.data-service.spec.ts +0 -54
- package/src/_modules/custom-data/custom-data.data-service.ts +0 -22
- package/src/_modules/custom-data/get-custom-data-routing-module.util.spec.ts +0 -28
- package/src/_modules/custom-data/get-custom-data-routing-module.util.ts +0 -24
- package/src/_modules/custom-data/index.ts +0 -9
- package/src/_modules/data-readers/_collections/dynts-sqlite-reader.util.spec.ts +0 -176
- package/src/_modules/data-readers/_collections/dynts-sqlite-reader.util.ts +0 -203
- package/src/_modules/data-readers/_models/interfaces/dynts-sqlite-reader.interface.ts +0 -33
- package/src/_modules/data-readers/index.ts +0 -11
- package/src/_modules/defaults/_collections/default-endpoints.util.ts +0 -487
- package/src/_modules/defaults/_models/default-user.data-model.ts +0 -72
- package/src/_modules/defaults/_services/default-auth.service.spec.ts +0 -269
- package/src/_modules/defaults/_services/default-auth.service.ts +0 -177
- package/src/_modules/defaults/_services/default-socket-events.service.spec.ts +0 -42
- package/src/_modules/defaults/_services/default-socket-events.service.ts +0 -61
- package/src/_modules/defaults/_services/default-user.data-service.spec.ts +0 -187
- package/src/_modules/defaults/_services/default-user.data-service.ts +0 -98
- package/src/_modules/defaults/index.ts +0 -17
- package/src/_modules/discord-assistant/_collections/dias-global-settings.const.ts +0 -19
- package/src/_modules/discord-assistant/_collections/dias.util.spec.ts +0 -366
- package/src/_modules/discord-assistant/_collections/dias.util.ts +0 -133
- package/src/_modules/discord-assistant/_models/dias-global-settings.interface.ts +0 -20
- package/src/_modules/discord-assistant/_models/dias-knowledge.data-model.ts +0 -53
- package/src/_modules/discord-assistant/_services/dias-chunk.data-service.ts +0 -177
- package/src/_modules/discord-assistant/_services/dias-io.control-service.spec.ts +0 -108
- package/src/_modules/discord-assistant/_services/dias-io.control-service.ts +0 -69
- package/src/_modules/discord-assistant/_services/dias-main.control-service.spec.ts +0 -22
- package/src/_modules/discord-assistant/_services/dias-main.control-service.ts +0 -27
- package/src/_modules/discord-assistant/_services/dias.service-base.spec.ts +0 -195
- package/src/_modules/discord-assistant/_services/dias.service-base.ts +0 -77
- package/src/_modules/discord-assistant/index.ts +0 -38
- package/src/_modules/discord-assistant-voiced/_services/dias-discord-bot.control-service.spec.ts +0 -34
- package/src/_modules/discord-assistant-voiced/_services/dias-discord-bot.control-service.ts +0 -11
- package/src/_modules/discord-assistant-voiced/index.ts +0 -36
- package/src/_modules/discord-bot/_collections/dibo-default-commands.const.ts +0 -17
- package/src/_modules/discord-bot/_collections/dibo-global-settings.conts.ts +0 -56
- package/src/_modules/discord-bot/_collections/dibo-operations.util.spec.ts +0 -214
- package/src/_modules/discord-bot/_collections/dibo-operations.util.ts +0 -387
- package/src/_modules/discord-bot/_models/dibo-command.interface.ts +0 -12
- package/src/_modules/discord-bot/_models/dibo-global-settings.interface.ts +0 -98
- package/src/_modules/discord-bot/_models/dibo-last-mention-date.inteface.ts +0 -8
- package/src/_modules/discord-bot/_models/dibo-last-message-date.interface.ts +0 -6
- package/src/_modules/discord-bot/_services/dibo-commands.control-service.spec.ts +0 -154
- package/src/_modules/discord-bot/_services/dibo-commands.control-service.ts +0 -153
- package/src/_modules/discord-bot/_services/dibo-io.control-service.spec.ts +0 -264
- package/src/_modules/discord-bot/_services/dibo-io.control-service.ts +0 -306
- package/src/_modules/discord-bot/_services/dibo-main.control-service.spec.ts +0 -408
- package/src/_modules/discord-bot/_services/dibo-main.control-service.ts +0 -488
- package/src/_modules/discord-bot/_services/dibo-routines.control-service.spec.ts +0 -105
- package/src/_modules/discord-bot/_services/dibo-routines.control-service.ts +0 -97
- package/src/_modules/discord-bot/index.ts +0 -36
- package/src/_modules/local-vector-search/_enums/lvs-search-mode.enum.ts +0 -35
- package/src/_modules/local-vector-search/_models/data-models/lvs-vector-persist.data-model.ts +0 -60
- package/src/_modules/local-vector-search/_models/lvs-search-result.interface.ts +0 -17
- package/src/_modules/local-vector-search/_services/lvs-bm25.util.spec.ts +0 -159
- package/src/_modules/local-vector-search/_services/lvs-bm25.util.ts +0 -206
- package/src/_modules/local-vector-search/_services/lvs-doc-chunk-data.service.spec.ts +0 -418
- package/src/_modules/local-vector-search/_services/lvs-doc-chunk-data.service.ts +0 -276
- package/src/_modules/local-vector-search/_services/lvs-local-vector-search.data-service.spec.ts +0 -480
- package/src/_modules/local-vector-search/_services/lvs-local-vector-search.data-service.ts +0 -416
- package/src/_modules/local-vector-search/_services/lvs-persistent-vector-pool.control-service.spec.ts +0 -214
- package/src/_modules/local-vector-search/_services/lvs-persistent-vector-pool.control-service.ts +0 -186
- package/src/_modules/local-vector-search/_services/lvs-vector-persist.data-service.spec.ts +0 -167
- package/src/_modules/local-vector-search/_services/lvs-vector-persist.data-service.ts +0 -130
- package/src/_modules/local-vector-search/_services/lvs-vector-pool.control-service.spec.ts +0 -509
- package/src/_modules/local-vector-search/_services/lvs-vector-pool.control-service.ts +0 -323
- package/src/_modules/local-vector-search/index.ts +0 -17
- package/src/_modules/logs/_models/file-log-entry.interface.ts +0 -13
- package/src/_modules/logs/_models/file-log-read-result.interface.ts +0 -37
- package/src/_modules/logs/file-log.service.spec.ts +0 -341
- package/src/_modules/logs/file-log.service.ts +0 -466
- package/src/_modules/logs/file-logs.controller.spec.ts +0 -245
- package/src/_modules/logs/file-logs.controller.ts +0 -165
- package/src/_modules/logs/get-file-logs-routing-module.util.ts +0 -51
- package/src/_modules/logs/get-logs-routing-module.util.ts +0 -36
- package/src/_modules/logs/index.ts +0 -11
- package/src/_modules/logs/log-buffer.service.ts +0 -101
- package/src/_modules/logs/logs.controller.ts +0 -109
- package/src/_modules/logs/logs.service.ts +0 -100
- package/src/_modules/mcp/_models/interfaces/dynts-mcp.interface.ts +0 -111
- package/src/_modules/mcp/_services/dynts-mcp-server.service-base.spec.ts +0 -151
- package/src/_modules/mcp/_services/dynts-mcp-server.service-base.ts +0 -125
- package/src/_modules/mcp/_services/dynts-mcp.adapter.ts +0 -168
- package/src/_modules/mcp/index.ts +0 -13
- package/src/_modules/messaging/README.md +0 -354
- package/src/_modules/messaging/_collections/get-messaging-routing-module.util.ts +0 -26
- package/src/_modules/messaging/_collections/msg-global-settings.const.ts +0 -22
- package/src/_modules/messaging/_collections/msg.util.spec.ts +0 -226
- package/src/_modules/messaging/_collections/msg.util.ts +0 -83
- package/src/_modules/messaging/_models/msg-global-settings.interface.ts +0 -37
- package/src/_modules/messaging/_services/msg-conversation.data-service.ts +0 -146
- package/src/_modules/messaging/_services/msg-events.service.spec.ts +0 -219
- package/src/_modules/messaging/_services/msg-events.service.ts +0 -267
- package/src/_modules/messaging/_services/msg-integration.control-service.ts +0 -180
- package/src/_modules/messaging/_services/msg-main.control-service.spec.ts +0 -147
- package/src/_modules/messaging/_services/msg-main.control-service.ts +0 -572
- package/src/_modules/messaging/_services/msg-message.data-service.ts +0 -129
- package/src/_modules/messaging/_services/msg.controller.spec.ts +0 -201
- package/src/_modules/messaging/_services/msg.controller.ts +0 -370
- package/src/_modules/messaging/index.ts +0 -30
- package/src/_modules/mock/app-extended-server.mock.ts +0 -201
- package/src/_modules/mock/app-integration-test.mock.ts +0 -51
- package/src/_modules/mock/app-params.mock.spec.ts +0 -21
- package/src/_modules/mock/app-params.mock.ts +0 -9
- package/src/_modules/mock/app-server.mock.ts +0 -188
- package/src/_modules/mock/auth-service.mock.spec.ts +0 -47
- package/src/_modules/mock/auth-service.mock.ts +0 -28
- package/src/_modules/mock/controller.mock.spec.ts +0 -26
- package/src/_modules/mock/controller.mock.ts +0 -16
- package/src/_modules/mock/data-model.mock.spec.ts +0 -111
- package/src/_modules/mock/data-model.mock.ts +0 -82
- package/src/_modules/mock/email-service-collection.mock.spec.ts +0 -24
- package/src/_modules/mock/email-service-collection.mock.ts +0 -15
- package/src/_modules/mock/email-service.mock.spec.ts +0 -17
- package/src/_modules/mock/email-service.mock.ts +0 -20
- package/src/_modules/mock/email-template.mock.html +0 -15
- package/src/_modules/mock/endpoint.mock.ts +0 -91
- package/src/_modules/mock/socket-client.mock.spec.ts +0 -40
- package/src/_modules/mock/socket-client.mock.ts +0 -45
- package/src/_modules/mock/socket-server.mock.spec.ts +0 -44
- package/src/_modules/mock/socket-server.mock.ts +0 -46
- package/src/_modules/oauth2/_routes/oauth2.controller.spec.ts +0 -107
- package/src/_modules/oauth2/_routes/oauth2.controller.ts +0 -99
- package/src/_modules/oauth2/_services/oauth2.auth-service.spec.ts +0 -254
- package/src/_modules/oauth2/_services/oauth2.auth-service.ts +0 -232
- package/src/_modules/oauth2/_services/oauth2.control-service.spec.ts +0 -585
- package/src/_modules/oauth2/_services/oauth2.control-service.ts +0 -654
- package/src/_modules/oauth2/index.ts +0 -17
- package/src/_modules/privacy-lifecycle/_enums/privacy-consent-decision.type-enum.ts +0 -5
- package/src/_modules/privacy-lifecycle/_enums/privacy-contributor-action.type-enum.ts +0 -10
- package/src/_modules/privacy-lifecycle/_enums/privacy-contributor-outcome.type-enum.ts +0 -7
- package/src/_modules/privacy-lifecycle/_enums/privacy-request-state.type-enum.ts +0 -15
- package/src/_modules/privacy-lifecycle/_enums/privacy-request.type-enum.ts +0 -9
- package/src/_modules/privacy-lifecycle/_models/privacy-consent-input.interface.ts +0 -12
- package/src/_modules/privacy-lifecycle/_models/privacy-consent-persistence-result.interface.ts +0 -7
- package/src/_modules/privacy-lifecycle/_models/privacy-consent-record.interface.ts +0 -15
- package/src/_modules/privacy-lifecycle/_models/privacy-consent-result.interface.ts +0 -7
- package/src/_modules/privacy-lifecycle/_models/privacy-consent-view.interface.ts +0 -13
- package/src/_modules/privacy-lifecycle/_models/privacy-contributor-context.interface.ts +0 -9
- package/src/_modules/privacy-lifecycle/_models/privacy-contributor-outcome.interface.ts +0 -14
- package/src/_modules/privacy-lifecycle/_models/privacy-contributor-plan.interface.ts +0 -8
- package/src/_modules/privacy-lifecycle/_models/privacy-contributor.interface.ts +0 -17
- package/src/_modules/privacy-lifecycle/_models/privacy-ledger-adapter.interface.ts +0 -21
- package/src/_modules/privacy-lifecycle/_models/privacy-ledger-result.interface.ts +0 -9
- package/src/_modules/privacy-lifecycle/_models/privacy-ledger-settings.interface.ts +0 -7
- package/src/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-input.interface.ts +0 -10
- package/src/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-persistence-result.interface.ts +0 -7
- package/src/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-result.interface.ts +0 -7
- package/src/_modules/privacy-lifecycle/_models/privacy-legal-acceptance-view.interface.ts +0 -11
- package/src/_modules/privacy-lifecycle/_models/privacy-legal-acceptance.interface.ts +0 -13
- package/src/_modules/privacy-lifecycle/_models/privacy-lifecycle-adapter.interface.ts +0 -19
- package/src/_modules/privacy-lifecycle/_models/privacy-lifecycle-settings.interface.ts +0 -9
- package/src/_modules/privacy-lifecycle/_models/privacy-request-create-result.interface.ts +0 -7
- package/src/_modules/privacy-lifecycle/_models/privacy-request-open.interface.ts +0 -10
- package/src/_modules/privacy-lifecycle/_models/privacy-request-persistence-create-result.interface.ts +0 -7
- package/src/_modules/privacy-lifecycle/_models/privacy-request-record.interface.ts +0 -21
- package/src/_modules/privacy-lifecycle/_models/privacy-request-result.interface.ts +0 -8
- package/src/_modules/privacy-lifecycle/_models/privacy-request-view.interface.ts +0 -20
- package/src/_modules/privacy-lifecycle/index.ts +0 -40
- package/src/_modules/privacy-lifecycle/privacy-ledger.control-service.spec.ts +0 -206
- package/src/_modules/privacy-lifecycle/privacy-ledger.control-service.ts +0 -253
- package/src/_modules/privacy-lifecycle/privacy-lifecycle.control-service.spec.ts +0 -353
- package/src/_modules/privacy-lifecycle/privacy-lifecycle.control-service.ts +0 -586
- package/src/_modules/rate-limit/_enums/rate-limit-store-kind.type-enum.ts +0 -5
- package/src/_modules/rate-limit/_models/rate-limit-config.interface.ts +0 -82
- package/src/_modules/rate-limit/_models/rate-limit-consume-request.interface.ts +0 -9
- package/src/_modules/rate-limit/_models/rate-limit-consume-result.interface.ts +0 -6
- package/src/_modules/rate-limit/_models/rate-limit-policy.interface.ts +0 -16
- package/src/_modules/rate-limit/_models/rate-limit-store.interface.ts +0 -9
- package/src/_modules/rate-limit/index.ts +0 -8
- package/src/_modules/rate-limit/rate-limit-in-memory.store.ts +0 -91
- package/src/_modules/rate-limit/rate-limit.middleware.spec.ts +0 -488
- package/src/_modules/rate-limit/rate-limit.middleware.ts +0 -504
- package/src/_modules/scheduler/_models/scheduler-job.interface.ts +0 -35
- package/src/_modules/scheduler/get-scheduler-routing-module.util.ts +0 -33
- package/src/_modules/scheduler/index.ts +0 -8
- package/src/_modules/scheduler/scheduler.controller.spec.ts +0 -42
- package/src/_modules/scheduler/scheduler.controller.ts +0 -69
- package/src/_modules/scheduler/scheduler.service.spec.ts +0 -141
- package/src/_modules/scheduler/scheduler.service.ts +0 -176
- package/src/_modules/scoped-config/_enums/dynts-scoped-config-level.enum.ts +0 -22
- package/src/_modules/scoped-config/_models/data-models/dynts-scoped-config.data-model.ts +0 -82
- package/src/_modules/scoped-config/_models/interfaces/dynts-scoped-config.interface.ts +0 -107
- package/src/_modules/scoped-config/_services/dynts-scoped-config.control-service.spec.ts +0 -312
- package/src/_modules/scoped-config/_services/dynts-scoped-config.control-service.ts +0 -311
- package/src/_modules/scoped-config/_services/dynts-scoped-config.data-service.spec.ts +0 -123
- package/src/_modules/scoped-config/_services/dynts-scoped-config.data-service.ts +0 -108
- package/src/_modules/scoped-config/index.ts +0 -17
- package/src/_modules/server/errors/errors.control-service.spec.ts +0 -246
- package/src/_modules/server/errors/errors.control-service.ts +0 -100
- package/src/_modules/server/errors/errors.controller.spec.ts +0 -340
- package/src/_modules/server/errors/errors.controller.ts +0 -559
- package/src/_modules/server/errors/errors.data-service.spec.ts +0 -480
- package/src/_modules/server/errors/errors.data-service.ts +0 -867
- package/src/_modules/server/index.ts +0 -40
- package/src/_modules/server/safe-diagnostic/safe-diagnostic-cause.type-enum.ts +0 -8
- package/src/_modules/server/safe-diagnostic/safe-diagnostic-stage.type-enum.ts +0 -20
- package/src/_modules/server/safe-diagnostic/safe-diagnostic.control-service.spec.ts +0 -124
- package/src/_modules/server/safe-diagnostic/safe-diagnostic.control-service.ts +0 -99
- package/src/_modules/server/safe-diagnostic/safe-diagnostic.interface.ts +0 -20
- package/src/_modules/server/server-status/db-readiness-probe-code.type-enum.ts +0 -13
- package/src/_modules/server/server-status/db-readiness-probe-stage.type-enum.ts +0 -7
- package/src/_modules/server/server-status/db-readiness-probe.control-service.spec.ts +0 -235
- package/src/_modules/server/server-status/db-readiness-probe.control-service.ts +0 -158
- package/src/_modules/server/server-status/db-readiness-probe.interface.ts +0 -20
- package/src/_modules/server/server-status/server-status-snapshot.control-service.spec.ts +0 -70
- package/src/_modules/server/server-status/server-status-snapshot.control-service.ts +0 -17
- package/src/_modules/server/server-status/server-status-snapshot.data-service.spec.ts +0 -77
- package/src/_modules/server/server-status/server-status-snapshot.data-service.ts +0 -37
- package/src/_modules/server/server-status/server-status.control-service.spec.ts +0 -672
- package/src/_modules/server/server-status/server-status.control-service.ts +0 -491
- package/src/_modules/server/server-status/server-status.controller.spec.ts +0 -276
- package/src/_modules/server/server-status/server-status.controller.ts +0 -336
- package/src/_modules/socket/_enums/socket-security.enum.ts +0 -11
- package/src/_modules/socket/_models/socket-client-service-params.control-model.spec.ts +0 -32
- package/src/_modules/socket/_models/socket-client-service-params.control-model.ts +0 -22
- package/src/_modules/socket/_models/socket-presence.control-model.spec.ts +0 -165
- package/src/_modules/socket/_models/socket-presence.control-model.ts +0 -211
- package/src/_modules/socket/_models/socket-server-service-params.control-model.spec.ts +0 -69
- package/src/_modules/socket/_models/socket-server-service-params.control-model.ts +0 -33
- package/src/_modules/socket/_services/socket-client.service.spec.ts +0 -15
- package/src/_modules/socket/_services/socket-client.service.ts +0 -260
- package/src/_modules/socket/_services/socket-server.service.spec.ts +0 -272
- package/src/_modules/socket/_services/socket-server.service.ts +0 -1037
- package/src/_modules/socket/app-extended.integration.spec.ts +0 -85
- package/src/_modules/socket/app-extended.server.ts +0 -648
- package/src/_modules/socket/index.ts +0 -42
- package/src/_modules/test/get-test-routing-module.util.spec.ts +0 -28
- package/src/_modules/test/get-test-routing-module.util.ts +0 -23
- package/src/_modules/test/index.ts +0 -12
- package/src/_modules/test/test.controller.spec.ts +0 -72
- package/src/_modules/test/test.controller.ts +0 -115
- package/src/_modules/test-email-sink/_collections/test-email-pattern.const.ts +0 -10
- package/src/_modules/test-email-sink/_models/data-models/dynts-sent-test-mail.data-model.ts +0 -41
- package/src/_modules/test-email-sink/_services/dynts-test-email-sink.service.spec.ts +0 -112
- package/src/_modules/test-email-sink/_services/dynts-test-email-sink.service.ts +0 -141
- package/src/_modules/test-email-sink/get-sent-mail-routing-module.util.ts +0 -29
- package/src/_modules/test-email-sink/index.ts +0 -11
- package/src/_modules/test-email-sink/test-email-sink.controller.ts +0 -83
- package/src/_modules/usage/get-usage-routing-module.util.ts +0 -23
- package/src/_modules/usage/index.ts +0 -15
- package/src/_modules/usage/usage.controller.spec.ts +0 -106
- package/src/_modules/usage/usage.controller.ts +0 -140
- package/src/_modules/usage/usage.data-service.spec.ts +0 -332
- package/src/_modules/usage/usage.data-service.ts +0 -185
- package/src/_services/base/api.service-base.spec.ts +0 -125
- package/src/_services/base/api.service-base.ts +0 -75
- package/src/_services/base/archive-data.service.spec.ts +0 -209
- package/src/_services/base/archive-data.service.ts +0 -228
- package/src/_services/base/data.service.spec.ts +0 -784
- package/src/_services/base/data.service.ts +0 -2792
- package/src/_services/base/db.service.encryption.spec.ts +0 -76
- package/src/_services/base/db.service.spec.ts +0 -160
- package/src/_services/base/db.service.ts +0 -1698
- package/src/_services/base/singleton.service-base.spec.ts +0 -28
- package/src/_services/base/singleton.service-base.ts +0 -24
- package/src/_services/base/singleton.service.spec.ts +0 -114
- package/src/_services/base/singleton.service.ts +0 -38
- package/src/_services/core/api.service.spec.ts +0 -187
- package/src/_services/core/api.service.ts +0 -627
- package/src/_services/core/auth.service.spec.ts +0 -159
- package/src/_services/core/auth.service.ts +0 -174
- package/src/_services/core/collection-growth-monitor.service.spec.ts +0 -119
- package/src/_services/core/collection-growth-monitor.service.ts +0 -234
- package/src/_services/core/db-stats.service.ts +0 -104
- package/src/_services/core/diagnostics.service.spec.ts +0 -44
- package/src/_services/core/diagnostics.service.ts +0 -158
- package/src/_services/core/email.service.spec.ts +0 -85
- package/src/_services/core/email.service.ts +0 -757
- package/src/_services/core/event-loop-diag.service.spec.ts +0 -22
- package/src/_services/core/event-loop-diag.service.ts +0 -144
- package/src/_services/core/global.service.spec.ts +0 -292
- package/src/_services/core/global.service.ts +0 -488
- package/src/_services/core/memory-guard.service.spec.ts +0 -245
- package/src/_services/core/memory-guard.service.ts +0 -481
- package/src/_services/core/migration-runner.service.spec.ts +0 -91
- package/src/_services/core/migration-runner.service.ts +0 -106
- package/src/_services/core/mongo-transaction.control-service.spec.ts +0 -165
- package/src/_services/core/mongo-transaction.control-service.ts +0 -148
- package/src/_services/core/request-hunter.service.spec.ts +0 -124
- package/src/_services/core/request-hunter.service.ts +0 -157
- package/src/_services/core/service-collection.service.spec.ts +0 -46
- package/src/_services/core/service-collection.service.ts +0 -6
- package/src/_services/route/controller.service.spec.ts +0 -53
- package/src/_services/route/controller.service.ts +0 -148
- package/src/_services/route/routing-module.service.spec.ts +0 -98
- package/src/_services/route/routing-module.service.ts +0 -330
- package/src/_services/server/app-safe-diagnostic.spec.ts +0 -124
- package/src/_services/server/app.server-retention.spec.ts +0 -106
- package/src/_services/server/app.server.ts +0 -1959
- package/src/_services/shared.static-service.spec.ts +0 -133
- package/src/_services/shared.static-service.ts +0 -107
- package/src/index.ts +0 -117
- package/tsconfig.app.json +0 -12
- package/tsconfig.json +0 -42
|
@@ -1,1959 +0,0 @@
|
|
|
1
|
-
|
|
2
|
-
import Mongoose = require('mongoose');
|
|
3
|
-
import Express = require('express');
|
|
4
|
-
/* import Mongoose from 'mongoose';
|
|
5
|
-
import Express from 'express'; */
|
|
6
|
-
|
|
7
|
-
import * as BodyParser from 'body-parser';
|
|
8
|
-
import * as FileSystem from 'fs';
|
|
9
|
-
import * as Http from 'http';
|
|
10
|
-
import * as Https from 'https';
|
|
11
|
-
import * as Path from 'path';
|
|
12
|
-
import * as dotenv from 'dotenv'
|
|
13
|
-
|
|
14
|
-
/* import { version } from '../../../package.json'; */
|
|
15
|
-
|
|
16
|
-
import {
|
|
17
|
-
DyFM_AnyError,
|
|
18
|
-
DyFM_Array,
|
|
19
|
-
DyFM_Async,
|
|
20
|
-
DyFM_Error,
|
|
21
|
-
DyFM_error_defaults,
|
|
22
|
-
DyFM_Error_Settings,
|
|
23
|
-
DyFM_ErrorLevel,
|
|
24
|
-
DyFM_Log,
|
|
25
|
-
DyFM_resolveRetentionTtlSeconds,
|
|
26
|
-
megabyte,
|
|
27
|
-
second
|
|
28
|
-
} from '@futdevpro/fsm-dynamo';
|
|
29
|
-
|
|
30
|
-
import { DyNTS_defaultFallbackCacheMaxAge } from '../../_collections/default-fallback-cache-max-age.const';
|
|
31
|
-
import { DyNTS_defaultNotFoundPageHtml } from '../../_collections/default-not-found-page.const';
|
|
32
|
-
import { DyNTS_global_settings } from '../../_collections/global-settings.const';
|
|
33
|
-
import { DyNTS_ClientSafeError_Util } from '../../_collections/client-safe-error.util';
|
|
34
|
-
import { DyNTS_getEnvironment_settings } from '../../_collections/get-environment-settings.util';
|
|
35
|
-
import { DyNTS_createSecurityHeadersMiddleware } from '../../_collections/security-headers.util';
|
|
36
|
-
import { DyNTS_createLoadShedMiddleware } from '../../_collections/load-shed.util';
|
|
37
|
-
import { DyNTS_createAppVersionHeaderMiddleware } from '../../_collections/app-version-header.util';
|
|
38
|
-
import { DyNTS_AppVersionHeader_Settings } from '../../_models/interfaces/app-version-header-settings.interface';
|
|
39
|
-
import { DyNTS_SecurityHeaders_Settings } from '../../_models/interfaces/security-headers-settings.interface';
|
|
40
|
-
import { startMongoReconnectGuard } from '../../_collections/mongo-reconnect-guard.util';
|
|
41
|
-
import { DyNTS_resolveStaticCacheControlHeader } from '../../_collections/static-cache-control.util';
|
|
42
|
-
import { DyNTS_RouteSecurity } from '../../_enums/route-security.enum';
|
|
43
|
-
import { DyNTS_App_Params } from '../../_models/control-models/app-params.control-model';
|
|
44
|
-
import {
|
|
45
|
-
DyNTS_AppSystemControls
|
|
46
|
-
} from '../../_models/control-models/app-system-controls.control-model';
|
|
47
|
-
import {
|
|
48
|
-
DyNTS_Endpoint_Params
|
|
49
|
-
} from '../../_models/control-models/endpoint-params.control-model';
|
|
50
|
-
import { DyNTS_Http_Settings } from '../../_models/control-models/http-settings.control-model';
|
|
51
|
-
import {
|
|
52
|
-
DyNTS_Certification_Settings
|
|
53
|
-
} from '../../_models/interfaces/certification-settings.interface';
|
|
54
|
-
import {
|
|
55
|
-
DyNTS_GlobalService_Settings
|
|
56
|
-
} from '../../_models/interfaces/global-service-settings.interface';
|
|
57
|
-
import {
|
|
58
|
-
DyNTS_StaticClient_Settings
|
|
59
|
-
} from '../../_models/interfaces/static-client-settings.interface';
|
|
60
|
-
import {
|
|
61
|
-
DyNTS_Cors_Settings
|
|
62
|
-
} from '../../_models/interfaces/cors-settings.interface';
|
|
63
|
-
import { DyNTS_DBService } from '../base/db.service';
|
|
64
|
-
import { DyNTS_SingletonService } from '../base/singleton.service';
|
|
65
|
-
import { DyNTS_GlobalService } from '../core/global.service';
|
|
66
|
-
import { DyNTS_CollectionGrowthMonitor } from '../core/collection-growth-monitor.service';
|
|
67
|
-
import { DyNTS_MemoryGuard } from '../core/memory-guard.service';
|
|
68
|
-
import { DyNTS_EventLoopDiag } from '../core/event-loop-diag.service';
|
|
69
|
-
import { DyNTS_RoutingModule } from '../route/routing-module.service';
|
|
70
|
-
import { DyNTS_getStarRoute } from '../../_collections/star.controller';
|
|
71
|
-
import { DyNTS_SafeDiagnosticStage_Type } from '../../_modules/server/safe-diagnostic/safe-diagnostic-stage.type-enum';
|
|
72
|
-
import { DyNTS_SafeDiagnostic_Interface } from '../../_modules/server/safe-diagnostic/safe-diagnostic.interface';
|
|
73
|
-
import {
|
|
74
|
-
DyNTS_SafeDiagnostic_ControlService
|
|
75
|
-
} from '../../_modules/server/safe-diagnostic/safe-diagnostic.control-service';
|
|
76
|
-
|
|
77
|
-
/**
|
|
78
|
-
*
|
|
79
|
-
* function MyDecorator(config: any) {
|
|
80
|
-
return function (target: Function) {
|
|
81
|
-
// attach metadata or modify target
|
|
82
|
-
target.prototype.myMeta = config;
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
|
|
86
|
-
@MyDecorator({ role: 'admin' })
|
|
87
|
-
class User {
|
|
88
|
-
printRole() {
|
|
89
|
-
console.log((this as any).myMeta.role); // → "admin"
|
|
90
|
-
}
|
|
91
|
-
}
|
|
92
|
-
|
|
93
|
-
*/
|
|
94
|
-
|
|
95
|
-
/**
|
|
96
|
-
* This will be the MAIN service of our server project,
|
|
97
|
-
* follow the types and type instructions while setting up your project
|
|
98
|
-
*
|
|
99
|
-
* In this service, there are abstract functions that you will need to implement,
|
|
100
|
-
* where you need to set up the main params for your application.
|
|
101
|
-
*
|
|
102
|
-
* (after the example, you can find the list of services you can/should setup)
|
|
103
|
-
*
|
|
104
|
-
* @example
|
|
105
|
-
* export class App extends DyNTS_AppExtended {
|
|
106
|
-
*
|
|
107
|
-
* ...
|
|
108
|
-
*
|
|
109
|
-
* // Setting up App params, and preparing project global settings
|
|
110
|
-
* setupAppParams(): void {
|
|
111
|
-
* this.params = new DyNTS_AppParams({
|
|
112
|
-
* name: 'Warbots Server',
|
|
113
|
-
* title: warbotsTitleLog,
|
|
114
|
-
* version: version,
|
|
115
|
-
* dbName: 'warbots',
|
|
116
|
-
* });
|
|
117
|
-
*
|
|
118
|
-
* // dynamoNTS_GlobalSettings.logRequestsContent = false;
|
|
119
|
-
* }
|
|
120
|
-
*
|
|
121
|
-
* ...
|
|
122
|
-
*
|
|
123
|
-
* // Setting up DBServices
|
|
124
|
-
* setGlobalServiceCollection(): void {
|
|
125
|
-
* DyNTS_GlobalService.setServices({
|
|
126
|
-
* authService: AuthService.getInstance(),
|
|
127
|
-
* emailServiceCollection: EmailServiceCollectionService.getInstance(),
|
|
128
|
-
* dbModels: [
|
|
129
|
-
* userModelParams,
|
|
130
|
-
* userDataModelParams,
|
|
131
|
-
* userOptionsModelParams,
|
|
132
|
-
* userStatisticsModelParams,
|
|
133
|
-
* userAchievementsModelParams,
|
|
134
|
-
* userNotificationsModelParams,
|
|
135
|
-
*
|
|
136
|
-
* matchStatisticsModelParams,
|
|
137
|
-
* matchDataModelParams,
|
|
138
|
-
|
|
139
|
-
* DyFM_usageSession_dataParams,
|
|
140
|
-
* DyFM_customData_dataParams,
|
|
141
|
-
* ]
|
|
142
|
-
* });
|
|
143
|
-
* }
|
|
144
|
-
*
|
|
145
|
-
* ...
|
|
146
|
-
*
|
|
147
|
-
* // Setting up Routes
|
|
148
|
-
* setupRoutingModules(): void {
|
|
149
|
-
* this.httpPort = env.port;
|
|
150
|
-
|
|
151
|
-
* this.routingModules = [
|
|
152
|
-
* new DyNTS_RoutingModule({
|
|
153
|
-
* route: '/user',
|
|
154
|
-
* controllers: [
|
|
155
|
-
* UserController.getInstance(),
|
|
156
|
-
* UserDataController.getInstance(),
|
|
157
|
-
* UserOptionsController.getInstance(),
|
|
158
|
-
* UserStatisticsController.getInstance(),
|
|
159
|
-
* UserAchievementsController.getInstance(),
|
|
160
|
-
* UserNotificationsController.getInstance()
|
|
161
|
-
* ]
|
|
162
|
-
* }),
|
|
163
|
-
* new DyNTS_RoutingModule({
|
|
164
|
-
* route: '/match',
|
|
165
|
-
* controllers: [
|
|
166
|
-
* MatchController.getInstance(),
|
|
167
|
-
* MatchDistributionController.getInstance(),
|
|
168
|
-
* MatchStatisticsController.getInstance(),
|
|
169
|
-
* ]
|
|
170
|
-
* }),
|
|
171
|
-
* new DyNTS_RoutingModule({
|
|
172
|
-
* route: '/server',
|
|
173
|
-
* controllers: [
|
|
174
|
-
* ServerController.getInstance(),
|
|
175
|
-
* ]
|
|
176
|
-
* }),
|
|
177
|
-
|
|
178
|
-
* getTestRoutingModule(),
|
|
179
|
-
* getUsageRoutingModule()
|
|
180
|
-
* ];
|
|
181
|
-
* }
|
|
182
|
-
* }
|
|
183
|
-
*
|
|
184
|
-
* //
|
|
185
|
-
* // The Services available
|
|
186
|
-
* //
|
|
187
|
-
* // Authentication Service
|
|
188
|
-
* // A commonly used basic service,
|
|
189
|
-
* // which is necessary fur certain functions (such as registering call issuers)
|
|
190
|
-
* //
|
|
191
|
-
* // This will handle Authentication Token checking/refreshing,
|
|
192
|
-
* // checking issuer's identifier and routeParams,
|
|
193
|
-
* // handling JWT Token, or maybe with OAuth2 or other commonly used security procedures
|
|
194
|
-
* //
|
|
195
|
-
* // You can create one with this Dynamo Object:
|
|
196
|
-
* //
|
|
197
|
-
*
|
|
198
|
-
* @example
|
|
199
|
-
* // follow the instructions on the abstract class (DyNTS_AuthService)
|
|
200
|
-
* export class AuthService extends DyNTS_AuthService {}
|
|
201
|
-
*
|
|
202
|
-
*
|
|
203
|
-
*
|
|
204
|
-
* //
|
|
205
|
-
*/
|
|
206
|
-
|
|
207
|
-
/**
|
|
208
|
-
* This will be the MAIN service of our server project,
|
|
209
|
-
* follow the types and type instructions while setting up your project
|
|
210
|
-
*
|
|
211
|
-
* In this service, there are abstract functions that you will need to implement,
|
|
212
|
-
* where you need to set up the main params for your application.
|
|
213
|
-
*
|
|
214
|
-
* (after the example, you can find the list of services you can/should setup)
|
|
215
|
-
*
|
|
216
|
-
* You need to setup the following functions:
|
|
217
|
-
* ```ts
|
|
218
|
-
* // this is where you set up the main params for your application
|
|
219
|
-
* getAppParams(): DyNTS_AppParams
|
|
220
|
-
*
|
|
221
|
-
* // this is where you connect your main services
|
|
222
|
-
* getGlobalServiceSettings(): DyNTS_GlobalService_Settings
|
|
223
|
-
*
|
|
224
|
-
* // this is where you set up your ports
|
|
225
|
-
* getPorts(): DyNTS_PortSettings
|
|
226
|
-
*
|
|
227
|
-
* // this is where you set up your routes
|
|
228
|
-
* getRoutingModules(): DyNTS_RoutingModule[]
|
|
229
|
-
*
|
|
230
|
-
*
|
|
231
|
-
*
|
|
232
|
-
* ```
|
|
233
|
-
* optionally you can setup the following functions:
|
|
234
|
-
* ```ts
|
|
235
|
-
* // this is where you set up your certifications
|
|
236
|
-
* getCertificationSettings(): DyNTS_CertificationSettings
|
|
237
|
-
*
|
|
238
|
-
* // this is where you set up additional root services
|
|
239
|
-
* getRootServices(): DyNTS_SingletonService[]
|
|
240
|
-
*
|
|
241
|
-
* // this is where you set up your initial db entries
|
|
242
|
-
* createEntries(): void
|
|
243
|
-
*
|
|
244
|
-
* // this is where you can define post setup processes
|
|
245
|
-
* postProcess(): void
|
|
246
|
-
*
|
|
247
|
-
*
|
|
248
|
-
*
|
|
249
|
-
* ```
|
|
250
|
-
*
|
|
251
|
-
*/
|
|
252
|
-
|
|
253
|
-
/** FR-258 / SR-2 — one entry from `collection.indexes()` (only the fields the TTL-installer reads). */
|
|
254
|
-
export interface DyNTS_TtlIndexInfo {
|
|
255
|
-
name?: string;
|
|
256
|
-
key?: Record<string, number>;
|
|
257
|
-
expireAfterSeconds?: number;
|
|
258
|
-
}
|
|
259
|
-
|
|
260
|
-
/**
|
|
261
|
-
* FR-258 / SR-2 — the minimal native-driver collection surface the TTL-installer needs. Declared
|
|
262
|
-
* structurally (not importing mongodb types) so it stays dependency-light and is trivially mockable
|
|
263
|
-
* in unit tests.
|
|
264
|
-
*/
|
|
265
|
-
export interface DyNTS_TtlIndexCollection {
|
|
266
|
-
indexes?: () => Promise<DyNTS_TtlIndexInfo[]>;
|
|
267
|
-
createIndex: (keys: Record<string, number>, options: { expireAfterSeconds: number }) => Promise<unknown>;
|
|
268
|
-
dropIndex?: (name: string) => Promise<unknown>;
|
|
269
|
-
}
|
|
270
|
-
|
|
271
|
-
/**
|
|
272
|
-
* FR-258 / SR-2 — outcome of {@link DyNTS_App.ensureRetentionTtlIndex}.
|
|
273
|
-
* - `created`: no `__created` TTL index existed → one was created.
|
|
274
|
-
* - `noop`: an index with the SAME TTL already existed → nothing done.
|
|
275
|
-
* - `differs`: an index exists with a DIFFERENT TTL (or a non-TTL `__created` index) → left UNTOUCHED,
|
|
276
|
-
* only a warning is emitted. We deliberately DO NOT drop+recreate at boot: rebuilding a TTL index on a
|
|
277
|
-
* multi-GB production collection is a heavy server-side op that can starve concurrent boot queries (e.g.
|
|
278
|
-
* the health-probe) and trip a fail-safe deploy revert. A deliberate retention CHANGE must be applied via
|
|
279
|
-
* maintenance, not silently at every startup.
|
|
280
|
-
*/
|
|
281
|
-
export type DyNTS_TtlIndexAction = 'created' | 'differs' | 'noop';
|
|
282
|
-
|
|
283
|
-
export abstract class DyNTS_App extends DyNTS_SingletonService {
|
|
284
|
-
|
|
285
|
-
protected systemControls: DyNTS_AppSystemControls = new DyNTS_AppSystemControls();
|
|
286
|
-
get started(): boolean {
|
|
287
|
-
return this.systemControls.app.started;
|
|
288
|
-
}
|
|
289
|
-
protected get superStarted(): boolean {
|
|
290
|
-
return this.systemControls.app.started;
|
|
291
|
-
}
|
|
292
|
-
protected constructErrors: (Error | DyFM_Error)[] = [];
|
|
293
|
-
|
|
294
|
-
/* removed since cant use version from package.json
|
|
295
|
-
private readonly _ntsVersion: string = 'v01.07.18';
|
|
296
|
-
protected get ntsVersion(): string {
|
|
297
|
-
return this._ntsVersion;
|
|
298
|
-
} */
|
|
299
|
-
|
|
300
|
-
get serverName(): string {
|
|
301
|
-
return this.params.name;
|
|
302
|
-
}
|
|
303
|
-
|
|
304
|
-
private _params: DyNTS_App_Params;
|
|
305
|
-
protected get params(): DyNTS_App_Params {
|
|
306
|
-
return this._params;
|
|
307
|
-
}
|
|
308
|
-
|
|
309
|
-
protected mongoose = Mongoose;
|
|
310
|
-
|
|
311
|
-
private _security: DyNTS_RouteSecurity;
|
|
312
|
-
protected get security(): DyNTS_RouteSecurity {
|
|
313
|
-
return this._security;
|
|
314
|
-
}
|
|
315
|
-
|
|
316
|
-
protected _portSettings: DyNTS_Http_Settings = new DyNTS_Http_Settings();
|
|
317
|
-
protected get portSettings(): DyNTS_Http_Settings {
|
|
318
|
-
return this._portSettings;
|
|
319
|
-
}
|
|
320
|
-
|
|
321
|
-
private _cert?: DyNTS_Certification_Settings;
|
|
322
|
-
protected get cert(): DyNTS_Certification_Settings {
|
|
323
|
-
return this._cert;
|
|
324
|
-
}
|
|
325
|
-
|
|
326
|
-
protected openExpress: Express.Application;
|
|
327
|
-
protected secureExpress: Express.Application;
|
|
328
|
-
protected httpsServer: Https.Server;
|
|
329
|
-
protected httpServer: Http.Server;
|
|
330
|
-
|
|
331
|
-
private globalService: DyNTS_GlobalService;
|
|
332
|
-
private _rootServices: DyNTS_SingletonService[] = [];
|
|
333
|
-
|
|
334
|
-
private _routingModules: DyNTS_RoutingModule[] = [];
|
|
335
|
-
|
|
336
|
-
protected readonly defaultReadyTimeout: number = 30 * second;
|
|
337
|
-
|
|
338
|
-
override readonly defaultErrorUserMsg =
|
|
339
|
-
`We encountered an unhandled Server Error, ` +
|
|
340
|
-
`\nplease contact the responsible development team.` +
|
|
341
|
-
`\n(Internal Server error)`;
|
|
342
|
-
|
|
343
|
-
get logSetup(): boolean {
|
|
344
|
-
return DyNTS_global_settings.log_settings.setup;
|
|
345
|
-
}
|
|
346
|
-
get deepLog(): boolean {
|
|
347
|
-
return DyNTS_global_settings.log_settings.deep;
|
|
348
|
-
}
|
|
349
|
-
get fnLogs(): boolean {
|
|
350
|
-
return DyNTS_global_settings.log_settings.functions;
|
|
351
|
-
}
|
|
352
|
-
debugLog: boolean = DyNTS_global_settings.log_settings.server_debug;
|
|
353
|
-
|
|
354
|
-
private reportSafeDiagnostic(
|
|
355
|
-
code: string,
|
|
356
|
-
stage: DyNTS_SafeDiagnosticStage_Type,
|
|
357
|
-
error?: unknown,
|
|
358
|
-
status: number = 500
|
|
359
|
-
): DyNTS_SafeDiagnostic_Interface {
|
|
360
|
-
const configuredPrefix: string | undefined = DyNTS_global_settings.systemShortCodeName;
|
|
361
|
-
const prefix: string = configuredPrefix && /^[A-Z][A-Z0-9_-]{1,31}$/.test(configuredPrefix)
|
|
362
|
-
? configuredPrefix
|
|
363
|
-
: 'DYNTS';
|
|
364
|
-
|
|
365
|
-
return DyNTS_SafeDiagnostic_ControlService.report({
|
|
366
|
-
code: `${prefix}|${code}`,
|
|
367
|
-
stage: stage,
|
|
368
|
-
error: error,
|
|
369
|
-
status: status,
|
|
370
|
-
});
|
|
371
|
-
}
|
|
372
|
-
|
|
373
|
-
private forwardSafeDiagnostic(diagnostic: DyNTS_SafeDiagnostic_Interface): void {
|
|
374
|
-
try {
|
|
375
|
-
const pending: Promise<void> | undefined = DyNTS_GlobalService.globalErrorHandler?.(
|
|
376
|
-
DyNTS_SafeDiagnostic_ControlService.toError(diagnostic)
|
|
377
|
-
);
|
|
378
|
-
|
|
379
|
-
void pending?.catch((error: unknown): void => {
|
|
380
|
-
this.reportSafeDiagnostic(
|
|
381
|
-
'DYNTS-AS0-GLOBAL-HANDLER-REJECTED',
|
|
382
|
-
DyNTS_SafeDiagnosticStage_Type.globalErrorHandler,
|
|
383
|
-
error
|
|
384
|
-
);
|
|
385
|
-
});
|
|
386
|
-
} catch (error) {
|
|
387
|
-
this.reportSafeDiagnostic(
|
|
388
|
-
'DYNTS-AS0-GLOBAL-HANDLER-THREW',
|
|
389
|
-
DyNTS_SafeDiagnosticStage_Type.globalErrorHandler,
|
|
390
|
-
error
|
|
391
|
-
);
|
|
392
|
-
}
|
|
393
|
-
}
|
|
394
|
-
|
|
395
|
-
constructor(/* extended?: boolean */){
|
|
396
|
-
super();
|
|
397
|
-
|
|
398
|
-
/* dotenv.config() */
|
|
399
|
-
|
|
400
|
-
process.on(
|
|
401
|
-
'unhandledRejection',
|
|
402
|
-
(reason: unknown): void => {
|
|
403
|
-
const diagnostic: DyNTS_SafeDiagnostic_Interface = this.reportSafeDiagnostic(
|
|
404
|
-
'DYNTS-AS0-BASE-UR',
|
|
405
|
-
DyNTS_SafeDiagnosticStage_Type.unhandledRejection,
|
|
406
|
-
reason
|
|
407
|
-
);
|
|
408
|
-
|
|
409
|
-
this.forwardSafeDiagnostic(diagnostic);
|
|
410
|
-
}
|
|
411
|
-
);
|
|
412
|
-
|
|
413
|
-
this.asyncConstruct(/* extended */).catch((error: unknown): void => {
|
|
414
|
-
const diagnostic: DyNTS_SafeDiagnostic_Interface = this.reportSafeDiagnostic(
|
|
415
|
-
'DYNTS-AS0-BOOTSTRAP-FAILED',
|
|
416
|
-
DyNTS_SafeDiagnosticStage_Type.bootstrap,
|
|
417
|
-
error
|
|
418
|
-
);
|
|
419
|
-
|
|
420
|
-
this.forwardSafeDiagnostic(diagnostic);
|
|
421
|
-
|
|
422
|
-
process.exit(1);
|
|
423
|
-
});
|
|
424
|
-
}
|
|
425
|
-
|
|
426
|
-
protected async asyncConstruct(extended?: boolean): Promise<void> {
|
|
427
|
-
if (this.fnLogs && this.deepLog) DyFM_Log.log('\nfn:. asyncConstruct');
|
|
428
|
-
|
|
429
|
-
try {
|
|
430
|
-
this.systemControls.app.init = true;
|
|
431
|
-
this._params = this.getAppParams();
|
|
432
|
-
DyFM_Log.log(
|
|
433
|
-
`\n\n\n\n\n\n\n\n\n\n` +
|
|
434
|
-
`Starting ${this._params?.name}... ` +
|
|
435
|
-
/* `v${version}` + */
|
|
436
|
-
`\n\n\n\n\n\n\n\n\n\n`
|
|
437
|
-
);
|
|
438
|
-
|
|
439
|
-
if (!this._params) {
|
|
440
|
-
throw new Error('getAppParams() must return a DyNTS_AppParams object!');
|
|
441
|
-
}
|
|
442
|
-
|
|
443
|
-
if (this.params.systemShortCodeName) {
|
|
444
|
-
DyNTS_global_settings.systemShortCodeName = this.params.systemShortCodeName;
|
|
445
|
-
}
|
|
446
|
-
|
|
447
|
-
if (this.params.systemName) {
|
|
448
|
-
DyNTS_global_settings.systemName = this.params.systemName;
|
|
449
|
-
DyFM_error_defaults.issuerSystem = this.params.systemName;
|
|
450
|
-
}
|
|
451
|
-
|
|
452
|
-
if (this.params.version) {
|
|
453
|
-
DyNTS_global_settings.systemVersion = this.params.version;
|
|
454
|
-
DyFM_error_defaults.systemVersion = this.params.version;
|
|
455
|
-
}
|
|
456
|
-
|
|
457
|
-
process.stdout.write(
|
|
458
|
-
String.fromCharCode(27) + ']0;' +
|
|
459
|
-
this._params?.name +
|
|
460
|
-
String.fromCharCode(7)
|
|
461
|
-
);
|
|
462
|
-
|
|
463
|
-
DyFM_error_defaults.issuerSystem = this._params.systemName;
|
|
464
|
-
|
|
465
|
-
this.overrideDynamoNTSGlobalSettings?.();
|
|
466
|
-
|
|
467
|
-
if (DyNTS_global_settings.log_settings.setup) {
|
|
468
|
-
DyFM_Log.S_info(`env settings;\n`, {
|
|
469
|
-
systemName: DyNTS_global_settings.systemName,
|
|
470
|
-
systemShortCodeName: DyNTS_global_settings.systemShortCodeName,
|
|
471
|
-
systemVersion: DyNTS_global_settings.systemVersion,
|
|
472
|
-
environment: DyNTS_global_settings.env_settings.environment,
|
|
473
|
-
/* log_settings: DyNTS_global_settings.log_settings,
|
|
474
|
-
env_settings: DyNTS_global_settings.env_settings, */
|
|
475
|
-
});
|
|
476
|
-
}
|
|
477
|
-
|
|
478
|
-
this.globalService = DyNTS_GlobalService.getInstance();
|
|
479
|
-
await DyNTS_GlobalService.setServices(this.getGlobalServiceCollection());
|
|
480
|
-
DyNTS_GlobalService.setParams(this.params);
|
|
481
|
-
|
|
482
|
-
if (this.getPortSettings) {
|
|
483
|
-
this._portSettings = this.getPortSettings();
|
|
484
|
-
}
|
|
485
|
-
|
|
486
|
-
if (this.getCertificationSettings) {
|
|
487
|
-
this._cert = this.getCertificationSettings();
|
|
488
|
-
}
|
|
489
|
-
|
|
490
|
-
if (this.getApiBasePath) {
|
|
491
|
-
DyNTS_global_settings.baseUrl = this.getApiBasePath();
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
if (this.getRoutingModules) {
|
|
495
|
-
this._routingModules = this.getRoutingModules();
|
|
496
|
-
|
|
497
|
-
// ezt egyelőre csak tesztelem, nem kerül be
|
|
498
|
-
/* if (
|
|
499
|
-
!DyNTS_global_settings.dontCreateDefaultRoute &&
|
|
500
|
-
!this._routingModules.some((routingModule: DyNTS_RoutingModule): boolean => routingModule.route === '/*')
|
|
501
|
-
) {
|
|
502
|
-
this._routingModules.push(
|
|
503
|
-
DyNTS_getStarRoute()
|
|
504
|
-
);
|
|
505
|
-
} */
|
|
506
|
-
}
|
|
507
|
-
|
|
508
|
-
if (this._params.dbUri) {
|
|
509
|
-
await this.startDB();
|
|
510
|
-
|
|
511
|
-
// createEntries csak akkor fut, ha a DB tényleg fel-jött.
|
|
512
|
-
// Ha a startDB jelezte a hibát, de továbbment, akkor a started flag false marad,
|
|
513
|
-
// és nem próbálunk meg írni egy nem létező kapcsolatra.
|
|
514
|
-
if (this.createEntries && this.systemControls.mongoose.started) {
|
|
515
|
-
await this.createEntries();
|
|
516
|
-
}
|
|
517
|
-
} else {
|
|
518
|
-
DyFM_Log.log(
|
|
519
|
-
`\nNo database connection created.`,
|
|
520
|
-
);
|
|
521
|
-
}
|
|
522
|
-
|
|
523
|
-
if (this._routingModules?.length) {
|
|
524
|
-
if (this.logSetup) DyFM_Log.log('\nsetting up express routes...');
|
|
525
|
-
|
|
526
|
-
this.setSecurity();
|
|
527
|
-
|
|
528
|
-
await this.initExpresses();
|
|
529
|
-
await this.startExpresses();
|
|
530
|
-
|
|
531
|
-
if (this._security !== DyNTS_RouteSecurity.secure) {
|
|
532
|
-
await this.mountOpenRoutes();
|
|
533
|
-
}
|
|
534
|
-
|
|
535
|
-
if (this._security !== DyNTS_RouteSecurity.open && this._cert) {
|
|
536
|
-
await this.mountSecureRoutes();
|
|
537
|
-
}
|
|
538
|
-
|
|
539
|
-
// Generikus, auth-agnosztikus extension-point: custom middleware az API
|
|
540
|
-
// route-ok UTÁN, de a SPA static catch-all (mountStaticClient) ELŐTT.
|
|
541
|
-
await this.mountCustomMiddleware();
|
|
542
|
-
|
|
543
|
-
await this.mountStaticClient();
|
|
544
|
-
|
|
545
|
-
if (this.logSetup) {
|
|
546
|
-
DyFM_Log.log(`\nRoutes mounted.... server using security: ${this._security}`);
|
|
547
|
-
}
|
|
548
|
-
} else {
|
|
549
|
-
DyFM_Log.warn(
|
|
550
|
-
`\nNo routes mounted!`,
|
|
551
|
-
);
|
|
552
|
-
}
|
|
553
|
-
|
|
554
|
-
if (this.getRootServices) {
|
|
555
|
-
this._rootServices = await this.getRootServices();
|
|
556
|
-
}
|
|
557
|
-
|
|
558
|
-
if (this.postProcess) {
|
|
559
|
-
await this.postProcess().catch((error: unknown): void => {
|
|
560
|
-
const diagnostic: DyNTS_SafeDiagnostic_Interface = this.reportSafeDiagnostic(
|
|
561
|
-
'DYNTS-AS0-POST-PROCESS-FAILED',
|
|
562
|
-
DyNTS_SafeDiagnosticStage_Type.postProcess,
|
|
563
|
-
error
|
|
564
|
-
);
|
|
565
|
-
|
|
566
|
-
this.forwardSafeDiagnostic(diagnostic);
|
|
567
|
-
});
|
|
568
|
-
}
|
|
569
|
-
|
|
570
|
-
// FR-193 — bedrock OOM korai-figyelmeztetés: feltelepítjük a heap-watchdogot, ha
|
|
571
|
-
// engedélyezve (DyNTS_global_settings.memoryGuard.enabled, default true). Biztonságos:
|
|
572
|
-
// a guard egy könnyű setInterval, ami SOHA nem dob; csak near-OOM küszöböknél hagy
|
|
573
|
-
// tartós nyomot az error-sinkbe, mielőtt a fatal heap-OOM megölné a process-t.
|
|
574
|
-
try {
|
|
575
|
-
if (DyNTS_global_settings.memoryGuard?.enabled) {
|
|
576
|
-
DyNTS_MemoryGuard.getInstance().install();
|
|
577
|
-
}
|
|
578
|
-
} catch (memoryGuardError: unknown) {
|
|
579
|
-
this.reportSafeDiagnostic(
|
|
580
|
-
'DYNTS-AS0-MEMORY-GUARD-SKIPPED',
|
|
581
|
-
DyNTS_SafeDiagnosticStage_Type.memoryGuard,
|
|
582
|
-
memoryGuardError
|
|
583
|
-
);
|
|
584
|
-
}
|
|
585
|
-
|
|
586
|
-
// BFR-OVERSEER-007 — event-loop-lag diag a MemoryGuard MELLÉ: a „process él, HTTP néma" wedge
|
|
587
|
-
// belső mérése (natív histogram, olcsó). Observation-only, sosem dob; a /server/diag olvas belőle.
|
|
588
|
-
try {
|
|
589
|
-
DyNTS_EventLoopDiag.getInstance().install();
|
|
590
|
-
} catch (eventLoopDiagError: unknown) {
|
|
591
|
-
this.reportSafeDiagnostic(
|
|
592
|
-
'DYNTS-AS0-EVENT-LOOP-DIAG-SKIPPED',
|
|
593
|
-
DyNTS_SafeDiagnosticStage_Type.eventLoopDiagnostic,
|
|
594
|
-
eventLoopDiagError
|
|
595
|
-
);
|
|
596
|
-
}
|
|
597
|
-
|
|
598
|
-
// FR-258 / SR-4 — proactive collection-growth monitor (companion to the MemoryGuard). Warns
|
|
599
|
-
// into the Errors-sink when a collection grows unbounded, BEFORE it can be loaded into heap and
|
|
600
|
-
// OOM. Default-on, observation-only, never throws.
|
|
601
|
-
try {
|
|
602
|
-
if (DyNTS_global_settings.collectionGrowthMonitor?.enabled) {
|
|
603
|
-
DyNTS_CollectionGrowthMonitor.getInstance().install();
|
|
604
|
-
}
|
|
605
|
-
} catch (cgmError: unknown) {
|
|
606
|
-
this.reportSafeDiagnostic(
|
|
607
|
-
'DYNTS-AS0-COLLECTION-GROWTH-MONITOR-SKIPPED',
|
|
608
|
-
DyNTS_SafeDiagnosticStage_Type.collectionGrowthMonitor,
|
|
609
|
-
cgmError
|
|
610
|
-
);
|
|
611
|
-
}
|
|
612
|
-
|
|
613
|
-
if (!extended) {
|
|
614
|
-
await this.ready();
|
|
615
|
-
|
|
616
|
-
if (this.params.title) {
|
|
617
|
-
DyFM_Log.success(this.params.title);
|
|
618
|
-
}
|
|
619
|
-
DyFM_Log.info(`Version: ${this.params.version}`);
|
|
620
|
-
/* DyFM_Log.info(`NTS Version: ${this.ntsVersion}`); */
|
|
621
|
-
DyFM_Log.H_success(`${this.params.name} started successfully.`);
|
|
622
|
-
}
|
|
623
|
-
} catch (error) {
|
|
624
|
-
this.constructErrors.push(error);
|
|
625
|
-
|
|
626
|
-
throw new DyFM_Error({
|
|
627
|
-
...this._getDefaultErrorSettings('asyncConstruct', error),
|
|
628
|
-
|
|
629
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-001`,
|
|
630
|
-
additionalContent: {
|
|
631
|
-
constructErrors: this.constructErrors,
|
|
632
|
-
systemControls: this.systemControls,
|
|
633
|
-
systemReadies: {
|
|
634
|
-
app: this.systemControls.app.getIsReady(),
|
|
635
|
-
mongoose: this.systemControls.mongoose.getIsReady(),
|
|
636
|
-
httpServer: this.systemControls.httpServer.getIsReady(),
|
|
637
|
-
httpsServer: this.systemControls.httpsServer.getIsReady(),
|
|
638
|
-
},
|
|
639
|
-
},
|
|
640
|
-
});
|
|
641
|
-
}
|
|
642
|
-
}
|
|
643
|
-
|
|
644
|
-
async ready(timeout: number = this.defaultReadyTimeout): Promise<void> {
|
|
645
|
-
try {
|
|
646
|
-
if (this.fnLogs) DyFM_Log.log('\nfn:. ready');
|
|
647
|
-
|
|
648
|
-
await DyFM_Async.delay(100);
|
|
649
|
-
|
|
650
|
-
let ready: boolean = false;
|
|
651
|
-
const start: number = +new Date();
|
|
652
|
-
|
|
653
|
-
if (this.constructErrors.length) {
|
|
654
|
-
this.reportSafeDiagnostic(
|
|
655
|
-
'DYNTS-AS0-READINESS-CONSTRUCT-ERROR',
|
|
656
|
-
DyNTS_SafeDiagnosticStage_Type.readiness,
|
|
657
|
-
this.constructErrors[0]
|
|
658
|
-
);
|
|
659
|
-
|
|
660
|
-
throw new DyFM_Error({
|
|
661
|
-
...this._getDefaultErrorSettings(
|
|
662
|
-
'ready',
|
|
663
|
-
new Error(`"${this._params.name}" start failed.`)
|
|
664
|
-
),
|
|
665
|
-
|
|
666
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-R01`,
|
|
667
|
-
additionalContent:
|
|
668
|
-
this.constructErrors.length === 1 ?
|
|
669
|
-
{ error: this.constructErrors[0] } :
|
|
670
|
-
{ errors: this.constructErrors },
|
|
671
|
-
});
|
|
672
|
-
}
|
|
673
|
-
|
|
674
|
-
while (!ready && +new Date() - start < timeout) {
|
|
675
|
-
if (this.systemControls.app.init) {
|
|
676
|
-
ready = (
|
|
677
|
-
this.systemControls.mongoose.getIsReady() &&
|
|
678
|
-
this.systemControls.httpServer.getIsReady() &&
|
|
679
|
-
this.systemControls.httpsServer.getIsReady()
|
|
680
|
-
);
|
|
681
|
-
}
|
|
682
|
-
|
|
683
|
-
if (!ready) {
|
|
684
|
-
await DyFM_Async.wait(100);
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
if (timeout < +new Date() - start) {
|
|
689
|
-
this.reportSafeDiagnostic(
|
|
690
|
-
'DYNTS-AS0-READINESS-TIMEOUT',
|
|
691
|
-
DyNTS_SafeDiagnosticStage_Type.readiness,
|
|
692
|
-
this.constructErrors[0] ?? new Error('readiness-timeout')
|
|
693
|
-
);
|
|
694
|
-
|
|
695
|
-
throw new DyFM_Error({
|
|
696
|
-
...this._getDefaultErrorSettings(
|
|
697
|
-
'ready',
|
|
698
|
-
new Error(`"${this._params.name}" start failed. TIMEOUT`)
|
|
699
|
-
),
|
|
700
|
-
|
|
701
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-R02`,
|
|
702
|
-
additionalContent: {
|
|
703
|
-
constructErrors: this.constructErrors,
|
|
704
|
-
systemControls: this.systemControls,
|
|
705
|
-
systemReadies: {
|
|
706
|
-
mongoose: this.systemControls.mongoose.getIsReady(),
|
|
707
|
-
httpServer: this.systemControls.httpServer.getIsReady(),
|
|
708
|
-
httpsServer: this.systemControls.httpsServer.getIsReady(),
|
|
709
|
-
},
|
|
710
|
-
},
|
|
711
|
-
});
|
|
712
|
-
}
|
|
713
|
-
|
|
714
|
-
if (this.constructErrors.length) {
|
|
715
|
-
this.reportSafeDiagnostic(
|
|
716
|
-
'DYNTS-AS0-READINESS-LATE-CONSTRUCT-ERROR',
|
|
717
|
-
DyNTS_SafeDiagnosticStage_Type.readiness,
|
|
718
|
-
this.constructErrors[0]
|
|
719
|
-
);
|
|
720
|
-
|
|
721
|
-
throw new DyFM_Error({
|
|
722
|
-
...this._getDefaultErrorSettings(
|
|
723
|
-
'ready',
|
|
724
|
-
new Error(`"${this._params.name}" start failed.`)
|
|
725
|
-
),
|
|
726
|
-
|
|
727
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-R03`,
|
|
728
|
-
additionalContent: this.constructErrors,
|
|
729
|
-
});
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
if (ready) {
|
|
733
|
-
this.systemControls.app.started = true;
|
|
734
|
-
|
|
735
|
-
if (this.fnLogs && this.deepLog) DyFM_Log.log('\nfn:. ready: return');
|
|
736
|
-
|
|
737
|
-
return;
|
|
738
|
-
}
|
|
739
|
-
|
|
740
|
-
this.systemControls.app.started = false;
|
|
741
|
-
|
|
742
|
-
let msg: string = `"${this._params.name}" start failed. UNKNOWN`;
|
|
743
|
-
|
|
744
|
-
if (this.systemControls.mongoose.init && !this.systemControls.mongoose.started) {
|
|
745
|
-
msg += `\nMongoose start failed.`;
|
|
746
|
-
}
|
|
747
|
-
|
|
748
|
-
if (this.systemControls.httpServer.init && !this.systemControls.httpServer.started) {
|
|
749
|
-
msg += `\nHTTP Server start failed.`;
|
|
750
|
-
}
|
|
751
|
-
|
|
752
|
-
if (this.systemControls.httpsServer.init && !this.systemControls.httpsServer.started) {
|
|
753
|
-
msg += `\nHTTPS Server start failed.`;
|
|
754
|
-
}
|
|
755
|
-
|
|
756
|
-
this.reportSafeDiagnostic(
|
|
757
|
-
'DYNTS-AS0-READINESS-UNKNOWN',
|
|
758
|
-
DyNTS_SafeDiagnosticStage_Type.readiness,
|
|
759
|
-
this.constructErrors[0] ?? new Error('readiness-unknown')
|
|
760
|
-
);
|
|
761
|
-
|
|
762
|
-
throw new DyFM_Error({
|
|
763
|
-
...this._getDefaultErrorSettings('ready', new Error(msg)),
|
|
764
|
-
|
|
765
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-R04`,
|
|
766
|
-
additionalContent: {
|
|
767
|
-
constructErrors: this.constructErrors,
|
|
768
|
-
systemControls: this.systemControls,
|
|
769
|
-
systemReadies: {
|
|
770
|
-
app: this.systemControls.app.getIsReady(),
|
|
771
|
-
mongoose: this.systemControls.mongoose.getIsReady(),
|
|
772
|
-
httpServer: this.systemControls.httpServer.getIsReady(),
|
|
773
|
-
httpsServer: this.systemControls.httpsServer.getIsReady(),
|
|
774
|
-
},
|
|
775
|
-
},
|
|
776
|
-
error: this.constructErrors?.[0] ?? new Error(),
|
|
777
|
-
});
|
|
778
|
-
} catch (error) {
|
|
779
|
-
throw new DyFM_Error({
|
|
780
|
-
...this._getDefaultErrorSettings('ready', error),
|
|
781
|
-
|
|
782
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-READY0`,
|
|
783
|
-
});
|
|
784
|
-
}
|
|
785
|
-
}
|
|
786
|
-
|
|
787
|
-
protected getSimplifiedConstructErrors(): string[] {
|
|
788
|
-
return this.constructErrors.map((error: any): any => {
|
|
789
|
-
if (error instanceof DyFM_Error) {
|
|
790
|
-
return error.getErrorSimplified();
|
|
791
|
-
} else {
|
|
792
|
-
return error;
|
|
793
|
-
}
|
|
794
|
-
});
|
|
795
|
-
}
|
|
796
|
-
|
|
797
|
-
async stop(dontLog?: boolean): Promise<void> {
|
|
798
|
-
try {
|
|
799
|
-
DyFM_Log.info('\nstopping server...\n');
|
|
800
|
-
|
|
801
|
-
await this.ready();
|
|
802
|
-
|
|
803
|
-
if (this.started) {
|
|
804
|
-
|
|
805
|
-
if (this.systemControls.mongoose.init) {
|
|
806
|
-
DyFM_Log.info(`\nstopping Mongoose....`);
|
|
807
|
-
|
|
808
|
-
let tryCount: number = 0;
|
|
809
|
-
|
|
810
|
-
while (
|
|
811
|
-
!this.systemControls.mongoose.started &&
|
|
812
|
-
!this.constructErrors.length &&
|
|
813
|
-
tryCount++ < 10
|
|
814
|
-
) {
|
|
815
|
-
DyFM_Log.warn(`Mongoose not even started yet....`);
|
|
816
|
-
await DyFM_Async.wait(second);
|
|
817
|
-
}
|
|
818
|
-
this.systemControls.mongoose.started = false;
|
|
819
|
-
|
|
820
|
-
if (this.mongoose) {
|
|
821
|
-
await DyFM_Array.asyncForEach(
|
|
822
|
-
Object.keys(this.mongoose.models),
|
|
823
|
-
async (modelName): Promise<void> => {
|
|
824
|
-
this.mongoose.deleteModel(modelName);
|
|
825
|
-
}
|
|
826
|
-
);
|
|
827
|
-
|
|
828
|
-
const disconnect: Promise<void> = new Promise((resolve): void => {
|
|
829
|
-
this.mongoose.connection.on('disconnecting', (): void => {
|
|
830
|
-
resolve();
|
|
831
|
-
});
|
|
832
|
-
});
|
|
833
|
-
|
|
834
|
-
await this.mongoose.disconnect();
|
|
835
|
-
await this.mongoose.connection.close();
|
|
836
|
-
await disconnect;
|
|
837
|
-
|
|
838
|
-
this.mongoose.connection.removeAllListeners();
|
|
839
|
-
|
|
840
|
-
while (
|
|
841
|
-
this.mongoose.connection.readyState !== 0 &&
|
|
842
|
-
!this.constructErrors.length
|
|
843
|
-
) {
|
|
844
|
-
DyFM_Log.warn(`\nMongoose still not disconnected....`);
|
|
845
|
-
await DyFM_Async.wait(second);
|
|
846
|
-
}
|
|
847
|
-
} else {
|
|
848
|
-
DyFM_Log.error(`\nMongoose not found.`);
|
|
849
|
-
}
|
|
850
|
-
this.systemControls.mongoose.init = false;
|
|
851
|
-
}
|
|
852
|
-
|
|
853
|
-
if (this.systemControls.httpServer.init) {
|
|
854
|
-
this.systemControls.httpServer.started = false;
|
|
855
|
-
|
|
856
|
-
if (this.httpServer) {
|
|
857
|
-
await new Promise((resolve): void => {
|
|
858
|
-
this.httpServer.close(resolve);
|
|
859
|
-
});
|
|
860
|
-
} else {
|
|
861
|
-
DyFM_Log.error(`\nHTTP Server not found.`);
|
|
862
|
-
}
|
|
863
|
-
this.systemControls.httpServer.init = false;
|
|
864
|
-
}
|
|
865
|
-
|
|
866
|
-
if (this.systemControls.httpsServer.init) {
|
|
867
|
-
this.systemControls.httpsServer.started = false;
|
|
868
|
-
|
|
869
|
-
if (this.httpsServer) {
|
|
870
|
-
await new Promise((resolve): void => {
|
|
871
|
-
this.httpsServer.close(resolve);
|
|
872
|
-
});
|
|
873
|
-
} else {
|
|
874
|
-
DyFM_Log.error(`\nHTTPS Server not found.`);
|
|
875
|
-
}
|
|
876
|
-
this.systemControls.httpsServer.init = false;
|
|
877
|
-
}
|
|
878
|
-
|
|
879
|
-
await DyFM_Async.wait(second);
|
|
880
|
-
|
|
881
|
-
if (!dontLog) {
|
|
882
|
-
DyFM_Log.H_log(`"${this._params.name}" stopped successfully.`);
|
|
883
|
-
}
|
|
884
|
-
}
|
|
885
|
-
} catch (error) {
|
|
886
|
-
throw new DyFM_Error({
|
|
887
|
-
...this._getDefaultErrorSettings('stop', error),
|
|
888
|
-
|
|
889
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-STOP0`,
|
|
890
|
-
});
|
|
891
|
-
}
|
|
892
|
-
}
|
|
893
|
-
|
|
894
|
-
/**
|
|
895
|
-
*
|
|
896
|
-
*/
|
|
897
|
-
private async startDB(): Promise<void> {
|
|
898
|
-
if (this.fnLogs && this.deepLog) DyFM_Log.log('\nfn:. startDB');
|
|
899
|
-
else if (this.logSetup) DyFM_Log.log('\nstarting DB connection...');
|
|
900
|
-
|
|
901
|
-
if (!this._params.dbUri) {
|
|
902
|
-
throw new DyFM_Error({
|
|
903
|
-
...this._getDefaultErrorSettings('startDB', new Error('DB URI is not set.')),
|
|
904
|
-
|
|
905
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-SDB0`,
|
|
906
|
-
});
|
|
907
|
-
}
|
|
908
|
-
|
|
909
|
-
if (!this._params.dbOptions) {
|
|
910
|
-
throw new DyFM_Error({
|
|
911
|
-
...this._getDefaultErrorSettings('startDB', new Error('DB OPTIONS are not set.')),
|
|
912
|
-
|
|
913
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-SDB0`,
|
|
914
|
-
});
|
|
915
|
-
}
|
|
916
|
-
|
|
917
|
-
if (this.systemControls.mongoose.init || this.systemControls.mongoose.started) {
|
|
918
|
-
throw new DyFM_Error({
|
|
919
|
-
...this._getDefaultErrorSettings('startDB', new Error('Mongoose is already initialized.')),
|
|
920
|
-
|
|
921
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-SDB0`,
|
|
922
|
-
});
|
|
923
|
-
}
|
|
924
|
-
|
|
925
|
-
try {
|
|
926
|
-
await new Promise<void>(
|
|
927
|
-
(resolve, reject): void => {
|
|
928
|
-
this.systemControls.mongoose.init = true;
|
|
929
|
-
|
|
930
|
-
this.mongoose.connection
|
|
931
|
-
.once('open', (): void => {
|
|
932
|
-
this.systemControls.mongoose.started = true;
|
|
933
|
-
DyFM_Log.success('\nConnected to MongoDB.\n');
|
|
934
|
-
|
|
935
|
-
resolve();
|
|
936
|
-
|
|
937
|
-
// FR-258 / SR-2 — install declared-retention TTL indexes. DEFERRED + fire-and-forget +
|
|
938
|
-
// fully non-fatal: a create-if-missing index op (and the `indexes()` probes) must NOT
|
|
939
|
-
// compete with boot-readiness. We delay it well past the deploy health-probe window so a
|
|
940
|
-
// cold boot is never slowed by it, then run it detached. `.unref()` keeps it from holding
|
|
941
|
-
// the event loop open. Any failure is logged but never crashes the app. (`'differs'` never
|
|
942
|
-
// rebuilds a live index — see ensureRetentionTtlIndex.)
|
|
943
|
-
const ttlInstallTimer: ReturnType<typeof setTimeout> = setTimeout((): void => {
|
|
944
|
-
void this.installRetentionTtlIndexes();
|
|
945
|
-
}, 30000);
|
|
946
|
-
if (typeof ttlInstallTimer.unref === 'function') { ttlInstallTimer.unref(); }
|
|
947
|
-
})
|
|
948
|
-
.on('error', (error): void => {
|
|
949
|
-
if (!this.systemControls.mongoose.started) {
|
|
950
|
-
// Initial DB-csatlakozás sikertelen:
|
|
951
|
-
// jelezzük a hibát (log + globalErrorHandler), de NEM szakítjuk meg az
|
|
952
|
-
// App startup-ot (nincs constructErrors push, nincs reject).
|
|
953
|
-
// A mongoose.init-et resetteljük, hogy a ready() ne várjon a DB-re.
|
|
954
|
-
// Ha a mongoose később mégis tudna csatlakozni, az 'open' event
|
|
955
|
-
// beállítja a started flag-et, így a runtime DB-műveletek elindulnak.
|
|
956
|
-
this.systemControls.mongoose.init = false;
|
|
957
|
-
|
|
958
|
-
const diagnostic: DyNTS_SafeDiagnostic_Interface = this.reportSafeDiagnostic(
|
|
959
|
-
'DYNTS-AS0-SDB1',
|
|
960
|
-
DyNTS_SafeDiagnosticStage_Type.databaseConnect,
|
|
961
|
-
error,
|
|
962
|
-
503
|
|
963
|
-
);
|
|
964
|
-
|
|
965
|
-
this.forwardSafeDiagnostic(diagnostic);
|
|
966
|
-
|
|
967
|
-
resolve();
|
|
968
|
-
|
|
969
|
-
} else {
|
|
970
|
-
const diagnostic: DyNTS_SafeDiagnostic_Interface = this.reportSafeDiagnostic(
|
|
971
|
-
'DYNTS-AS0-SDB2',
|
|
972
|
-
DyNTS_SafeDiagnosticStage_Type.databaseRuntime,
|
|
973
|
-
error,
|
|
974
|
-
503
|
|
975
|
-
);
|
|
976
|
-
|
|
977
|
-
this.forwardSafeDiagnostic(diagnostic);
|
|
978
|
-
}
|
|
979
|
-
});
|
|
980
|
-
|
|
981
|
-
try {
|
|
982
|
-
this.mongoose.connect(
|
|
983
|
-
this._params.dbUri,
|
|
984
|
-
this._params.dbOptions
|
|
985
|
-
/* {
|
|
986
|
-
directConnection: true,
|
|
987
|
-
} */
|
|
988
|
-
);
|
|
989
|
-
} catch (error) {
|
|
990
|
-
throw new DyFM_Error({
|
|
991
|
-
...this._getDefaultErrorSettings('startDB', error),
|
|
992
|
-
|
|
993
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-SDB3`,
|
|
994
|
-
});
|
|
995
|
-
}
|
|
996
|
-
}
|
|
997
|
-
);
|
|
998
|
-
} catch (error) {
|
|
999
|
-
throw new DyFM_Error({
|
|
1000
|
-
...this._getDefaultErrorSettings('startDB', error),
|
|
1001
|
-
|
|
1002
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-SDB0`,
|
|
1003
|
-
});
|
|
1004
|
-
}
|
|
1005
|
-
|
|
1006
|
-
// 2026-06-20 — Mongo reconnect-guard. A MongoDB-driver a hostnevet connect-kor EGYSZER
|
|
1007
|
-
// resolválja + cache-eli az IP-t; ha a Mongo-konténert recreate-elik (új docker-network IP),
|
|
1008
|
-
// a driver a HALOTT IP-n ragad → ECONNREFUSED + buffering-timeout, és a service magától SOHA
|
|
1009
|
-
// nem áll vissza. A guard sustained-disconnect (readyState !== 1) esetén — a driver saját
|
|
1010
|
-
// grace-e UTÁN — TELJES disconnect()+connect()-et csinál → ÚJ MongoClient → ÚJ DNS-resolve →
|
|
1011
|
-
// új IP → reconnect. Best-effort, always-on, healthy connection-t (===1) SOHA nem bánt; csak
|
|
1012
|
-
// konténer-IP-frissítés, nem ír adatot. Lásd: mongo-reconnect-guard.util.ts.
|
|
1013
|
-
try {
|
|
1014
|
-
startMongoReconnectGuard({
|
|
1015
|
-
getReadyState: (): number => this.mongoose.connection.readyState,
|
|
1016
|
-
reconnect: async (): Promise<void> => {
|
|
1017
|
-
await this.mongoose.disconnect().catch((): void => undefined);
|
|
1018
|
-
await this.mongoose.connect(this._params.dbUri, this._params.dbOptions);
|
|
1019
|
-
},
|
|
1020
|
-
log: (msg: string): void => {
|
|
1021
|
-
this.reportSafeDiagnostic(
|
|
1022
|
-
'DYNTS-AS0-MONGO-RECONNECT-EVENT',
|
|
1023
|
-
DyNTS_SafeDiagnosticStage_Type.mongoReconnectGuard,
|
|
1024
|
-
msg,
|
|
1025
|
-
503
|
|
1026
|
-
);
|
|
1027
|
-
},
|
|
1028
|
-
});
|
|
1029
|
-
} catch (guardErr) {
|
|
1030
|
-
this.reportSafeDiagnostic(
|
|
1031
|
-
'DYNTS-AS0-MONGO-RECONNECT-FAILED',
|
|
1032
|
-
DyNTS_SafeDiagnosticStage_Type.mongoReconnectGuard,
|
|
1033
|
-
guardErr,
|
|
1034
|
-
503
|
|
1035
|
-
);
|
|
1036
|
-
}
|
|
1037
|
-
}
|
|
1038
|
-
|
|
1039
|
-
/**
|
|
1040
|
-
* FR-258 / SR-2 — install MongoDB TTL indexes for every data-model that declared `retention`.
|
|
1041
|
-
*
|
|
1042
|
-
* Runs ONCE right after the DB connection opens. For each registered DB service (including the
|
|
1043
|
-
* auto-created `_archived` siblings, which inherit the parent model's `retention`), it ensures a
|
|
1044
|
-
* TTL index on the `__created` Date field with the resolved `expireAfterSeconds` — so MongoDB
|
|
1045
|
-
* NATIVELY auto-deletes documents older than the configured age. This is the fleet-wide defense
|
|
1046
|
-
* against the unbounded-collection-growth → in-memory-load → GC-thrash/OOM class.
|
|
1047
|
-
*
|
|
1048
|
-
* Guarantees:
|
|
1049
|
-
* - **Non-fatal** — any error is logged but NEVER blocks startup (called fire-and-forget).
|
|
1050
|
-
* - **Idempotent** — an existing index with the same TTL is a no-op; a CHANGED retention (different
|
|
1051
|
-
* `expireAfterSeconds`, or an existing non-TTL `__created` index) is reconciled by drop+recreate
|
|
1052
|
-
* (the field index is restored immediately, so query coverage is preserved).
|
|
1053
|
-
*/
|
|
1054
|
-
private async installRetentionTtlIndexes(): Promise<void> {
|
|
1055
|
-
try {
|
|
1056
|
-
const services: DyNTS_DBService<any>[] = DyNTS_GlobalService.getAllDBServices();
|
|
1057
|
-
let ensured: number = 0;
|
|
1058
|
-
|
|
1059
|
-
for (const service of services) {
|
|
1060
|
-
const ttlSeconds: number | undefined = DyFM_resolveRetentionTtlSeconds(service?.dataParams?.retention);
|
|
1061
|
-
if (!ttlSeconds) { continue; }
|
|
1062
|
-
|
|
1063
|
-
const dataName: string = service.dataParams.dataName;
|
|
1064
|
-
// The mongoose Model exposes the native driver collection (.indexes / .createIndex / .dropIndex).
|
|
1065
|
-
const collection: DyNTS_TtlIndexCollection | undefined =
|
|
1066
|
-
(service?.dataModel as unknown as { collection?: DyNTS_TtlIndexCollection })?.collection;
|
|
1067
|
-
if (!collection || typeof collection.createIndex !== 'function') { continue; }
|
|
1068
|
-
|
|
1069
|
-
try {
|
|
1070
|
-
const action: DyNTS_TtlIndexAction = await DyNTS_App.ensureRetentionTtlIndex(collection, ttlSeconds);
|
|
1071
|
-
if (action === 'created') {
|
|
1072
|
-
ensured++;
|
|
1073
|
-
if (this.logSetup) {
|
|
1074
|
-
DyFM_Log.success(
|
|
1075
|
-
`[FR-258 retention] TTL index created on "${dataName}" — ` +
|
|
1076
|
-
`${Math.round(ttlSeconds / 86400)}d (${ttlSeconds}s)`,
|
|
1077
|
-
);
|
|
1078
|
-
}
|
|
1079
|
-
} else if (action === 'differs') {
|
|
1080
|
-
// Live index has a different TTL — left untouched at boot (see ensureRetentionTtlIndex doc).
|
|
1081
|
-
this.reportSafeDiagnostic(
|
|
1082
|
-
'DYNTS-AS0-RETENTION-INDEX-DIFFERS',
|
|
1083
|
-
DyNTS_SafeDiagnosticStage_Type.retention,
|
|
1084
|
-
new Error('retention-index-differs')
|
|
1085
|
-
);
|
|
1086
|
-
}
|
|
1087
|
-
} catch (idxErr: unknown) {
|
|
1088
|
-
this.reportSafeDiagnostic(
|
|
1089
|
-
'DYNTS-AS0-RETENTION-INDEX-FAILED',
|
|
1090
|
-
DyNTS_SafeDiagnosticStage_Type.retention,
|
|
1091
|
-
idxErr
|
|
1092
|
-
);
|
|
1093
|
-
}
|
|
1094
|
-
}
|
|
1095
|
-
|
|
1096
|
-
if (ensured > 0) {
|
|
1097
|
-
DyFM_Log.success(`[FR-258 retention] ${ensured} TTL index(es) ensured (auto-retention active).`);
|
|
1098
|
-
}
|
|
1099
|
-
} catch (err: unknown) {
|
|
1100
|
-
this.reportSafeDiagnostic(
|
|
1101
|
-
'DYNTS-AS0-RETENTION-INSTALLER-FAILED',
|
|
1102
|
-
DyNTS_SafeDiagnosticStage_Type.retention,
|
|
1103
|
-
err
|
|
1104
|
-
);
|
|
1105
|
-
}
|
|
1106
|
-
}
|
|
1107
|
-
|
|
1108
|
-
/**
|
|
1109
|
-
* FR-258 / SR-2 — ensure a single `{ __created: 1 }` TTL index with the given `expireAfterSeconds`.
|
|
1110
|
-
* Extracted as a pure-ish static so it is unit-testable with a mock collection. Idempotent + BOOT-SAFE:
|
|
1111
|
-
* - no existing `__created` index → create it → `'created'`
|
|
1112
|
-
* - existing with the SAME TTL → no-op → `'noop'`
|
|
1113
|
-
* - existing with a DIFFERENT TTL / non-TTL → leave it as-is → `'differs'` (warn only — NO drop+recreate)
|
|
1114
|
-
*
|
|
1115
|
-
* The `'differs'` case intentionally does NOT mutate the live index. Dropping + recreating a TTL index on a
|
|
1116
|
-
* large (multi-GB) production collection is a heavy server-side operation; doing it automatically inside the
|
|
1117
|
-
* startup path can starve the concurrent boot queries (including the deploy health-probe) and trigger a
|
|
1118
|
-
* fail-safe revert. Create-if-missing is the essential growth-prevention behaviour; a deliberate retention
|
|
1119
|
-
* CHANGE on an already-indexed collection is a maintenance action, not a silent every-boot rebuild.
|
|
1120
|
-
*/
|
|
1121
|
-
static async ensureRetentionTtlIndex(
|
|
1122
|
-
collection: DyNTS_TtlIndexCollection,
|
|
1123
|
-
ttlSeconds: number,
|
|
1124
|
-
): Promise<DyNTS_TtlIndexAction> {
|
|
1125
|
-
const existingList: DyNTS_TtlIndexInfo[] = typeof collection.indexes === 'function'
|
|
1126
|
-
? await collection.indexes().catch((): DyNTS_TtlIndexInfo[] => [])
|
|
1127
|
-
: [];
|
|
1128
|
-
const existing: DyNTS_TtlIndexInfo | undefined =
|
|
1129
|
-
existingList.find((ix): boolean => !!ix?.key && ix.key.__created === 1);
|
|
1130
|
-
|
|
1131
|
-
if (!existing) {
|
|
1132
|
-
await collection.createIndex({ __created: 1 }, { expireAfterSeconds: ttlSeconds });
|
|
1133
|
-
return 'created';
|
|
1134
|
-
}
|
|
1135
|
-
if (existing.expireAfterSeconds === ttlSeconds) {
|
|
1136
|
-
return 'noop';
|
|
1137
|
-
}
|
|
1138
|
-
// Retention differs from the live index (or it is a non-TTL `__created` index). Leave it UNTOUCHED at
|
|
1139
|
-
// boot — only report it. Avoids a heavy drop+recreate competing with boot-readiness on a large collection.
|
|
1140
|
-
return 'differs';
|
|
1141
|
-
}
|
|
1142
|
-
|
|
1143
|
-
/**
|
|
1144
|
-
*
|
|
1145
|
-
*/
|
|
1146
|
-
private async initExpresses(): Promise<void> {
|
|
1147
|
-
if (this.fnLogs && this.deepLog) DyFM_Log.log('\nfn:. initExpresses');
|
|
1148
|
-
|
|
1149
|
-
try {
|
|
1150
|
-
if (this._security && this._security !== DyNTS_RouteSecurity.secure) {
|
|
1151
|
-
if (this._portSettings.httpPort === undefined || this._portSettings.httpPort === null) {
|
|
1152
|
-
let errorMsg: string =
|
|
1153
|
-
`\nYou have open routes, but httpPort is not set!` +
|
|
1154
|
-
`\nThere are ${this._routingModules.filter(
|
|
1155
|
-
m => m.security != DyNTS_RouteSecurity.secure
|
|
1156
|
-
).length} open/both routes` +
|
|
1157
|
-
`\nroot security: ${this._security}` +
|
|
1158
|
-
`\nset httpPort in DynamoBEServer - setupRoutingModules() to enable secure routes.`;
|
|
1159
|
-
|
|
1160
|
-
errorMsg += '\n\nThe routes setted to use open server:';
|
|
1161
|
-
this._routingModules.forEach((module: DyNTS_RoutingModule): void => {
|
|
1162
|
-
if (module.security != DyNTS_RouteSecurity.secure) {
|
|
1163
|
-
errorMsg += `\n ${module.route} (security: ${module.security})`;
|
|
1164
|
-
errorMsg += `\n subroutes using open sever:`;
|
|
1165
|
-
module.endpoints.forEach((endpoint: DyNTS_Endpoint_Params): void => {
|
|
1166
|
-
if (endpoint.security != DyNTS_RouteSecurity.secure) {
|
|
1167
|
-
errorMsg += `\n ${endpoint.endpoint} (security: ${endpoint.security})`;
|
|
1168
|
-
}
|
|
1169
|
-
});
|
|
1170
|
-
}
|
|
1171
|
-
});
|
|
1172
|
-
|
|
1173
|
-
const error = new Error(`Open routes cannot be established!\n${errorMsg}`);
|
|
1174
|
-
const errorStack: string[] = error.stack.split('\n');
|
|
1175
|
-
|
|
1176
|
-
errorStack.splice(1, 2);
|
|
1177
|
-
error.stack = errorStack.join('\n');
|
|
1178
|
-
|
|
1179
|
-
this.reportSafeDiagnostic(
|
|
1180
|
-
'DYNTS-AS0-OPEN-ROUTE-CONFIGURATION',
|
|
1181
|
-
DyNTS_SafeDiagnosticStage_Type.routing,
|
|
1182
|
-
error
|
|
1183
|
-
);
|
|
1184
|
-
|
|
1185
|
-
throw error;
|
|
1186
|
-
}
|
|
1187
|
-
|
|
1188
|
-
await this.initOpenExpress();
|
|
1189
|
-
}
|
|
1190
|
-
|
|
1191
|
-
if (this._security && this._security !== DyNTS_RouteSecurity.open) {
|
|
1192
|
-
if (!this._cert || !this._portSettings.httpsPort) {
|
|
1193
|
-
let errorMsg: string =
|
|
1194
|
-
`\nYou have secure routes, but the certification paths or httpsPort are not set!` +
|
|
1195
|
-
`\nThere are ${this._routingModules.filter(
|
|
1196
|
-
m => m.security && m.security !== DyNTS_RouteSecurity.open
|
|
1197
|
-
).length} secure routes` +
|
|
1198
|
-
`\nroot security: ${this._security}` +
|
|
1199
|
-
`\nset...` +
|
|
1200
|
-
`\n(missing exact howto...)` +
|
|
1201
|
-
/* `\n httpsPort and` +
|
|
1202
|
-
`\n cert: {` +
|
|
1203
|
-
`\n keyPath: FileSystem.PathLike,` +
|
|
1204
|
-
`\n certPath: FileSystem.PathLike,` +
|
|
1205
|
-
`\n }` + */
|
|
1206
|
-
`\nin DynamoBEServer - getRoutingModules() to enable secure routes.`;
|
|
1207
|
-
|
|
1208
|
-
errorMsg += '\n\nThe routes setted to use secure server:';
|
|
1209
|
-
this._routingModules.forEach((module: DyNTS_RoutingModule): void => {
|
|
1210
|
-
if (module.security && module.security !== DyNTS_RouteSecurity.open) {
|
|
1211
|
-
errorMsg += `\n ${module.route} (security: ${module.security})`;
|
|
1212
|
-
errorMsg += `\n location: ${module.stackLocation}`;
|
|
1213
|
-
errorMsg += `\n subroutes using secure sever:`;
|
|
1214
|
-
module.endpoints.forEach((endpoint: DyNTS_Endpoint_Params): void => {
|
|
1215
|
-
if (endpoint.security && endpoint.security !== DyNTS_RouteSecurity.open) {
|
|
1216
|
-
errorMsg += `\n ${endpoint.endpoint} (security: ${endpoint.security})`;
|
|
1217
|
-
errorMsg += `\n location: ${endpoint.stackLocation}`;
|
|
1218
|
-
}
|
|
1219
|
-
});
|
|
1220
|
-
}
|
|
1221
|
-
});
|
|
1222
|
-
|
|
1223
|
-
const error = new Error(`Secure routes cannot be established!\n${errorMsg}`);
|
|
1224
|
-
const errorStack: string[] = error.stack.split('\n');
|
|
1225
|
-
|
|
1226
|
-
errorStack.splice(1, 2);
|
|
1227
|
-
error.stack = errorStack.join('\n');
|
|
1228
|
-
|
|
1229
|
-
this.reportSafeDiagnostic(
|
|
1230
|
-
'DYNTS-AS0-SECURE-ROUTE-CONFIGURATION',
|
|
1231
|
-
DyNTS_SafeDiagnosticStage_Type.routing,
|
|
1232
|
-
error
|
|
1233
|
-
);
|
|
1234
|
-
|
|
1235
|
-
throw error;
|
|
1236
|
-
}
|
|
1237
|
-
|
|
1238
|
-
await this.initSecureExpress();
|
|
1239
|
-
}
|
|
1240
|
-
} catch (error) {
|
|
1241
|
-
throw new DyFM_Error({
|
|
1242
|
-
...this._getDefaultErrorSettings('initExpresses', error),
|
|
1243
|
-
|
|
1244
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-IE0`,
|
|
1245
|
-
});
|
|
1246
|
-
}
|
|
1247
|
-
}
|
|
1248
|
-
|
|
1249
|
-
/**
|
|
1250
|
-
*
|
|
1251
|
-
*/
|
|
1252
|
-
protected async initOpenExpress(): Promise<void> {
|
|
1253
|
-
if (this.fnLogs) DyFM_Log.log('\nfn:. initOpenExpress');
|
|
1254
|
-
this.openExpress = Express();
|
|
1255
|
-
this.openExpress.set('maxHeaderSize', 10 * megabyte); // 1024 * 1024 * 10, // 10MB
|
|
1256
|
-
this.openExpress.use(BodyParser.urlencoded(this._portSettings.httpUrlencoded));
|
|
1257
|
-
this.openExpress.use(BodyParser.json(this._portSettings.httpJson));
|
|
1258
|
-
// BFR-011 / SEC-R2-8 — security headerek a CORS ELŐTT (az OPTIONS preflight-válaszok is kapják).
|
|
1259
|
-
this.mountSecurityHeaders(this.openExpress);
|
|
1260
|
-
// FR-041 — CORS allowlist enforcement. No-op if getCorsSettings() is not overridden.
|
|
1261
|
-
this.mountCors(this.openExpress);
|
|
1262
|
-
// FR-292 — a deployolt app-verzio minden valaszon. A CORS UTAN kell, mert az
|
|
1263
|
-
// `Access-Control-Expose-Headers`-hoz HOZZAFUZ (kulonben a CORS felulirna).
|
|
1264
|
-
this.mountAppVersionHeader(this.openExpress);
|
|
1265
|
-
// BFR-OVERSEER-009 — opt-in auto-load-shed 503 CRITICAL memória-nyomásnál (esszenciális utak kivételével).
|
|
1266
|
-
if (DyNTS_global_settings.memoryGuard?.loadShedEnabled) {
|
|
1267
|
-
this.openExpress.use(DyNTS_createLoadShedMiddleware());
|
|
1268
|
-
}
|
|
1269
|
-
}
|
|
1270
|
-
|
|
1271
|
-
/**
|
|
1272
|
-
*
|
|
1273
|
-
*/
|
|
1274
|
-
protected async initSecureExpress(): Promise<void> {
|
|
1275
|
-
if (this.fnLogs) DyFM_Log.log('\nfn:. initSecureExpress');
|
|
1276
|
-
this.secureExpress = Express();
|
|
1277
|
-
this.secureExpress.use(BodyParser.urlencoded(this._portSettings.httpsUrlencoded));
|
|
1278
|
-
this.secureExpress.use(BodyParser.json(this._portSettings.httpsJson));
|
|
1279
|
-
// BFR-011 / SEC-R2-8 — security headerek a CORS ELŐTT (mint az open expressen).
|
|
1280
|
-
this.mountSecurityHeaders(this.secureExpress);
|
|
1281
|
-
// FR-041 — CORS allowlist enforcement (same as open express).
|
|
1282
|
-
this.mountCors(this.secureExpress);
|
|
1283
|
-
// FR-292 — a deployolt app-verzio minden valaszon (mint az open expressen).
|
|
1284
|
-
this.mountAppVersionHeader(this.secureExpress);
|
|
1285
|
-
// BFR-OVERSEER-009 — opt-in auto-load-shed 503 (mint az open expressen).
|
|
1286
|
-
if (DyNTS_global_settings.memoryGuard?.loadShedEnabled) {
|
|
1287
|
-
this.secureExpress.use(DyNTS_createLoadShedMiddleware());
|
|
1288
|
-
}
|
|
1289
|
-
|
|
1290
|
-
const options = {
|
|
1291
|
-
key: FileSystem.readFileSync(this._cert.keyPath),
|
|
1292
|
-
cert: FileSystem.readFileSync(this._cert.certPath),
|
|
1293
|
-
maxHeaderSize: 10 * megabyte, // 1024 * 1024 * 10, // 10MB
|
|
1294
|
-
};
|
|
1295
|
-
|
|
1296
|
-
this.httpsServer = Https.createServer(options, this.secureExpress);
|
|
1297
|
-
}
|
|
1298
|
-
|
|
1299
|
-
/**
|
|
1300
|
-
*
|
|
1301
|
-
*/
|
|
1302
|
-
private async startExpresses(): Promise<void> {
|
|
1303
|
-
if (this.fnLogs && this.deepLog) DyFM_Log.log('\nfn:. startExpresses');
|
|
1304
|
-
|
|
1305
|
-
try {
|
|
1306
|
-
if (this._security && this._security !== DyNTS_RouteSecurity.open) {
|
|
1307
|
-
await new Promise<void>((resolve, reject): void => {
|
|
1308
|
-
this.systemControls.httpsServer.init = true;
|
|
1309
|
-
this.httpsServer
|
|
1310
|
-
.listen(
|
|
1311
|
-
this._portSettings.httpsPort,
|
|
1312
|
-
this.params.secureHost,
|
|
1313
|
-
this.params.expressBacklog,
|
|
1314
|
-
(): void => {
|
|
1315
|
-
this.systemControls.httpsServer.started = true;
|
|
1316
|
-
DyFM_Log.success(
|
|
1317
|
-
`\nHTTPS (secure) server is listening on port: ` +
|
|
1318
|
-
`${this.params.secureHost}:${this._portSettings.httpsPort}`
|
|
1319
|
-
);
|
|
1320
|
-
|
|
1321
|
-
resolve();
|
|
1322
|
-
})
|
|
1323
|
-
.on('error', (error: unknown): void => {
|
|
1324
|
-
const diagnostic: DyNTS_SafeDiagnostic_Interface = this.reportSafeDiagnostic(
|
|
1325
|
-
'DYNTS-AS0-HTTPS-ERROR',
|
|
1326
|
-
DyNTS_SafeDiagnosticStage_Type.httpsServer,
|
|
1327
|
-
error,
|
|
1328
|
-
503
|
|
1329
|
-
);
|
|
1330
|
-
|
|
1331
|
-
if (!this.systemControls.httpsServer.started) {
|
|
1332
|
-
const d_error: DyFM_Error = new DyFM_Error({
|
|
1333
|
-
...this._getDefaultErrorSettings('startExpresses', error),
|
|
1334
|
-
|
|
1335
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-SE1`,
|
|
1336
|
-
message: `HTTPS (secure) start server ERROR`,
|
|
1337
|
-
});
|
|
1338
|
-
|
|
1339
|
-
this.constructErrors.push(d_error);
|
|
1340
|
-
this.forwardSafeDiagnostic(diagnostic);
|
|
1341
|
-
|
|
1342
|
-
reject(d_error);
|
|
1343
|
-
|
|
1344
|
-
} else {
|
|
1345
|
-
this.forwardSafeDiagnostic(diagnostic);
|
|
1346
|
-
}
|
|
1347
|
-
})
|
|
1348
|
-
.on('uncaughtException', (exception): void => {
|
|
1349
|
-
const diagnostic: DyNTS_SafeDiagnostic_Interface = this.reportSafeDiagnostic(
|
|
1350
|
-
'DYNTS-AS0-HTTPS-UNCAUGHT',
|
|
1351
|
-
DyNTS_SafeDiagnosticStage_Type.httpsServer,
|
|
1352
|
-
exception
|
|
1353
|
-
);
|
|
1354
|
-
|
|
1355
|
-
this.forwardSafeDiagnostic(diagnostic);
|
|
1356
|
-
});
|
|
1357
|
-
});
|
|
1358
|
-
}
|
|
1359
|
-
|
|
1360
|
-
if (this._security && this._security !== DyNTS_RouteSecurity.secure) {
|
|
1361
|
-
this.systemControls.httpServer.init = true;
|
|
1362
|
-
await new Promise<void>((resolve, reject): void => {
|
|
1363
|
-
this.httpServer = this.openExpress
|
|
1364
|
-
.listen(
|
|
1365
|
-
this._portSettings.httpPort,
|
|
1366
|
-
this.params.openHost,
|
|
1367
|
-
this.params.expressBacklog,
|
|
1368
|
-
(): void => {
|
|
1369
|
-
this.systemControls.httpServer.started = true;
|
|
1370
|
-
|
|
1371
|
-
const resolvedPort: number = this.httpServer?.address?.()?.['port'] ?? this._portSettings.httpPort;
|
|
1372
|
-
|
|
1373
|
-
if (this._portSettings.httpPort === 0) {
|
|
1374
|
-
DyFM_Log.H_warn(
|
|
1375
|
-
`\nHTTP (open) server is using a randomly selected port by the OS: ${resolvedPort}` +
|
|
1376
|
-
`\n (httpPort was set to 0 — this is intended for testing only)`
|
|
1377
|
-
);
|
|
1378
|
-
}
|
|
1379
|
-
|
|
1380
|
-
DyFM_Log.success(
|
|
1381
|
-
`\nHTTP (open) server is listening on port: ` +
|
|
1382
|
-
`${this.params.openHost}:${resolvedPort}`
|
|
1383
|
-
);
|
|
1384
|
-
|
|
1385
|
-
resolve();
|
|
1386
|
-
}
|
|
1387
|
-
)
|
|
1388
|
-
.on('error', (error: unknown): void => {
|
|
1389
|
-
const diagnostic: DyNTS_SafeDiagnostic_Interface = this.reportSafeDiagnostic(
|
|
1390
|
-
'DYNTS-AS0-HTTP-ERROR',
|
|
1391
|
-
DyNTS_SafeDiagnosticStage_Type.httpServer,
|
|
1392
|
-
error,
|
|
1393
|
-
503
|
|
1394
|
-
);
|
|
1395
|
-
|
|
1396
|
-
if (!this.systemControls.httpServer.started) {
|
|
1397
|
-
const d_error: DyFM_Error = new DyFM_Error({
|
|
1398
|
-
...this._getDefaultErrorSettings('startExpresses', error),
|
|
1399
|
-
|
|
1400
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-SE3`,
|
|
1401
|
-
message: `HTTP (open) start server ERROR`,
|
|
1402
|
-
});
|
|
1403
|
-
|
|
1404
|
-
this.constructErrors.push(d_error);
|
|
1405
|
-
this.forwardSafeDiagnostic(diagnostic);
|
|
1406
|
-
|
|
1407
|
-
reject(d_error);
|
|
1408
|
-
|
|
1409
|
-
} else {
|
|
1410
|
-
this.forwardSafeDiagnostic(diagnostic);
|
|
1411
|
-
}
|
|
1412
|
-
})
|
|
1413
|
-
.on('uncaughtException', (exception): void => {
|
|
1414
|
-
const diagnostic: DyNTS_SafeDiagnostic_Interface = this.reportSafeDiagnostic(
|
|
1415
|
-
'DYNTS-AS0-HTTP-UNCAUGHT',
|
|
1416
|
-
DyNTS_SafeDiagnosticStage_Type.httpServer,
|
|
1417
|
-
exception
|
|
1418
|
-
);
|
|
1419
|
-
|
|
1420
|
-
this.forwardSafeDiagnostic(diagnostic);
|
|
1421
|
-
});
|
|
1422
|
-
});
|
|
1423
|
-
}
|
|
1424
|
-
} catch (error) {
|
|
1425
|
-
throw new DyFM_Error({
|
|
1426
|
-
...this._getDefaultErrorSettings('startExpresses', error),
|
|
1427
|
-
|
|
1428
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-SE0`,
|
|
1429
|
-
});
|
|
1430
|
-
}
|
|
1431
|
-
}
|
|
1432
|
-
|
|
1433
|
-
/**
|
|
1434
|
-
*
|
|
1435
|
-
*/
|
|
1436
|
-
private async expressErrorHandling(error, req, res, next): Promise<void> {
|
|
1437
|
-
try {
|
|
1438
|
-
if (error) {
|
|
1439
|
-
const diagnostic: DyNTS_SafeDiagnostic_Interface = this.reportSafeDiagnostic(
|
|
1440
|
-
'DYNTS-AS0-EXPRESS-ERROR',
|
|
1441
|
-
DyNTS_SafeDiagnosticStage_Type.expressFallback,
|
|
1442
|
-
error
|
|
1443
|
-
);
|
|
1444
|
-
|
|
1445
|
-
this.forwardSafeDiagnostic(diagnostic);
|
|
1446
|
-
|
|
1447
|
-
// Kliens-safe strip (BFR-FDPAUTHSERVICE-002): az express-error út eddig NYERS error-t küldött
|
|
1448
|
-
// (0 strip) — DyFM-nél belső stack/verzió/issuer, axios-jellegű error-nál akár auth-header is
|
|
1449
|
-
// kimehetett. A strip-szabályok SSOT-ja a DyNTS_ClientSafeError_Util.
|
|
1450
|
-
res.send(DyNTS_ClientSafeError_Util.toClientSafe(error))
|
|
1451
|
-
} else {
|
|
1452
|
-
const diagnostic: DyNTS_SafeDiagnostic_Interface = this.reportSafeDiagnostic(
|
|
1453
|
-
'DYNTS-AS0-EXPRESS-MISSING-ERROR',
|
|
1454
|
-
DyNTS_SafeDiagnosticStage_Type.expressFallback
|
|
1455
|
-
);
|
|
1456
|
-
|
|
1457
|
-
this.forwardSafeDiagnostic(diagnostic);
|
|
1458
|
-
}
|
|
1459
|
-
} catch (error) {
|
|
1460
|
-
const diagnostic: DyNTS_SafeDiagnostic_Interface = this.reportSafeDiagnostic(
|
|
1461
|
-
'DYNTS-AS0-EXPRESS-MULTILEVEL',
|
|
1462
|
-
DyNTS_SafeDiagnosticStage_Type.expressFallback,
|
|
1463
|
-
error
|
|
1464
|
-
);
|
|
1465
|
-
|
|
1466
|
-
this.forwardSafeDiagnostic(diagnostic);
|
|
1467
|
-
}
|
|
1468
|
-
}
|
|
1469
|
-
|
|
1470
|
-
/**
|
|
1471
|
-
*
|
|
1472
|
-
*/
|
|
1473
|
-
private async mountSecureRoutes (): Promise<void> {
|
|
1474
|
-
try {
|
|
1475
|
-
if (this.fnLogs && this.deepLog) DyFM_Log.log('\nfn:. mountSecureRoutes');
|
|
1476
|
-
|
|
1477
|
-
if (!this.secureExpress) {
|
|
1478
|
-
throw new Error(
|
|
1479
|
-
'secureExpress was not initialized. ' +
|
|
1480
|
-
'Secure routes require getCertificationSettings and httpsPort, and cert files must exist.' +
|
|
1481
|
-
'\n\nYou need to set security to secure or both in any route and set httpsPort in getPortSettings.' +
|
|
1482
|
-
'\n\nYou need to set cert files in getCertificationSettings.'
|
|
1483
|
-
);
|
|
1484
|
-
}
|
|
1485
|
-
|
|
1486
|
-
this.secureExpress.use(
|
|
1487
|
-
(error, req, res, next): Promise<void> => this.expressErrorHandling(error, req, res, next)
|
|
1488
|
-
);
|
|
1489
|
-
|
|
1490
|
-
await DyFM_Array.asyncForEach(
|
|
1491
|
-
this._routingModules,
|
|
1492
|
-
async (module: DyNTS_RoutingModule): Promise<void> => {
|
|
1493
|
-
if (module.security !== DyNTS_RouteSecurity.open) {
|
|
1494
|
-
if (this.logSetup) {
|
|
1495
|
-
DyFM_Log.log(`route mount (secure): ${module.route}`);
|
|
1496
|
-
}
|
|
1497
|
-
|
|
1498
|
-
const existingRoutes: DyNTS_RoutingModule[] = this._routingModules.filter(
|
|
1499
|
-
(mod: DyNTS_RoutingModule): boolean => mod.route === module.route
|
|
1500
|
-
);
|
|
1501
|
-
|
|
1502
|
-
if (1 < existingRoutes.length) {
|
|
1503
|
-
const error: Error = new Error(`ROUTE DUPLICATION: ${module.route}`);
|
|
1504
|
-
/* const errorStack: string[] = error.stack.split('\n');
|
|
1505
|
-
|
|
1506
|
-
errorStack.splice(1, 4);
|
|
1507
|
-
error.stack = errorStack.join('\n'); */
|
|
1508
|
-
error.stack = module.stackLocation;
|
|
1509
|
-
|
|
1510
|
-
this.reportSafeDiagnostic(
|
|
1511
|
-
'DYNTS-AS0-SECURE-ROUTE-DUPLICATION',
|
|
1512
|
-
DyNTS_SafeDiagnosticStage_Type.routing,
|
|
1513
|
-
error
|
|
1514
|
-
);
|
|
1515
|
-
|
|
1516
|
-
throw new DyFM_Error({
|
|
1517
|
-
...this._getDefaultErrorSettings('mountSecureRoutes', error),
|
|
1518
|
-
|
|
1519
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-MSR1`,
|
|
1520
|
-
message: `ROUTE DUPLICATION: ${module.route}`,
|
|
1521
|
-
});
|
|
1522
|
-
}
|
|
1523
|
-
|
|
1524
|
-
this.secureExpress.use(module.route, module.secureRouter);
|
|
1525
|
-
}
|
|
1526
|
-
}
|
|
1527
|
-
);
|
|
1528
|
-
} catch (error) {
|
|
1529
|
-
throw new DyFM_Error({
|
|
1530
|
-
...this._getDefaultErrorSettings('mountSecureRoutes', error),
|
|
1531
|
-
|
|
1532
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-MSR0`,
|
|
1533
|
-
});
|
|
1534
|
-
}
|
|
1535
|
-
}
|
|
1536
|
-
|
|
1537
|
-
/**
|
|
1538
|
-
*
|
|
1539
|
-
*/
|
|
1540
|
-
private async mountOpenRoutes(): Promise<void> {
|
|
1541
|
-
try {
|
|
1542
|
-
if (this.fnLogs && this.deepLog) DyFM_Log.log('\nfn:. mountOpenRoutes');
|
|
1543
|
-
|
|
1544
|
-
if (!this.openExpress) {
|
|
1545
|
-
throw new Error(
|
|
1546
|
-
'openExpress was not initialized. Open routes require getOpenExpress and httpPort.' +
|
|
1547
|
-
'\n\nYou need to set security to open or both in any route and set httpPort in getPortSettings.'
|
|
1548
|
-
);
|
|
1549
|
-
}
|
|
1550
|
-
|
|
1551
|
-
this.openExpress.use(
|
|
1552
|
-
(error, req, res, next): Promise<void> => this.expressErrorHandling(error, req, res, next)
|
|
1553
|
-
);
|
|
1554
|
-
|
|
1555
|
-
await DyFM_Array.asyncForEach(
|
|
1556
|
-
this._routingModules,
|
|
1557
|
-
async (module: DyNTS_RoutingModule): Promise<void> => {
|
|
1558
|
-
if (module.security !== DyNTS_RouteSecurity.secure) {
|
|
1559
|
-
if (this.logSetup) {
|
|
1560
|
-
DyFM_Log.log(`route mount (open): ${module.route}`);
|
|
1561
|
-
}
|
|
1562
|
-
|
|
1563
|
-
const existingRoutes: DyNTS_RoutingModule[] = this._routingModules.filter(
|
|
1564
|
-
(mod: DyNTS_RoutingModule): boolean => mod.route === module.route
|
|
1565
|
-
);
|
|
1566
|
-
|
|
1567
|
-
if (1 < existingRoutes.length) {
|
|
1568
|
-
const error: Error = new Error(`ROUTE DUPLICATION: ${module.route}`);
|
|
1569
|
-
/* const errorStack: string[] = error.stack.split('\n');
|
|
1570
|
-
|
|
1571
|
-
errorStack.splice(1, 4);
|
|
1572
|
-
error.stack = errorStack.join('\n'); */
|
|
1573
|
-
error.stack = module.stackLocation;
|
|
1574
|
-
|
|
1575
|
-
this.reportSafeDiagnostic(
|
|
1576
|
-
'DYNTS-AS0-OPEN-ROUTE-DUPLICATION',
|
|
1577
|
-
DyNTS_SafeDiagnosticStage_Type.routing,
|
|
1578
|
-
error
|
|
1579
|
-
);
|
|
1580
|
-
|
|
1581
|
-
throw new DyFM_Error({
|
|
1582
|
-
...this._getDefaultErrorSettings('mountOpenRoutes', error),
|
|
1583
|
-
|
|
1584
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-MOR1`,
|
|
1585
|
-
message: `ROUTE DUPLICATION: ${module.route}`,
|
|
1586
|
-
});
|
|
1587
|
-
}
|
|
1588
|
-
|
|
1589
|
-
this.openExpress.use(module.route, module.openRouter);
|
|
1590
|
-
}
|
|
1591
|
-
}
|
|
1592
|
-
);
|
|
1593
|
-
} catch (error) {
|
|
1594
|
-
throw new DyFM_Error({
|
|
1595
|
-
...this._getDefaultErrorSettings('mountOpenRoutes', error),
|
|
1596
|
-
|
|
1597
|
-
errorCode: `${DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-MOR0`,
|
|
1598
|
-
});
|
|
1599
|
-
}
|
|
1600
|
-
}
|
|
1601
|
-
|
|
1602
|
-
/**
|
|
1603
|
-
* FR-041 — CORS middleware. Echoes a matching `Access-Control-Allow-Origin`
|
|
1604
|
-
* for any request whose Origin header is in `getCorsSettings().allowedOrigins`,
|
|
1605
|
-
* adds the canonical `Access-Control-*` companion headers, and short-circuits
|
|
1606
|
-
* the OPTIONS preflight with a 204.
|
|
1607
|
-
*
|
|
1608
|
-
* No-op when the subclass does NOT override `getCorsSettings()` — preserves
|
|
1609
|
-
* back-compat for apps that have always been same-origin and never needed
|
|
1610
|
-
* CORS (the typical pre-FR-041 case).
|
|
1611
|
-
*
|
|
1612
|
-
* Why hand-rolled instead of the `cors` npm package:
|
|
1613
|
-
* - ~30 lines, zero new dependency.
|
|
1614
|
-
* - Full control over Vary/credentials/preflight semantics.
|
|
1615
|
-
* - Aligns with FDP "no unnecessary deps" philosophy.
|
|
1616
|
-
*/
|
|
1617
|
-
/**
|
|
1618
|
-
* BFR-011 / SEC-R2-8 — security response-headerek mountolása (a `mountCors` tükörképe).
|
|
1619
|
-
* A `DyNTS_global_settings.securityHeaders` alapján (default-ON) minden válaszra ráteszi a
|
|
1620
|
-
* biztonsági headereket + eltávolítja az `x-powered-by`-t. A CORS-mount ELŐTT hívandó, hogy az
|
|
1621
|
-
* OPTIONS preflight-válaszok (amiket a mountCors 204-gyel rövidre zár) is megkapják.
|
|
1622
|
-
*/
|
|
1623
|
-
protected mountSecurityHeaders(express: Express.Application): void {
|
|
1624
|
-
const settings: DyNTS_SecurityHeaders_Settings | undefined = DyNTS_global_settings.securityHeaders;
|
|
1625
|
-
if (!settings || !settings.enabled) {
|
|
1626
|
-
return;
|
|
1627
|
-
}
|
|
1628
|
-
|
|
1629
|
-
if (settings.removePoweredBy !== false) {
|
|
1630
|
-
express.disable('x-powered-by');
|
|
1631
|
-
}
|
|
1632
|
-
|
|
1633
|
-
express.use(DyNTS_createSecurityHeadersMiddleware(
|
|
1634
|
-
settings,
|
|
1635
|
-
DyNTS_getEnvironment_settings().environment,
|
|
1636
|
-
));
|
|
1637
|
-
}
|
|
1638
|
-
|
|
1639
|
-
/**
|
|
1640
|
-
* FR-292 — a deployolt app-verziot minden valaszra rateszi (`X-App-Version`), hogy a
|
|
1641
|
-
* bongeszoben NYITVA HAGYOTT SPA eszrevegye, ha kozben ujabb kliens-build ment ki.
|
|
1642
|
-
*
|
|
1643
|
-
* Nem polling: a jelzes a MAR MENO API-hivasokon utazik. Az `enabled` default TRUE — egy
|
|
1644
|
-
* informativ response-header, ami se PII-t, se belso reszletet nem szivarogtat, viszont
|
|
1645
|
-
* enelkul minden app kulon-kulon epitene ugyanezt.
|
|
1646
|
-
*/
|
|
1647
|
-
protected mountAppVersionHeader(express: Express.Application): void {
|
|
1648
|
-
const settings: DyNTS_AppVersionHeader_Settings | undefined = DyNTS_global_settings.appVersionHeader;
|
|
1649
|
-
if (settings?.enabled === false) {
|
|
1650
|
-
return;
|
|
1651
|
-
}
|
|
1652
|
-
express.use(DyNTS_createAppVersionHeaderMiddleware(
|
|
1653
|
-
(): string => DyNTS_global_settings.systemVersion,
|
|
1654
|
-
settings?.headerName,
|
|
1655
|
-
));
|
|
1656
|
-
}
|
|
1657
|
-
|
|
1658
|
-
protected mountCors(express: Express.Application): void {
|
|
1659
|
-
const settings: DyNTS_Cors_Settings | undefined = this.getCorsSettings?.();
|
|
1660
|
-
if (!settings) {
|
|
1661
|
-
return;
|
|
1662
|
-
}
|
|
1663
|
-
|
|
1664
|
-
const allowCreds: boolean = settings.allowCredentials !== false;
|
|
1665
|
-
const methods: string[] = settings.allowedMethods ?? [
|
|
1666
|
-
'GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS',
|
|
1667
|
-
];
|
|
1668
|
-
const headers: string[] = settings.allowedHeaders ?? [
|
|
1669
|
-
'Authorization', 'Content-Type', 'X-Admin-Key', 'X-Requested-With',
|
|
1670
|
-
];
|
|
1671
|
-
const exposed: string[] = settings.exposedHeaders ?? [
|
|
1672
|
-
'Content-Length', 'Content-Type',
|
|
1673
|
-
];
|
|
1674
|
-
const maxAge: number = settings.maxAgeSeconds ?? 86400;
|
|
1675
|
-
|
|
1676
|
-
const isAllowed: (origin: string) => boolean = (origin: string): boolean => {
|
|
1677
|
-
if (settings.allowedOrigins === '*') return true;
|
|
1678
|
-
if (typeof settings.allowedOrigins === 'function') {
|
|
1679
|
-
return settings.allowedOrigins(origin);
|
|
1680
|
-
}
|
|
1681
|
-
return settings.allowedOrigins.includes(origin);
|
|
1682
|
-
};
|
|
1683
|
-
|
|
1684
|
-
express.use((req: Express.Request, res: Express.Response, next: Express.NextFunction): void => {
|
|
1685
|
-
const origin: string | undefined = req.headers.origin;
|
|
1686
|
-
if (origin && isAllowed(origin)) {
|
|
1687
|
-
// Echo the matching origin (NOT wildcard) because credentials require it.
|
|
1688
|
-
res.setHeader('Access-Control-Allow-Origin', origin);
|
|
1689
|
-
if (allowCreds) {
|
|
1690
|
-
res.setHeader('Access-Control-Allow-Credentials', 'true');
|
|
1691
|
-
}
|
|
1692
|
-
res.setHeader('Access-Control-Allow-Methods', methods.join(', '));
|
|
1693
|
-
res.setHeader('Access-Control-Allow-Headers', headers.join(', '));
|
|
1694
|
-
res.setHeader('Access-Control-Expose-Headers', exposed.join(', '));
|
|
1695
|
-
res.setHeader('Access-Control-Max-Age', String(maxAge));
|
|
1696
|
-
res.setHeader('Vary', 'Origin');
|
|
1697
|
-
}
|
|
1698
|
-
if (req.method === 'OPTIONS') {
|
|
1699
|
-
res.status(204).end();
|
|
1700
|
-
return;
|
|
1701
|
-
}
|
|
1702
|
-
next();
|
|
1703
|
-
});
|
|
1704
|
-
}
|
|
1705
|
-
|
|
1706
|
-
/**
|
|
1707
|
-
* Generikus, auth-agnosztikus extension-point orchestrator. A `registerCustomMiddleware`
|
|
1708
|
-
* hookot hívja (ha a subclass override-olja) minden AKTÍV Express instance-ra
|
|
1709
|
-
* (open + secure), az API route-ok UTÁN, de a SPA static catch-all (`app.get('*')`)
|
|
1710
|
-
* ELŐTT — ez az EGYETLEN korrekt pont egy sub-path middleware-hez (pl. reverse-proxy),
|
|
1711
|
-
* mert a catch-all minden utána mountolt route-ot elnyel. No-op ha nincs override (back-compat).
|
|
1712
|
-
*/
|
|
1713
|
-
private async mountCustomMiddleware(): Promise<void> {
|
|
1714
|
-
if (!this.registerCustomMiddleware) {
|
|
1715
|
-
return;
|
|
1716
|
-
}
|
|
1717
|
-
|
|
1718
|
-
if (this.openExpress) {
|
|
1719
|
-
await this.registerCustomMiddleware(this.openExpress, DyNTS_RouteSecurity.open);
|
|
1720
|
-
}
|
|
1721
|
-
|
|
1722
|
-
if (this.secureExpress) {
|
|
1723
|
-
await this.registerCustomMiddleware(this.secureExpress, DyNTS_RouteSecurity.secure);
|
|
1724
|
-
}
|
|
1725
|
-
|
|
1726
|
-
if (this.logSetup) {
|
|
1727
|
-
DyFM_Log.log('\nCustom middleware registered (pre-static).');
|
|
1728
|
-
}
|
|
1729
|
-
}
|
|
1730
|
-
|
|
1731
|
-
/**
|
|
1732
|
-
* Ha getStaticClientSettings() visszaad beállításokat, a client static fájlok a '/' alatt
|
|
1733
|
-
* lesznek kiszolgálva (API route-ok után). SPA fallback opcionális (fallbackPath).
|
|
1734
|
-
* Asset cache (assetCacheMaxAge, assetCacheImmutable) és fallback cache (fallbackCacheMaxAge)
|
|
1735
|
-
* opcionálisak; ha nincs megadva fallbackCacheMaxAge, DyNTS_defaultFallbackCacheMaxAge (0) marad.
|
|
1736
|
-
*/
|
|
1737
|
-
private async mountStaticClient(): Promise<void> {
|
|
1738
|
-
const settings: DyNTS_StaticClient_Settings | undefined = this.getStaticClientSettings?.();
|
|
1739
|
-
if (!settings) {
|
|
1740
|
-
return;
|
|
1741
|
-
}
|
|
1742
|
-
|
|
1743
|
-
const absoluteRoot: string = Path.isAbsolute(settings.root)
|
|
1744
|
-
? settings.root
|
|
1745
|
-
: Path.resolve(process.cwd(), settings.root);
|
|
1746
|
-
|
|
1747
|
-
const hasAssetCache: boolean =
|
|
1748
|
-
settings.assetCacheMaxAge !== undefined || settings.assetCacheImmutable === true;
|
|
1749
|
-
const staticOptions: { setHeaders: (res: Express.Response, filePath: string) => void } | undefined =
|
|
1750
|
-
hasAssetCache && settings.assetCacheMaxAge !== undefined
|
|
1751
|
-
? {
|
|
1752
|
-
setHeaders: (res: Express.Response, filePath: string): void => {
|
|
1753
|
-
// A HTML entry-fájlok (index.html) no-cache-t kapnak, a hash-elt asset-ek
|
|
1754
|
-
// immutable long-cache-t — lásd DyNTS_resolveStaticCacheControlHeader (served-stale-index fix).
|
|
1755
|
-
res.setHeader(
|
|
1756
|
-
'Cache-Control',
|
|
1757
|
-
DyNTS_resolveStaticCacheControlHeader({
|
|
1758
|
-
filePath: filePath,
|
|
1759
|
-
assetCacheMaxAge: settings.assetCacheMaxAge!,
|
|
1760
|
-
assetCacheImmutable: settings.assetCacheImmutable === true,
|
|
1761
|
-
}),
|
|
1762
|
-
);
|
|
1763
|
-
},
|
|
1764
|
-
}
|
|
1765
|
-
: undefined;
|
|
1766
|
-
|
|
1767
|
-
const staticMiddleware: Express.Handler =
|
|
1768
|
-
staticOptions
|
|
1769
|
-
? Express.static(absoluteRoot, staticOptions)
|
|
1770
|
-
: Express.static(absoluteRoot);
|
|
1771
|
-
|
|
1772
|
-
const fallbackMaxAge: number =
|
|
1773
|
-
settings.fallbackCacheMaxAge ?? DyNTS_defaultFallbackCacheMaxAge;
|
|
1774
|
-
|
|
1775
|
-
// API-namespace guard (BFR-DYNAMOBUILDER-001): a catch-all fallback NE fedje az API-prefixeket —
|
|
1776
|
-
// egy ismeretlen `GET /api/...` 404 JSON-t kapjon, ne megtévesztő `200 + index.html`-t.
|
|
1777
|
-
// Konfigurálható (fallbackExcludePrefixes); default a bevett FDP namespace-pár.
|
|
1778
|
-
const excludePrefixes: string[] = settings.fallbackExcludePrefixes ?? ['/api', '/auth-api'];
|
|
1779
|
-
const isApiNamespacePath = (path: string): boolean =>
|
|
1780
|
-
excludePrefixes.some((prefix: string): boolean => path === prefix || path.startsWith(`${prefix}/`));
|
|
1781
|
-
|
|
1782
|
-
if (this.openExpress) {
|
|
1783
|
-
this.openExpress.use('/', staticMiddleware);
|
|
1784
|
-
if (settings.fallbackPath) {
|
|
1785
|
-
this.openExpress.get('*', (req: Express.Request, res: Express.Response): void => {
|
|
1786
|
-
if (isApiNamespacePath(req.path)) {
|
|
1787
|
-
res.status(404).send({ message: `Unknown API endpoint: ${req.path}` });
|
|
1788
|
-
return;
|
|
1789
|
-
}
|
|
1790
|
-
res.setHeader('Cache-Control', `max-age=${fallbackMaxAge}`);
|
|
1791
|
-
res.sendFile(settings.fallbackPath!, { root: absoluteRoot });
|
|
1792
|
-
});
|
|
1793
|
-
} else {
|
|
1794
|
-
this.openExpress.get('*', (req: Express.Request, res: Express.Response): void => {
|
|
1795
|
-
if (isApiNamespacePath(req.path)) {
|
|
1796
|
-
res.status(404).send({ message: `Unknown API endpoint: ${req.path}` });
|
|
1797
|
-
return;
|
|
1798
|
-
}
|
|
1799
|
-
res.status(404).type('html').send(DyNTS_defaultNotFoundPageHtml);
|
|
1800
|
-
});
|
|
1801
|
-
}
|
|
1802
|
-
}
|
|
1803
|
-
|
|
1804
|
-
if (this.secureExpress) {
|
|
1805
|
-
this.secureExpress.use('/', staticMiddleware);
|
|
1806
|
-
if (settings.fallbackPath) {
|
|
1807
|
-
this.secureExpress.get('*', (req: Express.Request, res: Express.Response): void => {
|
|
1808
|
-
if (isApiNamespacePath(req.path)) {
|
|
1809
|
-
res.status(404).send({ message: `Unknown API endpoint: ${req.path}` });
|
|
1810
|
-
return;
|
|
1811
|
-
}
|
|
1812
|
-
res.setHeader('Cache-Control', `max-age=${fallbackMaxAge}`);
|
|
1813
|
-
res.sendFile(settings.fallbackPath!, { root: absoluteRoot });
|
|
1814
|
-
});
|
|
1815
|
-
} else {
|
|
1816
|
-
this.secureExpress.get('*', (req: Express.Request, res: Express.Response): void => {
|
|
1817
|
-
if (isApiNamespacePath(req.path)) {
|
|
1818
|
-
res.status(404).send({ message: `Unknown API endpoint: ${req.path}` });
|
|
1819
|
-
return;
|
|
1820
|
-
}
|
|
1821
|
-
res.status(404).type('html').send(DyNTS_defaultNotFoundPageHtml);
|
|
1822
|
-
});
|
|
1823
|
-
}
|
|
1824
|
-
}
|
|
1825
|
-
|
|
1826
|
-
if (this.logSetup) {
|
|
1827
|
-
DyFM_Log.log(`\nStatic client mounted at / (root: ${absoluteRoot})`);
|
|
1828
|
-
}
|
|
1829
|
-
}
|
|
1830
|
-
|
|
1831
|
-
/**
|
|
1832
|
-
*
|
|
1833
|
-
*/
|
|
1834
|
-
private setSecurity(): void {
|
|
1835
|
-
if (this.fnLogs && this.deepLog) DyFM_Log.log('\nfn:. setSecurity');
|
|
1836
|
-
this._routingModules.forEach((module: DyNTS_RoutingModule): void => {
|
|
1837
|
-
if (!module.security) {
|
|
1838
|
-
DyFM_Log.warn(`RoutingModule security is not set for ${module.route}\n`);
|
|
1839
|
-
|
|
1840
|
-
} else if (!this._security) {
|
|
1841
|
-
this._security = module.security;
|
|
1842
|
-
|
|
1843
|
-
} else if (this._security !== module.security) {
|
|
1844
|
-
this._security = DyNTS_RouteSecurity.both;
|
|
1845
|
-
}
|
|
1846
|
-
});
|
|
1847
|
-
|
|
1848
|
-
if (!this._security) {
|
|
1849
|
-
let msg = `Could not set security for the server! (${this.security})`;
|
|
1850
|
-
|
|
1851
|
-
msg += '\n RoutingModules:';
|
|
1852
|
-
this._routingModules.forEach((module: DyNTS_RoutingModule): void => {
|
|
1853
|
-
msg += `\n ${module.route} (security: ${module.security})`;
|
|
1854
|
-
});
|
|
1855
|
-
|
|
1856
|
-
if (this._routingModules.length === 0) {
|
|
1857
|
-
msg += '\n - no RoutingModule found -\n';
|
|
1858
|
-
}
|
|
1859
|
-
DyFM_Log.warn(msg);
|
|
1860
|
-
}
|
|
1861
|
-
}
|
|
1862
|
-
|
|
1863
|
-
private _getDefaultErrorSettings(
|
|
1864
|
-
fnName: string,
|
|
1865
|
-
error: DyFM_AnyError
|
|
1866
|
-
): DyFM_Error_Settings {
|
|
1867
|
-
return {
|
|
1868
|
-
status: (error as DyFM_Error)?.___status ?? 500,
|
|
1869
|
-
message: (error as Error)?.message ??
|
|
1870
|
-
(error as DyFM_Error)?._message ??
|
|
1871
|
-
`${fnName} was UNSUCCESSFUL (NTS)`,
|
|
1872
|
-
userMessage: (error as DyFM_Error)?.__userMessage ?? this.defaultErrorUserMsg,
|
|
1873
|
-
addECToUserMsg: !(error as DyFM_Error)?.__userMessage,
|
|
1874
|
-
issuerService: `${this?.constructor?.name}-DyNTS_App`,
|
|
1875
|
-
level: DyFM_ErrorLevel.fatal,
|
|
1876
|
-
error: error,
|
|
1877
|
-
systemVersion: DyNTS_global_settings.systemVersion,
|
|
1878
|
-
};
|
|
1879
|
-
}
|
|
1880
|
-
|
|
1881
|
-
/**
|
|
1882
|
-
* MISSING Description (TODO)
|
|
1883
|
-
*/
|
|
1884
|
-
abstract getAppParams(): DyNTS_App_Params;
|
|
1885
|
-
|
|
1886
|
-
/**
|
|
1887
|
-
* MISSING Description (TODO)
|
|
1888
|
-
*/
|
|
1889
|
-
abstract getGlobalServiceCollection(): DyNTS_GlobalService_Settings;
|
|
1890
|
-
|
|
1891
|
-
/**
|
|
1892
|
-
* MISSING Description (TODO)
|
|
1893
|
-
*/
|
|
1894
|
-
abstract getPortSettings(): DyNTS_Http_Settings;
|
|
1895
|
-
|
|
1896
|
-
/**
|
|
1897
|
-
* MISSING Description (TODO)
|
|
1898
|
-
*/
|
|
1899
|
-
overrideDynamoNTSGlobalSettings?(): void;
|
|
1900
|
-
|
|
1901
|
-
/**
|
|
1902
|
-
* Ha megadva, a visszaadott értéket használjuk a route prefix-ként
|
|
1903
|
-
* (DyNTS_global_settings.baseUrl felülírása erre az app-ra).
|
|
1904
|
-
*/
|
|
1905
|
-
getApiBasePath?(): string;
|
|
1906
|
-
|
|
1907
|
-
/**
|
|
1908
|
-
* MISSING Description (TODO)
|
|
1909
|
-
*/
|
|
1910
|
-
getRoutingModules?(): DyNTS_RoutingModule[];
|
|
1911
|
-
|
|
1912
|
-
/**
|
|
1913
|
-
* MISSING Description (TODO)
|
|
1914
|
-
*/
|
|
1915
|
-
getRootServices?(): Promise<any[]>;
|
|
1916
|
-
|
|
1917
|
-
/**
|
|
1918
|
-
* MISSING Description (TODO)
|
|
1919
|
-
*/
|
|
1920
|
-
getCertificationSettings?(): DyNTS_Certification_Settings;
|
|
1921
|
-
|
|
1922
|
-
/**
|
|
1923
|
-
* Ha megadva, a client static fájlok a '/' alatt lesznek kiszolgálva (API route-ok után).
|
|
1924
|
-
* Opcionális fallbackPath pl. SPA index.html-hez.
|
|
1925
|
-
*/
|
|
1926
|
-
getStaticClientSettings?(): DyNTS_StaticClient_Settings | undefined;
|
|
1927
|
-
|
|
1928
|
-
/**
|
|
1929
|
-
* FR-041 — Ha megadva, CORS middleware mount-olódik mindkét Express instance-ra
|
|
1930
|
-
* (open + secure). Az `allowedOrigins` listán szereplő Origin-eket echo-zza vissza,
|
|
1931
|
-
* `Access-Control-Allow-Credentials: true`-val (default) együtt a Bearer JWT
|
|
1932
|
-
* cross-domain auth flow miatt. OPTIONS preflight 204-gyel rövidre záródik.
|
|
1933
|
-
* Ha undefined → no CORS headers, no preflight handling — back-compat.
|
|
1934
|
-
*/
|
|
1935
|
-
getCorsSettings?(): DyNTS_Cors_Settings | undefined;
|
|
1936
|
-
|
|
1937
|
-
/**
|
|
1938
|
-
* Opcionális generikus hook: custom Express middleware regisztrálása az API route-ok
|
|
1939
|
-
* UTÁN és a SPA static catch-all ELŐTT. Auth-AGNOSZTIKUS framework extension-point —
|
|
1940
|
-
* a subclass (pl. FDP base App) ezen keresztül mount-olhat reverse-proxyt egy sub-path-re
|
|
1941
|
-
* (pl. `/auth-api`), ami a `app.get('*')` catch-all elé kell kerüljön. A hívási időzítést
|
|
1942
|
-
* lásd: `mountCustomMiddleware`. Undefined → no-op (back-compat).
|
|
1943
|
-
*/
|
|
1944
|
-
registerCustomMiddleware?(
|
|
1945
|
-
express: Express.Application,
|
|
1946
|
-
security: DyNTS_RouteSecurity,
|
|
1947
|
-
): void | Promise<void>;
|
|
1948
|
-
|
|
1949
|
-
/**
|
|
1950
|
-
* MISSING Description (TODO)
|
|
1951
|
-
*/
|
|
1952
|
-
createEntries?(): Promise<void>;
|
|
1953
|
-
|
|
1954
|
-
/**
|
|
1955
|
-
* MISSING Description (TODO)
|
|
1956
|
-
*/
|
|
1957
|
-
postProcess?(): Promise<void>;
|
|
1958
|
-
|
|
1959
|
-
}
|