@futdevpro/nts-dynamo 1.15.156 → 1.15.157
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/__documentations/2026-08-22-bfr-ctm-018-content-free-endpoint-errors.md +54 -54
- package/__documentations/2026-08-22-bfr-ctm-020-content-free-request-telemetry.md +65 -0
- package/__documentations/2026-08-22-content-free-process-error-boundary.md +26 -26
- 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-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 +32 -32
- package/build/_modules/privacy-lifecycle/index.js +17 -17
- 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 +1 -1
- package/src/_models/control-models/endpoint-params.control-model.spec.ts +102 -102
- package/src/_models/control-models/endpoint-params.control-model.ts +131 -131
- package/src/_models/interfaces/request-telemetry-settings.interface.ts +9 -0
- package/src/_models/interfaces/request-telemetry-snapshot.interface.ts +30 -0
- package/src/_modules/server/safe-diagnostic/safe-diagnostic-stage.type-enum.ts +3 -3
- package/src/_services/core/request-telemetry.control-service.spec.ts +217 -0
- package/src/_services/core/request-telemetry.control-service.ts +381 -0
- package/src/_services/route/routing-module.service.ts +27 -18
- package/src/_services/server/app.server.ts +29 -9
- package/src/index.ts +5 -2
|
@@ -1,1227 +1,1240 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DyNTS_App = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const Mongoose = require("mongoose");
|
|
6
|
-
const Express = require("express");
|
|
7
|
-
/* import Mongoose from 'mongoose';
|
|
8
|
-
import Express from 'express'; */
|
|
9
|
-
const BodyParser = tslib_1.__importStar(require("body-parser"));
|
|
10
|
-
const FileSystem = tslib_1.__importStar(require("fs"));
|
|
11
|
-
const Https = tslib_1.__importStar(require("https"));
|
|
12
|
-
const Path = tslib_1.__importStar(require("path"));
|
|
13
|
-
/* import { version } from '../../../package.json'; */
|
|
14
|
-
const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
|
|
15
|
-
const default_fallback_cache_max_age_const_1 = require("../../_collections/default-fallback-cache-max-age.const");
|
|
16
|
-
const default_not_found_page_const_1 = require("../../_collections/default-not-found-page.const");
|
|
17
|
-
const global_settings_const_1 = require("../../_collections/global-settings.const");
|
|
18
|
-
const client_safe_error_util_1 = require("../../_collections/client-safe-error.util");
|
|
19
|
-
const get_environment_settings_util_1 = require("../../_collections/get-environment-settings.util");
|
|
20
|
-
const security_headers_util_1 = require("../../_collections/security-headers.util");
|
|
21
|
-
const load_shed_util_1 = require("../../_collections/load-shed.util");
|
|
22
|
-
const app_version_header_util_1 = require("../../_collections/app-version-header.util");
|
|
23
|
-
const mongo_reconnect_guard_util_1 = require("../../_collections/mongo-reconnect-guard.util");
|
|
24
|
-
const static_cache_control_util_1 = require("../../_collections/static-cache-control.util");
|
|
25
|
-
const route_security_enum_1 = require("../../_enums/route-security.enum");
|
|
26
|
-
const app_system_controls_control_model_1 = require("../../_models/control-models/app-system-controls.control-model");
|
|
27
|
-
const http_settings_control_model_1 = require("../../_models/control-models/http-settings.control-model");
|
|
28
|
-
const singleton_service_1 = require("../base/singleton.service");
|
|
29
|
-
const global_service_1 = require("../core/global.service");
|
|
30
|
-
const collection_growth_monitor_service_1 = require("../core/collection-growth-monitor.service");
|
|
31
|
-
const memory_guard_service_1 = require("../core/memory-guard.service");
|
|
32
|
-
const event_loop_diag_service_1 = require("../core/event-loop-diag.service");
|
|
33
|
-
const
|
|
34
|
-
const
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
`\
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
const
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
this.
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
this.
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
this.
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
this.
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
global_service_1.DyNTS_GlobalService.
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
!
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
//
|
|
193
|
-
//
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
await this.
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
214
|
-
//
|
|
215
|
-
|
|
216
|
-
await this.
|
|
217
|
-
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
222
|
-
|
|
223
|
-
|
|
224
|
-
|
|
225
|
-
|
|
226
|
-
|
|
227
|
-
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
this.
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
//
|
|
235
|
-
//
|
|
236
|
-
//
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
//
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
252
|
-
|
|
253
|
-
|
|
254
|
-
//
|
|
255
|
-
//
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
274
|
-
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
282
|
-
|
|
283
|
-
|
|
284
|
-
|
|
285
|
-
|
|
286
|
-
|
|
287
|
-
|
|
288
|
-
|
|
289
|
-
|
|
290
|
-
|
|
291
|
-
|
|
292
|
-
|
|
293
|
-
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
|
|
297
|
-
|
|
298
|
-
|
|
299
|
-
|
|
300
|
-
|
|
301
|
-
|
|
302
|
-
|
|
303
|
-
|
|
304
|
-
|
|
305
|
-
|
|
306
|
-
{
|
|
307
|
-
|
|
308
|
-
|
|
309
|
-
|
|
310
|
-
|
|
311
|
-
|
|
312
|
-
|
|
313
|
-
this.systemControls.
|
|
314
|
-
|
|
315
|
-
|
|
316
|
-
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
|
|
326
|
-
|
|
327
|
-
|
|
328
|
-
|
|
329
|
-
|
|
330
|
-
|
|
331
|
-
|
|
332
|
-
|
|
333
|
-
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
|
|
337
|
-
|
|
338
|
-
|
|
339
|
-
|
|
340
|
-
|
|
341
|
-
|
|
342
|
-
|
|
343
|
-
|
|
344
|
-
|
|
345
|
-
|
|
346
|
-
|
|
347
|
-
|
|
348
|
-
|
|
349
|
-
|
|
350
|
-
|
|
351
|
-
|
|
352
|
-
|
|
353
|
-
|
|
354
|
-
|
|
355
|
-
|
|
356
|
-
|
|
357
|
-
|
|
358
|
-
|
|
359
|
-
|
|
360
|
-
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
364
|
-
|
|
365
|
-
|
|
366
|
-
|
|
367
|
-
|
|
368
|
-
|
|
369
|
-
|
|
370
|
-
|
|
371
|
-
|
|
372
|
-
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
|
|
376
|
-
|
|
377
|
-
|
|
378
|
-
|
|
379
|
-
|
|
380
|
-
|
|
381
|
-
|
|
382
|
-
|
|
383
|
-
|
|
384
|
-
|
|
385
|
-
|
|
386
|
-
|
|
387
|
-
|
|
388
|
-
|
|
389
|
-
|
|
390
|
-
|
|
391
|
-
|
|
392
|
-
|
|
393
|
-
|
|
394
|
-
|
|
395
|
-
|
|
396
|
-
|
|
397
|
-
|
|
398
|
-
|
|
399
|
-
|
|
400
|
-
|
|
401
|
-
|
|
402
|
-
|
|
403
|
-
|
|
404
|
-
|
|
405
|
-
|
|
406
|
-
|
|
407
|
-
|
|
408
|
-
|
|
409
|
-
|
|
410
|
-
|
|
411
|
-
|
|
412
|
-
|
|
413
|
-
|
|
414
|
-
|
|
415
|
-
|
|
416
|
-
|
|
417
|
-
|
|
418
|
-
|
|
419
|
-
await this.mongoose.
|
|
420
|
-
await
|
|
421
|
-
|
|
422
|
-
|
|
423
|
-
|
|
424
|
-
|
|
425
|
-
|
|
426
|
-
|
|
427
|
-
|
|
428
|
-
|
|
429
|
-
|
|
430
|
-
|
|
431
|
-
|
|
432
|
-
|
|
433
|
-
|
|
434
|
-
|
|
435
|
-
|
|
436
|
-
|
|
437
|
-
|
|
438
|
-
|
|
439
|
-
|
|
440
|
-
|
|
441
|
-
|
|
442
|
-
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
|
|
446
|
-
|
|
447
|
-
|
|
448
|
-
|
|
449
|
-
|
|
450
|
-
|
|
451
|
-
|
|
452
|
-
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
466
|
-
|
|
467
|
-
|
|
468
|
-
|
|
469
|
-
|
|
470
|
-
|
|
471
|
-
|
|
472
|
-
|
|
473
|
-
|
|
474
|
-
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
480
|
-
|
|
481
|
-
|
|
482
|
-
|
|
483
|
-
|
|
484
|
-
|
|
485
|
-
|
|
486
|
-
|
|
487
|
-
|
|
488
|
-
|
|
489
|
-
|
|
490
|
-
|
|
491
|
-
|
|
492
|
-
|
|
493
|
-
|
|
494
|
-
|
|
495
|
-
|
|
496
|
-
|
|
497
|
-
|
|
498
|
-
|
|
499
|
-
this.mongoose.
|
|
500
|
-
|
|
501
|
-
|
|
502
|
-
|
|
503
|
-
|
|
504
|
-
|
|
505
|
-
//
|
|
506
|
-
//
|
|
507
|
-
//
|
|
508
|
-
//
|
|
509
|
-
//
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
513
|
-
|
|
514
|
-
|
|
515
|
-
|
|
516
|
-
|
|
517
|
-
|
|
518
|
-
|
|
519
|
-
|
|
520
|
-
//
|
|
521
|
-
//
|
|
522
|
-
//
|
|
523
|
-
//
|
|
524
|
-
//
|
|
525
|
-
|
|
526
|
-
|
|
527
|
-
this.
|
|
528
|
-
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
this.
|
|
533
|
-
|
|
534
|
-
|
|
535
|
-
|
|
536
|
-
|
|
537
|
-
|
|
538
|
-
|
|
539
|
-
|
|
540
|
-
|
|
541
|
-
|
|
542
|
-
|
|
543
|
-
|
|
544
|
-
|
|
545
|
-
|
|
546
|
-
|
|
547
|
-
|
|
548
|
-
|
|
549
|
-
|
|
550
|
-
|
|
551
|
-
|
|
552
|
-
|
|
553
|
-
|
|
554
|
-
|
|
555
|
-
|
|
556
|
-
|
|
557
|
-
//
|
|
558
|
-
//
|
|
559
|
-
//
|
|
560
|
-
//
|
|
561
|
-
//
|
|
562
|
-
//
|
|
563
|
-
|
|
564
|
-
|
|
565
|
-
|
|
566
|
-
|
|
567
|
-
|
|
568
|
-
await this.mongoose.
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
574
|
-
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
578
|
-
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
*
|
|
582
|
-
*
|
|
583
|
-
*
|
|
584
|
-
*
|
|
585
|
-
*
|
|
586
|
-
*
|
|
587
|
-
*
|
|
588
|
-
*
|
|
589
|
-
*
|
|
590
|
-
* - **
|
|
591
|
-
*
|
|
592
|
-
*
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
608
|
-
|
|
609
|
-
|
|
610
|
-
|
|
611
|
-
|
|
612
|
-
|
|
613
|
-
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
630
|
-
|
|
631
|
-
|
|
632
|
-
|
|
633
|
-
|
|
634
|
-
|
|
635
|
-
|
|
636
|
-
|
|
637
|
-
*
|
|
638
|
-
*
|
|
639
|
-
* - existing
|
|
640
|
-
* - existing with
|
|
641
|
-
*
|
|
642
|
-
*
|
|
643
|
-
*
|
|
644
|
-
*
|
|
645
|
-
*
|
|
646
|
-
*
|
|
647
|
-
|
|
648
|
-
|
|
649
|
-
|
|
650
|
-
|
|
651
|
-
|
|
652
|
-
|
|
653
|
-
|
|
654
|
-
|
|
655
|
-
|
|
656
|
-
|
|
657
|
-
|
|
658
|
-
|
|
659
|
-
|
|
660
|
-
|
|
661
|
-
//
|
|
662
|
-
|
|
663
|
-
|
|
664
|
-
|
|
665
|
-
|
|
666
|
-
|
|
667
|
-
|
|
668
|
-
|
|
669
|
-
|
|
670
|
-
|
|
671
|
-
|
|
672
|
-
|
|
673
|
-
|
|
674
|
-
|
|
675
|
-
`\
|
|
676
|
-
`\
|
|
677
|
-
|
|
678
|
-
|
|
679
|
-
|
|
680
|
-
|
|
681
|
-
errorMsg += `\n
|
|
682
|
-
|
|
683
|
-
|
|
684
|
-
|
|
685
|
-
|
|
686
|
-
|
|
687
|
-
|
|
688
|
-
|
|
689
|
-
|
|
690
|
-
const
|
|
691
|
-
errorStack.
|
|
692
|
-
|
|
693
|
-
|
|
694
|
-
|
|
695
|
-
|
|
696
|
-
|
|
697
|
-
|
|
698
|
-
|
|
699
|
-
|
|
700
|
-
|
|
701
|
-
|
|
702
|
-
`\
|
|
703
|
-
`\
|
|
704
|
-
`\
|
|
705
|
-
|
|
706
|
-
`\n
|
|
707
|
-
`\n
|
|
708
|
-
`\n
|
|
709
|
-
`\n
|
|
710
|
-
`\
|
|
711
|
-
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
errorMsg += `\n
|
|
716
|
-
errorMsg += `\n
|
|
717
|
-
|
|
718
|
-
|
|
719
|
-
|
|
720
|
-
errorMsg += `\n
|
|
721
|
-
|
|
722
|
-
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
const
|
|
727
|
-
errorStack.
|
|
728
|
-
|
|
729
|
-
|
|
730
|
-
|
|
731
|
-
|
|
732
|
-
|
|
733
|
-
|
|
734
|
-
|
|
735
|
-
|
|
736
|
-
|
|
737
|
-
|
|
738
|
-
|
|
739
|
-
|
|
740
|
-
|
|
741
|
-
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
745
|
-
|
|
746
|
-
|
|
747
|
-
|
|
748
|
-
|
|
749
|
-
this.openExpress
|
|
750
|
-
this.openExpress.
|
|
751
|
-
this.openExpress.use(BodyParser.
|
|
752
|
-
|
|
753
|
-
|
|
754
|
-
|
|
755
|
-
|
|
756
|
-
|
|
757
|
-
//
|
|
758
|
-
|
|
759
|
-
|
|
760
|
-
|
|
761
|
-
|
|
762
|
-
|
|
763
|
-
|
|
764
|
-
|
|
765
|
-
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
|
|
769
|
-
|
|
770
|
-
this.
|
|
771
|
-
|
|
772
|
-
this.secureExpress
|
|
773
|
-
|
|
774
|
-
this.
|
|
775
|
-
//
|
|
776
|
-
this.
|
|
777
|
-
// FR-
|
|
778
|
-
this.
|
|
779
|
-
//
|
|
780
|
-
|
|
781
|
-
|
|
782
|
-
|
|
783
|
-
|
|
784
|
-
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
794
|
-
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
799
|
-
|
|
800
|
-
|
|
801
|
-
|
|
802
|
-
|
|
803
|
-
|
|
804
|
-
|
|
805
|
-
|
|
806
|
-
|
|
807
|
-
|
|
808
|
-
|
|
809
|
-
|
|
810
|
-
|
|
811
|
-
|
|
812
|
-
|
|
813
|
-
|
|
814
|
-
|
|
815
|
-
|
|
816
|
-
|
|
817
|
-
|
|
818
|
-
|
|
819
|
-
|
|
820
|
-
|
|
821
|
-
}
|
|
822
|
-
|
|
823
|
-
|
|
824
|
-
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
|
|
828
|
-
|
|
829
|
-
|
|
830
|
-
|
|
831
|
-
|
|
832
|
-
|
|
833
|
-
|
|
834
|
-
|
|
835
|
-
|
|
836
|
-
|
|
837
|
-
|
|
838
|
-
|
|
839
|
-
|
|
840
|
-
|
|
841
|
-
|
|
842
|
-
|
|
843
|
-
|
|
844
|
-
|
|
845
|
-
|
|
846
|
-
|
|
847
|
-
|
|
848
|
-
|
|
849
|
-
|
|
850
|
-
|
|
851
|
-
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
}
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
869
|
-
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
875
|
-
|
|
876
|
-
|
|
877
|
-
|
|
878
|
-
|
|
879
|
-
|
|
880
|
-
|
|
881
|
-
|
|
882
|
-
|
|
883
|
-
|
|
884
|
-
|
|
885
|
-
|
|
886
|
-
|
|
887
|
-
|
|
888
|
-
|
|
889
|
-
|
|
890
|
-
|
|
891
|
-
|
|
892
|
-
|
|
893
|
-
|
|
894
|
-
|
|
895
|
-
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
907
|
-
|
|
908
|
-
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
|
|
912
|
-
|
|
913
|
-
|
|
914
|
-
|
|
915
|
-
|
|
916
|
-
|
|
917
|
-
|
|
918
|
-
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
|
|
925
|
-
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
|
|
929
|
-
|
|
930
|
-
|
|
931
|
-
|
|
932
|
-
|
|
933
|
-
|
|
934
|
-
|
|
935
|
-
|
|
936
|
-
|
|
937
|
-
|
|
938
|
-
|
|
939
|
-
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
945
|
-
|
|
946
|
-
|
|
947
|
-
|
|
948
|
-
|
|
949
|
-
|
|
950
|
-
|
|
951
|
-
|
|
952
|
-
|
|
953
|
-
|
|
954
|
-
|
|
955
|
-
|
|
956
|
-
|
|
957
|
-
|
|
958
|
-
|
|
959
|
-
|
|
960
|
-
|
|
961
|
-
|
|
962
|
-
|
|
963
|
-
|
|
964
|
-
|
|
965
|
-
|
|
966
|
-
|
|
967
|
-
|
|
968
|
-
|
|
969
|
-
|
|
970
|
-
|
|
971
|
-
|
|
972
|
-
|
|
973
|
-
|
|
974
|
-
|
|
975
|
-
|
|
976
|
-
|
|
977
|
-
|
|
978
|
-
|
|
979
|
-
|
|
980
|
-
|
|
981
|
-
|
|
982
|
-
|
|
983
|
-
|
|
984
|
-
|
|
985
|
-
|
|
986
|
-
|
|
987
|
-
|
|
988
|
-
|
|
989
|
-
*
|
|
990
|
-
*
|
|
991
|
-
*
|
|
992
|
-
*
|
|
993
|
-
*
|
|
994
|
-
*
|
|
995
|
-
*
|
|
996
|
-
*
|
|
997
|
-
*
|
|
998
|
-
*
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
*
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
*
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
if (settings
|
|
1012
|
-
|
|
1013
|
-
}
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
*
|
|
1021
|
-
*
|
|
1022
|
-
*
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1033
|
-
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
const
|
|
1037
|
-
|
|
1038
|
-
|
|
1039
|
-
|
|
1040
|
-
const
|
|
1041
|
-
|
|
1042
|
-
|
|
1043
|
-
|
|
1044
|
-
|
|
1045
|
-
|
|
1046
|
-
|
|
1047
|
-
|
|
1048
|
-
|
|
1049
|
-
|
|
1050
|
-
|
|
1051
|
-
|
|
1052
|
-
|
|
1053
|
-
|
|
1054
|
-
|
|
1055
|
-
|
|
1056
|
-
|
|
1057
|
-
|
|
1058
|
-
|
|
1059
|
-
|
|
1060
|
-
|
|
1061
|
-
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
|
|
1065
|
-
|
|
1066
|
-
|
|
1067
|
-
|
|
1068
|
-
|
|
1069
|
-
|
|
1070
|
-
|
|
1071
|
-
|
|
1072
|
-
|
|
1073
|
-
|
|
1074
|
-
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
|
|
1078
|
-
|
|
1079
|
-
|
|
1080
|
-
|
|
1081
|
-
|
|
1082
|
-
|
|
1083
|
-
|
|
1084
|
-
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1099
|
-
|
|
1100
|
-
|
|
1101
|
-
|
|
1102
|
-
|
|
1103
|
-
|
|
1104
|
-
|
|
1105
|
-
|
|
1106
|
-
|
|
1107
|
-
|
|
1108
|
-
|
|
1109
|
-
|
|
1110
|
-
|
|
1111
|
-
|
|
1112
|
-
|
|
1113
|
-
|
|
1114
|
-
|
|
1115
|
-
|
|
1116
|
-
|
|
1117
|
-
|
|
1118
|
-
|
|
1119
|
-
|
|
1120
|
-
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
const
|
|
1126
|
-
?
|
|
1127
|
-
|
|
1128
|
-
|
|
1129
|
-
|
|
1130
|
-
|
|
1131
|
-
|
|
1132
|
-
|
|
1133
|
-
|
|
1134
|
-
|
|
1135
|
-
|
|
1136
|
-
|
|
1137
|
-
|
|
1138
|
-
|
|
1139
|
-
|
|
1140
|
-
|
|
1141
|
-
|
|
1142
|
-
|
|
1143
|
-
|
|
1144
|
-
|
|
1145
|
-
|
|
1146
|
-
|
|
1147
|
-
|
|
1148
|
-
|
|
1149
|
-
|
|
1150
|
-
|
|
1151
|
-
|
|
1152
|
-
|
|
1153
|
-
|
|
1154
|
-
|
|
1155
|
-
|
|
1156
|
-
|
|
1157
|
-
|
|
1158
|
-
|
|
1159
|
-
|
|
1160
|
-
|
|
1161
|
-
|
|
1162
|
-
|
|
1163
|
-
|
|
1164
|
-
|
|
1165
|
-
res.
|
|
1166
|
-
});
|
|
1167
|
-
}
|
|
1168
|
-
|
|
1169
|
-
|
|
1170
|
-
|
|
1171
|
-
|
|
1172
|
-
|
|
1173
|
-
|
|
1174
|
-
|
|
1175
|
-
|
|
1176
|
-
|
|
1177
|
-
|
|
1178
|
-
|
|
1179
|
-
|
|
1180
|
-
|
|
1181
|
-
|
|
1182
|
-
|
|
1183
|
-
|
|
1184
|
-
|
|
1185
|
-
|
|
1186
|
-
|
|
1187
|
-
|
|
1188
|
-
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1194
|
-
|
|
1195
|
-
|
|
1196
|
-
|
|
1197
|
-
|
|
1198
|
-
|
|
1199
|
-
if (
|
|
1200
|
-
|
|
1201
|
-
|
|
1202
|
-
|
|
1203
|
-
|
|
1204
|
-
}
|
|
1205
|
-
if (this.
|
|
1206
|
-
|
|
1207
|
-
}
|
|
1208
|
-
|
|
1209
|
-
|
|
1210
|
-
|
|
1211
|
-
|
|
1212
|
-
|
|
1213
|
-
|
|
1214
|
-
|
|
1215
|
-
|
|
1216
|
-
|
|
1217
|
-
|
|
1218
|
-
|
|
1219
|
-
|
|
1220
|
-
|
|
1221
|
-
|
|
1222
|
-
|
|
1223
|
-
|
|
1224
|
-
|
|
1225
|
-
|
|
1226
|
-
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyNTS_App = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const Mongoose = require("mongoose");
|
|
6
|
+
const Express = require("express");
|
|
7
|
+
/* import Mongoose from 'mongoose';
|
|
8
|
+
import Express from 'express'; */
|
|
9
|
+
const BodyParser = tslib_1.__importStar(require("body-parser"));
|
|
10
|
+
const FileSystem = tslib_1.__importStar(require("fs"));
|
|
11
|
+
const Https = tslib_1.__importStar(require("https"));
|
|
12
|
+
const Path = tslib_1.__importStar(require("path"));
|
|
13
|
+
/* import { version } from '../../../package.json'; */
|
|
14
|
+
const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
|
|
15
|
+
const default_fallback_cache_max_age_const_1 = require("../../_collections/default-fallback-cache-max-age.const");
|
|
16
|
+
const default_not_found_page_const_1 = require("../../_collections/default-not-found-page.const");
|
|
17
|
+
const global_settings_const_1 = require("../../_collections/global-settings.const");
|
|
18
|
+
const client_safe_error_util_1 = require("../../_collections/client-safe-error.util");
|
|
19
|
+
const get_environment_settings_util_1 = require("../../_collections/get-environment-settings.util");
|
|
20
|
+
const security_headers_util_1 = require("../../_collections/security-headers.util");
|
|
21
|
+
const load_shed_util_1 = require("../../_collections/load-shed.util");
|
|
22
|
+
const app_version_header_util_1 = require("../../_collections/app-version-header.util");
|
|
23
|
+
const mongo_reconnect_guard_util_1 = require("../../_collections/mongo-reconnect-guard.util");
|
|
24
|
+
const static_cache_control_util_1 = require("../../_collections/static-cache-control.util");
|
|
25
|
+
const route_security_enum_1 = require("../../_enums/route-security.enum");
|
|
26
|
+
const app_system_controls_control_model_1 = require("../../_models/control-models/app-system-controls.control-model");
|
|
27
|
+
const http_settings_control_model_1 = require("../../_models/control-models/http-settings.control-model");
|
|
28
|
+
const singleton_service_1 = require("../base/singleton.service");
|
|
29
|
+
const global_service_1 = require("../core/global.service");
|
|
30
|
+
const collection_growth_monitor_service_1 = require("../core/collection-growth-monitor.service");
|
|
31
|
+
const memory_guard_service_1 = require("../core/memory-guard.service");
|
|
32
|
+
const event_loop_diag_service_1 = require("../core/event-loop-diag.service");
|
|
33
|
+
const request_telemetry_control_service_1 = require("../core/request-telemetry.control-service");
|
|
34
|
+
const safe_diagnostic_stage_type_enum_1 = require("../../_modules/server/safe-diagnostic/safe-diagnostic-stage.type-enum");
|
|
35
|
+
const safe_diagnostic_control_service_1 = require("../../_modules/server/safe-diagnostic/safe-diagnostic.control-service");
|
|
36
|
+
class DyNTS_App extends singleton_service_1.DyNTS_SingletonService {
|
|
37
|
+
systemControls = new app_system_controls_control_model_1.DyNTS_AppSystemControls();
|
|
38
|
+
get started() {
|
|
39
|
+
return this.systemControls.app.started;
|
|
40
|
+
}
|
|
41
|
+
get superStarted() {
|
|
42
|
+
return this.systemControls.app.started;
|
|
43
|
+
}
|
|
44
|
+
constructErrors = [];
|
|
45
|
+
/* removed since cant use version from package.json
|
|
46
|
+
private readonly _ntsVersion: string = 'v01.07.18';
|
|
47
|
+
protected get ntsVersion(): string {
|
|
48
|
+
return this._ntsVersion;
|
|
49
|
+
} */
|
|
50
|
+
get serverName() {
|
|
51
|
+
return this.params.name;
|
|
52
|
+
}
|
|
53
|
+
_params;
|
|
54
|
+
get params() {
|
|
55
|
+
return this._params;
|
|
56
|
+
}
|
|
57
|
+
mongoose = Mongoose;
|
|
58
|
+
_security;
|
|
59
|
+
get security() {
|
|
60
|
+
return this._security;
|
|
61
|
+
}
|
|
62
|
+
_portSettings = new http_settings_control_model_1.DyNTS_Http_Settings();
|
|
63
|
+
get portSettings() {
|
|
64
|
+
return this._portSettings;
|
|
65
|
+
}
|
|
66
|
+
_cert;
|
|
67
|
+
get cert() {
|
|
68
|
+
return this._cert;
|
|
69
|
+
}
|
|
70
|
+
openExpress;
|
|
71
|
+
secureExpress;
|
|
72
|
+
httpsServer;
|
|
73
|
+
httpServer;
|
|
74
|
+
globalService;
|
|
75
|
+
_rootServices = [];
|
|
76
|
+
_routingModules = [];
|
|
77
|
+
defaultReadyTimeout = 30 * fsm_dynamo_1.second;
|
|
78
|
+
defaultErrorUserMsg = `We encountered an unhandled Server Error, ` +
|
|
79
|
+
`\nplease contact the responsible development team.` +
|
|
80
|
+
`\n(Internal Server error)`;
|
|
81
|
+
get logSetup() {
|
|
82
|
+
return global_settings_const_1.DyNTS_global_settings.log_settings.setup;
|
|
83
|
+
}
|
|
84
|
+
get deepLog() {
|
|
85
|
+
return global_settings_const_1.DyNTS_global_settings.log_settings.deep;
|
|
86
|
+
}
|
|
87
|
+
get fnLogs() {
|
|
88
|
+
return global_settings_const_1.DyNTS_global_settings.log_settings.functions;
|
|
89
|
+
}
|
|
90
|
+
debugLog = global_settings_const_1.DyNTS_global_settings.log_settings.server_debug;
|
|
91
|
+
reportSafeDiagnostic(code, stage, error, status = 500) {
|
|
92
|
+
const configuredPrefix = global_settings_const_1.DyNTS_global_settings.systemShortCodeName;
|
|
93
|
+
const prefix = configuredPrefix && /^[A-Z][A-Z0-9_-]{1,31}$/.test(configuredPrefix)
|
|
94
|
+
? configuredPrefix
|
|
95
|
+
: 'DYNTS';
|
|
96
|
+
return safe_diagnostic_control_service_1.DyNTS_SafeDiagnostic_ControlService.report({
|
|
97
|
+
code: `${prefix}|${code}`,
|
|
98
|
+
stage: stage,
|
|
99
|
+
error: error,
|
|
100
|
+
status: status,
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
forwardSafeDiagnostic(diagnostic) {
|
|
104
|
+
try {
|
|
105
|
+
const pending = global_service_1.DyNTS_GlobalService.globalErrorHandler?.(safe_diagnostic_control_service_1.DyNTS_SafeDiagnostic_ControlService.toError(diagnostic));
|
|
106
|
+
void pending?.catch((error) => {
|
|
107
|
+
this.reportSafeDiagnostic('DYNTS-AS0-GLOBAL-HANDLER-REJECTED', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.globalErrorHandler, error);
|
|
108
|
+
});
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
this.reportSafeDiagnostic('DYNTS-AS0-GLOBAL-HANDLER-THREW', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.globalErrorHandler, error);
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
constructor( /* extended?: boolean */) {
|
|
115
|
+
super();
|
|
116
|
+
/* dotenv.config() */
|
|
117
|
+
process.on('unhandledRejection', (reason) => {
|
|
118
|
+
const diagnostic = this.reportSafeDiagnostic('DYNTS-AS0-BASE-UR', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.unhandledRejection, reason);
|
|
119
|
+
this.forwardSafeDiagnostic(diagnostic);
|
|
120
|
+
});
|
|
121
|
+
this.asyncConstruct( /* extended */).catch((error) => {
|
|
122
|
+
const diagnostic = this.reportSafeDiagnostic('DYNTS-AS0-BOOTSTRAP-FAILED', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.bootstrap, error);
|
|
123
|
+
this.forwardSafeDiagnostic(diagnostic);
|
|
124
|
+
process.exit(1);
|
|
125
|
+
});
|
|
126
|
+
}
|
|
127
|
+
async asyncConstruct(extended) {
|
|
128
|
+
if (this.fnLogs && this.deepLog)
|
|
129
|
+
fsm_dynamo_1.DyFM_Log.log('\nfn:. asyncConstruct');
|
|
130
|
+
try {
|
|
131
|
+
this.systemControls.app.init = true;
|
|
132
|
+
this._params = this.getAppParams();
|
|
133
|
+
fsm_dynamo_1.DyFM_Log.log(`\n\n\n\n\n\n\n\n\n\n` +
|
|
134
|
+
`Starting ${this._params?.name}... ` +
|
|
135
|
+
/* `v${version}` + */
|
|
136
|
+
`\n\n\n\n\n\n\n\n\n\n`);
|
|
137
|
+
if (!this._params) {
|
|
138
|
+
throw new Error('getAppParams() must return a DyNTS_AppParams object!');
|
|
139
|
+
}
|
|
140
|
+
if (this.params.systemShortCodeName) {
|
|
141
|
+
global_settings_const_1.DyNTS_global_settings.systemShortCodeName = this.params.systemShortCodeName;
|
|
142
|
+
}
|
|
143
|
+
if (this.params.systemName) {
|
|
144
|
+
global_settings_const_1.DyNTS_global_settings.systemName = this.params.systemName;
|
|
145
|
+
fsm_dynamo_1.DyFM_error_defaults.issuerSystem = this.params.systemName;
|
|
146
|
+
}
|
|
147
|
+
if (this.params.version) {
|
|
148
|
+
global_settings_const_1.DyNTS_global_settings.systemVersion = this.params.version;
|
|
149
|
+
fsm_dynamo_1.DyFM_error_defaults.systemVersion = this.params.version;
|
|
150
|
+
}
|
|
151
|
+
process.stdout.write(String.fromCharCode(27) + ']0;' +
|
|
152
|
+
this._params?.name +
|
|
153
|
+
String.fromCharCode(7));
|
|
154
|
+
fsm_dynamo_1.DyFM_error_defaults.issuerSystem = this._params.systemName;
|
|
155
|
+
this.overrideDynamoNTSGlobalSettings?.();
|
|
156
|
+
if (global_settings_const_1.DyNTS_global_settings.log_settings.setup) {
|
|
157
|
+
fsm_dynamo_1.DyFM_Log.S_info(`env settings;\n`, {
|
|
158
|
+
systemName: global_settings_const_1.DyNTS_global_settings.systemName,
|
|
159
|
+
systemShortCodeName: global_settings_const_1.DyNTS_global_settings.systemShortCodeName,
|
|
160
|
+
systemVersion: global_settings_const_1.DyNTS_global_settings.systemVersion,
|
|
161
|
+
environment: global_settings_const_1.DyNTS_global_settings.env_settings.environment,
|
|
162
|
+
/* log_settings: DyNTS_global_settings.log_settings,
|
|
163
|
+
env_settings: DyNTS_global_settings.env_settings, */
|
|
164
|
+
});
|
|
165
|
+
}
|
|
166
|
+
this.globalService = global_service_1.DyNTS_GlobalService.getInstance();
|
|
167
|
+
await global_service_1.DyNTS_GlobalService.setServices(this.getGlobalServiceCollection());
|
|
168
|
+
global_service_1.DyNTS_GlobalService.setParams(this.params);
|
|
169
|
+
if (this.getPortSettings) {
|
|
170
|
+
this._portSettings = this.getPortSettings();
|
|
171
|
+
}
|
|
172
|
+
if (this.getCertificationSettings) {
|
|
173
|
+
this._cert = this.getCertificationSettings();
|
|
174
|
+
}
|
|
175
|
+
if (this.getApiBasePath) {
|
|
176
|
+
global_settings_const_1.DyNTS_global_settings.baseUrl = this.getApiBasePath();
|
|
177
|
+
}
|
|
178
|
+
if (this.getRoutingModules) {
|
|
179
|
+
this._routingModules = this.getRoutingModules();
|
|
180
|
+
// ezt egyelőre csak tesztelem, nem kerül be
|
|
181
|
+
/* if (
|
|
182
|
+
!DyNTS_global_settings.dontCreateDefaultRoute &&
|
|
183
|
+
!this._routingModules.some((routingModule: DyNTS_RoutingModule): boolean => routingModule.route === '/*')
|
|
184
|
+
) {
|
|
185
|
+
this._routingModules.push(
|
|
186
|
+
DyNTS_getStarRoute()
|
|
187
|
+
);
|
|
188
|
+
} */
|
|
189
|
+
}
|
|
190
|
+
if (this._params.dbUri) {
|
|
191
|
+
await this.startDB();
|
|
192
|
+
// createEntries csak akkor fut, ha a DB tényleg fel-jött.
|
|
193
|
+
// Ha a startDB jelezte a hibát, de továbbment, akkor a started flag false marad,
|
|
194
|
+
// és nem próbálunk meg írni egy nem létező kapcsolatra.
|
|
195
|
+
if (this.createEntries && this.systemControls.mongoose.started) {
|
|
196
|
+
await this.createEntries();
|
|
197
|
+
}
|
|
198
|
+
}
|
|
199
|
+
else {
|
|
200
|
+
fsm_dynamo_1.DyFM_Log.log(`\nNo database connection created.`);
|
|
201
|
+
}
|
|
202
|
+
if (this._routingModules?.length) {
|
|
203
|
+
if (this.logSetup)
|
|
204
|
+
fsm_dynamo_1.DyFM_Log.log('\nsetting up express routes...');
|
|
205
|
+
this.setSecurity();
|
|
206
|
+
await this.initExpresses();
|
|
207
|
+
await this.startExpresses();
|
|
208
|
+
if (this._security !== route_security_enum_1.DyNTS_RouteSecurity.secure) {
|
|
209
|
+
await this.mountOpenRoutes();
|
|
210
|
+
}
|
|
211
|
+
if (this._security !== route_security_enum_1.DyNTS_RouteSecurity.open && this._cert) {
|
|
212
|
+
await this.mountSecureRoutes();
|
|
213
|
+
}
|
|
214
|
+
// Generikus, auth-agnosztikus extension-point: custom middleware az API
|
|
215
|
+
// route-ok UTÁN, de a SPA static catch-all (mountStaticClient) ELŐTT.
|
|
216
|
+
await this.mountCustomMiddleware();
|
|
217
|
+
await this.mountStaticClient();
|
|
218
|
+
if (this.logSetup) {
|
|
219
|
+
fsm_dynamo_1.DyFM_Log.log(`\nRoutes mounted.... server using security: ${this._security}`);
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
else {
|
|
223
|
+
fsm_dynamo_1.DyFM_Log.warn(`\nNo routes mounted!`);
|
|
224
|
+
}
|
|
225
|
+
if (this.getRootServices) {
|
|
226
|
+
this._rootServices = await this.getRootServices();
|
|
227
|
+
}
|
|
228
|
+
if (this.postProcess) {
|
|
229
|
+
await this.postProcess().catch((error) => {
|
|
230
|
+
const diagnostic = this.reportSafeDiagnostic('DYNTS-AS0-POST-PROCESS-FAILED', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.postProcess, error);
|
|
231
|
+
this.forwardSafeDiagnostic(diagnostic);
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
// FR-193 — bedrock OOM korai-figyelmeztetés: feltelepítjük a heap-watchdogot, ha
|
|
235
|
+
// engedélyezve (DyNTS_global_settings.memoryGuard.enabled, default true). Biztonságos:
|
|
236
|
+
// a guard egy könnyű setInterval, ami SOHA nem dob; csak near-OOM küszöböknél hagy
|
|
237
|
+
// tartós nyomot az error-sinkbe, mielőtt a fatal heap-OOM megölné a process-t.
|
|
238
|
+
try {
|
|
239
|
+
if (global_settings_const_1.DyNTS_global_settings.memoryGuard?.enabled) {
|
|
240
|
+
memory_guard_service_1.DyNTS_MemoryGuard.getInstance().install();
|
|
241
|
+
}
|
|
242
|
+
}
|
|
243
|
+
catch (memoryGuardError) {
|
|
244
|
+
this.reportSafeDiagnostic('DYNTS-AS0-MEMORY-GUARD-SKIPPED', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.memoryGuard, memoryGuardError);
|
|
245
|
+
}
|
|
246
|
+
// BFR-OVERSEER-007 — event-loop-lag diag a MemoryGuard MELLÉ: a „process él, HTTP néma" wedge
|
|
247
|
+
// belső mérése (natív histogram, olcsó). Observation-only, sosem dob; a /server/diag olvas belőle.
|
|
248
|
+
try {
|
|
249
|
+
event_loop_diag_service_1.DyNTS_EventLoopDiag.getInstance().install();
|
|
250
|
+
}
|
|
251
|
+
catch (eventLoopDiagError) {
|
|
252
|
+
this.reportSafeDiagnostic('DYNTS-AS0-EVENT-LOOP-DIAG-SKIPPED', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.eventLoopDiagnostic, eventLoopDiagError);
|
|
253
|
+
}
|
|
254
|
+
// FR-258 / SR-4 — proactive collection-growth monitor (companion to the MemoryGuard). Warns
|
|
255
|
+
// into the Errors-sink when a collection grows unbounded, BEFORE it can be loaded into heap and
|
|
256
|
+
// OOM. Default-on, observation-only, never throws.
|
|
257
|
+
try {
|
|
258
|
+
if (global_settings_const_1.DyNTS_global_settings.collectionGrowthMonitor?.enabled) {
|
|
259
|
+
collection_growth_monitor_service_1.DyNTS_CollectionGrowthMonitor.getInstance().install();
|
|
260
|
+
}
|
|
261
|
+
}
|
|
262
|
+
catch (cgmError) {
|
|
263
|
+
this.reportSafeDiagnostic('DYNTS-AS0-COLLECTION-GROWTH-MONITOR-SKIPPED', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.collectionGrowthMonitor, cgmError);
|
|
264
|
+
}
|
|
265
|
+
if (!extended) {
|
|
266
|
+
await this.ready();
|
|
267
|
+
if (this.params.title) {
|
|
268
|
+
fsm_dynamo_1.DyFM_Log.success(this.params.title);
|
|
269
|
+
}
|
|
270
|
+
fsm_dynamo_1.DyFM_Log.info(`Version: ${this.params.version}`);
|
|
271
|
+
/* DyFM_Log.info(`NTS Version: ${this.ntsVersion}`); */
|
|
272
|
+
fsm_dynamo_1.DyFM_Log.H_success(`${this.params.name} started successfully.`);
|
|
273
|
+
}
|
|
274
|
+
}
|
|
275
|
+
catch (error) {
|
|
276
|
+
this.constructErrors.push(error);
|
|
277
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
278
|
+
...this._getDefaultErrorSettings('asyncConstruct', error),
|
|
279
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-001`,
|
|
280
|
+
additionalContent: {
|
|
281
|
+
constructErrors: this.constructErrors,
|
|
282
|
+
systemControls: this.systemControls,
|
|
283
|
+
systemReadies: {
|
|
284
|
+
app: this.systemControls.app.getIsReady(),
|
|
285
|
+
mongoose: this.systemControls.mongoose.getIsReady(),
|
|
286
|
+
httpServer: this.systemControls.httpServer.getIsReady(),
|
|
287
|
+
httpsServer: this.systemControls.httpsServer.getIsReady(),
|
|
288
|
+
},
|
|
289
|
+
},
|
|
290
|
+
});
|
|
291
|
+
}
|
|
292
|
+
}
|
|
293
|
+
async ready(timeout = this.defaultReadyTimeout) {
|
|
294
|
+
try {
|
|
295
|
+
if (this.fnLogs)
|
|
296
|
+
fsm_dynamo_1.DyFM_Log.log('\nfn:. ready');
|
|
297
|
+
await fsm_dynamo_1.DyFM_Async.delay(100);
|
|
298
|
+
let ready = false;
|
|
299
|
+
const start = +new Date();
|
|
300
|
+
if (this.constructErrors.length) {
|
|
301
|
+
this.reportSafeDiagnostic('DYNTS-AS0-READINESS-CONSTRUCT-ERROR', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.readiness, this.constructErrors[0]);
|
|
302
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
303
|
+
...this._getDefaultErrorSettings('ready', new Error(`"${this._params.name}" start failed.`)),
|
|
304
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-R01`,
|
|
305
|
+
additionalContent: this.constructErrors.length === 1 ?
|
|
306
|
+
{ error: this.constructErrors[0] } :
|
|
307
|
+
{ errors: this.constructErrors },
|
|
308
|
+
});
|
|
309
|
+
}
|
|
310
|
+
while (!ready && +new Date() - start < timeout) {
|
|
311
|
+
if (this.systemControls.app.init) {
|
|
312
|
+
ready = (this.systemControls.mongoose.getIsReady() &&
|
|
313
|
+
this.systemControls.httpServer.getIsReady() &&
|
|
314
|
+
this.systemControls.httpsServer.getIsReady());
|
|
315
|
+
}
|
|
316
|
+
if (!ready) {
|
|
317
|
+
await fsm_dynamo_1.DyFM_Async.wait(100);
|
|
318
|
+
}
|
|
319
|
+
}
|
|
320
|
+
if (timeout < +new Date() - start) {
|
|
321
|
+
this.reportSafeDiagnostic('DYNTS-AS0-READINESS-TIMEOUT', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.readiness, this.constructErrors[0] ?? new Error('readiness-timeout'));
|
|
322
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
323
|
+
...this._getDefaultErrorSettings('ready', new Error(`"${this._params.name}" start failed. TIMEOUT`)),
|
|
324
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-R02`,
|
|
325
|
+
additionalContent: {
|
|
326
|
+
constructErrors: this.constructErrors,
|
|
327
|
+
systemControls: this.systemControls,
|
|
328
|
+
systemReadies: {
|
|
329
|
+
mongoose: this.systemControls.mongoose.getIsReady(),
|
|
330
|
+
httpServer: this.systemControls.httpServer.getIsReady(),
|
|
331
|
+
httpsServer: this.systemControls.httpsServer.getIsReady(),
|
|
332
|
+
},
|
|
333
|
+
},
|
|
334
|
+
});
|
|
335
|
+
}
|
|
336
|
+
if (this.constructErrors.length) {
|
|
337
|
+
this.reportSafeDiagnostic('DYNTS-AS0-READINESS-LATE-CONSTRUCT-ERROR', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.readiness, this.constructErrors[0]);
|
|
338
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
339
|
+
...this._getDefaultErrorSettings('ready', new Error(`"${this._params.name}" start failed.`)),
|
|
340
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-R03`,
|
|
341
|
+
additionalContent: this.constructErrors,
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
if (ready) {
|
|
345
|
+
this.systemControls.app.started = true;
|
|
346
|
+
if (this.fnLogs && this.deepLog)
|
|
347
|
+
fsm_dynamo_1.DyFM_Log.log('\nfn:. ready: return');
|
|
348
|
+
return;
|
|
349
|
+
}
|
|
350
|
+
this.systemControls.app.started = false;
|
|
351
|
+
let msg = `"${this._params.name}" start failed. UNKNOWN`;
|
|
352
|
+
if (this.systemControls.mongoose.init && !this.systemControls.mongoose.started) {
|
|
353
|
+
msg += `\nMongoose start failed.`;
|
|
354
|
+
}
|
|
355
|
+
if (this.systemControls.httpServer.init && !this.systemControls.httpServer.started) {
|
|
356
|
+
msg += `\nHTTP Server start failed.`;
|
|
357
|
+
}
|
|
358
|
+
if (this.systemControls.httpsServer.init && !this.systemControls.httpsServer.started) {
|
|
359
|
+
msg += `\nHTTPS Server start failed.`;
|
|
360
|
+
}
|
|
361
|
+
this.reportSafeDiagnostic('DYNTS-AS0-READINESS-UNKNOWN', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.readiness, this.constructErrors[0] ?? new Error('readiness-unknown'));
|
|
362
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
363
|
+
...this._getDefaultErrorSettings('ready', new Error(msg)),
|
|
364
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-R04`,
|
|
365
|
+
additionalContent: {
|
|
366
|
+
constructErrors: this.constructErrors,
|
|
367
|
+
systemControls: this.systemControls,
|
|
368
|
+
systemReadies: {
|
|
369
|
+
app: this.systemControls.app.getIsReady(),
|
|
370
|
+
mongoose: this.systemControls.mongoose.getIsReady(),
|
|
371
|
+
httpServer: this.systemControls.httpServer.getIsReady(),
|
|
372
|
+
httpsServer: this.systemControls.httpsServer.getIsReady(),
|
|
373
|
+
},
|
|
374
|
+
},
|
|
375
|
+
error: this.constructErrors?.[0] ?? new Error(),
|
|
376
|
+
});
|
|
377
|
+
}
|
|
378
|
+
catch (error) {
|
|
379
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
380
|
+
...this._getDefaultErrorSettings('ready', error),
|
|
381
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-READY0`,
|
|
382
|
+
});
|
|
383
|
+
}
|
|
384
|
+
}
|
|
385
|
+
getSimplifiedConstructErrors() {
|
|
386
|
+
return this.constructErrors.map((error) => {
|
|
387
|
+
if (error instanceof fsm_dynamo_1.DyFM_Error) {
|
|
388
|
+
return error.getErrorSimplified();
|
|
389
|
+
}
|
|
390
|
+
else {
|
|
391
|
+
return error;
|
|
392
|
+
}
|
|
393
|
+
});
|
|
394
|
+
}
|
|
395
|
+
async stop(dontLog) {
|
|
396
|
+
try {
|
|
397
|
+
fsm_dynamo_1.DyFM_Log.info('\nstopping server...\n');
|
|
398
|
+
await this.ready();
|
|
399
|
+
if (this.started) {
|
|
400
|
+
if (this.systemControls.mongoose.init) {
|
|
401
|
+
fsm_dynamo_1.DyFM_Log.info(`\nstopping Mongoose....`);
|
|
402
|
+
let tryCount = 0;
|
|
403
|
+
while (!this.systemControls.mongoose.started &&
|
|
404
|
+
!this.constructErrors.length &&
|
|
405
|
+
tryCount++ < 10) {
|
|
406
|
+
fsm_dynamo_1.DyFM_Log.warn(`Mongoose not even started yet....`);
|
|
407
|
+
await fsm_dynamo_1.DyFM_Async.wait(fsm_dynamo_1.second);
|
|
408
|
+
}
|
|
409
|
+
this.systemControls.mongoose.started = false;
|
|
410
|
+
if (this.mongoose) {
|
|
411
|
+
await fsm_dynamo_1.DyFM_Array.asyncForEach(Object.keys(this.mongoose.models), async (modelName) => {
|
|
412
|
+
this.mongoose.deleteModel(modelName);
|
|
413
|
+
});
|
|
414
|
+
const disconnect = new Promise((resolve) => {
|
|
415
|
+
this.mongoose.connection.on('disconnecting', () => {
|
|
416
|
+
resolve();
|
|
417
|
+
});
|
|
418
|
+
});
|
|
419
|
+
await this.mongoose.disconnect();
|
|
420
|
+
await this.mongoose.connection.close();
|
|
421
|
+
await disconnect;
|
|
422
|
+
this.mongoose.connection.removeAllListeners();
|
|
423
|
+
while (this.mongoose.connection.readyState !== 0 &&
|
|
424
|
+
!this.constructErrors.length) {
|
|
425
|
+
fsm_dynamo_1.DyFM_Log.warn(`\nMongoose still not disconnected....`);
|
|
426
|
+
await fsm_dynamo_1.DyFM_Async.wait(fsm_dynamo_1.second);
|
|
427
|
+
}
|
|
428
|
+
}
|
|
429
|
+
else {
|
|
430
|
+
fsm_dynamo_1.DyFM_Log.error(`\nMongoose not found.`);
|
|
431
|
+
}
|
|
432
|
+
this.systemControls.mongoose.init = false;
|
|
433
|
+
}
|
|
434
|
+
if (this.systemControls.httpServer.init) {
|
|
435
|
+
this.systemControls.httpServer.started = false;
|
|
436
|
+
if (this.httpServer) {
|
|
437
|
+
await new Promise((resolve) => {
|
|
438
|
+
this.httpServer.close(resolve);
|
|
439
|
+
});
|
|
440
|
+
}
|
|
441
|
+
else {
|
|
442
|
+
fsm_dynamo_1.DyFM_Log.error(`\nHTTP Server not found.`);
|
|
443
|
+
}
|
|
444
|
+
this.systemControls.httpServer.init = false;
|
|
445
|
+
}
|
|
446
|
+
if (this.systemControls.httpsServer.init) {
|
|
447
|
+
this.systemControls.httpsServer.started = false;
|
|
448
|
+
if (this.httpsServer) {
|
|
449
|
+
await new Promise((resolve) => {
|
|
450
|
+
this.httpsServer.close(resolve);
|
|
451
|
+
});
|
|
452
|
+
}
|
|
453
|
+
else {
|
|
454
|
+
fsm_dynamo_1.DyFM_Log.error(`\nHTTPS Server not found.`);
|
|
455
|
+
}
|
|
456
|
+
this.systemControls.httpsServer.init = false;
|
|
457
|
+
}
|
|
458
|
+
await fsm_dynamo_1.DyFM_Async.wait(fsm_dynamo_1.second);
|
|
459
|
+
if (!dontLog) {
|
|
460
|
+
fsm_dynamo_1.DyFM_Log.H_log(`"${this._params.name}" stopped successfully.`);
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
}
|
|
464
|
+
catch (error) {
|
|
465
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
466
|
+
...this._getDefaultErrorSettings('stop', error),
|
|
467
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-STOP0`,
|
|
468
|
+
});
|
|
469
|
+
}
|
|
470
|
+
}
|
|
471
|
+
/**
|
|
472
|
+
*
|
|
473
|
+
*/
|
|
474
|
+
async startDB() {
|
|
475
|
+
if (this.fnLogs && this.deepLog)
|
|
476
|
+
fsm_dynamo_1.DyFM_Log.log('\nfn:. startDB');
|
|
477
|
+
else if (this.logSetup)
|
|
478
|
+
fsm_dynamo_1.DyFM_Log.log('\nstarting DB connection...');
|
|
479
|
+
if (!this._params.dbUri) {
|
|
480
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
481
|
+
...this._getDefaultErrorSettings('startDB', new Error('DB URI is not set.')),
|
|
482
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-SDB0`,
|
|
483
|
+
});
|
|
484
|
+
}
|
|
485
|
+
if (!this._params.dbOptions) {
|
|
486
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
487
|
+
...this._getDefaultErrorSettings('startDB', new Error('DB OPTIONS are not set.')),
|
|
488
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-SDB0`,
|
|
489
|
+
});
|
|
490
|
+
}
|
|
491
|
+
if (this.systemControls.mongoose.init || this.systemControls.mongoose.started) {
|
|
492
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
493
|
+
...this._getDefaultErrorSettings('startDB', new Error('Mongoose is already initialized.')),
|
|
494
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-SDB0`,
|
|
495
|
+
});
|
|
496
|
+
}
|
|
497
|
+
try {
|
|
498
|
+
await new Promise((resolve, reject) => {
|
|
499
|
+
this.systemControls.mongoose.init = true;
|
|
500
|
+
this.mongoose.connection
|
|
501
|
+
.once('open', () => {
|
|
502
|
+
this.systemControls.mongoose.started = true;
|
|
503
|
+
fsm_dynamo_1.DyFM_Log.success('\nConnected to MongoDB.\n');
|
|
504
|
+
resolve();
|
|
505
|
+
// FR-258 / SR-2 — install declared-retention TTL indexes. DEFERRED + fire-and-forget +
|
|
506
|
+
// fully non-fatal: a create-if-missing index op (and the `indexes()` probes) must NOT
|
|
507
|
+
// compete with boot-readiness. We delay it well past the deploy health-probe window so a
|
|
508
|
+
// cold boot is never slowed by it, then run it detached. `.unref()` keeps it from holding
|
|
509
|
+
// the event loop open. Any failure is logged but never crashes the app. (`'differs'` never
|
|
510
|
+
// rebuilds a live index — see ensureRetentionTtlIndex.)
|
|
511
|
+
const ttlInstallTimer = setTimeout(() => {
|
|
512
|
+
void this.installRetentionTtlIndexes();
|
|
513
|
+
}, 30000);
|
|
514
|
+
if (typeof ttlInstallTimer.unref === 'function') {
|
|
515
|
+
ttlInstallTimer.unref();
|
|
516
|
+
}
|
|
517
|
+
})
|
|
518
|
+
.on('error', (error) => {
|
|
519
|
+
if (!this.systemControls.mongoose.started) {
|
|
520
|
+
// Initial DB-csatlakozás sikertelen:
|
|
521
|
+
// jelezzük a hibát (log + globalErrorHandler), de NEM szakítjuk meg az
|
|
522
|
+
// App startup-ot (nincs constructErrors push, nincs reject).
|
|
523
|
+
// A mongoose.init-et resetteljük, hogy a ready() ne várjon a DB-re.
|
|
524
|
+
// Ha a mongoose később mégis tudna csatlakozni, az 'open' event
|
|
525
|
+
// beállítja a started flag-et, így a runtime DB-műveletek elindulnak.
|
|
526
|
+
this.systemControls.mongoose.init = false;
|
|
527
|
+
const diagnostic = this.reportSafeDiagnostic('DYNTS-AS0-SDB1', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.databaseConnect, error, 503);
|
|
528
|
+
this.forwardSafeDiagnostic(diagnostic);
|
|
529
|
+
resolve();
|
|
530
|
+
}
|
|
531
|
+
else {
|
|
532
|
+
const diagnostic = this.reportSafeDiagnostic('DYNTS-AS0-SDB2', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.databaseRuntime, error, 503);
|
|
533
|
+
this.forwardSafeDiagnostic(diagnostic);
|
|
534
|
+
}
|
|
535
|
+
});
|
|
536
|
+
try {
|
|
537
|
+
this.mongoose.connect(this._params.dbUri, this._params.dbOptions
|
|
538
|
+
/* {
|
|
539
|
+
directConnection: true,
|
|
540
|
+
} */
|
|
541
|
+
);
|
|
542
|
+
}
|
|
543
|
+
catch (error) {
|
|
544
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
545
|
+
...this._getDefaultErrorSettings('startDB', error),
|
|
546
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-SDB3`,
|
|
547
|
+
});
|
|
548
|
+
}
|
|
549
|
+
});
|
|
550
|
+
}
|
|
551
|
+
catch (error) {
|
|
552
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
553
|
+
...this._getDefaultErrorSettings('startDB', error),
|
|
554
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-SDB0`,
|
|
555
|
+
});
|
|
556
|
+
}
|
|
557
|
+
// 2026-06-20 — Mongo reconnect-guard. A MongoDB-driver a hostnevet connect-kor EGYSZER
|
|
558
|
+
// resolválja + cache-eli az IP-t; ha a Mongo-konténert recreate-elik (új docker-network IP),
|
|
559
|
+
// a driver a HALOTT IP-n ragad → ECONNREFUSED + buffering-timeout, és a service magától SOHA
|
|
560
|
+
// nem áll vissza. A guard sustained-disconnect (readyState !== 1) esetén — a driver saját
|
|
561
|
+
// grace-e UTÁN — TELJES disconnect()+connect()-et csinál → ÚJ MongoClient → ÚJ DNS-resolve →
|
|
562
|
+
// új IP → reconnect. Best-effort, always-on, healthy connection-t (===1) SOHA nem bánt; csak
|
|
563
|
+
// konténer-IP-frissítés, nem ír adatot. Lásd: mongo-reconnect-guard.util.ts.
|
|
564
|
+
try {
|
|
565
|
+
(0, mongo_reconnect_guard_util_1.startMongoReconnectGuard)({
|
|
566
|
+
getReadyState: () => this.mongoose.connection.readyState,
|
|
567
|
+
reconnect: async () => {
|
|
568
|
+
await this.mongoose.disconnect().catch(() => undefined);
|
|
569
|
+
await this.mongoose.connect(this._params.dbUri, this._params.dbOptions);
|
|
570
|
+
},
|
|
571
|
+
log: (msg) => {
|
|
572
|
+
this.reportSafeDiagnostic('DYNTS-AS0-MONGO-RECONNECT-EVENT', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.mongoReconnectGuard, msg, 503);
|
|
573
|
+
},
|
|
574
|
+
});
|
|
575
|
+
}
|
|
576
|
+
catch (guardErr) {
|
|
577
|
+
this.reportSafeDiagnostic('DYNTS-AS0-MONGO-RECONNECT-FAILED', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.mongoReconnectGuard, guardErr, 503);
|
|
578
|
+
}
|
|
579
|
+
}
|
|
580
|
+
/**
|
|
581
|
+
* FR-258 / SR-2 — install MongoDB TTL indexes for every data-model that declared `retention`.
|
|
582
|
+
*
|
|
583
|
+
* Runs ONCE right after the DB connection opens. For each registered DB service (including the
|
|
584
|
+
* auto-created `_archived` siblings, which inherit the parent model's `retention`), it ensures a
|
|
585
|
+
* TTL index on the `__created` Date field with the resolved `expireAfterSeconds` — so MongoDB
|
|
586
|
+
* NATIVELY auto-deletes documents older than the configured age. This is the fleet-wide defense
|
|
587
|
+
* against the unbounded-collection-growth → in-memory-load → GC-thrash/OOM class.
|
|
588
|
+
*
|
|
589
|
+
* Guarantees:
|
|
590
|
+
* - **Non-fatal** — any error is logged but NEVER blocks startup (called fire-and-forget).
|
|
591
|
+
* - **Idempotent** — an existing index with the same TTL is a no-op; a CHANGED retention (different
|
|
592
|
+
* `expireAfterSeconds`, or an existing non-TTL `__created` index) is reconciled by drop+recreate
|
|
593
|
+
* (the field index is restored immediately, so query coverage is preserved).
|
|
594
|
+
*/
|
|
595
|
+
async installRetentionTtlIndexes() {
|
|
596
|
+
try {
|
|
597
|
+
const services = global_service_1.DyNTS_GlobalService.getAllDBServices();
|
|
598
|
+
let ensured = 0;
|
|
599
|
+
for (const service of services) {
|
|
600
|
+
const ttlSeconds = (0, fsm_dynamo_1.DyFM_resolveRetentionTtlSeconds)(service?.dataParams?.retention);
|
|
601
|
+
if (!ttlSeconds) {
|
|
602
|
+
continue;
|
|
603
|
+
}
|
|
604
|
+
const dataName = service.dataParams.dataName;
|
|
605
|
+
// The mongoose Model exposes the native driver collection (.indexes / .createIndex / .dropIndex).
|
|
606
|
+
const collection = service?.dataModel?.collection;
|
|
607
|
+
if (!collection || typeof collection.createIndex !== 'function') {
|
|
608
|
+
continue;
|
|
609
|
+
}
|
|
610
|
+
try {
|
|
611
|
+
const action = await DyNTS_App.ensureRetentionTtlIndex(collection, ttlSeconds);
|
|
612
|
+
if (action === 'created') {
|
|
613
|
+
ensured++;
|
|
614
|
+
if (this.logSetup) {
|
|
615
|
+
fsm_dynamo_1.DyFM_Log.success(`[FR-258 retention] TTL index created on "${dataName}" — ` +
|
|
616
|
+
`${Math.round(ttlSeconds / 86400)}d (${ttlSeconds}s)`);
|
|
617
|
+
}
|
|
618
|
+
}
|
|
619
|
+
else if (action === 'differs') {
|
|
620
|
+
// Live index has a different TTL — left untouched at boot (see ensureRetentionTtlIndex doc).
|
|
621
|
+
this.reportSafeDiagnostic('DYNTS-AS0-RETENTION-INDEX-DIFFERS', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.retention, new Error('retention-index-differs'));
|
|
622
|
+
}
|
|
623
|
+
}
|
|
624
|
+
catch (idxErr) {
|
|
625
|
+
this.reportSafeDiagnostic('DYNTS-AS0-RETENTION-INDEX-FAILED', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.retention, idxErr);
|
|
626
|
+
}
|
|
627
|
+
}
|
|
628
|
+
if (ensured > 0) {
|
|
629
|
+
fsm_dynamo_1.DyFM_Log.success(`[FR-258 retention] ${ensured} TTL index(es) ensured (auto-retention active).`);
|
|
630
|
+
}
|
|
631
|
+
}
|
|
632
|
+
catch (err) {
|
|
633
|
+
this.reportSafeDiagnostic('DYNTS-AS0-RETENTION-INSTALLER-FAILED', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.retention, err);
|
|
634
|
+
}
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* FR-258 / SR-2 — ensure a single `{ __created: 1 }` TTL index with the given `expireAfterSeconds`.
|
|
638
|
+
* Extracted as a pure-ish static so it is unit-testable with a mock collection. Idempotent + BOOT-SAFE:
|
|
639
|
+
* - no existing `__created` index → create it → `'created'`
|
|
640
|
+
* - existing with the SAME TTL → no-op → `'noop'`
|
|
641
|
+
* - existing with a DIFFERENT TTL / non-TTL → leave it as-is → `'differs'` (warn only — NO drop+recreate)
|
|
642
|
+
*
|
|
643
|
+
* The `'differs'` case intentionally does NOT mutate the live index. Dropping + recreating a TTL index on a
|
|
644
|
+
* large (multi-GB) production collection is a heavy server-side operation; doing it automatically inside the
|
|
645
|
+
* startup path can starve the concurrent boot queries (including the deploy health-probe) and trigger a
|
|
646
|
+
* fail-safe revert. Create-if-missing is the essential growth-prevention behaviour; a deliberate retention
|
|
647
|
+
* CHANGE on an already-indexed collection is a maintenance action, not a silent every-boot rebuild.
|
|
648
|
+
*/
|
|
649
|
+
static async ensureRetentionTtlIndex(collection, ttlSeconds) {
|
|
650
|
+
const existingList = typeof collection.indexes === 'function'
|
|
651
|
+
? await collection.indexes().catch(() => [])
|
|
652
|
+
: [];
|
|
653
|
+
const existing = existingList.find((ix) => !!ix?.key && ix.key.__created === 1);
|
|
654
|
+
if (!existing) {
|
|
655
|
+
await collection.createIndex({ __created: 1 }, { expireAfterSeconds: ttlSeconds });
|
|
656
|
+
return 'created';
|
|
657
|
+
}
|
|
658
|
+
if (existing.expireAfterSeconds === ttlSeconds) {
|
|
659
|
+
return 'noop';
|
|
660
|
+
}
|
|
661
|
+
// Retention differs from the live index (or it is a non-TTL `__created` index). Leave it UNTOUCHED at
|
|
662
|
+
// boot — only report it. Avoids a heavy drop+recreate competing with boot-readiness on a large collection.
|
|
663
|
+
return 'differs';
|
|
664
|
+
}
|
|
665
|
+
/**
|
|
666
|
+
*
|
|
667
|
+
*/
|
|
668
|
+
async initExpresses() {
|
|
669
|
+
if (this.fnLogs && this.deepLog)
|
|
670
|
+
fsm_dynamo_1.DyFM_Log.log('\nfn:. initExpresses');
|
|
671
|
+
try {
|
|
672
|
+
if (this._security && this._security !== route_security_enum_1.DyNTS_RouteSecurity.secure) {
|
|
673
|
+
if (this._portSettings.httpPort === undefined || this._portSettings.httpPort === null) {
|
|
674
|
+
let errorMsg = `\nYou have open routes, but httpPort is not set!` +
|
|
675
|
+
`\nThere are ${this._routingModules.filter(m => m.security != route_security_enum_1.DyNTS_RouteSecurity.secure).length} open/both routes` +
|
|
676
|
+
`\nroot security: ${this._security}` +
|
|
677
|
+
`\nset httpPort in DynamoBEServer - setupRoutingModules() to enable secure routes.`;
|
|
678
|
+
errorMsg += '\n\nThe routes setted to use open server:';
|
|
679
|
+
this._routingModules.forEach((module) => {
|
|
680
|
+
if (module.security != route_security_enum_1.DyNTS_RouteSecurity.secure) {
|
|
681
|
+
errorMsg += `\n ${module.route} (security: ${module.security})`;
|
|
682
|
+
errorMsg += `\n subroutes using open sever:`;
|
|
683
|
+
module.endpoints.forEach((endpoint) => {
|
|
684
|
+
if (endpoint.security != route_security_enum_1.DyNTS_RouteSecurity.secure) {
|
|
685
|
+
errorMsg += `\n ${endpoint.endpoint} (security: ${endpoint.security})`;
|
|
686
|
+
}
|
|
687
|
+
});
|
|
688
|
+
}
|
|
689
|
+
});
|
|
690
|
+
const error = new Error(`Open routes cannot be established!\n${errorMsg}`);
|
|
691
|
+
const errorStack = error.stack.split('\n');
|
|
692
|
+
errorStack.splice(1, 2);
|
|
693
|
+
error.stack = errorStack.join('\n');
|
|
694
|
+
this.reportSafeDiagnostic('DYNTS-AS0-OPEN-ROUTE-CONFIGURATION', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.routing, error);
|
|
695
|
+
throw error;
|
|
696
|
+
}
|
|
697
|
+
await this.initOpenExpress();
|
|
698
|
+
}
|
|
699
|
+
if (this._security && this._security !== route_security_enum_1.DyNTS_RouteSecurity.open) {
|
|
700
|
+
if (!this._cert || !this._portSettings.httpsPort) {
|
|
701
|
+
let errorMsg = `\nYou have secure routes, but the certification paths or httpsPort are not set!` +
|
|
702
|
+
`\nThere are ${this._routingModules.filter(m => m.security && m.security !== route_security_enum_1.DyNTS_RouteSecurity.open).length} secure routes` +
|
|
703
|
+
`\nroot security: ${this._security}` +
|
|
704
|
+
`\nset...` +
|
|
705
|
+
`\n(missing exact howto...)` +
|
|
706
|
+
/* `\n httpsPort and` +
|
|
707
|
+
`\n cert: {` +
|
|
708
|
+
`\n keyPath: FileSystem.PathLike,` +
|
|
709
|
+
`\n certPath: FileSystem.PathLike,` +
|
|
710
|
+
`\n }` + */
|
|
711
|
+
`\nin DynamoBEServer - getRoutingModules() to enable secure routes.`;
|
|
712
|
+
errorMsg += '\n\nThe routes setted to use secure server:';
|
|
713
|
+
this._routingModules.forEach((module) => {
|
|
714
|
+
if (module.security && module.security !== route_security_enum_1.DyNTS_RouteSecurity.open) {
|
|
715
|
+
errorMsg += `\n ${module.route} (security: ${module.security})`;
|
|
716
|
+
errorMsg += `\n location: ${module.stackLocation}`;
|
|
717
|
+
errorMsg += `\n subroutes using secure sever:`;
|
|
718
|
+
module.endpoints.forEach((endpoint) => {
|
|
719
|
+
if (endpoint.security && endpoint.security !== route_security_enum_1.DyNTS_RouteSecurity.open) {
|
|
720
|
+
errorMsg += `\n ${endpoint.endpoint} (security: ${endpoint.security})`;
|
|
721
|
+
errorMsg += `\n location: ${endpoint.stackLocation}`;
|
|
722
|
+
}
|
|
723
|
+
});
|
|
724
|
+
}
|
|
725
|
+
});
|
|
726
|
+
const error = new Error(`Secure routes cannot be established!\n${errorMsg}`);
|
|
727
|
+
const errorStack = error.stack.split('\n');
|
|
728
|
+
errorStack.splice(1, 2);
|
|
729
|
+
error.stack = errorStack.join('\n');
|
|
730
|
+
this.reportSafeDiagnostic('DYNTS-AS0-SECURE-ROUTE-CONFIGURATION', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.routing, error);
|
|
731
|
+
throw error;
|
|
732
|
+
}
|
|
733
|
+
await this.initSecureExpress();
|
|
734
|
+
}
|
|
735
|
+
}
|
|
736
|
+
catch (error) {
|
|
737
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
738
|
+
...this._getDefaultErrorSettings('initExpresses', error),
|
|
739
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-IE0`,
|
|
740
|
+
});
|
|
741
|
+
}
|
|
742
|
+
}
|
|
743
|
+
/**
|
|
744
|
+
*
|
|
745
|
+
*/
|
|
746
|
+
async initOpenExpress() {
|
|
747
|
+
if (this.fnLogs)
|
|
748
|
+
fsm_dynamo_1.DyFM_Log.log('\nfn:. initOpenExpress');
|
|
749
|
+
this.openExpress = Express();
|
|
750
|
+
this.openExpress.set('maxHeaderSize', 10 * fsm_dynamo_1.megabyte); // 1024 * 1024 * 10, // 10MB
|
|
751
|
+
this.openExpress.use(BodyParser.urlencoded(this._portSettings.httpUrlencoded));
|
|
752
|
+
this.openExpress.use(BodyParser.json(this._portSettings.httpJson));
|
|
753
|
+
// BFR-011 / SEC-R2-8 — security headerek a CORS ELŐTT (az OPTIONS preflight-válaszok is kapják).
|
|
754
|
+
this.mountSecurityHeaders(this.openExpress);
|
|
755
|
+
// FR-041 — CORS allowlist enforcement. No-op if getCorsSettings() is not overridden.
|
|
756
|
+
this.mountCors(this.openExpress);
|
|
757
|
+
// FR-292 — a deployolt app-verzio minden valaszon. A CORS UTAN kell, mert az
|
|
758
|
+
// `Access-Control-Expose-Headers`-hoz HOZZAFUZ (kulonben a CORS felulirna).
|
|
759
|
+
this.mountAppVersionHeader(this.openExpress);
|
|
760
|
+
this.mountRequestTelemetry(this.openExpress);
|
|
761
|
+
// BFR-OVERSEER-009 — opt-in auto-load-shed 503 CRITICAL memória-nyomásnál (esszenciális utak kivételével).
|
|
762
|
+
if (global_settings_const_1.DyNTS_global_settings.memoryGuard?.loadShedEnabled) {
|
|
763
|
+
this.openExpress.use((0, load_shed_util_1.DyNTS_createLoadShedMiddleware)());
|
|
764
|
+
}
|
|
765
|
+
}
|
|
766
|
+
/**
|
|
767
|
+
*
|
|
768
|
+
*/
|
|
769
|
+
async initSecureExpress() {
|
|
770
|
+
if (this.fnLogs)
|
|
771
|
+
fsm_dynamo_1.DyFM_Log.log('\nfn:. initSecureExpress');
|
|
772
|
+
this.secureExpress = Express();
|
|
773
|
+
this.secureExpress.use(BodyParser.urlencoded(this._portSettings.httpsUrlencoded));
|
|
774
|
+
this.secureExpress.use(BodyParser.json(this._portSettings.httpsJson));
|
|
775
|
+
// BFR-011 / SEC-R2-8 — security headerek a CORS ELŐTT (mint az open expressen).
|
|
776
|
+
this.mountSecurityHeaders(this.secureExpress);
|
|
777
|
+
// FR-041 — CORS allowlist enforcement (same as open express).
|
|
778
|
+
this.mountCors(this.secureExpress);
|
|
779
|
+
// FR-292 — a deployolt app-verzio minden valaszon (mint az open expressen).
|
|
780
|
+
this.mountAppVersionHeader(this.secureExpress);
|
|
781
|
+
this.mountRequestTelemetry(this.secureExpress);
|
|
782
|
+
// BFR-OVERSEER-009 — opt-in auto-load-shed 503 (mint az open expressen).
|
|
783
|
+
if (global_settings_const_1.DyNTS_global_settings.memoryGuard?.loadShedEnabled) {
|
|
784
|
+
this.secureExpress.use((0, load_shed_util_1.DyNTS_createLoadShedMiddleware)());
|
|
785
|
+
}
|
|
786
|
+
const options = {
|
|
787
|
+
key: FileSystem.readFileSync(this._cert.keyPath),
|
|
788
|
+
cert: FileSystem.readFileSync(this._cert.certPath),
|
|
789
|
+
maxHeaderSize: 10 * fsm_dynamo_1.megabyte, // 1024 * 1024 * 10, // 10MB
|
|
790
|
+
};
|
|
791
|
+
this.httpsServer = Https.createServer(options, this.secureExpress);
|
|
792
|
+
}
|
|
793
|
+
/**
|
|
794
|
+
*
|
|
795
|
+
*/
|
|
796
|
+
async startExpresses() {
|
|
797
|
+
if (this.fnLogs && this.deepLog)
|
|
798
|
+
fsm_dynamo_1.DyFM_Log.log('\nfn:. startExpresses');
|
|
799
|
+
try {
|
|
800
|
+
if (this._security && this._security !== route_security_enum_1.DyNTS_RouteSecurity.open) {
|
|
801
|
+
await new Promise((resolve, reject) => {
|
|
802
|
+
this.systemControls.httpsServer.init = true;
|
|
803
|
+
this.httpsServer
|
|
804
|
+
.listen(this._portSettings.httpsPort, this.params.secureHost, this.params.expressBacklog, () => {
|
|
805
|
+
this.systemControls.httpsServer.started = true;
|
|
806
|
+
fsm_dynamo_1.DyFM_Log.success(`\nHTTPS (secure) server is listening on port: ` +
|
|
807
|
+
`${this.params.secureHost}:${this._portSettings.httpsPort}`);
|
|
808
|
+
resolve();
|
|
809
|
+
})
|
|
810
|
+
.on('error', (error) => {
|
|
811
|
+
const diagnostic = this.reportSafeDiagnostic('DYNTS-AS0-HTTPS-ERROR', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.httpsServer, error, 503);
|
|
812
|
+
if (!this.systemControls.httpsServer.started) {
|
|
813
|
+
const d_error = new fsm_dynamo_1.DyFM_Error({
|
|
814
|
+
...this._getDefaultErrorSettings('startExpresses', error),
|
|
815
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-SE1`,
|
|
816
|
+
message: `HTTPS (secure) start server ERROR`,
|
|
817
|
+
});
|
|
818
|
+
this.constructErrors.push(d_error);
|
|
819
|
+
this.forwardSafeDiagnostic(diagnostic);
|
|
820
|
+
reject(d_error);
|
|
821
|
+
}
|
|
822
|
+
else {
|
|
823
|
+
this.forwardSafeDiagnostic(diagnostic);
|
|
824
|
+
}
|
|
825
|
+
})
|
|
826
|
+
.on('uncaughtException', (exception) => {
|
|
827
|
+
const diagnostic = this.reportSafeDiagnostic('DYNTS-AS0-HTTPS-UNCAUGHT', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.httpsServer, exception);
|
|
828
|
+
this.forwardSafeDiagnostic(diagnostic);
|
|
829
|
+
});
|
|
830
|
+
});
|
|
831
|
+
}
|
|
832
|
+
if (this._security && this._security !== route_security_enum_1.DyNTS_RouteSecurity.secure) {
|
|
833
|
+
this.systemControls.httpServer.init = true;
|
|
834
|
+
await new Promise((resolve, reject) => {
|
|
835
|
+
this.httpServer = this.openExpress
|
|
836
|
+
.listen(this._portSettings.httpPort, this.params.openHost, this.params.expressBacklog, () => {
|
|
837
|
+
this.systemControls.httpServer.started = true;
|
|
838
|
+
const resolvedPort = this.httpServer?.address?.()?.['port'] ?? this._portSettings.httpPort;
|
|
839
|
+
if (this._portSettings.httpPort === 0) {
|
|
840
|
+
fsm_dynamo_1.DyFM_Log.H_warn(`\nHTTP (open) server is using a randomly selected port by the OS: ${resolvedPort}` +
|
|
841
|
+
`\n (httpPort was set to 0 — this is intended for testing only)`);
|
|
842
|
+
}
|
|
843
|
+
fsm_dynamo_1.DyFM_Log.success(`\nHTTP (open) server is listening on port: ` +
|
|
844
|
+
`${this.params.openHost}:${resolvedPort}`);
|
|
845
|
+
resolve();
|
|
846
|
+
})
|
|
847
|
+
.on('error', (error) => {
|
|
848
|
+
const diagnostic = this.reportSafeDiagnostic('DYNTS-AS0-HTTP-ERROR', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.httpServer, error, 503);
|
|
849
|
+
if (!this.systemControls.httpServer.started) {
|
|
850
|
+
const d_error = new fsm_dynamo_1.DyFM_Error({
|
|
851
|
+
...this._getDefaultErrorSettings('startExpresses', error),
|
|
852
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-SE3`,
|
|
853
|
+
message: `HTTP (open) start server ERROR`,
|
|
854
|
+
});
|
|
855
|
+
this.constructErrors.push(d_error);
|
|
856
|
+
this.forwardSafeDiagnostic(diagnostic);
|
|
857
|
+
reject(d_error);
|
|
858
|
+
}
|
|
859
|
+
else {
|
|
860
|
+
this.forwardSafeDiagnostic(diagnostic);
|
|
861
|
+
}
|
|
862
|
+
})
|
|
863
|
+
.on('uncaughtException', (exception) => {
|
|
864
|
+
const diagnostic = this.reportSafeDiagnostic('DYNTS-AS0-HTTP-UNCAUGHT', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.httpServer, exception);
|
|
865
|
+
this.forwardSafeDiagnostic(diagnostic);
|
|
866
|
+
});
|
|
867
|
+
});
|
|
868
|
+
}
|
|
869
|
+
}
|
|
870
|
+
catch (error) {
|
|
871
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
872
|
+
...this._getDefaultErrorSettings('startExpresses', error),
|
|
873
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-SE0`,
|
|
874
|
+
});
|
|
875
|
+
}
|
|
876
|
+
}
|
|
877
|
+
/**
|
|
878
|
+
*
|
|
879
|
+
*/
|
|
880
|
+
async expressErrorHandling(error, req, res, next) {
|
|
881
|
+
try {
|
|
882
|
+
if (error) {
|
|
883
|
+
const diagnostic = this.reportSafeDiagnostic('DYNTS-AS0-EXPRESS-ERROR', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.expressFallback, error);
|
|
884
|
+
this.forwardSafeDiagnostic(diagnostic);
|
|
885
|
+
// Kliens-safe strip (BFR-FDPAUTHSERVICE-002): az express-error út eddig NYERS error-t küldött
|
|
886
|
+
// (0 strip) — DyFM-nél belső stack/verzió/issuer, axios-jellegű error-nál akár auth-header is
|
|
887
|
+
// kimehetett. A strip-szabályok SSOT-ja a DyNTS_ClientSafeError_Util.
|
|
888
|
+
res.send(client_safe_error_util_1.DyNTS_ClientSafeError_Util.toClientSafe(error));
|
|
889
|
+
}
|
|
890
|
+
else {
|
|
891
|
+
const diagnostic = this.reportSafeDiagnostic('DYNTS-AS0-EXPRESS-MISSING-ERROR', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.expressFallback);
|
|
892
|
+
this.forwardSafeDiagnostic(diagnostic);
|
|
893
|
+
}
|
|
894
|
+
}
|
|
895
|
+
catch (error) {
|
|
896
|
+
const diagnostic = this.reportSafeDiagnostic('DYNTS-AS0-EXPRESS-MULTILEVEL', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.expressFallback, error);
|
|
897
|
+
this.forwardSafeDiagnostic(diagnostic);
|
|
898
|
+
}
|
|
899
|
+
}
|
|
900
|
+
/**
|
|
901
|
+
*
|
|
902
|
+
*/
|
|
903
|
+
async mountSecureRoutes() {
|
|
904
|
+
try {
|
|
905
|
+
if (this.fnLogs && this.deepLog)
|
|
906
|
+
fsm_dynamo_1.DyFM_Log.log('\nfn:. mountSecureRoutes');
|
|
907
|
+
if (!this.secureExpress) {
|
|
908
|
+
throw new Error('secureExpress was not initialized. ' +
|
|
909
|
+
'Secure routes require getCertificationSettings and httpsPort, and cert files must exist.' +
|
|
910
|
+
'\n\nYou need to set security to secure or both in any route and set httpsPort in getPortSettings.' +
|
|
911
|
+
'\n\nYou need to set cert files in getCertificationSettings.');
|
|
912
|
+
}
|
|
913
|
+
this.secureExpress.use((error, req, res, next) => this.expressErrorHandling(error, req, res, next));
|
|
914
|
+
await fsm_dynamo_1.DyFM_Array.asyncForEach(this._routingModules, async (module) => {
|
|
915
|
+
if (module.security !== route_security_enum_1.DyNTS_RouteSecurity.open) {
|
|
916
|
+
if (this.logSetup) {
|
|
917
|
+
fsm_dynamo_1.DyFM_Log.log(`route mount (secure): ${module.route}`);
|
|
918
|
+
}
|
|
919
|
+
const existingRoutes = this._routingModules.filter((mod) => mod.route === module.route);
|
|
920
|
+
if (1 < existingRoutes.length) {
|
|
921
|
+
const error = new Error(`ROUTE DUPLICATION: ${module.route}`);
|
|
922
|
+
/* const errorStack: string[] = error.stack.split('\n');
|
|
923
|
+
|
|
924
|
+
errorStack.splice(1, 4);
|
|
925
|
+
error.stack = errorStack.join('\n'); */
|
|
926
|
+
error.stack = module.stackLocation;
|
|
927
|
+
this.reportSafeDiagnostic('DYNTS-AS0-SECURE-ROUTE-DUPLICATION', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.routing, error);
|
|
928
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
929
|
+
...this._getDefaultErrorSettings('mountSecureRoutes', error),
|
|
930
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-MSR1`,
|
|
931
|
+
message: `ROUTE DUPLICATION: ${module.route}`,
|
|
932
|
+
});
|
|
933
|
+
}
|
|
934
|
+
this.secureExpress.use(module.route, module.secureRouter);
|
|
935
|
+
}
|
|
936
|
+
});
|
|
937
|
+
}
|
|
938
|
+
catch (error) {
|
|
939
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
940
|
+
...this._getDefaultErrorSettings('mountSecureRoutes', error),
|
|
941
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-MSR0`,
|
|
942
|
+
});
|
|
943
|
+
}
|
|
944
|
+
}
|
|
945
|
+
/**
|
|
946
|
+
*
|
|
947
|
+
*/
|
|
948
|
+
async mountOpenRoutes() {
|
|
949
|
+
try {
|
|
950
|
+
if (this.fnLogs && this.deepLog)
|
|
951
|
+
fsm_dynamo_1.DyFM_Log.log('\nfn:. mountOpenRoutes');
|
|
952
|
+
if (!this.openExpress) {
|
|
953
|
+
throw new Error('openExpress was not initialized. Open routes require getOpenExpress and httpPort.' +
|
|
954
|
+
'\n\nYou need to set security to open or both in any route and set httpPort in getPortSettings.');
|
|
955
|
+
}
|
|
956
|
+
this.openExpress.use((error, req, res, next) => this.expressErrorHandling(error, req, res, next));
|
|
957
|
+
await fsm_dynamo_1.DyFM_Array.asyncForEach(this._routingModules, async (module) => {
|
|
958
|
+
if (module.security !== route_security_enum_1.DyNTS_RouteSecurity.secure) {
|
|
959
|
+
if (this.logSetup) {
|
|
960
|
+
fsm_dynamo_1.DyFM_Log.log(`route mount (open): ${module.route}`);
|
|
961
|
+
}
|
|
962
|
+
const existingRoutes = this._routingModules.filter((mod) => mod.route === module.route);
|
|
963
|
+
if (1 < existingRoutes.length) {
|
|
964
|
+
const error = new Error(`ROUTE DUPLICATION: ${module.route}`);
|
|
965
|
+
/* const errorStack: string[] = error.stack.split('\n');
|
|
966
|
+
|
|
967
|
+
errorStack.splice(1, 4);
|
|
968
|
+
error.stack = errorStack.join('\n'); */
|
|
969
|
+
error.stack = module.stackLocation;
|
|
970
|
+
this.reportSafeDiagnostic('DYNTS-AS0-OPEN-ROUTE-DUPLICATION', safe_diagnostic_stage_type_enum_1.DyNTS_SafeDiagnosticStage_Type.routing, error);
|
|
971
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
972
|
+
...this._getDefaultErrorSettings('mountOpenRoutes', error),
|
|
973
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-MOR1`,
|
|
974
|
+
message: `ROUTE DUPLICATION: ${module.route}`,
|
|
975
|
+
});
|
|
976
|
+
}
|
|
977
|
+
this.openExpress.use(module.route, module.openRouter);
|
|
978
|
+
}
|
|
979
|
+
});
|
|
980
|
+
}
|
|
981
|
+
catch (error) {
|
|
982
|
+
throw new fsm_dynamo_1.DyFM_Error({
|
|
983
|
+
...this._getDefaultErrorSettings('mountOpenRoutes', error),
|
|
984
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-AS0-MOR0`,
|
|
985
|
+
});
|
|
986
|
+
}
|
|
987
|
+
}
|
|
988
|
+
/**
|
|
989
|
+
* FR-041 — CORS middleware. Echoes a matching `Access-Control-Allow-Origin`
|
|
990
|
+
* for any request whose Origin header is in `getCorsSettings().allowedOrigins`,
|
|
991
|
+
* adds the canonical `Access-Control-*` companion headers, and short-circuits
|
|
992
|
+
* the OPTIONS preflight with a 204.
|
|
993
|
+
*
|
|
994
|
+
* No-op when the subclass does NOT override `getCorsSettings()` — preserves
|
|
995
|
+
* back-compat for apps that have always been same-origin and never needed
|
|
996
|
+
* CORS (the typical pre-FR-041 case).
|
|
997
|
+
*
|
|
998
|
+
* Why hand-rolled instead of the `cors` npm package:
|
|
999
|
+
* - ~30 lines, zero new dependency.
|
|
1000
|
+
* - Full control over Vary/credentials/preflight semantics.
|
|
1001
|
+
* - Aligns with FDP "no unnecessary deps" philosophy.
|
|
1002
|
+
*/
|
|
1003
|
+
/**
|
|
1004
|
+
* BFR-011 / SEC-R2-8 — security response-headerek mountolása (a `mountCors` tükörképe).
|
|
1005
|
+
* A `DyNTS_global_settings.securityHeaders` alapján (default-ON) minden válaszra ráteszi a
|
|
1006
|
+
* biztonsági headereket + eltávolítja az `x-powered-by`-t. A CORS-mount ELŐTT hívandó, hogy az
|
|
1007
|
+
* OPTIONS preflight-válaszok (amiket a mountCors 204-gyel rövidre zár) is megkapják.
|
|
1008
|
+
*/
|
|
1009
|
+
mountSecurityHeaders(express) {
|
|
1010
|
+
const settings = global_settings_const_1.DyNTS_global_settings.securityHeaders;
|
|
1011
|
+
if (!settings || !settings.enabled) {
|
|
1012
|
+
return;
|
|
1013
|
+
}
|
|
1014
|
+
if (settings.removePoweredBy !== false) {
|
|
1015
|
+
express.disable('x-powered-by');
|
|
1016
|
+
}
|
|
1017
|
+
express.use((0, security_headers_util_1.DyNTS_createSecurityHeadersMiddleware)(settings, (0, get_environment_settings_util_1.DyNTS_getEnvironment_settings)().environment));
|
|
1018
|
+
}
|
|
1019
|
+
/**
|
|
1020
|
+
* FR-292 — a deployolt app-verziot minden valaszra rateszi (`X-App-Version`), hogy a
|
|
1021
|
+
* bongeszoben NYITVA HAGYOTT SPA eszrevegye, ha kozben ujabb kliens-build ment ki.
|
|
1022
|
+
*
|
|
1023
|
+
* Nem polling: a jelzes a MAR MENO API-hivasokon utazik. Az `enabled` default TRUE — egy
|
|
1024
|
+
* informativ response-header, ami se PII-t, se belso reszletet nem szivarogtat, viszont
|
|
1025
|
+
* enelkul minden app kulon-kulon epitene ugyanezt.
|
|
1026
|
+
*/
|
|
1027
|
+
mountAppVersionHeader(express) {
|
|
1028
|
+
const settings = global_settings_const_1.DyNTS_global_settings.appVersionHeader;
|
|
1029
|
+
if (settings?.enabled === false) {
|
|
1030
|
+
return;
|
|
1031
|
+
}
|
|
1032
|
+
express.use((0, app_version_header_util_1.DyNTS_createAppVersionHeaderMiddleware)(() => global_settings_const_1.DyNTS_global_settings.systemVersion, settings?.headerName));
|
|
1033
|
+
}
|
|
1034
|
+
/** Mounts opt-in correlation and aggregate metrics before load shedding and every API route. */
|
|
1035
|
+
mountRequestTelemetry(express) {
|
|
1036
|
+
const settings = this.getRequestTelemetrySettings?.();
|
|
1037
|
+
if (settings?.enabled !== true) {
|
|
1038
|
+
return;
|
|
1039
|
+
}
|
|
1040
|
+
const telemetry = request_telemetry_control_service_1.DyNTS_RequestTelemetry_ControlService.getInstance();
|
|
1041
|
+
telemetry.configure(settings);
|
|
1042
|
+
express.use(telemetry.createMiddleware());
|
|
1043
|
+
}
|
|
1044
|
+
mountCors(express) {
|
|
1045
|
+
const settings = this.getCorsSettings?.();
|
|
1046
|
+
if (!settings) {
|
|
1047
|
+
return;
|
|
1048
|
+
}
|
|
1049
|
+
const allowCreds = settings.allowCredentials !== false;
|
|
1050
|
+
const methods = settings.allowedMethods ?? [
|
|
1051
|
+
'GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS',
|
|
1052
|
+
];
|
|
1053
|
+
const headers = settings.allowedHeaders ?? [
|
|
1054
|
+
'Authorization', 'Content-Type', 'X-Admin-Key', 'X-Requested-With',
|
|
1055
|
+
];
|
|
1056
|
+
const exposed = settings.exposedHeaders ?? [
|
|
1057
|
+
'Content-Length', 'Content-Type',
|
|
1058
|
+
];
|
|
1059
|
+
const maxAge = settings.maxAgeSeconds ?? 86400;
|
|
1060
|
+
const isAllowed = (origin) => {
|
|
1061
|
+
if (settings.allowedOrigins === '*')
|
|
1062
|
+
return true;
|
|
1063
|
+
if (typeof settings.allowedOrigins === 'function') {
|
|
1064
|
+
return settings.allowedOrigins(origin);
|
|
1065
|
+
}
|
|
1066
|
+
return settings.allowedOrigins.includes(origin);
|
|
1067
|
+
};
|
|
1068
|
+
express.use((req, res, next) => {
|
|
1069
|
+
const origin = req.headers.origin;
|
|
1070
|
+
if (origin && isAllowed(origin)) {
|
|
1071
|
+
// Echo the matching origin (NOT wildcard) because credentials require it.
|
|
1072
|
+
res.setHeader('Access-Control-Allow-Origin', origin);
|
|
1073
|
+
if (allowCreds) {
|
|
1074
|
+
res.setHeader('Access-Control-Allow-Credentials', 'true');
|
|
1075
|
+
}
|
|
1076
|
+
res.setHeader('Access-Control-Allow-Methods', methods.join(', '));
|
|
1077
|
+
res.setHeader('Access-Control-Allow-Headers', headers.join(', '));
|
|
1078
|
+
res.setHeader('Access-Control-Expose-Headers', exposed.join(', '));
|
|
1079
|
+
res.setHeader('Access-Control-Max-Age', String(maxAge));
|
|
1080
|
+
res.setHeader('Vary', 'Origin');
|
|
1081
|
+
}
|
|
1082
|
+
if (req.method === 'OPTIONS') {
|
|
1083
|
+
res.status(204).end();
|
|
1084
|
+
return;
|
|
1085
|
+
}
|
|
1086
|
+
next();
|
|
1087
|
+
});
|
|
1088
|
+
}
|
|
1089
|
+
/**
|
|
1090
|
+
* Generikus, auth-agnosztikus extension-point orchestrator. A `registerCustomMiddleware`
|
|
1091
|
+
* hookot hívja (ha a subclass override-olja) minden AKTÍV Express instance-ra
|
|
1092
|
+
* (open + secure), az API route-ok UTÁN, de a SPA static catch-all (`app.get('*')`)
|
|
1093
|
+
* ELŐTT — ez az EGYETLEN korrekt pont egy sub-path middleware-hez (pl. reverse-proxy),
|
|
1094
|
+
* mert a catch-all minden utána mountolt route-ot elnyel. No-op ha nincs override (back-compat).
|
|
1095
|
+
*/
|
|
1096
|
+
async mountCustomMiddleware() {
|
|
1097
|
+
if (!this.registerCustomMiddleware) {
|
|
1098
|
+
return;
|
|
1099
|
+
}
|
|
1100
|
+
if (this.openExpress) {
|
|
1101
|
+
await this.registerCustomMiddleware(this.openExpress, route_security_enum_1.DyNTS_RouteSecurity.open);
|
|
1102
|
+
}
|
|
1103
|
+
if (this.secureExpress) {
|
|
1104
|
+
await this.registerCustomMiddleware(this.secureExpress, route_security_enum_1.DyNTS_RouteSecurity.secure);
|
|
1105
|
+
}
|
|
1106
|
+
if (this.logSetup) {
|
|
1107
|
+
fsm_dynamo_1.DyFM_Log.log('\nCustom middleware registered (pre-static).');
|
|
1108
|
+
}
|
|
1109
|
+
}
|
|
1110
|
+
/**
|
|
1111
|
+
* Ha getStaticClientSettings() visszaad beállításokat, a client static fájlok a '/' alatt
|
|
1112
|
+
* lesznek kiszolgálva (API route-ok után). SPA fallback opcionális (fallbackPath).
|
|
1113
|
+
* Asset cache (assetCacheMaxAge, assetCacheImmutable) és fallback cache (fallbackCacheMaxAge)
|
|
1114
|
+
* opcionálisak; ha nincs megadva fallbackCacheMaxAge, DyNTS_defaultFallbackCacheMaxAge (0) marad.
|
|
1115
|
+
*/
|
|
1116
|
+
async mountStaticClient() {
|
|
1117
|
+
const settings = this.getStaticClientSettings?.();
|
|
1118
|
+
if (!settings) {
|
|
1119
|
+
return;
|
|
1120
|
+
}
|
|
1121
|
+
const absoluteRoot = Path.isAbsolute(settings.root)
|
|
1122
|
+
? settings.root
|
|
1123
|
+
: Path.resolve(process.cwd(), settings.root);
|
|
1124
|
+
const hasAssetCache = settings.assetCacheMaxAge !== undefined || settings.assetCacheImmutable === true;
|
|
1125
|
+
const staticOptions = hasAssetCache && settings.assetCacheMaxAge !== undefined
|
|
1126
|
+
? {
|
|
1127
|
+
setHeaders: (res, filePath) => {
|
|
1128
|
+
// A HTML entry-fájlok (index.html) no-cache-t kapnak, a hash-elt asset-ek
|
|
1129
|
+
// immutable long-cache-t — lásd DyNTS_resolveStaticCacheControlHeader (served-stale-index fix).
|
|
1130
|
+
res.setHeader('Cache-Control', (0, static_cache_control_util_1.DyNTS_resolveStaticCacheControlHeader)({
|
|
1131
|
+
filePath: filePath,
|
|
1132
|
+
assetCacheMaxAge: settings.assetCacheMaxAge,
|
|
1133
|
+
assetCacheImmutable: settings.assetCacheImmutable === true,
|
|
1134
|
+
}));
|
|
1135
|
+
},
|
|
1136
|
+
}
|
|
1137
|
+
: undefined;
|
|
1138
|
+
const staticMiddleware = staticOptions
|
|
1139
|
+
? Express.static(absoluteRoot, staticOptions)
|
|
1140
|
+
: Express.static(absoluteRoot);
|
|
1141
|
+
const fallbackMaxAge = settings.fallbackCacheMaxAge ?? default_fallback_cache_max_age_const_1.DyNTS_defaultFallbackCacheMaxAge;
|
|
1142
|
+
// API-namespace guard (BFR-DYNAMOBUILDER-001): a catch-all fallback NE fedje az API-prefixeket —
|
|
1143
|
+
// egy ismeretlen `GET /api/...` 404 JSON-t kapjon, ne megtévesztő `200 + index.html`-t.
|
|
1144
|
+
// Konfigurálható (fallbackExcludePrefixes); default a bevett FDP namespace-pár.
|
|
1145
|
+
const excludePrefixes = settings.fallbackExcludePrefixes ?? ['/api', '/auth-api'];
|
|
1146
|
+
const isApiNamespacePath = (path) => excludePrefixes.some((prefix) => path === prefix || path.startsWith(`${prefix}/`));
|
|
1147
|
+
if (this.openExpress) {
|
|
1148
|
+
this.openExpress.use('/', staticMiddleware);
|
|
1149
|
+
if (settings.fallbackPath) {
|
|
1150
|
+
this.openExpress.get('*', (req, res) => {
|
|
1151
|
+
if (isApiNamespacePath(req.path)) {
|
|
1152
|
+
res.status(404).send({ message: `Unknown API endpoint: ${req.path}` });
|
|
1153
|
+
return;
|
|
1154
|
+
}
|
|
1155
|
+
res.setHeader('Cache-Control', `max-age=${fallbackMaxAge}`);
|
|
1156
|
+
res.sendFile(settings.fallbackPath, { root: absoluteRoot });
|
|
1157
|
+
});
|
|
1158
|
+
}
|
|
1159
|
+
else {
|
|
1160
|
+
this.openExpress.get('*', (req, res) => {
|
|
1161
|
+
if (isApiNamespacePath(req.path)) {
|
|
1162
|
+
res.status(404).send({ message: `Unknown API endpoint: ${req.path}` });
|
|
1163
|
+
return;
|
|
1164
|
+
}
|
|
1165
|
+
res.status(404).type('html').send(default_not_found_page_const_1.DyNTS_defaultNotFoundPageHtml);
|
|
1166
|
+
});
|
|
1167
|
+
}
|
|
1168
|
+
}
|
|
1169
|
+
if (this.secureExpress) {
|
|
1170
|
+
this.secureExpress.use('/', staticMiddleware);
|
|
1171
|
+
if (settings.fallbackPath) {
|
|
1172
|
+
this.secureExpress.get('*', (req, res) => {
|
|
1173
|
+
if (isApiNamespacePath(req.path)) {
|
|
1174
|
+
res.status(404).send({ message: `Unknown API endpoint: ${req.path}` });
|
|
1175
|
+
return;
|
|
1176
|
+
}
|
|
1177
|
+
res.setHeader('Cache-Control', `max-age=${fallbackMaxAge}`);
|
|
1178
|
+
res.sendFile(settings.fallbackPath, { root: absoluteRoot });
|
|
1179
|
+
});
|
|
1180
|
+
}
|
|
1181
|
+
else {
|
|
1182
|
+
this.secureExpress.get('*', (req, res) => {
|
|
1183
|
+
if (isApiNamespacePath(req.path)) {
|
|
1184
|
+
res.status(404).send({ message: `Unknown API endpoint: ${req.path}` });
|
|
1185
|
+
return;
|
|
1186
|
+
}
|
|
1187
|
+
res.status(404).type('html').send(default_not_found_page_const_1.DyNTS_defaultNotFoundPageHtml);
|
|
1188
|
+
});
|
|
1189
|
+
}
|
|
1190
|
+
}
|
|
1191
|
+
if (this.logSetup) {
|
|
1192
|
+
fsm_dynamo_1.DyFM_Log.log(`\nStatic client mounted at / (root: ${absoluteRoot})`);
|
|
1193
|
+
}
|
|
1194
|
+
}
|
|
1195
|
+
/**
|
|
1196
|
+
*
|
|
1197
|
+
*/
|
|
1198
|
+
setSecurity() {
|
|
1199
|
+
if (this.fnLogs && this.deepLog)
|
|
1200
|
+
fsm_dynamo_1.DyFM_Log.log('\nfn:. setSecurity');
|
|
1201
|
+
this._routingModules.forEach((module) => {
|
|
1202
|
+
if (!module.security) {
|
|
1203
|
+
fsm_dynamo_1.DyFM_Log.warn(`RoutingModule security is not set for ${module.route}\n`);
|
|
1204
|
+
}
|
|
1205
|
+
else if (!this._security) {
|
|
1206
|
+
this._security = module.security;
|
|
1207
|
+
}
|
|
1208
|
+
else if (this._security !== module.security) {
|
|
1209
|
+
this._security = route_security_enum_1.DyNTS_RouteSecurity.both;
|
|
1210
|
+
}
|
|
1211
|
+
});
|
|
1212
|
+
if (!this._security) {
|
|
1213
|
+
let msg = `Could not set security for the server! (${this.security})`;
|
|
1214
|
+
msg += '\n RoutingModules:';
|
|
1215
|
+
this._routingModules.forEach((module) => {
|
|
1216
|
+
msg += `\n ${module.route} (security: ${module.security})`;
|
|
1217
|
+
});
|
|
1218
|
+
if (this._routingModules.length === 0) {
|
|
1219
|
+
msg += '\n - no RoutingModule found -\n';
|
|
1220
|
+
}
|
|
1221
|
+
fsm_dynamo_1.DyFM_Log.warn(msg);
|
|
1222
|
+
}
|
|
1223
|
+
}
|
|
1224
|
+
_getDefaultErrorSettings(fnName, error) {
|
|
1225
|
+
return {
|
|
1226
|
+
status: error?.___status ?? 500,
|
|
1227
|
+
message: error?.message ??
|
|
1228
|
+
error?._message ??
|
|
1229
|
+
`${fnName} was UNSUCCESSFUL (NTS)`,
|
|
1230
|
+
userMessage: error?.__userMessage ?? this.defaultErrorUserMsg,
|
|
1231
|
+
addECToUserMsg: !error?.__userMessage,
|
|
1232
|
+
issuerService: `${this?.constructor?.name}-DyNTS_App`,
|
|
1233
|
+
level: fsm_dynamo_1.DyFM_ErrorLevel.fatal,
|
|
1234
|
+
error: error,
|
|
1235
|
+
systemVersion: global_settings_const_1.DyNTS_global_settings.systemVersion,
|
|
1236
|
+
};
|
|
1237
|
+
}
|
|
1238
|
+
}
|
|
1239
|
+
exports.DyNTS_App = DyNTS_App;
|
|
1227
1240
|
//# sourceMappingURL=app.server.js.map
|