@futdevpro/nts-dynamo 1.15.155 → 1.15.156
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +10 -10
- package/__documentations/2026-08-22-bfr-ctm-018-content-free-endpoint-errors.md +54 -0
- package/__documentations/2026-08-22-content-free-process-error-boundary.md +26 -6
- 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 -119
- package/build/_models/control-models/endpoint-params.control-model.d.ts.map +1 -1
- package/build/_models/control-models/endpoint-params.control-model.js +409 -484
- package/build/_models/control-models/endpoint-params.control-model.js.map +1 -1
- 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/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 -19
- package/build/_modules/server/safe-diagnostic/safe-diagnostic-stage.type-enum.d.ts.map +1 -1
- package/build/_modules/server/safe-diagnostic/safe-diagnostic-stage.type-enum.js +24 -23
- package/build/_modules/server/safe-diagnostic/safe-diagnostic-stage.type-enum.js.map +1 -1
- 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/service-collection.service.d.ts +4 -4
- package/build/_services/core/service-collection.service.js +7 -7
- package/build/_services/route/controller.service.d.ts +124 -124
- package/build/_services/route/controller.service.js +95 -95
- package/build/_services/route/routing-module.service.d.ts +80 -80
- package/build/_services/route/routing-module.service.js +250 -250
- package/build/_services/server/app.server.d.ts +429 -429
- package/build/_services/server/app.server.js +1226 -1226
- package/build/_services/shared.static-service.d.ts +43 -43
- package/build/_services/shared.static-service.js +92 -92
- package/build/index.d.ts +63 -63
- package/build/index.js +101 -101
- package/package.json +1 -1
- package/src/_models/control-models/endpoint-params.control-model.spec.ts +102 -17
- package/src/_models/control-models/endpoint-params.control-model.ts +131 -220
- package/src/_modules/server/safe-diagnostic/safe-diagnostic-stage.type-enum.ts +3 -2
- package/src/_services/shared.static-service.spec.ts +57 -57
- package/src/_services/shared.static-service.ts +48 -48
package/build/_modules/ai/_modules/open-ai/_services/data-services/oai-vector-data.service.js
CHANGED
|
@@ -1,481 +1,481 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.DyNTS_OAI_VectorDataService = void 0;
|
|
4
|
-
const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
|
|
5
|
-
const fsm_dynamo_2 = require("@futdevpro/fsm-dynamo");
|
|
6
|
-
const open_ai_1 = require("@futdevpro/fsm-dynamo/ai/open-ai");
|
|
7
|
-
const global_settings_const_1 = require("../../../../../../_collections/global-settings.const");
|
|
8
|
-
const data_service_1 = require("../../../../../../_services/base/data.service");
|
|
9
|
-
const oai_embedding_control_service_1 = require("../oai-embedding.control-service");
|
|
10
|
-
/**
|
|
11
|
-
* Vector Data Service that is connected to the relevant DBServices
|
|
12
|
-
* extends {@link DyNTS_DataService}
|
|
13
|
-
*
|
|
14
|
-
* For the vectorization, you need to setup the index in the DB to something like this:
|
|
15
|
-
* (the path declared here must be the same as the vectorizeUseIndex in the {@link DyFM_DataProperty_Params})
|
|
16
|
-
* ```json
|
|
17
|
-
* {
|
|
18
|
-
* "fields": [
|
|
19
|
-
* {
|
|
20
|
-
* "type": "vector",
|
|
21
|
-
* "path": "contentVectorized",
|
|
22
|
-
* "numDimensions": 3072,
|
|
23
|
-
* "similarity": "cosine"
|
|
24
|
-
* }
|
|
25
|
-
* ]
|
|
26
|
-
* }
|
|
27
|
-
* ```
|
|
28
|
-
*
|
|
29
|
-
* @example
|
|
30
|
-
* export class UserMatchStatisticsService extends DyNTS_DataService<UserMatchStatistics> {
|
|
31
|
-
* constructor(
|
|
32
|
-
* set: {
|
|
33
|
-
* data?: UserMatchStatistics,
|
|
34
|
-
* openAISettings?: DyFM_OAI_Settings,
|
|
35
|
-
* issuer: string,
|
|
36
|
-
* }
|
|
37
|
-
* ) {
|
|
38
|
-
* super(
|
|
39
|
-
* new UserMatchStatistics(set?.data),
|
|
40
|
-
* userMatchStatisticsModelParams,
|
|
41
|
-
* set?.openAISettings ?? defaultOpenAISettings,
|
|
42
|
-
* set.issuer,
|
|
43
|
-
* );
|
|
44
|
-
* }
|
|
45
|
-
* }
|
|
46
|
-
*/
|
|
47
|
-
class DyNTS_OAI_VectorDataService extends data_service_1.DyNTS_DataService {
|
|
48
|
-
openAISettings;
|
|
49
|
-
/**
|
|
50
|
-
* Properties that are vectorized
|
|
51
|
-
* (properties that are marked with vectorizeFrom in other properties)
|
|
52
|
-
*/
|
|
53
|
-
vectorizeProperties;
|
|
54
|
-
vectorizedProperties;
|
|
55
|
-
/* readonly vectorizeProperties: { from: string, to: string }[]; */
|
|
56
|
-
debugLog = false;
|
|
57
|
-
swallowVectorizedProperties = true;
|
|
58
|
-
embedding_CS;
|
|
59
|
-
tokenSpent = 0;
|
|
60
|
-
constructor(
|
|
61
|
-
/**
|
|
62
|
-
* Initial data, this will be used by functions on default
|
|
63
|
-
*/
|
|
64
|
-
data,
|
|
65
|
-
/**
|
|
66
|
-
* DB data prams will be used to connect to usable dbService on GlobalService
|
|
67
|
-
*/
|
|
68
|
-
dataParams,
|
|
69
|
-
/**
|
|
70
|
-
* OpenAI settings
|
|
71
|
-
*/
|
|
72
|
-
openAISettings,
|
|
73
|
-
/**
|
|
74
|
-
* Initial set for issuer to be able to follow the issuer's activity
|
|
75
|
-
*/
|
|
76
|
-
issuer) {
|
|
77
|
-
super(data, dataParams, issuer);
|
|
78
|
-
this.openAISettings = openAISettings;
|
|
79
|
-
this.vectorizedProperties = Object.values(dataParams.properties).filter((property) => property.vectorizedFrom);
|
|
80
|
-
this.vectorizeProperties = Object.keys(dataParams.properties).filter((key) => this.vectorizedProperties.some((property) => property.vectorizedFrom.includes(key))).map((key) => dataParams.properties[key]);
|
|
81
|
-
/* const vectorizePropertyKeys: string[] = Object.keys(dataParams.properties).filter(
|
|
82
|
-
(key: string): boolean => (
|
|
83
|
-
dataParams.properties[key] as DyFM_DataProperty_Params<any>
|
|
84
|
-
).vectorizedFrom &&
|
|
85
|
-
(dataParams.properties[key] as DyFM_DataProperty_Params<any>).vectorizedFrom !== key
|
|
86
|
-
); */
|
|
87
|
-
if (!openAISettings.config.apiKey) {
|
|
88
|
-
throw new fsm_dynamo_2.DyFM_Error({
|
|
89
|
-
...this.getDefaultErrorSettings('constructor', new Error('openAISettings.config.apiKey is required')),
|
|
90
|
-
});
|
|
91
|
-
}
|
|
92
|
-
const model = openAISettings.defaultSettings.useModel ??
|
|
93
|
-
open_ai_1.DyFM_OAI_Model.textEmbedding_3Large;
|
|
94
|
-
/* if (
|
|
95
|
-
!DyFM_allOpenAIEmbeddingModels.includes(model)
|
|
96
|
-
) {
|
|
97
|
-
throw new DyFM_Error({
|
|
98
|
-
...this.getDefaultErrorSettings(
|
|
99
|
-
'constructor',
|
|
100
|
-
new Error(`useModel "${model}" is not an embedding model!`)
|
|
101
|
-
),
|
|
102
|
-
});
|
|
103
|
-
} */
|
|
104
|
-
if (!this.vectorizedProperties.length) {
|
|
105
|
-
throw new Error('vectorizedProperties is missing! ' +
|
|
106
|
-
`\nkeys with vectorizedFrom: ${Object.keys(dataParams.properties).filter((key) => Boolean(dataParams.properties[key].vectorizedFrom)).map(key => `"${key}"`).join(', ')}`);
|
|
107
|
-
}
|
|
108
|
-
if (!this.vectorizeProperties.length) {
|
|
109
|
-
throw new Error('vectorizeProperties is missing! ' +
|
|
110
|
-
`\nkeys with vectorizeFrom: ${Object.keys(dataParams.properties).filter((key) => Boolean(dataParams.properties[key].vectorizedFrom)).map(key => `"${key}"`).join(', ')}`);
|
|
111
|
-
}
|
|
112
|
-
/* if (!vectorizePropertyKeys.length) {
|
|
113
|
-
throw new Error(
|
|
114
|
-
'vectorizedPropertyKeys is missing! ' +
|
|
115
|
-
`\nkeys with vectorizeFrom: ${Object.keys(dataParams.properties).filter(
|
|
116
|
-
(key: string): boolean => Boolean(
|
|
117
|
-
(dataParams.properties[key] as DyFM_DataProperty_Params<any>).vectorizedFrom
|
|
118
|
-
)
|
|
119
|
-
).map(key => `"${key}"`).join(', ')}`
|
|
120
|
-
);
|
|
121
|
-
} */
|
|
122
|
-
/* vectorizePropertyKeys.forEach((key: string): void => {
|
|
123
|
-
dataParams.properties[key].embeddingModel ??= model;
|
|
124
|
-
}); */
|
|
125
|
-
this.vectorizedProperties.forEach((property) => {
|
|
126
|
-
property.embeddingModel ??= model;
|
|
127
|
-
});
|
|
128
|
-
/* this.vectorizeProperties = vectorizePropertyKeys.map(
|
|
129
|
-
(key: string): DyFM_DataProperty_Params<any> =>
|
|
130
|
-
dataParams.properties[key] as DyFM_DataProperty_Params<any>
|
|
131
|
-
); */
|
|
132
|
-
}
|
|
133
|
-
/**
|
|
134
|
-
* Vectorizes the properties of the data
|
|
135
|
-
* IF they are not vectorized yet OR alwaysVectorize is true
|
|
136
|
-
* (That are marked with vectorizeFrom if the specific property is not defined)
|
|
137
|
-
*
|
|
138
|
-
* @example
|
|
139
|
-
* const data = await vectorizeDataProperties(data);
|
|
140
|
-
*
|
|
141
|
-
* @returns The vectorized data
|
|
142
|
-
*/
|
|
143
|
-
async vectorizeDataProperties(newData, forceVectorize) {
|
|
144
|
-
try {
|
|
145
|
-
let existingData;
|
|
146
|
-
if (!forceVectorize && newData?._id) {
|
|
147
|
-
existingData = await this.getDataById(newData._id, true, true);
|
|
148
|
-
}
|
|
149
|
-
await fsm_dynamo_2.DyFM_Array.asyncForEachAllAtOnce(this.vectorizedProperties, async (property) => {
|
|
150
|
-
await this.checkAndVectorizeSingleProperty(property, newData, existingData, forceVectorize);
|
|
151
|
-
});
|
|
152
|
-
return newData;
|
|
153
|
-
}
|
|
154
|
-
catch (error) {
|
|
155
|
-
throw new fsm_dynamo_2.DyFM_Error({
|
|
156
|
-
...this.getDefaultErrorSettings('vectorizeDataProperties', error),
|
|
157
|
-
});
|
|
158
|
-
}
|
|
159
|
-
}
|
|
160
|
-
async checkAndVectorizeSingleProperty(vectorizedProperty, newData, existingData, forceVectorize) {
|
|
161
|
-
const newValue = await this.getVectorizingDataForVectorizedProperty(vectorizedProperty, newData);
|
|
162
|
-
const existingValue = await this.getVectorizingDataForVectorizedProperty(vectorizedProperty, existingData);
|
|
163
|
-
const vectorizedFrom = vectorizedProperty.vectorizedFrom[0];
|
|
164
|
-
const vectorizingPropertyHaveValue = Boolean(newData[vectorizedFrom]);
|
|
165
|
-
const newDataIsNewChanged = (!existingValue && vectorizingPropertyHaveValue) ||
|
|
166
|
-
!fsm_dynamo_2.DyFM_Object.sameObjects(existingValue, newValue);
|
|
167
|
-
if (forceVectorize || (vectorizingPropertyHaveValue && newDataIsNewChanged)) {
|
|
168
|
-
if (!vectorizedProperty.embeddingModel) {
|
|
169
|
-
throw new fsm_dynamo_2.DyFM_Error({
|
|
170
|
-
...this.getDefaultErrorSettings('vectorizeDataProperties', new Error(`Property "${vectorizedProperty.key}" has no embedding model!`)),
|
|
171
|
-
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-VDB-VDB1`,
|
|
172
|
-
__localStack: this.dataParams.stackLocation,
|
|
173
|
-
});
|
|
174
|
-
}
|
|
175
|
-
if (this.debugLog) {
|
|
176
|
-
fsm_dynamo_1.DyFM_Log.log(`vectorizing "${vectorizedProperty.key}" in new "${this.dataParams.dataName}"` +
|
|
177
|
-
newData?.name ? `: "${newData?.name}"` : '');
|
|
178
|
-
}
|
|
179
|
-
newData[vectorizedProperty.key] = await this.vectorize(newValue, vectorizedProperty.embeddingModel);
|
|
180
|
-
}
|
|
181
|
-
else if (existingData?.[vectorizedProperty.key] && !newData?.[vectorizedProperty.key]) {
|
|
182
|
-
newData[vectorizedProperty.key] = existingData[vectorizedProperty.key];
|
|
183
|
-
}
|
|
184
|
-
}
|
|
185
|
-
async getVectorizingDataForVectorizedProperty(vectorizedProperty, data) {
|
|
186
|
-
if (vectorizedProperty.vectorizedFrom.length === 1) {
|
|
187
|
-
const value = data?.[vectorizedProperty.vectorizedFrom[0]];
|
|
188
|
-
if (value === undefined) {
|
|
189
|
-
return undefined;
|
|
190
|
-
}
|
|
191
|
-
else if (typeof value === 'string') {
|
|
192
|
-
return value;
|
|
193
|
-
}
|
|
194
|
-
else if (Array.isArray(value) || typeof value === 'object') {
|
|
195
|
-
return JSON.stringify(value);
|
|
196
|
-
}
|
|
197
|
-
else {
|
|
198
|
-
return `${value}`;
|
|
199
|
-
}
|
|
200
|
-
}
|
|
201
|
-
else {
|
|
202
|
-
const object = {};
|
|
203
|
-
vectorizedProperty.vectorizedFrom.forEach((key) => {
|
|
204
|
-
if (data?.[key] !== undefined) {
|
|
205
|
-
object[key] = data[key];
|
|
206
|
-
}
|
|
207
|
-
});
|
|
208
|
-
return JSON.stringify(object);
|
|
209
|
-
}
|
|
210
|
-
}
|
|
211
|
-
/**
|
|
212
|
-
* Vectorizes the input
|
|
213
|
-
*
|
|
214
|
-
* @example
|
|
215
|
-
* const vector = await vectorize(input);
|
|
216
|
-
*/
|
|
217
|
-
async vectorize(input, useModel = this.openAISettings.defaultSettings.useModel) {
|
|
218
|
-
try {
|
|
219
|
-
if (!input) {
|
|
220
|
-
throw new fsm_dynamo_2.DyFM_Error({
|
|
221
|
-
...this.getDefaultErrorSettings('vectorize', new Error('input is required')),
|
|
222
|
-
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-VDB-V1`,
|
|
223
|
-
});
|
|
224
|
-
}
|
|
225
|
-
this.embedding_CS ??= new oai_embedding_control_service_1.DyNTS_OAI_Embedding_ControlService(this.openAISettings);
|
|
226
|
-
const response = await this.embedding_CS.createEmbedding({
|
|
227
|
-
text: input,
|
|
228
|
-
model: useModel,
|
|
229
|
-
fullResponse: true,
|
|
230
|
-
issuer: this.issuer,
|
|
231
|
-
});
|
|
232
|
-
this.tokenSpent += response.usage.total_tokens;
|
|
233
|
-
return response.data[0].embedding;
|
|
234
|
-
}
|
|
235
|
-
catch (error) {
|
|
236
|
-
throw new fsm_dynamo_2.DyFM_Error({
|
|
237
|
-
...this.getDefaultErrorSettings('vectorize', error),
|
|
238
|
-
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-VDB-V0`,
|
|
239
|
-
});
|
|
240
|
-
}
|
|
241
|
-
}
|
|
242
|
-
/**
|
|
243
|
-
* Vectorizes the input and searches for the most similar data
|
|
244
|
-
* (the default limit is 3, and the default numberOfCandidates is 100)
|
|
245
|
-
*
|
|
246
|
-
* @example
|
|
247
|
-
* const result = await vectorSearch(input, searchInKey);
|
|
248
|
-
*/
|
|
249
|
-
async vectorSearch(set) {
|
|
250
|
-
try {
|
|
251
|
-
if (!set.input) {
|
|
252
|
-
throw new fsm_dynamo_2.DyFM_Error({
|
|
253
|
-
...this.getDefaultErrorSettings('vectorSearch', new Error('input is required')),
|
|
254
|
-
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-VDB-VS1`,
|
|
255
|
-
});
|
|
256
|
-
}
|
|
257
|
-
set.limit ??= 3;
|
|
258
|
-
set.numberOfCandidates ??= 100;
|
|
259
|
-
const { input, searchInKey, limit, numberOfCandidates, filterBy } = set;
|
|
260
|
-
this.embedding_CS ??= new oai_embedding_control_service_1.DyNTS_OAI_Embedding_ControlService(this.openAISettings);
|
|
261
|
-
const property = this.dataParams.properties[searchInKey];
|
|
262
|
-
if (!property) {
|
|
263
|
-
throw new fsm_dynamo_2.DyFM_Error({
|
|
264
|
-
...this.getDefaultErrorSettings('vectorSearch', new Error(`Property "${searchInKey}" not found! ` +
|
|
265
|
-
`while searching "${this.dataParams.dataName}" ` +
|
|
266
|
-
`(The searchable properties are: ${this.vectorizedProperties.map(p => `"${p.key}"`).join(', ')})`)),
|
|
267
|
-
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-VDB-VS2`,
|
|
268
|
-
__localStack: this.dataParams.stackLocation,
|
|
269
|
-
});
|
|
270
|
-
}
|
|
271
|
-
if (!property.vectorizeUseIndex) {
|
|
272
|
-
throw new fsm_dynamo_2.DyFM_Error({
|
|
273
|
-
...this.getDefaultErrorSettings('vectorSearch', new Error(`Property "${searchInKey}" has no vectorizeUseIndex!`)),
|
|
274
|
-
});
|
|
275
|
-
}
|
|
276
|
-
const response = await this.embedding_CS.createEmbedding({
|
|
277
|
-
text: input,
|
|
278
|
-
model: property.embeddingModel,
|
|
279
|
-
fullResponse: true,
|
|
280
|
-
issuer: this.issuer,
|
|
281
|
-
});
|
|
282
|
-
this.tokenSpent += response.usage.total_tokens;
|
|
283
|
-
const embeddedInput = response.data[0].embedding;
|
|
284
|
-
/* const vectorSearchFilter = */
|
|
285
|
-
const vectorSearchFilter = {
|
|
286
|
-
$vectorSearch: {
|
|
287
|
-
/** this is the index name that is created in the DB (in the Atlas)
|
|
288
|
-
* also the same that is used in the {@link DyFM_DataProperty_Params} */
|
|
289
|
-
index: property.vectorizeUseIndex,
|
|
290
|
-
queryVector: embeddedInput,
|
|
291
|
-
/** this is the property key that is vectorized and used to search */
|
|
292
|
-
path: searchInKey,
|
|
293
|
-
numCandidates: numberOfCandidates,
|
|
294
|
-
limit: limit,
|
|
295
|
-
}
|
|
296
|
-
};
|
|
297
|
-
if (filterBy) {
|
|
298
|
-
vectorSearchFilter.filter = filterBy;
|
|
299
|
-
}
|
|
300
|
-
if (this.debugLog) {
|
|
301
|
-
fsm_dynamo_1.DyFM_Log.log(`vectorSearch...`);
|
|
302
|
-
}
|
|
303
|
-
const result = await this.dataDBService.aggregate([vectorSearchFilter]);
|
|
304
|
-
if (this.debugLog) {
|
|
305
|
-
fsm_dynamo_1.DyFM_Log.log(`vectorSearch: ${result.length} results`);
|
|
306
|
-
}
|
|
307
|
-
return result;
|
|
308
|
-
}
|
|
309
|
-
catch (error) {
|
|
310
|
-
throw new fsm_dynamo_2.DyFM_Error({
|
|
311
|
-
...this.getDefaultErrorSettings('vectorSearch', error),
|
|
312
|
-
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-VDB-VS0`,
|
|
313
|
-
});
|
|
314
|
-
}
|
|
315
|
-
}
|
|
316
|
-
/**
|
|
317
|
-
* VectorDataService overrides the saveData function to vectorize the data properties
|
|
318
|
-
*
|
|
319
|
-
* {@link DyNTS_DataService.saveData}
|
|
320
|
-
*/
|
|
321
|
-
async saveData(data, dontSetToService, forceVectorize) {
|
|
322
|
-
try {
|
|
323
|
-
data = this.ensureData(data);
|
|
324
|
-
data = await this.vectorizeDataProperties(data, forceVectorize);
|
|
325
|
-
data = await super.saveData(data, dontSetToService);
|
|
326
|
-
if (this.swallowVectorizedProperties) {
|
|
327
|
-
this.vectorizedProperties.forEach((property) => {
|
|
328
|
-
delete data[property.key];
|
|
329
|
-
});
|
|
330
|
-
}
|
|
331
|
-
fsm_dynamo_2.DyFM_Object.cleanObject(data);
|
|
332
|
-
return data;
|
|
333
|
-
}
|
|
334
|
-
catch (error) {
|
|
335
|
-
throw new fsm_dynamo_2.DyFM_Error({
|
|
336
|
-
...this.getDefaultErrorSettings('saveData', error),
|
|
337
|
-
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-VDB-SD0`,
|
|
338
|
-
});
|
|
339
|
-
}
|
|
340
|
-
}
|
|
341
|
-
getProvidedData(data) {
|
|
342
|
-
this.vectorizedProperties.forEach((property) => {
|
|
343
|
-
delete data[property.key];
|
|
344
|
-
});
|
|
345
|
-
return data;
|
|
346
|
-
}
|
|
347
|
-
}
|
|
348
|
-
exports.DyNTS_OAI_VectorDataService = DyNTS_OAI_VectorDataService;
|
|
349
|
-
//import {
|
|
350
|
-
// DyFM_DataModel_Params,
|
|
351
|
-
// DyFM_DataProperty_Params,
|
|
352
|
-
// DyFM_Metadata,
|
|
353
|
-
//} from '@futdevpro/fsm-dynamo';
|
|
354
|
-
//import { DyFM_OAI_Settings, DyFM_OAI_EmbeddingModel, DyFM_OAI_Model } from '@futdevpro/fsm-dynamo/ai/open-ai';
|
|
355
|
-
//
|
|
356
|
-
//import { DyNTS_DAI_VectorDataService } from '../../_modules/document-ai/_services/dai-vector-data.service-base';
|
|
357
|
-
//import { DyNTS_OAI_Embedding_Service } from './oai-embedding.service';
|
|
358
|
-
//import { DyNTS_global_settings } from '../../../../_collections/global-settings.const';
|
|
359
|
-
//import { DyNTS_OAI_global_settings } from '../_collections/oai-global-settings.const';
|
|
360
|
-
//
|
|
361
|
-
///**
|
|
362
|
-
// * OpenAI implementation of the generic Vector Data Service
|
|
363
|
-
// * Extends the generic DAI VectorDataService with OpenAI-specific functionality
|
|
364
|
-
// */
|
|
365
|
-
//export class DyNTS_OAI_VectorDataService<T extends DyFM_Metadata> extends DyNTS_DAI_VectorDataService<T> {
|
|
366
|
-
//
|
|
367
|
-
// debugLog: boolean = true;
|
|
368
|
-
// swallowVectorizedProperties: boolean = true;
|
|
369
|
-
//
|
|
370
|
-
// constructor(
|
|
371
|
-
// /** Initial data */
|
|
372
|
-
// data: T,
|
|
373
|
-
// /** DB data params */
|
|
374
|
-
// dataParams: DyFM_DataModel_Params<T>,
|
|
375
|
-
// /** OpenAI settings */
|
|
376
|
-
// public readonly openAISettings: DyFM_OAI_Settings,
|
|
377
|
-
// /** Issuer */
|
|
378
|
-
// issuer: string
|
|
379
|
-
// ) {
|
|
380
|
-
// // Create OpenAI embedding service
|
|
381
|
-
// const embeddingService = new DyNTS_OAI_Embedding_Service(openAISettings);
|
|
382
|
-
//
|
|
383
|
-
// super(data, dataParams, embeddingService, issuer);
|
|
384
|
-
//
|
|
385
|
-
// if (!openAISettings.openAIConfig.apiKey) {
|
|
386
|
-
// throw new Error('openAIConfig.apiKey is required');
|
|
387
|
-
// }
|
|
388
|
-
//
|
|
389
|
-
// const model: DyFM_OAI_EmbeddingModel = openAISettings.defaultSettings.useModel as DyFM_OAI_EmbeddingModel ??
|
|
390
|
-
// DyFM_OAI_Model.textEmbedding_3Large;
|
|
391
|
-
//
|
|
392
|
-
// // Configure vectorized properties with OpenAI-specific settings
|
|
393
|
-
// this.configureVectorizedProperties(model);
|
|
394
|
-
// }
|
|
395
|
-
//
|
|
396
|
-
// /**
|
|
397
|
-
// * Configure vectorized properties with OpenAI-specific settings
|
|
398
|
-
// */
|
|
399
|
-
// private configureVectorizedProperties(model: DyFM_OAI_EmbeddingModel): void {
|
|
400
|
-
// // Update vectorized properties with OpenAI model info
|
|
401
|
-
// this.vectorizedProperties.forEach(property => {
|
|
402
|
-
// if (property.vectorizedFrom) {
|
|
403
|
-
// // Set the embedding model for this property
|
|
404
|
-
// (property as any).embeddingModel = model;
|
|
405
|
-
// }
|
|
406
|
-
// });
|
|
407
|
-
// }
|
|
408
|
-
//
|
|
409
|
-
// /**
|
|
410
|
-
// * Perform vector search with OpenAI-specific implementation
|
|
411
|
-
// */
|
|
412
|
-
// protected override async performVectorSearch(
|
|
413
|
-
// query: string,
|
|
414
|
-
// model: string,
|
|
415
|
-
// issuer: string,
|
|
416
|
-
// options: any
|
|
417
|
-
// ): Promise<T[]> {
|
|
418
|
-
// try {
|
|
419
|
-
// // Create embedding for the query
|
|
420
|
-
// const queryEmbedding = await this.embeddingService.createEmbedding(query, model, issuer);
|
|
421
|
-
//
|
|
422
|
-
// // Get all data
|
|
423
|
-
// const allData = await this.getAllData();
|
|
424
|
-
//
|
|
425
|
-
// // Calculate similarities (simplified implementation)
|
|
426
|
-
// const results = allData.map(item => {
|
|
427
|
-
// const itemEmbedding = (item as any).chunkParentedContentVectorized;
|
|
428
|
-
// if (!itemEmbedding) return { item, similarity: 0 };
|
|
429
|
-
//
|
|
430
|
-
// const similarity = this.calculateCosineSimilarity(queryEmbedding, itemEmbedding);
|
|
431
|
-
// return { item, similarity };
|
|
432
|
-
// })
|
|
433
|
-
// .filter(result => result.similarity >= (options.minSimilarity || 0))
|
|
434
|
-
// .sort((a, b) => b.similarity - a.similarity)
|
|
435
|
-
// .slice(0, options.limit || 10)
|
|
436
|
-
// .map(result => result.item);
|
|
437
|
-
//
|
|
438
|
-
// return results;
|
|
439
|
-
// } catch (error) {
|
|
440
|
-
// throw new Error(`Vector search failed: ${error.message}`);
|
|
441
|
-
// }
|
|
442
|
-
// }
|
|
443
|
-
//
|
|
444
|
-
// /**
|
|
445
|
-
// * Calculate cosine similarity between two vectors
|
|
446
|
-
// */
|
|
447
|
-
// private calculateCosineSimilarity(vecA: number[], vecB: number[]): number {
|
|
448
|
-
// if (vecA.length !== vecB.length) return 0;
|
|
449
|
-
//
|
|
450
|
-
// let dotProduct = 0;
|
|
451
|
-
// let normA = 0;
|
|
452
|
-
// let normB = 0;
|
|
453
|
-
//
|
|
454
|
-
// for (let i = 0; i < vecA.length; i++) {
|
|
455
|
-
// dotProduct += vecA[i] * vecB[i];
|
|
456
|
-
// normA += vecA[i] * vecA[i];
|
|
457
|
-
// normB += vecB[i] * vecB[i];
|
|
458
|
-
// }
|
|
459
|
-
//
|
|
460
|
-
// if (normA === 0 || normB === 0) return 0;
|
|
461
|
-
//
|
|
462
|
-
// return dotProduct / (Math.sqrt(normA) * Math.sqrt(normB));
|
|
463
|
-
// }
|
|
464
|
-
//
|
|
465
|
-
// /**
|
|
466
|
-
// * Get default error settings
|
|
467
|
-
// */
|
|
468
|
-
// protected getDefaultErrorSettings(
|
|
469
|
-
// method: string,
|
|
470
|
-
// error: any,
|
|
471
|
-
// issuer?: string
|
|
472
|
-
// ): any {
|
|
473
|
-
// return {
|
|
474
|
-
// method,
|
|
475
|
-
// error,
|
|
476
|
-
// issuer: issuer || this.issuer,
|
|
477
|
-
// userMsg: this.defaultErrorUserMsg,
|
|
478
|
-
// };
|
|
479
|
-
// }
|
|
480
|
-
//}
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.DyNTS_OAI_VectorDataService = void 0;
|
|
4
|
+
const fsm_dynamo_1 = require("@futdevpro/fsm-dynamo");
|
|
5
|
+
const fsm_dynamo_2 = require("@futdevpro/fsm-dynamo");
|
|
6
|
+
const open_ai_1 = require("@futdevpro/fsm-dynamo/ai/open-ai");
|
|
7
|
+
const global_settings_const_1 = require("../../../../../../_collections/global-settings.const");
|
|
8
|
+
const data_service_1 = require("../../../../../../_services/base/data.service");
|
|
9
|
+
const oai_embedding_control_service_1 = require("../oai-embedding.control-service");
|
|
10
|
+
/**
|
|
11
|
+
* Vector Data Service that is connected to the relevant DBServices
|
|
12
|
+
* extends {@link DyNTS_DataService}
|
|
13
|
+
*
|
|
14
|
+
* For the vectorization, you need to setup the index in the DB to something like this:
|
|
15
|
+
* (the path declared here must be the same as the vectorizeUseIndex in the {@link DyFM_DataProperty_Params})
|
|
16
|
+
* ```json
|
|
17
|
+
* {
|
|
18
|
+
* "fields": [
|
|
19
|
+
* {
|
|
20
|
+
* "type": "vector",
|
|
21
|
+
* "path": "contentVectorized",
|
|
22
|
+
* "numDimensions": 3072,
|
|
23
|
+
* "similarity": "cosine"
|
|
24
|
+
* }
|
|
25
|
+
* ]
|
|
26
|
+
* }
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @example
|
|
30
|
+
* export class UserMatchStatisticsService extends DyNTS_DataService<UserMatchStatistics> {
|
|
31
|
+
* constructor(
|
|
32
|
+
* set: {
|
|
33
|
+
* data?: UserMatchStatistics,
|
|
34
|
+
* openAISettings?: DyFM_OAI_Settings,
|
|
35
|
+
* issuer: string,
|
|
36
|
+
* }
|
|
37
|
+
* ) {
|
|
38
|
+
* super(
|
|
39
|
+
* new UserMatchStatistics(set?.data),
|
|
40
|
+
* userMatchStatisticsModelParams,
|
|
41
|
+
* set?.openAISettings ?? defaultOpenAISettings,
|
|
42
|
+
* set.issuer,
|
|
43
|
+
* );
|
|
44
|
+
* }
|
|
45
|
+
* }
|
|
46
|
+
*/
|
|
47
|
+
class DyNTS_OAI_VectorDataService extends data_service_1.DyNTS_DataService {
|
|
48
|
+
openAISettings;
|
|
49
|
+
/**
|
|
50
|
+
* Properties that are vectorized
|
|
51
|
+
* (properties that are marked with vectorizeFrom in other properties)
|
|
52
|
+
*/
|
|
53
|
+
vectorizeProperties;
|
|
54
|
+
vectorizedProperties;
|
|
55
|
+
/* readonly vectorizeProperties: { from: string, to: string }[]; */
|
|
56
|
+
debugLog = false;
|
|
57
|
+
swallowVectorizedProperties = true;
|
|
58
|
+
embedding_CS;
|
|
59
|
+
tokenSpent = 0;
|
|
60
|
+
constructor(
|
|
61
|
+
/**
|
|
62
|
+
* Initial data, this will be used by functions on default
|
|
63
|
+
*/
|
|
64
|
+
data,
|
|
65
|
+
/**
|
|
66
|
+
* DB data prams will be used to connect to usable dbService on GlobalService
|
|
67
|
+
*/
|
|
68
|
+
dataParams,
|
|
69
|
+
/**
|
|
70
|
+
* OpenAI settings
|
|
71
|
+
*/
|
|
72
|
+
openAISettings,
|
|
73
|
+
/**
|
|
74
|
+
* Initial set for issuer to be able to follow the issuer's activity
|
|
75
|
+
*/
|
|
76
|
+
issuer) {
|
|
77
|
+
super(data, dataParams, issuer);
|
|
78
|
+
this.openAISettings = openAISettings;
|
|
79
|
+
this.vectorizedProperties = Object.values(dataParams.properties).filter((property) => property.vectorizedFrom);
|
|
80
|
+
this.vectorizeProperties = Object.keys(dataParams.properties).filter((key) => this.vectorizedProperties.some((property) => property.vectorizedFrom.includes(key))).map((key) => dataParams.properties[key]);
|
|
81
|
+
/* const vectorizePropertyKeys: string[] = Object.keys(dataParams.properties).filter(
|
|
82
|
+
(key: string): boolean => (
|
|
83
|
+
dataParams.properties[key] as DyFM_DataProperty_Params<any>
|
|
84
|
+
).vectorizedFrom &&
|
|
85
|
+
(dataParams.properties[key] as DyFM_DataProperty_Params<any>).vectorizedFrom !== key
|
|
86
|
+
); */
|
|
87
|
+
if (!openAISettings.config.apiKey) {
|
|
88
|
+
throw new fsm_dynamo_2.DyFM_Error({
|
|
89
|
+
...this.getDefaultErrorSettings('constructor', new Error('openAISettings.config.apiKey is required')),
|
|
90
|
+
});
|
|
91
|
+
}
|
|
92
|
+
const model = openAISettings.defaultSettings.useModel ??
|
|
93
|
+
open_ai_1.DyFM_OAI_Model.textEmbedding_3Large;
|
|
94
|
+
/* if (
|
|
95
|
+
!DyFM_allOpenAIEmbeddingModels.includes(model)
|
|
96
|
+
) {
|
|
97
|
+
throw new DyFM_Error({
|
|
98
|
+
...this.getDefaultErrorSettings(
|
|
99
|
+
'constructor',
|
|
100
|
+
new Error(`useModel "${model}" is not an embedding model!`)
|
|
101
|
+
),
|
|
102
|
+
});
|
|
103
|
+
} */
|
|
104
|
+
if (!this.vectorizedProperties.length) {
|
|
105
|
+
throw new Error('vectorizedProperties is missing! ' +
|
|
106
|
+
`\nkeys with vectorizedFrom: ${Object.keys(dataParams.properties).filter((key) => Boolean(dataParams.properties[key].vectorizedFrom)).map(key => `"${key}"`).join(', ')}`);
|
|
107
|
+
}
|
|
108
|
+
if (!this.vectorizeProperties.length) {
|
|
109
|
+
throw new Error('vectorizeProperties is missing! ' +
|
|
110
|
+
`\nkeys with vectorizeFrom: ${Object.keys(dataParams.properties).filter((key) => Boolean(dataParams.properties[key].vectorizedFrom)).map(key => `"${key}"`).join(', ')}`);
|
|
111
|
+
}
|
|
112
|
+
/* if (!vectorizePropertyKeys.length) {
|
|
113
|
+
throw new Error(
|
|
114
|
+
'vectorizedPropertyKeys is missing! ' +
|
|
115
|
+
`\nkeys with vectorizeFrom: ${Object.keys(dataParams.properties).filter(
|
|
116
|
+
(key: string): boolean => Boolean(
|
|
117
|
+
(dataParams.properties[key] as DyFM_DataProperty_Params<any>).vectorizedFrom
|
|
118
|
+
)
|
|
119
|
+
).map(key => `"${key}"`).join(', ')}`
|
|
120
|
+
);
|
|
121
|
+
} */
|
|
122
|
+
/* vectorizePropertyKeys.forEach((key: string): void => {
|
|
123
|
+
dataParams.properties[key].embeddingModel ??= model;
|
|
124
|
+
}); */
|
|
125
|
+
this.vectorizedProperties.forEach((property) => {
|
|
126
|
+
property.embeddingModel ??= model;
|
|
127
|
+
});
|
|
128
|
+
/* this.vectorizeProperties = vectorizePropertyKeys.map(
|
|
129
|
+
(key: string): DyFM_DataProperty_Params<any> =>
|
|
130
|
+
dataParams.properties[key] as DyFM_DataProperty_Params<any>
|
|
131
|
+
); */
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* Vectorizes the properties of the data
|
|
135
|
+
* IF they are not vectorized yet OR alwaysVectorize is true
|
|
136
|
+
* (That are marked with vectorizeFrom if the specific property is not defined)
|
|
137
|
+
*
|
|
138
|
+
* @example
|
|
139
|
+
* const data = await vectorizeDataProperties(data);
|
|
140
|
+
*
|
|
141
|
+
* @returns The vectorized data
|
|
142
|
+
*/
|
|
143
|
+
async vectorizeDataProperties(newData, forceVectorize) {
|
|
144
|
+
try {
|
|
145
|
+
let existingData;
|
|
146
|
+
if (!forceVectorize && newData?._id) {
|
|
147
|
+
existingData = await this.getDataById(newData._id, true, true);
|
|
148
|
+
}
|
|
149
|
+
await fsm_dynamo_2.DyFM_Array.asyncForEachAllAtOnce(this.vectorizedProperties, async (property) => {
|
|
150
|
+
await this.checkAndVectorizeSingleProperty(property, newData, existingData, forceVectorize);
|
|
151
|
+
});
|
|
152
|
+
return newData;
|
|
153
|
+
}
|
|
154
|
+
catch (error) {
|
|
155
|
+
throw new fsm_dynamo_2.DyFM_Error({
|
|
156
|
+
...this.getDefaultErrorSettings('vectorizeDataProperties', error),
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
async checkAndVectorizeSingleProperty(vectorizedProperty, newData, existingData, forceVectorize) {
|
|
161
|
+
const newValue = await this.getVectorizingDataForVectorizedProperty(vectorizedProperty, newData);
|
|
162
|
+
const existingValue = await this.getVectorizingDataForVectorizedProperty(vectorizedProperty, existingData);
|
|
163
|
+
const vectorizedFrom = vectorizedProperty.vectorizedFrom[0];
|
|
164
|
+
const vectorizingPropertyHaveValue = Boolean(newData[vectorizedFrom]);
|
|
165
|
+
const newDataIsNewChanged = (!existingValue && vectorizingPropertyHaveValue) ||
|
|
166
|
+
!fsm_dynamo_2.DyFM_Object.sameObjects(existingValue, newValue);
|
|
167
|
+
if (forceVectorize || (vectorizingPropertyHaveValue && newDataIsNewChanged)) {
|
|
168
|
+
if (!vectorizedProperty.embeddingModel) {
|
|
169
|
+
throw new fsm_dynamo_2.DyFM_Error({
|
|
170
|
+
...this.getDefaultErrorSettings('vectorizeDataProperties', new Error(`Property "${vectorizedProperty.key}" has no embedding model!`)),
|
|
171
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-VDB-VDB1`,
|
|
172
|
+
__localStack: this.dataParams.stackLocation,
|
|
173
|
+
});
|
|
174
|
+
}
|
|
175
|
+
if (this.debugLog) {
|
|
176
|
+
fsm_dynamo_1.DyFM_Log.log(`vectorizing "${vectorizedProperty.key}" in new "${this.dataParams.dataName}"` +
|
|
177
|
+
newData?.name ? `: "${newData?.name}"` : '');
|
|
178
|
+
}
|
|
179
|
+
newData[vectorizedProperty.key] = await this.vectorize(newValue, vectorizedProperty.embeddingModel);
|
|
180
|
+
}
|
|
181
|
+
else if (existingData?.[vectorizedProperty.key] && !newData?.[vectorizedProperty.key]) {
|
|
182
|
+
newData[vectorizedProperty.key] = existingData[vectorizedProperty.key];
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
async getVectorizingDataForVectorizedProperty(vectorizedProperty, data) {
|
|
186
|
+
if (vectorizedProperty.vectorizedFrom.length === 1) {
|
|
187
|
+
const value = data?.[vectorizedProperty.vectorizedFrom[0]];
|
|
188
|
+
if (value === undefined) {
|
|
189
|
+
return undefined;
|
|
190
|
+
}
|
|
191
|
+
else if (typeof value === 'string') {
|
|
192
|
+
return value;
|
|
193
|
+
}
|
|
194
|
+
else if (Array.isArray(value) || typeof value === 'object') {
|
|
195
|
+
return JSON.stringify(value);
|
|
196
|
+
}
|
|
197
|
+
else {
|
|
198
|
+
return `${value}`;
|
|
199
|
+
}
|
|
200
|
+
}
|
|
201
|
+
else {
|
|
202
|
+
const object = {};
|
|
203
|
+
vectorizedProperty.vectorizedFrom.forEach((key) => {
|
|
204
|
+
if (data?.[key] !== undefined) {
|
|
205
|
+
object[key] = data[key];
|
|
206
|
+
}
|
|
207
|
+
});
|
|
208
|
+
return JSON.stringify(object);
|
|
209
|
+
}
|
|
210
|
+
}
|
|
211
|
+
/**
|
|
212
|
+
* Vectorizes the input
|
|
213
|
+
*
|
|
214
|
+
* @example
|
|
215
|
+
* const vector = await vectorize(input);
|
|
216
|
+
*/
|
|
217
|
+
async vectorize(input, useModel = this.openAISettings.defaultSettings.useModel) {
|
|
218
|
+
try {
|
|
219
|
+
if (!input) {
|
|
220
|
+
throw new fsm_dynamo_2.DyFM_Error({
|
|
221
|
+
...this.getDefaultErrorSettings('vectorize', new Error('input is required')),
|
|
222
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-VDB-V1`,
|
|
223
|
+
});
|
|
224
|
+
}
|
|
225
|
+
this.embedding_CS ??= new oai_embedding_control_service_1.DyNTS_OAI_Embedding_ControlService(this.openAISettings);
|
|
226
|
+
const response = await this.embedding_CS.createEmbedding({
|
|
227
|
+
text: input,
|
|
228
|
+
model: useModel,
|
|
229
|
+
fullResponse: true,
|
|
230
|
+
issuer: this.issuer,
|
|
231
|
+
});
|
|
232
|
+
this.tokenSpent += response.usage.total_tokens;
|
|
233
|
+
return response.data[0].embedding;
|
|
234
|
+
}
|
|
235
|
+
catch (error) {
|
|
236
|
+
throw new fsm_dynamo_2.DyFM_Error({
|
|
237
|
+
...this.getDefaultErrorSettings('vectorize', error),
|
|
238
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-VDB-V0`,
|
|
239
|
+
});
|
|
240
|
+
}
|
|
241
|
+
}
|
|
242
|
+
/**
|
|
243
|
+
* Vectorizes the input and searches for the most similar data
|
|
244
|
+
* (the default limit is 3, and the default numberOfCandidates is 100)
|
|
245
|
+
*
|
|
246
|
+
* @example
|
|
247
|
+
* const result = await vectorSearch(input, searchInKey);
|
|
248
|
+
*/
|
|
249
|
+
async vectorSearch(set) {
|
|
250
|
+
try {
|
|
251
|
+
if (!set.input) {
|
|
252
|
+
throw new fsm_dynamo_2.DyFM_Error({
|
|
253
|
+
...this.getDefaultErrorSettings('vectorSearch', new Error('input is required')),
|
|
254
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-VDB-VS1`,
|
|
255
|
+
});
|
|
256
|
+
}
|
|
257
|
+
set.limit ??= 3;
|
|
258
|
+
set.numberOfCandidates ??= 100;
|
|
259
|
+
const { input, searchInKey, limit, numberOfCandidates, filterBy } = set;
|
|
260
|
+
this.embedding_CS ??= new oai_embedding_control_service_1.DyNTS_OAI_Embedding_ControlService(this.openAISettings);
|
|
261
|
+
const property = this.dataParams.properties[searchInKey];
|
|
262
|
+
if (!property) {
|
|
263
|
+
throw new fsm_dynamo_2.DyFM_Error({
|
|
264
|
+
...this.getDefaultErrorSettings('vectorSearch', new Error(`Property "${searchInKey}" not found! ` +
|
|
265
|
+
`while searching "${this.dataParams.dataName}" ` +
|
|
266
|
+
`(The searchable properties are: ${this.vectorizedProperties.map(p => `"${p.key}"`).join(', ')})`)),
|
|
267
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-VDB-VS2`,
|
|
268
|
+
__localStack: this.dataParams.stackLocation,
|
|
269
|
+
});
|
|
270
|
+
}
|
|
271
|
+
if (!property.vectorizeUseIndex) {
|
|
272
|
+
throw new fsm_dynamo_2.DyFM_Error({
|
|
273
|
+
...this.getDefaultErrorSettings('vectorSearch', new Error(`Property "${searchInKey}" has no vectorizeUseIndex!`)),
|
|
274
|
+
});
|
|
275
|
+
}
|
|
276
|
+
const response = await this.embedding_CS.createEmbedding({
|
|
277
|
+
text: input,
|
|
278
|
+
model: property.embeddingModel,
|
|
279
|
+
fullResponse: true,
|
|
280
|
+
issuer: this.issuer,
|
|
281
|
+
});
|
|
282
|
+
this.tokenSpent += response.usage.total_tokens;
|
|
283
|
+
const embeddedInput = response.data[0].embedding;
|
|
284
|
+
/* const vectorSearchFilter = */
|
|
285
|
+
const vectorSearchFilter = {
|
|
286
|
+
$vectorSearch: {
|
|
287
|
+
/** this is the index name that is created in the DB (in the Atlas)
|
|
288
|
+
* also the same that is used in the {@link DyFM_DataProperty_Params} */
|
|
289
|
+
index: property.vectorizeUseIndex,
|
|
290
|
+
queryVector: embeddedInput,
|
|
291
|
+
/** this is the property key that is vectorized and used to search */
|
|
292
|
+
path: searchInKey,
|
|
293
|
+
numCandidates: numberOfCandidates,
|
|
294
|
+
limit: limit,
|
|
295
|
+
}
|
|
296
|
+
};
|
|
297
|
+
if (filterBy) {
|
|
298
|
+
vectorSearchFilter.filter = filterBy;
|
|
299
|
+
}
|
|
300
|
+
if (this.debugLog) {
|
|
301
|
+
fsm_dynamo_1.DyFM_Log.log(`vectorSearch...`);
|
|
302
|
+
}
|
|
303
|
+
const result = await this.dataDBService.aggregate([vectorSearchFilter]);
|
|
304
|
+
if (this.debugLog) {
|
|
305
|
+
fsm_dynamo_1.DyFM_Log.log(`vectorSearch: ${result.length} results`);
|
|
306
|
+
}
|
|
307
|
+
return result;
|
|
308
|
+
}
|
|
309
|
+
catch (error) {
|
|
310
|
+
throw new fsm_dynamo_2.DyFM_Error({
|
|
311
|
+
...this.getDefaultErrorSettings('vectorSearch', error),
|
|
312
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-VDB-VS0`,
|
|
313
|
+
});
|
|
314
|
+
}
|
|
315
|
+
}
|
|
316
|
+
/**
|
|
317
|
+
* VectorDataService overrides the saveData function to vectorize the data properties
|
|
318
|
+
*
|
|
319
|
+
* {@link DyNTS_DataService.saveData}
|
|
320
|
+
*/
|
|
321
|
+
async saveData(data, dontSetToService, forceVectorize) {
|
|
322
|
+
try {
|
|
323
|
+
data = this.ensureData(data);
|
|
324
|
+
data = await this.vectorizeDataProperties(data, forceVectorize);
|
|
325
|
+
data = await super.saveData(data, dontSetToService);
|
|
326
|
+
if (this.swallowVectorizedProperties) {
|
|
327
|
+
this.vectorizedProperties.forEach((property) => {
|
|
328
|
+
delete data[property.key];
|
|
329
|
+
});
|
|
330
|
+
}
|
|
331
|
+
fsm_dynamo_2.DyFM_Object.cleanObject(data);
|
|
332
|
+
return data;
|
|
333
|
+
}
|
|
334
|
+
catch (error) {
|
|
335
|
+
throw new fsm_dynamo_2.DyFM_Error({
|
|
336
|
+
...this.getDefaultErrorSettings('saveData', error),
|
|
337
|
+
errorCode: `${global_settings_const_1.DyNTS_global_settings.systemShortCodeName}|DyNTS-VDB-SD0`,
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
}
|
|
341
|
+
getProvidedData(data) {
|
|
342
|
+
this.vectorizedProperties.forEach((property) => {
|
|
343
|
+
delete data[property.key];
|
|
344
|
+
});
|
|
345
|
+
return data;
|
|
346
|
+
}
|
|
347
|
+
}
|
|
348
|
+
exports.DyNTS_OAI_VectorDataService = DyNTS_OAI_VectorDataService;
|
|
349
|
+
//import {
|
|
350
|
+
// DyFM_DataModel_Params,
|
|
351
|
+
// DyFM_DataProperty_Params,
|
|
352
|
+
// DyFM_Metadata,
|
|
353
|
+
//} from '@futdevpro/fsm-dynamo';
|
|
354
|
+
//import { DyFM_OAI_Settings, DyFM_OAI_EmbeddingModel, DyFM_OAI_Model } from '@futdevpro/fsm-dynamo/ai/open-ai';
|
|
355
|
+
//
|
|
356
|
+
//import { DyNTS_DAI_VectorDataService } from '../../_modules/document-ai/_services/dai-vector-data.service-base';
|
|
357
|
+
//import { DyNTS_OAI_Embedding_Service } from './oai-embedding.service';
|
|
358
|
+
//import { DyNTS_global_settings } from '../../../../_collections/global-settings.const';
|
|
359
|
+
//import { DyNTS_OAI_global_settings } from '../_collections/oai-global-settings.const';
|
|
360
|
+
//
|
|
361
|
+
///**
|
|
362
|
+
// * OpenAI implementation of the generic Vector Data Service
|
|
363
|
+
// * Extends the generic DAI VectorDataService with OpenAI-specific functionality
|
|
364
|
+
// */
|
|
365
|
+
//export class DyNTS_OAI_VectorDataService<T extends DyFM_Metadata> extends DyNTS_DAI_VectorDataService<T> {
|
|
366
|
+
//
|
|
367
|
+
// debugLog: boolean = true;
|
|
368
|
+
// swallowVectorizedProperties: boolean = true;
|
|
369
|
+
//
|
|
370
|
+
// constructor(
|
|
371
|
+
// /** Initial data */
|
|
372
|
+
// data: T,
|
|
373
|
+
// /** DB data params */
|
|
374
|
+
// dataParams: DyFM_DataModel_Params<T>,
|
|
375
|
+
// /** OpenAI settings */
|
|
376
|
+
// public readonly openAISettings: DyFM_OAI_Settings,
|
|
377
|
+
// /** Issuer */
|
|
378
|
+
// issuer: string
|
|
379
|
+
// ) {
|
|
380
|
+
// // Create OpenAI embedding service
|
|
381
|
+
// const embeddingService = new DyNTS_OAI_Embedding_Service(openAISettings);
|
|
382
|
+
//
|
|
383
|
+
// super(data, dataParams, embeddingService, issuer);
|
|
384
|
+
//
|
|
385
|
+
// if (!openAISettings.openAIConfig.apiKey) {
|
|
386
|
+
// throw new Error('openAIConfig.apiKey is required');
|
|
387
|
+
// }
|
|
388
|
+
//
|
|
389
|
+
// const model: DyFM_OAI_EmbeddingModel = openAISettings.defaultSettings.useModel as DyFM_OAI_EmbeddingModel ??
|
|
390
|
+
// DyFM_OAI_Model.textEmbedding_3Large;
|
|
391
|
+
//
|
|
392
|
+
// // Configure vectorized properties with OpenAI-specific settings
|
|
393
|
+
// this.configureVectorizedProperties(model);
|
|
394
|
+
// }
|
|
395
|
+
//
|
|
396
|
+
// /**
|
|
397
|
+
// * Configure vectorized properties with OpenAI-specific settings
|
|
398
|
+
// */
|
|
399
|
+
// private configureVectorizedProperties(model: DyFM_OAI_EmbeddingModel): void {
|
|
400
|
+
// // Update vectorized properties with OpenAI model info
|
|
401
|
+
// this.vectorizedProperties.forEach(property => {
|
|
402
|
+
// if (property.vectorizedFrom) {
|
|
403
|
+
// // Set the embedding model for this property
|
|
404
|
+
// (property as any).embeddingModel = model;
|
|
405
|
+
// }
|
|
406
|
+
// });
|
|
407
|
+
// }
|
|
408
|
+
//
|
|
409
|
+
// /**
|
|
410
|
+
// * Perform vector search with OpenAI-specific implementation
|
|
411
|
+
// */
|
|
412
|
+
// protected override async performVectorSearch(
|
|
413
|
+
// query: string,
|
|
414
|
+
// model: string,
|
|
415
|
+
// issuer: string,
|
|
416
|
+
// options: any
|
|
417
|
+
// ): Promise<T[]> {
|
|
418
|
+
// try {
|
|
419
|
+
// // Create embedding for the query
|
|
420
|
+
// const queryEmbedding = await this.embeddingService.createEmbedding(query, model, issuer);
|
|
421
|
+
//
|
|
422
|
+
// // Get all data
|
|
423
|
+
// const allData = await this.getAllData();
|
|
424
|
+
//
|
|
425
|
+
// // Calculate similarities (simplified implementation)
|
|
426
|
+
// const results = allData.map(item => {
|
|
427
|
+
// const itemEmbedding = (item as any).chunkParentedContentVectorized;
|
|
428
|
+
// if (!itemEmbedding) return { item, similarity: 0 };
|
|
429
|
+
//
|
|
430
|
+
// const similarity = this.calculateCosineSimilarity(queryEmbedding, itemEmbedding);
|
|
431
|
+
// return { item, similarity };
|
|
432
|
+
// })
|
|
433
|
+
// .filter(result => result.similarity >= (options.minSimilarity || 0))
|
|
434
|
+
// .sort((a, b) => b.similarity - a.similarity)
|
|
435
|
+
// .slice(0, options.limit || 10)
|
|
436
|
+
// .map(result => result.item);
|
|
437
|
+
//
|
|
438
|
+
// return results;
|
|
439
|
+
// } catch (error) {
|
|
440
|
+
// throw new Error(`Vector search failed: ${error.message}`);
|
|
441
|
+
// }
|
|
442
|
+
// }
|
|
443
|
+
//
|
|
444
|
+
// /**
|
|
445
|
+
// * Calculate cosine similarity between two vectors
|
|
446
|
+
// */
|
|
447
|
+
// private calculateCosineSimilarity(vecA: number[], vecB: number[]): number {
|
|
448
|
+
// if (vecA.length !== vecB.length) return 0;
|
|
449
|
+
//
|
|
450
|
+
// let dotProduct = 0;
|
|
451
|
+
// let normA = 0;
|
|
452
|
+
// let normB = 0;
|
|
453
|
+
//
|
|
454
|
+
// for (let i = 0; i < vecA.length; i++) {
|
|
455
|
+
// dotProduct += vecA[i] * vecB[i];
|
|
456
|
+
// normA += vecA[i] * vecA[i];
|
|
457
|
+
// normB += vecB[i] * vecB[i];
|
|
458
|
+
// }
|
|
459
|
+
//
|
|
460
|
+
// if (normA === 0 || normB === 0) return 0;
|
|
461
|
+
//
|
|
462
|
+
// return dotProduct / (Math.sqrt(normA) * Math.sqrt(normB));
|
|
463
|
+
// }
|
|
464
|
+
//
|
|
465
|
+
// /**
|
|
466
|
+
// * Get default error settings
|
|
467
|
+
// */
|
|
468
|
+
// protected getDefaultErrorSettings(
|
|
469
|
+
// method: string,
|
|
470
|
+
// error: any,
|
|
471
|
+
// issuer?: string
|
|
472
|
+
// ): any {
|
|
473
|
+
// return {
|
|
474
|
+
// method,
|
|
475
|
+
// error,
|
|
476
|
+
// issuer: issuer || this.issuer,
|
|
477
|
+
// userMsg: this.defaultErrorUserMsg,
|
|
478
|
+
// };
|
|
479
|
+
// }
|
|
480
|
+
//}
|
|
481
481
|
//# sourceMappingURL=oai-vector-data.service.js.map
|