@webiny/api-core 0.0.0-unstable.e6f0dc8ca7 → 0.0.0-unstable.e9333b3f0b
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/ApiCoreFeature.d.ts +2 -2
- package/ApiCoreFeature.js +48 -18
- package/ApiCoreFeature.js.map +1 -1
- package/domain/identity/SystemIdentityValue.js +9 -8
- package/domain/identity/SystemIdentityValue.js.map +1 -1
- package/domain/security/ApiToken.js +5 -11
- package/domain/security/ApiToken.js.map +1 -1
- package/domain/tenancy/RootTenantValue.js +9 -8
- package/domain/tenancy/RootTenantValue.js.map +1 -1
- package/domain/tenancy/errors.js +0 -3
- package/exports/api/build-params.js +0 -3
- package/exports/api/event-publisher.js +0 -3
- package/exports/api/graphql.js +0 -2
- package/exports/api/key-value-store.js +0 -3
- package/exports/api/logger.js +0 -3
- package/exports/api/security/api-key.d.ts +1 -0
- package/exports/api/security/api-key.js +1 -2
- package/exports/api/security/authentication.js +0 -2
- package/exports/api/security/role.js +1 -3
- package/exports/api/security/user.js +0 -2
- package/exports/api/security.js +3 -7
- package/exports/api/system.js +0 -2
- package/exports/api/tasks.d.ts +1 -0
- package/exports/api/tasks.js +1 -3
- package/exports/api/tenancy.js +4 -6
- package/exports/api/webhooks.d.ts +1 -0
- package/exports/api/webhooks.js +1 -0
- package/exports/api.d.ts +2 -1
- package/exports/api.js +2 -3
- package/features/ai/Ai.d.ts +5 -1
- package/features/ai/Ai.js +206 -119
- package/features/ai/Ai.js.map +1 -1
- package/features/ai/AiModelRegistry.d.ts +14 -0
- package/features/ai/AiModelRegistry.js +39 -0
- package/features/ai/AiModelRegistry.js.map +1 -0
- package/features/ai/AiSdkToolHandlerResolver.d.ts +11 -0
- package/features/ai/AiSdkToolHandlerResolver.js +19 -0
- package/features/ai/AiSdkToolHandlerResolver.js.map +1 -0
- package/features/ai/AiSdkTools.d.ts +4 -3
- package/features/ai/AiSdkTools.js +25 -19
- package/features/ai/AiSdkTools.js.map +1 -1
- package/features/ai/AnthropicSdkFactory.js +66 -65
- package/features/ai/AnthropicSdkFactory.js.map +1 -1
- package/features/ai/DEVELOPERS.md +169 -0
- package/features/ai/GoogleSdkFactory.d.ts +10 -0
- package/features/ai/GoogleSdkFactory.js +65 -0
- package/features/ai/GoogleSdkFactory.js.map +1 -0
- package/features/ai/OpenAiSdkFactory.js +126 -181
- package/features/ai/OpenAiSdkFactory.js.map +1 -1
- package/features/ai/RemoteAiModelCatalog.d.ts +13 -0
- package/features/ai/RemoteAiModelCatalog.js +74 -0
- package/features/ai/RemoteAiModelCatalog.js.map +1 -0
- package/features/ai/TextExtractor/DefaultTextExtractor.d.ts +9 -0
- package/features/ai/TextExtractor/DefaultTextExtractor.js +28 -0
- package/features/ai/TextExtractor/DefaultTextExtractor.js.map +1 -0
- package/features/ai/TextExtractor/abstractions.d.ts +12 -0
- package/features/ai/TextExtractor/abstractions.js +5 -0
- package/features/ai/TextExtractor/abstractions.js.map +1 -0
- package/features/ai/TextExtractor/index.d.ts +3 -0
- package/features/ai/TextExtractor/index.js +2 -0
- package/features/ai/TextExtractor/parsers/docxParser.d.ts +1 -0
- package/features/ai/TextExtractor/parsers/docxParser.js +111 -0
- package/features/ai/TextExtractor/parsers/docxParser.js.map +1 -0
- package/features/ai/abstractions.d.ts +102 -7
- package/features/ai/abstractions.js +11 -32
- package/features/ai/abstractions.js.map +1 -1
- package/features/ai/events.d.ts +95 -0
- package/features/ai/events.js +59 -0
- package/features/ai/events.js.map +1 -0
- package/features/ai/feature.js +23 -8
- package/features/ai/feature.js.map +1 -1
- package/features/ai/index.d.ts +6 -2
- package/features/ai/index.js +4 -3
- package/features/ai/toolPipeline/AiOutputToolRegistry.d.ts +11 -0
- package/features/ai/toolPipeline/AiOutputToolRegistry.js +31 -0
- package/features/ai/toolPipeline/AiOutputToolRegistry.js.map +1 -0
- package/features/ai/toolPipeline/AiToolPipelineRunner.d.ts +10 -0
- package/features/ai/toolPipeline/AiToolPipelineRunner.js +36 -0
- package/features/ai/toolPipeline/AiToolPipelineRunner.js.map +1 -0
- package/features/ai/toolPipeline/abstractions.d.ts +23 -0
- package/features/ai/toolPipeline/abstractions.js +7 -0
- package/features/ai/toolPipeline/abstractions.js.map +1 -0
- package/features/ai/toolPipeline/index.d.ts +2 -0
- package/features/ai/toolPipeline/index.js +1 -0
- package/features/buildParams/BuildParams.js +20 -14
- package/features/buildParams/BuildParams.js.map +1 -1
- package/features/buildParams/abstractions.js +3 -4
- package/features/buildParams/abstractions.js.map +1 -1
- package/features/buildParams/feature.js +6 -5
- package/features/buildParams/feature.js.map +1 -1
- package/features/buildParams/index.js +0 -2
- package/features/dateFormatter/DefaultDateFormatter.d.ts +15 -0
- package/features/dateFormatter/DefaultDateFormatter.js +20 -0
- package/features/dateFormatter/DefaultDateFormatter.js.map +1 -0
- package/features/dateFormatter/abstractions.d.ts +13 -0
- package/features/dateFormatter/abstractions.js +5 -0
- package/features/dateFormatter/abstractions.js.map +1 -0
- package/features/dateFormatter/feature.d.ts +4 -0
- package/features/dateFormatter/feature.js +11 -0
- package/features/dateFormatter/feature.js.map +1 -0
- package/features/dateFormatter/index.d.ts +3 -0
- package/features/dateFormatter/index.js +2 -0
- package/features/encryption/EncryptionKeyCacheFeature.d.ts +8 -0
- package/features/encryption/EncryptionKeyCacheFeature.js +11 -0
- package/features/encryption/EncryptionKeyCacheFeature.js.map +1 -0
- package/features/encryption/EncryptionService.d.ts +4 -3
- package/features/encryption/EncryptionService.js +57 -46
- package/features/encryption/EncryptionService.js.map +1 -1
- package/features/encryption/MemoryEncryptionKeyCache.d.ts +13 -0
- package/features/encryption/MemoryEncryptionKeyCache.js +26 -0
- package/features/encryption/MemoryEncryptionKeyCache.js.map +1 -0
- package/features/encryption/abstractions.d.ts +13 -2
- package/features/encryption/abstractions.js +3 -2
- package/features/encryption/abstractions.js.map +1 -1
- package/features/encryption/feature.js +6 -5
- package/features/encryption/feature.js.map +1 -1
- package/features/encryption/index.d.ts +1 -0
- package/features/encryption/index.js +1 -2
- package/features/eventPublisher/EventPublisher.js +9 -15
- package/features/eventPublisher/EventPublisher.js.map +1 -1
- package/features/eventPublisher/__tests__/EventPublisher.test.js +385 -419
- package/features/eventPublisher/__tests__/EventPublisher.test.js.map +1 -1
- package/features/eventPublisher/abstractions.js +7 -12
- package/features/eventPublisher/abstractions.js.map +1 -1
- package/features/eventPublisher/feature.js +8 -7
- package/features/eventPublisher/feature.js.map +1 -1
- package/features/eventPublisher/index.js +0 -2
- package/features/featureFlags/FeatureFlags.js +15 -12
- package/features/featureFlags/FeatureFlags.js.map +1 -1
- package/features/featureFlags/abstractions.js +2 -1
- package/features/featureFlags/abstractions.js.map +1 -1
- package/features/featureFlags/decorators/FeatureFlagsWithLicenseDecorator.d.ts +13 -0
- package/features/featureFlags/decorators/FeatureFlagsWithLicenseDecorator.js +61 -0
- package/features/featureFlags/decorators/FeatureFlagsWithLicenseDecorator.js.map +1 -0
- package/features/featureFlags/feature.js +6 -5
- package/features/featureFlags/feature.js.map +1 -1
- package/features/hashing/ScryptHasher.d.ts +11 -0
- package/features/hashing/ScryptHasher.js +74 -0
- package/features/hashing/ScryptHasher.js.map +1 -0
- package/features/hashing/abstractions.d.ts +18 -0
- package/features/hashing/abstractions.js +5 -0
- package/features/hashing/abstractions.js.map +1 -0
- package/features/hashing/feature.d.ts +4 -0
- package/features/hashing/feature.js +11 -0
- package/features/hashing/feature.js.map +1 -0
- package/features/hashing/index.d.ts +2 -0
- package/features/hashing/index.js +1 -0
- package/features/httpClient/HttpClient.d.ts +7 -0
- package/features/httpClient/HttpClient.js +72 -0
- package/features/httpClient/HttpClient.js.map +1 -0
- package/features/httpClient/HttpRequestError.d.ts +10 -0
- package/features/httpClient/HttpRequestError.js +13 -0
- package/features/httpClient/HttpRequestError.js.map +1 -0
- package/features/httpClient/HttpStatusError.d.ts +12 -0
- package/features/httpClient/HttpStatusError.js +12 -0
- package/features/httpClient/HttpStatusError.js.map +1 -0
- package/features/httpClient/abstractions.d.ts +32 -0
- package/features/httpClient/abstractions.js +5 -0
- package/features/httpClient/abstractions.js.map +1 -0
- package/features/httpClient/feature.d.ts +4 -0
- package/features/httpClient/feature.js +11 -0
- package/features/httpClient/feature.js.map +1 -0
- package/features/httpClient/index.d.ts +3 -0
- package/features/httpClient/index.js +3 -0
- package/features/keyValueStore/GlobalKeyValueStore.js +30 -25
- package/features/keyValueStore/GlobalKeyValueStore.js.map +1 -1
- package/features/keyValueStore/KeyValueStore.d.ts +2 -2
- package/features/keyValueStore/KeyValueStore.js +31 -27
- package/features/keyValueStore/KeyValueStore.js.map +1 -1
- package/features/keyValueStore/KeyValueStoreRepository.d.ts +2 -2
- package/features/keyValueStore/KeyValueStoreRepository.js +34 -41
- package/features/keyValueStore/KeyValueStoreRepository.js.map +1 -1
- package/features/keyValueStore/abstractions.d.ts +14 -3
- package/features/keyValueStore/abstractions.js +5 -20
- package/features/keyValueStore/abstractions.js.map +1 -1
- package/features/keyValueStore/errors.js +16 -17
- package/features/keyValueStore/errors.js.map +1 -1
- package/features/keyValueStore/feature.js +9 -9
- package/features/keyValueStore/feature.js.map +1 -1
- package/features/keyValueStore/index.js +1 -3
- package/features/logger/LoggerService.js +41 -45
- package/features/logger/LoggerService.js.map +1 -1
- package/features/logger/abstractions.js +2 -2
- package/features/logger/abstractions.js.map +1 -1
- package/features/logger/feature.js +6 -5
- package/features/logger/feature.js.map +1 -1
- package/features/logger/index.js +0 -2
- package/features/masker/Masker.js +11 -14
- package/features/masker/Masker.js.map +1 -1
- package/features/masker/abstractions.js +2 -1
- package/features/masker/abstractions.js.map +1 -1
- package/features/masker/feature.js +7 -6
- package/features/masker/feature.js.map +1 -1
- package/features/masker/index.js +0 -2
- package/features/requestContext/RawAssumePermissions.d.ts +14 -0
- package/features/requestContext/RawAssumePermissions.js +19 -0
- package/features/requestContext/RawAssumePermissions.js.map +1 -0
- package/features/requestContext/RawAuthToken.d.ts +14 -0
- package/features/requestContext/RawAuthToken.js +19 -0
- package/features/requestContext/RawAuthToken.js.map +1 -0
- package/features/requestContext/RawTenantId.d.ts +14 -0
- package/features/requestContext/RawTenantId.js +19 -0
- package/features/requestContext/RawTenantId.js.map +1 -0
- package/features/requestContext/RequestIdentityLoader.d.ts +19 -0
- package/features/requestContext/RequestIdentityLoader.js +26 -0
- package/features/requestContext/RequestIdentityLoader.js.map +1 -0
- package/features/requestContext/RequestTenantLoader.d.ts +18 -0
- package/features/requestContext/RequestTenantLoader.js +52 -0
- package/features/requestContext/RequestTenantLoader.js.map +1 -0
- package/features/requestContext/abstractions.d.ts +75 -0
- package/features/requestContext/abstractions.js +9 -0
- package/features/requestContext/abstractions.js.map +1 -0
- package/features/requestContext/extractAssumePermissions.d.ts +14 -0
- package/features/requestContext/extractAssumePermissions.js +32 -0
- package/features/requestContext/extractAssumePermissions.js.map +1 -0
- package/features/requestContext/feature.d.ts +12 -0
- package/features/requestContext/feature.js +19 -0
- package/features/requestContext/feature.js.map +1 -0
- package/features/requestContext/index.d.ts +4 -0
- package/features/requestContext/index.js +3 -0
- package/features/security/IdentityContext/AnonymousIdentity.js +12 -16
- package/features/security/IdentityContext/AnonymousIdentity.js.map +1 -1
- package/features/security/IdentityContext/AuthenticatedIdentity.js +5 -8
- package/features/security/IdentityContext/AuthenticatedIdentity.js.map +1 -1
- package/features/security/IdentityContext/Identity.js +63 -71
- package/features/security/IdentityContext/Identity.js.map +1 -1
- package/features/security/IdentityContext/IdentityContext.d.ts +3 -3
- package/features/security/IdentityContext/IdentityContext.js +70 -107
- package/features/security/IdentityContext/IdentityContext.js.map +1 -1
- package/features/security/IdentityContext/abstractions.js +2 -2
- package/features/security/IdentityContext/abstractions.js.map +1 -1
- package/features/security/IdentityContext/feature.js +6 -5
- package/features/security/IdentityContext/feature.js.map +1 -1
- package/features/security/IdentityContext/index.js +0 -3
- package/features/security/SecurityFeature.js +13 -21
- package/features/security/SecurityFeature.js.map +1 -1
- package/features/security/apiKeys/ApiKeyAuthenticator.d.ts +14 -0
- package/features/security/apiKeys/ApiKeyAuthenticator.js +36 -0
- package/features/security/apiKeys/ApiKeyAuthenticator.js.map +1 -0
- package/features/security/apiKeys/ApiKeyAuthorizer.d.ts +10 -0
- package/features/security/apiKeys/ApiKeyAuthorizer.js +15 -0
- package/features/security/apiKeys/ApiKeyAuthorizer.js.map +1 -0
- package/features/security/apiKeys/CreateApiKey/CreateApiKeyUseCase.js +53 -49
- package/features/security/apiKeys/CreateApiKey/CreateApiKeyUseCase.js.map +1 -1
- package/features/security/apiKeys/CreateApiKey/abstractions.js +2 -2
- package/features/security/apiKeys/CreateApiKey/abstractions.js.map +1 -1
- package/features/security/apiKeys/CreateApiKey/events.js +17 -16
- package/features/security/apiKeys/CreateApiKey/events.js.map +1 -1
- package/features/security/apiKeys/CreateApiKey/feature.js +6 -5
- package/features/security/apiKeys/CreateApiKey/feature.js.map +1 -1
- package/features/security/apiKeys/CreateApiKey/index.js +0 -2
- package/features/security/apiKeys/DeleteApiKey/DeleteApiKeyUseCase.js +29 -30
- package/features/security/apiKeys/DeleteApiKey/DeleteApiKeyUseCase.js.map +1 -1
- package/features/security/apiKeys/DeleteApiKey/abstractions.js +2 -2
- package/features/security/apiKeys/DeleteApiKey/abstractions.js.map +1 -1
- package/features/security/apiKeys/DeleteApiKey/events.js +17 -16
- package/features/security/apiKeys/DeleteApiKey/events.js.map +1 -1
- package/features/security/apiKeys/DeleteApiKey/feature.js +6 -5
- package/features/security/apiKeys/DeleteApiKey/feature.js.map +1 -1
- package/features/security/apiKeys/DeleteApiKey/index.js +0 -2
- package/features/security/apiKeys/GetApiKey/GetApiKeyUseCase.d.ts +1 -1
- package/features/security/apiKeys/GetApiKey/GetApiKeyUseCase.js +16 -14
- package/features/security/apiKeys/GetApiKey/GetApiKeyUseCase.js.map +1 -1
- package/features/security/apiKeys/GetApiKey/abstractions.js +2 -2
- package/features/security/apiKeys/GetApiKey/abstractions.js.map +1 -1
- package/features/security/apiKeys/GetApiKey/feature.js +6 -5
- package/features/security/apiKeys/GetApiKey/feature.js.map +1 -1
- package/features/security/apiKeys/GetApiKey/index.js +0 -2
- package/features/security/apiKeys/GetApiKeyBySlug/GetApiKeyBySlugUseCase.d.ts +1 -3
- package/features/security/apiKeys/GetApiKeyBySlug/GetApiKeyBySlugUseCase.js +13 -10
- package/features/security/apiKeys/GetApiKeyBySlug/GetApiKeyBySlugUseCase.js.map +1 -1
- package/features/security/apiKeys/GetApiKeyBySlug/abstractions.d.ts +1 -1
- package/features/security/apiKeys/GetApiKeyBySlug/abstractions.js +2 -2
- package/features/security/apiKeys/GetApiKeyBySlug/abstractions.js.map +1 -1
- package/features/security/apiKeys/GetApiKeyBySlug/feature.js +6 -5
- package/features/security/apiKeys/GetApiKeyBySlug/feature.js.map +1 -1
- package/features/security/apiKeys/GetApiKeyBySlug/index.js +0 -2
- package/features/security/apiKeys/GetApiKeyByToken/GetApiKeyByTokenUseCase.d.ts +1 -3
- package/features/security/apiKeys/GetApiKeyByToken/GetApiKeyByTokenUseCase.js +13 -10
- package/features/security/apiKeys/GetApiKeyByToken/GetApiKeyByTokenUseCase.js.map +1 -1
- package/features/security/apiKeys/GetApiKeyByToken/abstractions.d.ts +1 -1
- package/features/security/apiKeys/GetApiKeyByToken/abstractions.js +2 -2
- package/features/security/apiKeys/GetApiKeyByToken/abstractions.js.map +1 -1
- package/features/security/apiKeys/GetApiKeyByToken/feature.js +6 -5
- package/features/security/apiKeys/GetApiKeyByToken/feature.js.map +1 -1
- package/features/security/apiKeys/GetApiKeyByToken/index.js +0 -2
- package/features/security/apiKeys/ListApiKeys/ListApiKeysUseCase.js +17 -17
- package/features/security/apiKeys/ListApiKeys/ListApiKeysUseCase.js.map +1 -1
- package/features/security/apiKeys/ListApiKeys/abstractions.js +2 -2
- package/features/security/apiKeys/ListApiKeys/abstractions.js.map +1 -1
- package/features/security/apiKeys/ListApiKeys/feature.js +6 -5
- package/features/security/apiKeys/ListApiKeys/feature.js.map +1 -1
- package/features/security/apiKeys/ListApiKeys/index.js +0 -2
- package/features/security/apiKeys/UpdateApiKey/UpdateApiKeyUseCase.js +45 -42
- package/features/security/apiKeys/UpdateApiKey/UpdateApiKeyUseCase.js.map +1 -1
- package/features/security/apiKeys/UpdateApiKey/abstractions.js +2 -2
- package/features/security/apiKeys/UpdateApiKey/abstractions.js.map +1 -1
- package/features/security/apiKeys/UpdateApiKey/events.js +17 -16
- package/features/security/apiKeys/UpdateApiKey/events.js.map +1 -1
- package/features/security/apiKeys/UpdateApiKey/feature.js +6 -5
- package/features/security/apiKeys/UpdateApiKey/feature.js.map +1 -1
- package/features/security/apiKeys/UpdateApiKey/index.js +0 -2
- package/features/security/apiKeys/feature.js +24 -17
- package/features/security/apiKeys/feature.js.map +1 -1
- package/features/security/apiKeys/shared/ApiKeyProvider.d.ts +3 -5
- package/features/security/apiKeys/shared/ApiKeyProvider.js +31 -46
- package/features/security/apiKeys/shared/ApiKeyProvider.js.map +1 -1
- package/features/security/apiKeys/shared/ApiKeysRepository.d.ts +1 -0
- package/features/security/apiKeys/shared/ApiKeysRepository.js +123 -135
- package/features/security/apiKeys/shared/ApiKeysRepository.js.map +1 -1
- package/features/security/apiKeys/shared/abstractions.js +4 -6
- package/features/security/apiKeys/shared/abstractions.js.map +1 -1
- package/features/security/apiKeys/shared/errors.js +29 -32
- package/features/security/apiKeys/shared/errors.js.map +1 -1
- package/features/security/apiKeys/shared/generateToken.d.ts +1 -1
- package/features/security/apiKeys/shared/generateToken.js +6 -16
- package/features/security/apiKeys/shared/generateToken.js.map +1 -1
- package/features/security/apiKeys/shared/schemas.d.ts +2 -2
- package/features/security/apiKeys/shared/schemas.js +27 -23
- package/features/security/apiKeys/shared/schemas.js.map +1 -1
- package/features/security/apiKeys/shared/types.d.ts +1 -1
- package/features/security/apiKeys/shared/types.js +0 -3
- package/features/security/authentication/AuthenticationContext/AuthenticationContext.js +44 -38
- package/features/security/authentication/AuthenticationContext/AuthenticationContext.js.map +1 -1
- package/features/security/authentication/AuthenticationContext/SetIdTokenCookie.js +33 -43
- package/features/security/authentication/AuthenticationContext/SetIdTokenCookie.js.map +1 -1
- package/features/security/authentication/AuthenticationContext/abstractions.js +2 -2
- package/features/security/authentication/AuthenticationContext/abstractions.js.map +1 -1
- package/features/security/authentication/AuthenticationContext/errors.js +51 -116
- package/features/security/authentication/AuthenticationContext/errors.js.map +1 -1
- package/features/security/authentication/AuthenticationContext/events.js +17 -16
- package/features/security/authentication/AuthenticationContext/events.js.map +1 -1
- package/features/security/authentication/AuthenticationContext/feature.js +6 -5
- package/features/security/authentication/AuthenticationContext/feature.js.map +1 -1
- package/features/security/authentication/AuthenticationContext/index.js +2 -4
- package/features/security/authentication/Authenticator/abstractions.js +2 -2
- package/features/security/authentication/Authenticator/abstractions.js.map +1 -1
- package/features/security/authentication/Authenticator/index.js +0 -2
- package/features/security/authorization/AuthorizationContext/AuthorizationContext.js +46 -59
- package/features/security/authorization/AuthorizationContext/AuthorizationContext.js.map +1 -1
- package/features/security/authorization/AuthorizationContext/abstractions.js +3 -4
- package/features/security/authorization/AuthorizationContext/abstractions.js.map +1 -1
- package/features/security/authorization/AuthorizationContext/feature.js +10 -9
- package/features/security/authorization/AuthorizationContext/feature.js.map +1 -1
- package/features/security/authorization/AuthorizationContext/index.js +1 -4
- package/features/security/authorization/Authorizer/abstractions.js +2 -2
- package/features/security/authorization/Authorizer/abstractions.js.map +1 -1
- package/features/security/authorization/Authorizer/index.js +0 -2
- package/features/security/authorization/GroupsTeamsAuthorizer/AssumedPermissions.d.ts +30 -0
- package/features/security/authorization/GroupsTeamsAuthorizer/AssumedPermissions.js +60 -0
- package/features/security/authorization/GroupsTeamsAuthorizer/AssumedPermissions.js.map +1 -0
- package/features/security/authorization/GroupsTeamsAuthorizer/GetPermissionsFromIdentity.d.ts +4 -4
- package/features/security/authorization/GroupsTeamsAuthorizer/GetPermissionsFromIdentity.js +61 -65
- package/features/security/authorization/GroupsTeamsAuthorizer/GetPermissionsFromIdentity.js.map +1 -1
- package/features/security/authorization/GroupsTeamsAuthorizer/RolesTeamsAuthorizer.js +26 -40
- package/features/security/authorization/GroupsTeamsAuthorizer/RolesTeamsAuthorizer.js.map +1 -1
- package/features/security/authorization/GroupsTeamsAuthorizer/abstractions.js +2 -1
- package/features/security/authorization/GroupsTeamsAuthorizer/abstractions.js.map +1 -1
- package/features/security/authorization/GroupsTeamsAuthorizer/feature.js +9 -6
- package/features/security/authorization/GroupsTeamsAuthorizer/feature.js.map +1 -1
- package/features/security/login/abstractions.js +9 -8
- package/features/security/login/abstractions.js.map +1 -1
- package/features/security/login/index.js +0 -2
- package/features/security/permissions/createPermissionSchema.js +6 -5
- package/features/security/permissions/createPermissionSchema.js.map +1 -1
- package/features/security/permissions/createPermissions.js +148 -236
- package/features/security/permissions/createPermissions.js.map +1 -1
- package/features/security/permissions/index.js +0 -2
- package/features/security/permissions/types.js +0 -3
- package/features/security/roles/CreateRole/CreateRoleUseCase.js +58 -59
- package/features/security/roles/CreateRole/CreateRoleUseCase.js.map +1 -1
- package/features/security/roles/CreateRole/abstractions.js +2 -2
- package/features/security/roles/CreateRole/abstractions.js.map +1 -1
- package/features/security/roles/CreateRole/events.js +17 -16
- package/features/security/roles/CreateRole/events.js.map +1 -1
- package/features/security/roles/CreateRole/feature.js +6 -5
- package/features/security/roles/CreateRole/feature.js.map +1 -1
- package/features/security/roles/CreateRole/index.js +0 -2
- package/features/security/roles/CreateRole/schema.d.ts +1 -1
- package/features/security/roles/CreateRole/schema.js +8 -7
- package/features/security/roles/CreateRole/schema.js.map +1 -1
- package/features/security/roles/DeleteRole/DeleteRoleUseCase.js +35 -41
- package/features/security/roles/DeleteRole/DeleteRoleUseCase.js.map +1 -1
- package/features/security/roles/DeleteRole/abstractions.js +2 -2
- package/features/security/roles/DeleteRole/abstractions.js.map +1 -1
- package/features/security/roles/DeleteRole/events.js +17 -16
- package/features/security/roles/DeleteRole/events.js.map +1 -1
- package/features/security/roles/DeleteRole/feature.js +6 -5
- package/features/security/roles/DeleteRole/feature.js.map +1 -1
- package/features/security/roles/DeleteRole/index.js +0 -2
- package/features/security/roles/GetRole/GetRoleUseCase.js +19 -18
- package/features/security/roles/GetRole/GetRoleUseCase.js.map +1 -1
- package/features/security/roles/GetRole/abstractions.js +2 -2
- package/features/security/roles/GetRole/abstractions.js.map +1 -1
- package/features/security/roles/GetRole/feature.js +6 -5
- package/features/security/roles/GetRole/feature.js.map +1 -1
- package/features/security/roles/GetRole/index.js +0 -2
- package/features/security/roles/Installer/RolesInstaller.js +38 -35
- package/features/security/roles/Installer/RolesInstaller.js.map +1 -1
- package/features/security/roles/ListRoles/ListRolesUseCase.js +18 -17
- package/features/security/roles/ListRoles/ListRolesUseCase.js.map +1 -1
- package/features/security/roles/ListRoles/abstractions.js +2 -2
- package/features/security/roles/ListRoles/abstractions.js.map +1 -1
- package/features/security/roles/ListRoles/feature.js +6 -5
- package/features/security/roles/ListRoles/feature.js.map +1 -1
- package/features/security/roles/ListRoles/index.js +0 -2
- package/features/security/roles/UpdateRole/UpdateRoleUseCase.js +49 -50
- package/features/security/roles/UpdateRole/UpdateRoleUseCase.js.map +1 -1
- package/features/security/roles/UpdateRole/abstractions.js +2 -2
- package/features/security/roles/UpdateRole/abstractions.js.map +1 -1
- package/features/security/roles/UpdateRole/events.js +17 -16
- package/features/security/roles/UpdateRole/events.js.map +1 -1
- package/features/security/roles/UpdateRole/feature.js +6 -5
- package/features/security/roles/UpdateRole/feature.js.map +1 -1
- package/features/security/roles/UpdateRole/index.js +0 -2
- package/features/security/roles/UpdateRole/schema.d.ts +1 -1
- package/features/security/roles/UpdateRole/schema.js +7 -6
- package/features/security/roles/UpdateRole/schema.js.map +1 -1
- package/features/security/roles/feature.js +14 -18
- package/features/security/roles/feature.js.map +1 -1
- package/features/security/roles/shared/RoleProvider.js +27 -21
- package/features/security/roles/shared/RoleProvider.js.map +1 -1
- package/features/security/roles/shared/RolesRepository.js +96 -113
- package/features/security/roles/shared/RolesRepository.js.map +1 -1
- package/features/security/roles/shared/abstractions.js +3 -4
- package/features/security/roles/shared/abstractions.js.map +1 -1
- package/features/security/roles/shared/decorators/ListCache.js +23 -22
- package/features/security/roles/shared/decorators/ListCache.js.map +1 -1
- package/features/security/roles/shared/decorators/RolesRepositoryCachingDecorator.js +40 -62
- package/features/security/roles/shared/decorators/RolesRepositoryCachingDecorator.js.map +1 -1
- package/features/security/roles/shared/errors.js +50 -56
- package/features/security/roles/shared/errors.js.map +1 -1
- package/features/security/roles/shared/types.js +0 -3
- package/features/security/shared/abstractions.js +4 -6
- package/features/security/shared/abstractions.js.map +1 -1
- package/features/security/shared/description.d.ts +4 -0
- package/features/security/shared/description.js +7 -0
- package/features/security/shared/description.js.map +1 -0
- package/features/security/shared/errors.js +8 -8
- package/features/security/shared/errors.js.map +1 -1
- package/features/security/shared/index.d.ts +1 -0
- package/features/security/shared/index.js +1 -2
- package/features/security/teams/CreateTeam/CreateTeamUseCase.d.ts +3 -1
- package/features/security/teams/CreateTeam/CreateTeamUseCase.js +65 -59
- package/features/security/teams/CreateTeam/CreateTeamUseCase.js.map +1 -1
- package/features/security/teams/CreateTeam/abstractions.js +2 -2
- package/features/security/teams/CreateTeam/abstractions.js.map +1 -1
- package/features/security/teams/CreateTeam/events.js +17 -16
- package/features/security/teams/CreateTeam/events.js.map +1 -1
- package/features/security/teams/CreateTeam/feature.js +6 -5
- package/features/security/teams/CreateTeam/feature.js.map +1 -1
- package/features/security/teams/CreateTeam/index.js +0 -2
- package/features/security/teams/CreateTeam/schema.d.ts +1 -1
- package/features/security/teams/CreateTeam/schema.js +6 -5
- package/features/security/teams/CreateTeam/schema.js.map +1 -1
- package/features/security/teams/DeleteTeam/DeleteTeamUseCase.js +36 -46
- package/features/security/teams/DeleteTeam/DeleteTeamUseCase.js.map +1 -1
- package/features/security/teams/DeleteTeam/abstractions.js +2 -2
- package/features/security/teams/DeleteTeam/abstractions.js.map +1 -1
- package/features/security/teams/DeleteTeam/events.js +17 -16
- package/features/security/teams/DeleteTeam/events.js.map +1 -1
- package/features/security/teams/DeleteTeam/feature.js +6 -5
- package/features/security/teams/DeleteTeam/feature.js.map +1 -1
- package/features/security/teams/DeleteTeam/index.js +0 -2
- package/features/security/teams/GetTeam/GetTeamUseCase.js +17 -17
- package/features/security/teams/GetTeam/GetTeamUseCase.js.map +1 -1
- package/features/security/teams/GetTeam/abstractions.js +2 -2
- package/features/security/teams/GetTeam/abstractions.js.map +1 -1
- package/features/security/teams/GetTeam/feature.js +6 -5
- package/features/security/teams/GetTeam/feature.js.map +1 -1
- package/features/security/teams/GetTeam/index.js +0 -2
- package/features/security/teams/ListTeams/ListTeamsUseCase.js +20 -21
- package/features/security/teams/ListTeams/ListTeamsUseCase.js.map +1 -1
- package/features/security/teams/ListTeams/abstractions.js +2 -2
- package/features/security/teams/ListTeams/abstractions.js.map +1 -1
- package/features/security/teams/ListTeams/feature.js +6 -5
- package/features/security/teams/ListTeams/feature.js.map +1 -1
- package/features/security/teams/ListTeams/index.js +0 -2
- package/features/security/teams/UpdateTeam/UpdateTeamUseCase.d.ts +3 -1
- package/features/security/teams/UpdateTeam/UpdateTeamUseCase.js +61 -58
- package/features/security/teams/UpdateTeam/UpdateTeamUseCase.js.map +1 -1
- package/features/security/teams/UpdateTeam/abstractions.js +2 -2
- package/features/security/teams/UpdateTeam/abstractions.js.map +1 -1
- package/features/security/teams/UpdateTeam/events.js +17 -16
- package/features/security/teams/UpdateTeam/events.js.map +1 -1
- package/features/security/teams/UpdateTeam/feature.js +6 -5
- package/features/security/teams/UpdateTeam/feature.js.map +1 -1
- package/features/security/teams/UpdateTeam/index.js +0 -2
- package/features/security/teams/UpdateTeam/schema.d.ts +1 -1
- package/features/security/teams/UpdateTeam/schema.js +5 -4
- package/features/security/teams/UpdateTeam/schema.js.map +1 -1
- package/features/security/teams/feature.js +13 -17
- package/features/security/teams/feature.js.map +1 -1
- package/features/security/teams/shared/TeamProvider.js +27 -21
- package/features/security/teams/shared/TeamProvider.js.map +1 -1
- package/features/security/teams/shared/TeamsRepository.js +100 -118
- package/features/security/teams/shared/TeamsRepository.js.map +1 -1
- package/features/security/teams/shared/abstractions.js +3 -4
- package/features/security/teams/shared/abstractions.js.map +1 -1
- package/features/security/teams/shared/decorators/TeamsRepositoryCachingDecorator.js +40 -62
- package/features/security/teams/shared/decorators/TeamsRepositoryCachingDecorator.js.map +1 -1
- package/features/security/teams/shared/errors.js +62 -70
- package/features/security/teams/shared/errors.js.map +1 -1
- package/features/security/teams/shared/resolveRoleIdentifiers.d.ts +17 -0
- package/features/security/teams/shared/resolveRoleIdentifiers.js +32 -0
- package/features/security/teams/shared/resolveRoleIdentifiers.js.map +1 -0
- package/features/security/teams/shared/types.js +0 -3
- package/features/security/utils/AppPermissions.js +50 -89
- package/features/security/utils/AppPermissions.js.map +1 -1
- package/features/security/utils/IdentityValue.js +19 -22
- package/features/security/utils/IdentityValue.js.map +1 -1
- package/features/security/utils/filterOutCustomWbyAppsPermissions.js +24 -27
- package/features/security/utils/filterOutCustomWbyAppsPermissions.js.map +1 -1
- package/features/security/utils/getPermissionsFromRoles.d.ts +1 -1
- package/features/security/utils/getPermissionsFromRoles.js +5 -10
- package/features/security/utils/getPermissionsFromRoles.js.map +1 -1
- package/features/security/utils/isJwt.js +2 -1
- package/features/security/utils/isJwt.js.map +1 -1
- package/features/security/utils/verifyJwtUsingJwk.js +6 -7
- package/features/security/utils/verifyJwtUsingJwk.js.map +1 -1
- package/features/serviceDiscovery/ServiceDiscovery.d.ts +17 -0
- package/features/serviceDiscovery/ServiceDiscovery.js +22 -0
- package/features/serviceDiscovery/ServiceDiscovery.js.map +1 -0
- package/features/serviceDiscovery/__tests__/ServiceDiscovery.test.d.ts +1 -0
- package/features/serviceDiscovery/__tests__/ServiceDiscovery.test.js +111 -0
- package/features/serviceDiscovery/__tests__/ServiceDiscovery.test.js.map +1 -0
- package/features/serviceDiscovery/index.d.ts +3 -0
- package/features/serviceDiscovery/index.js +1 -0
- package/features/slugify/DefaultSlugify.d.ts +8 -0
- package/features/slugify/DefaultSlugify.js +20 -0
- package/features/slugify/DefaultSlugify.js.map +1 -0
- package/features/slugify/abstractions.d.ts +12 -0
- package/features/slugify/abstractions.js +5 -0
- package/features/slugify/abstractions.js.map +1 -0
- package/features/slugify/feature.d.ts +4 -0
- package/features/slugify/feature.js +11 -0
- package/features/slugify/feature.js.map +1 -0
- package/features/slugify/index.d.ts +3 -0
- package/features/slugify/index.js +2 -0
- package/features/storageOperations/abstractions.d.ts +21 -0
- package/features/storageOperations/abstractions.js +10 -0
- package/features/storageOperations/abstractions.js.map +1 -0
- package/features/stringFormatter/DefaultStringFormatter.d.ts +17 -0
- package/features/stringFormatter/DefaultStringFormatter.js +19 -0
- package/features/stringFormatter/DefaultStringFormatter.js.map +1 -0
- package/features/stringFormatter/abstractions.d.ts +11 -0
- package/features/stringFormatter/abstractions.js +5 -0
- package/features/stringFormatter/abstractions.js.map +1 -0
- package/features/stringFormatter/feature.d.ts +4 -0
- package/features/stringFormatter/feature.js +13 -0
- package/features/stringFormatter/feature.js.map +1 -0
- package/features/stringFormatter/index.d.ts +3 -0
- package/features/stringFormatter/index.js +2 -0
- package/features/system/InstallSystem/InstallSystemUseCase.js +45 -44
- package/features/system/InstallSystem/InstallSystemUseCase.js.map +1 -1
- package/features/system/InstallSystem/abstractions.js +3 -17
- package/features/system/InstallSystem/abstractions.js.map +1 -1
- package/features/system/InstallSystem/errors.js +15 -16
- package/features/system/InstallSystem/errors.js.map +1 -1
- package/features/system/InstallSystem/events.js +8 -5
- package/features/system/InstallSystem/events.js.map +1 -1
- package/features/system/InstallSystem/feature.js +6 -7
- package/features/system/InstallSystem/feature.js.map +1 -1
- package/features/system/InstallSystem/index.js +2 -6
- package/features/system/SystemFeature.js +6 -5
- package/features/system/SystemFeature.js.map +1 -1
- package/features/task/TaskController/abstractions.js +2 -10
- package/features/task/TaskController/abstractions.js.map +1 -1
- package/features/task/TaskController/index.js +0 -2
- package/features/task/TaskDefinition/abstractions.d.ts +69 -4
- package/features/task/TaskDefinition/abstractions.js +9 -40
- package/features/task/TaskDefinition/abstractions.js.map +1 -1
- package/features/task/TaskDefinition/index.js +0 -2
- package/features/task/TaskService/abstractions.js +9 -13
- package/features/task/TaskService/abstractions.js.map +1 -1
- package/features/task/TaskService/index.js +0 -2
- package/features/tenancy/CreateTenant/CreateTenantGateway.js +14 -11
- package/features/tenancy/CreateTenant/CreateTenantGateway.js.map +1 -1
- package/features/tenancy/CreateTenant/CreateTenantRepository.js +18 -15
- package/features/tenancy/CreateTenant/CreateTenantRepository.js.map +1 -1
- package/features/tenancy/CreateTenant/CreateTenantUseCase.d.ts +1 -1
- package/features/tenancy/CreateTenant/CreateTenantUseCase.js +44 -41
- package/features/tenancy/CreateTenant/CreateTenantUseCase.js.map +1 -1
- package/features/tenancy/CreateTenant/abstractions.js +6 -29
- package/features/tenancy/CreateTenant/abstractions.js.map +1 -1
- package/features/tenancy/CreateTenant/decorators/CreateTenantWithWcpIncrement.js +16 -15
- package/features/tenancy/CreateTenant/decorators/CreateTenantWithWcpIncrement.js.map +1 -1
- package/features/tenancy/CreateTenant/errors.js +8 -8
- package/features/tenancy/CreateTenant/errors.js.map +1 -1
- package/features/tenancy/CreateTenant/events.js +16 -11
- package/features/tenancy/CreateTenant/events.js.map +1 -1
- package/features/tenancy/CreateTenant/feature.js +9 -8
- package/features/tenancy/CreateTenant/feature.js.map +1 -1
- package/features/tenancy/CreateTenant/index.js +2 -4
- package/features/tenancy/DeleteTenant/DeleteTenantGateway.js +15 -12
- package/features/tenancy/DeleteTenant/DeleteTenantGateway.js.map +1 -1
- package/features/tenancy/DeleteTenant/DeleteTenantRepository.js +22 -19
- package/features/tenancy/DeleteTenant/DeleteTenantRepository.js.map +1 -1
- package/features/tenancy/DeleteTenant/DeleteTenantUseCase.js +29 -27
- package/features/tenancy/DeleteTenant/DeleteTenantUseCase.js.map +1 -1
- package/features/tenancy/DeleteTenant/abstractions.js +6 -10
- package/features/tenancy/DeleteTenant/abstractions.js.map +1 -1
- package/features/tenancy/DeleteTenant/decorators/DeleteTenantWithWcpDecrement.js +16 -13
- package/features/tenancy/DeleteTenant/decorators/DeleteTenantWithWcpDecrement.js.map +1 -1
- package/features/tenancy/DeleteTenant/events.js +16 -11
- package/features/tenancy/DeleteTenant/events.js.map +1 -1
- package/features/tenancy/DeleteTenant/feature.js +9 -8
- package/features/tenancy/DeleteTenant/feature.js.map +1 -1
- package/features/tenancy/DeleteTenant/index.js +2 -4
- package/features/tenancy/GetRootTenant/GetRootTenantUseCase.js +15 -12
- package/features/tenancy/GetRootTenant/GetRootTenantUseCase.js.map +1 -1
- package/features/tenancy/GetRootTenant/abstractions.js +2 -4
- package/features/tenancy/GetRootTenant/abstractions.js.map +1 -1
- package/features/tenancy/GetRootTenant/feature.js +6 -5
- package/features/tenancy/GetRootTenant/feature.js.map +1 -1
- package/features/tenancy/GetRootTenant/index.js +0 -2
- package/features/tenancy/GetTenantById/GetTenantByIdGateway.js +17 -12
- package/features/tenancy/GetTenantById/GetTenantByIdGateway.js.map +1 -1
- package/features/tenancy/GetTenantById/GetTenantByIdRepository.js +18 -19
- package/features/tenancy/GetTenantById/GetTenantByIdRepository.js.map +1 -1
- package/features/tenancy/GetTenantById/GetTenantByIdUseCase.js +17 -17
- package/features/tenancy/GetTenantById/GetTenantByIdUseCase.js.map +1 -1
- package/features/tenancy/GetTenantById/abstractions.js +4 -6
- package/features/tenancy/GetTenantById/abstractions.js.map +1 -1
- package/features/tenancy/GetTenantById/feature.js +8 -12
- package/features/tenancy/GetTenantById/feature.js.map +1 -1
- package/features/tenancy/GetTenantById/index.js +1 -3
- package/features/tenancy/InstallTenant/DependencyResolver.js +53 -65
- package/features/tenancy/InstallTenant/DependencyResolver.js.map +1 -1
- package/features/tenancy/InstallTenant/InstallTenantUseCase.d.ts +1 -1
- package/features/tenancy/InstallTenant/InstallTenantUseCase.js +95 -113
- package/features/tenancy/InstallTenant/InstallTenantUseCase.js.map +1 -1
- package/features/tenancy/InstallTenant/abstractions.js +4 -15
- package/features/tenancy/InstallTenant/abstractions.js.map +1 -1
- package/features/tenancy/InstallTenant/errors.js +15 -16
- package/features/tenancy/InstallTenant/errors.js.map +1 -1
- package/features/tenancy/InstallTenant/events.js +8 -5
- package/features/tenancy/InstallTenant/events.js.map +1 -1
- package/features/tenancy/InstallTenant/feature.js +6 -5
- package/features/tenancy/InstallTenant/feature.js.map +1 -1
- package/features/tenancy/InstallTenant/index.js +1 -3
- package/features/tenancy/ListTenants/ListTenantsGateway.js +14 -11
- package/features/tenancy/ListTenants/ListTenantsGateway.js.map +1 -1
- package/features/tenancy/ListTenants/ListTenantsRepository.js +14 -12
- package/features/tenancy/ListTenants/ListTenantsRepository.js.map +1 -1
- package/features/tenancy/ListTenants/ListTenantsUseCase.js +16 -14
- package/features/tenancy/ListTenants/ListTenantsUseCase.js.map +1 -1
- package/features/tenancy/ListTenants/abstractions.js +4 -12
- package/features/tenancy/ListTenants/abstractions.js.map +1 -1
- package/features/tenancy/ListTenants/feature.js +8 -7
- package/features/tenancy/ListTenants/feature.js.map +1 -1
- package/features/tenancy/ListTenants/index.js +1 -3
- package/features/tenancy/TenancyFeature.js +20 -26
- package/features/tenancy/TenancyFeature.js.map +1 -1
- package/features/tenancy/TenantContext/TenantContext.js +49 -49
- package/features/tenancy/TenantContext/TenantContext.js.map +1 -1
- package/features/tenancy/TenantContext/abstractions.js +2 -2
- package/features/tenancy/TenantContext/abstractions.js.map +1 -1
- package/features/tenancy/TenantContext/errors.js +7 -7
- package/features/tenancy/TenantContext/errors.js.map +1 -1
- package/features/tenancy/TenantContext/feature.js +6 -5
- package/features/tenancy/TenantContext/feature.js.map +1 -1
- package/features/tenancy/TenantContext/index.js +0 -2
- package/features/tenancy/UpdateTenant/UpdateTenantGateway.js +14 -11
- package/features/tenancy/UpdateTenant/UpdateTenantGateway.js.map +1 -1
- package/features/tenancy/UpdateTenant/UpdateTenantRepository.js +19 -16
- package/features/tenancy/UpdateTenant/UpdateTenantRepository.js.map +1 -1
- package/features/tenancy/UpdateTenant/UpdateTenantUseCase.d.ts +2 -2
- package/features/tenancy/UpdateTenant/UpdateTenantUseCase.js +37 -36
- package/features/tenancy/UpdateTenant/UpdateTenantUseCase.js.map +1 -1
- package/features/tenancy/UpdateTenant/abstractions.js +6 -10
- package/features/tenancy/UpdateTenant/abstractions.js.map +1 -1
- package/features/tenancy/UpdateTenant/events.js +16 -11
- package/features/tenancy/UpdateTenant/events.js.map +1 -1
- package/features/tenancy/UpdateTenant/feature.js +8 -7
- package/features/tenancy/UpdateTenant/feature.js.map +1 -1
- package/features/tenancy/UpdateTenant/index.js +2 -4
- package/features/tenancy/shared/TenantCache.js +18 -17
- package/features/tenancy/shared/TenantCache.js.map +1 -1
- package/features/tenancy/shared/abstractions.js +2 -1
- package/features/tenancy/shared/abstractions.js.map +1 -1
- package/features/tenancy/shared/storageOperations.js +2 -5
- package/features/tenancy/shared/storageOperations.js.map +1 -1
- package/features/users/AdminUsersFeature.js +15 -19
- package/features/users/AdminUsersFeature.js.map +1 -1
- package/features/users/CreateUser/CreateUserUseCase.js +65 -100
- package/features/users/CreateUser/CreateUserUseCase.js.map +1 -1
- package/features/users/CreateUser/abstractions.js +2 -13
- package/features/users/CreateUser/abstractions.js.map +1 -1
- package/features/users/CreateUser/decorators/CreateUserWithWcpIncrement.d.ts +1 -1
- package/features/users/CreateUser/decorators/CreateUserWithWcpIncrement.js +16 -15
- package/features/users/CreateUser/decorators/CreateUserWithWcpIncrement.js.map +1 -1
- package/features/users/CreateUser/events.js +17 -18
- package/features/users/CreateUser/events.js.map +1 -1
- package/features/users/CreateUser/feature.js +7 -6
- package/features/users/CreateUser/feature.js.map +1 -1
- package/features/users/CreateUser/index.js +0 -2
- package/features/users/CreateUser/schema.js +14 -18
- package/features/users/CreateUser/schema.js.map +1 -1
- package/features/users/DeleteUser/DeleteUserUseCase.js +35 -50
- package/features/users/DeleteUser/DeleteUserUseCase.js.map +1 -1
- package/features/users/DeleteUser/abstractions.js +2 -13
- package/features/users/DeleteUser/abstractions.js.map +1 -1
- package/features/users/DeleteUser/decorators/DeleteUserWithWcpDecrement.js +15 -16
- package/features/users/DeleteUser/decorators/DeleteUserWithWcpDecrement.js.map +1 -1
- package/features/users/DeleteUser/errors.js +7 -7
- package/features/users/DeleteUser/errors.js.map +1 -1
- package/features/users/DeleteUser/events.js +17 -18
- package/features/users/DeleteUser/events.js.map +1 -1
- package/features/users/DeleteUser/feature.js +7 -6
- package/features/users/DeleteUser/feature.js.map +1 -1
- package/features/users/DeleteUser/index.js +0 -2
- package/features/users/ExternalIdpUserSync/ExternalIdpUserSyncHandler.js +60 -74
- package/features/users/ExternalIdpUserSync/ExternalIdpUserSyncHandler.js.map +1 -1
- package/features/users/ExternalIdpUserSync/feature.js +6 -5
- package/features/users/ExternalIdpUserSync/feature.js.map +1 -1
- package/features/users/ExternalIdpUserSync/index.js +0 -2
- package/features/users/GetIdentityProfile/GetIdentityProfileUseCase.js +29 -39
- package/features/users/GetIdentityProfile/GetIdentityProfileUseCase.js.map +1 -1
- package/features/users/GetIdentityProfile/abstractions.js +2 -11
- package/features/users/GetIdentityProfile/abstractions.js.map +1 -1
- package/features/users/GetIdentityProfile/feature.js +6 -5
- package/features/users/GetIdentityProfile/feature.js.map +1 -1
- package/features/users/GetIdentityProfile/index.js +0 -2
- package/features/users/GetIdentityProfile/types.js +0 -3
- package/features/users/GetUser/GetUserUseCase.js +19 -23
- package/features/users/GetUser/GetUserUseCase.js.map +1 -1
- package/features/users/GetUser/abstractions.js +2 -11
- package/features/users/GetUser/abstractions.js.map +1 -1
- package/features/users/GetUser/feature.js +6 -5
- package/features/users/GetUser/feature.js.map +1 -1
- package/features/users/GetUser/index.js +0 -2
- package/features/users/ListUserTeams/ListUserTeamsUseCase.js +33 -42
- package/features/users/ListUserTeams/ListUserTeamsUseCase.js.map +1 -1
- package/features/users/ListUserTeams/abstractions.js +2 -11
- package/features/users/ListUserTeams/abstractions.js.map +1 -1
- package/features/users/ListUserTeams/feature.js +6 -5
- package/features/users/ListUserTeams/feature.js.map +1 -1
- package/features/users/ListUserTeams/index.js +0 -2
- package/features/users/ListUsers/ListUsersUseCase.js +19 -23
- package/features/users/ListUsers/ListUsersUseCase.js.map +1 -1
- package/features/users/ListUsers/abstractions.js +2 -11
- package/features/users/ListUsers/abstractions.js.map +1 -1
- package/features/users/ListUsers/feature.js +6 -5
- package/features/users/ListUsers/feature.js.map +1 -1
- package/features/users/ListUsers/index.js +0 -2
- package/features/users/UpdateUser/UpdateUserUseCase.js +52 -74
- package/features/users/UpdateUser/UpdateUserUseCase.js.map +1 -1
- package/features/users/UpdateUser/abstractions.js +2 -13
- package/features/users/UpdateUser/abstractions.js.map +1 -1
- package/features/users/UpdateUser/events.js +17 -18
- package/features/users/UpdateUser/events.js.map +1 -1
- package/features/users/UpdateUser/feature.js +6 -5
- package/features/users/UpdateUser/feature.js.map +1 -1
- package/features/users/UpdateUser/index.js +0 -2
- package/features/users/UpdateUser/schema.js +11 -10
- package/features/users/UpdateUser/schema.js.map +1 -1
- package/features/users/shared/AdminUsersRepository.js +104 -112
- package/features/users/shared/AdminUsersRepository.js.map +1 -1
- package/features/users/shared/abstractions.js +2 -9
- package/features/users/shared/abstractions.js.map +1 -1
- package/features/users/shared/errors.js +40 -46
- package/features/users/shared/errors.js.map +1 -1
- package/features/users/shared/loaders.js +52 -66
- package/features/users/shared/loaders.js.map +1 -1
- package/features/users/shared/storageAbstractions.js +2 -2
- package/features/users/shared/storageAbstractions.js.map +1 -1
- package/features/users/shared/types.js +0 -3
- package/features/wcp/WcpContext/WcpContext.d.ts +15 -5
- package/features/wcp/WcpContext/WcpContext.js +174 -142
- package/features/wcp/WcpContext/WcpContext.js.map +1 -1
- package/features/wcp/WcpContext/abstractions.js +2 -6
- package/features/wcp/WcpContext/abstractions.js.map +1 -1
- package/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.d.ts +14 -60
- package/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.js +188 -134
- package/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.js.map +1 -1
- package/features/wcp/WcpContext/feature.d.ts +1 -2
- package/features/wcp/WcpContext/feature.js +6 -5
- package/features/wcp/WcpContext/feature.js.map +1 -1
- package/features/wcp/WcpContext/index.d.ts +0 -1
- package/features/wcp/WcpContext/index.js +0 -2
- package/features/wcp/WcpContext/types.d.ts +0 -4
- package/features/wcp/WcpContext/types.js +0 -3
- package/features/wcp/WcpContext/utils.js +35 -53
- package/features/wcp/WcpContext/utils.js.map +1 -1
- package/features/wcp/WcpFeature.d.ts +1 -1
- package/features/wcp/WcpFeature.js +12 -6
- package/features/wcp/WcpFeature.js.map +1 -1
- package/features/wcp/WcpLicenseLoader.d.ts +25 -0
- package/features/wcp/WcpLicenseLoader.js +58 -0
- package/features/wcp/WcpLicenseLoader.js.map +1 -0
- package/features/wcp/WcpLicenseProvider.d.ts +21 -0
- package/features/wcp/WcpLicenseProvider.js +14 -0
- package/features/wcp/WcpLicenseProvider.js.map +1 -0
- package/features/wcp/resolveWcpProjectEnvironment.d.ts +9 -0
- package/features/wcp/resolveWcpProjectEnvironment.js +23 -0
- package/features/wcp/resolveWcpProjectEnvironment.js.map +1 -0
- package/features/webhooks/Webhook/WebhookProvider.d.ts +12 -0
- package/features/webhooks/Webhook/WebhookProvider.js +28 -0
- package/features/webhooks/Webhook/WebhookProvider.js.map +1 -0
- package/features/webhooks/Webhook/abstractions/WebhookFactory.d.ts +16 -0
- package/features/webhooks/Webhook/abstractions/WebhookFactory.js +5 -0
- package/features/webhooks/Webhook/abstractions/WebhookFactory.js.map +1 -0
- package/features/webhooks/Webhook/abstractions/WebhookProvider.d.ts +9 -0
- package/features/webhooks/Webhook/abstractions/WebhookProvider.js +5 -0
- package/features/webhooks/Webhook/abstractions/WebhookProvider.js.map +1 -0
- package/features/webhooks/Webhook/feature.d.ts +4 -0
- package/features/webhooks/Webhook/feature.js +11 -0
- package/features/webhooks/Webhook/feature.js.map +1 -0
- package/features/webhooks/Webhook/index.d.ts +2 -0
- package/features/webhooks/Webhook/index.js +2 -0
- package/features/webhooks/WebhookDispatcher/NullWebhookDispatcher.d.ts +8 -0
- package/features/webhooks/WebhookDispatcher/NullWebhookDispatcher.js +11 -0
- package/features/webhooks/WebhookDispatcher/NullWebhookDispatcher.js.map +1 -0
- package/features/webhooks/WebhookDispatcher/abstractions.d.ts +12 -0
- package/features/webhooks/WebhookDispatcher/abstractions.js +5 -0
- package/features/webhooks/WebhookDispatcher/abstractions.js.map +1 -0
- package/features/webhooks/WebhookSignPayload/abstractions.d.ts +14 -0
- package/features/webhooks/WebhookSignPayload/abstractions.js +5 -0
- package/features/webhooks/WebhookSignPayload/abstractions.js.map +1 -0
- package/features/webhooks/WebhookVerifyPayload/abstractions.d.ts +11 -0
- package/features/webhooks/WebhookVerifyPayload/abstractions.js +5 -0
- package/features/webhooks/WebhookVerifyPayload/abstractions.js.map +1 -0
- package/features/webhooks/index.d.ts +5 -0
- package/features/webhooks/index.js +5 -0
- package/graphql/ApiCoreSchemaFactory.d.ts +16 -0
- package/graphql/ApiCoreSchemaFactory.js +58 -0
- package/graphql/ApiCoreSchemaFactory.js.map +1 -0
- package/graphql/featureFlags/FeatureFlagsSchemaFactory.d.ts +10 -0
- package/graphql/featureFlags/FeatureFlagsSchemaFactory.js +53 -0
- package/graphql/featureFlags/FeatureFlagsSchemaFactory.js.map +1 -0
- package/graphql/security/NotAuthorizedResponse.d.ts +1 -1
- package/graphql/security/NotAuthorizedResponse.js +12 -15
- package/graphql/security/NotAuthorizedResponse.js.map +1 -1
- package/graphql/security/ProfileMapper.js +12 -11
- package/graphql/security/ProfileMapper.js.map +1 -1
- package/graphql/security/SecuritySchemaFactory.d.ts +15 -0
- package/graphql/security/SecuritySchemaFactory.js +27 -0
- package/graphql/security/SecuritySchemaFactory.js.map +1 -0
- package/graphql/security/addApiKeySchema.d.ts +2 -0
- package/graphql/security/addApiKeySchema.js +108 -0
- package/graphql/security/addApiKeySchema.js.map +1 -0
- package/graphql/security/addIdentitySchema.d.ts +2 -0
- package/graphql/security/addIdentitySchema.js +170 -0
- package/graphql/security/addIdentitySchema.js.map +1 -0
- package/graphql/security/addRoleSchema.d.ts +2 -0
- package/graphql/security/addRoleSchema.js +137 -0
- package/graphql/security/addRoleSchema.js.map +1 -0
- package/graphql/security/addSecurityBaseSchema.d.ts +2 -0
- package/graphql/security/{base.gql.js → addSecurityBaseSchema.js} +14 -15
- package/graphql/security/addSecurityBaseSchema.js.map +1 -0
- package/graphql/security/addTeamSchema.d.ts +2 -0
- package/graphql/security/addTeamSchema.js +157 -0
- package/graphql/security/addTeamSchema.js.map +1 -0
- package/graphql/system/SystemSchemaFactory.d.ts +10 -0
- package/graphql/system/SystemSchemaFactory.js +70 -0
- package/graphql/system/SystemSchemaFactory.js.map +1 -0
- package/graphql/users/UsersSchemaFactory.d.ts +10 -0
- package/graphql/users/UsersSchemaFactory.js +195 -0
- package/graphql/users/UsersSchemaFactory.js.map +1 -0
- package/graphql/wcp/WcpSchemaFactory.d.ts +10 -0
- package/graphql/wcp/WcpSchemaFactory.js +100 -0
- package/graphql/wcp/WcpSchemaFactory.js.map +1 -0
- package/idp/JwksCache.d.ts +14 -3
- package/idp/JwksCache.js +100 -26
- package/idp/JwksCache.js.map +1 -1
- package/idp/JwksStoreFeature.d.ts +8 -0
- package/idp/JwksStoreFeature.js +11 -0
- package/idp/JwksStoreFeature.js.map +1 -0
- package/idp/JwtAuthenticator.js +34 -46
- package/idp/JwtAuthenticator.js.map +1 -1
- package/idp/MemoryJwksStore.d.ts +14 -0
- package/idp/MemoryJwksStore.js +21 -0
- package/idp/MemoryJwksStore.js.map +1 -0
- package/idp/OidcJwtIdentityProvider.js +55 -78
- package/idp/OidcJwtIdentityProvider.js.map +1 -1
- package/idp/abstractions.d.ts +24 -0
- package/idp/abstractions.js +6 -14
- package/idp/abstractions.js.map +1 -1
- package/idp/feature.js +8 -8
- package/idp/feature.js.map +1 -1
- package/idp/index.d.ts +1 -0
- package/idp/index.js +2 -3
- package/idp/types.js +0 -3
- package/index.d.ts +3 -1
- package/index.js +3 -3
- package/models/base/BaseModel.js +51 -56
- package/models/base/BaseModel.js.map +1 -1
- package/models/base/ModelBuilder.js +65 -78
- package/models/base/ModelBuilder.js.map +1 -1
- package/models/base/ModelFactory.js +0 -3
- package/models/base/__tests__/ModelBuilder.test.js +437 -454
- package/models/base/__tests__/ModelBuilder.test.js.map +1 -1
- package/models/base/abstractions.js +0 -3
- package/models/cms/FieldBuilder.js +112 -121
- package/models/cms/FieldBuilder.js.map +1 -1
- package/models/cms/FieldBuilderRegistry.js +13 -12
- package/models/cms/FieldBuilderRegistry.js.map +1 -1
- package/models/cms/FieldDefinitionsBuilder.js +37 -54
- package/models/cms/FieldDefinitionsBuilder.js.map +1 -1
- package/models/cms/PrivateCmsModelBuilder.js +84 -89
- package/models/cms/PrivateCmsModelBuilder.js.map +1 -1
- package/models/cms/PrivatePage/Page.fields.js +7 -6
- package/models/cms/PrivatePage/Page.fields.js.map +1 -1
- package/models/cms/PrivatePage/PageModelBuilder.js +18 -15
- package/models/cms/PrivatePage/PageModelBuilder.js.map +1 -1
- package/models/cms/PrivatePage/PageModelFactory.js +20 -25
- package/models/cms/PrivatePage/PageModelFactory.js.map +1 -1
- package/models/cms/PrivatePage/__tests__/PageModelFactory.test.js +218 -234
- package/models/cms/PrivatePage/__tests__/PageModelFactory.test.js.map +1 -1
- package/models/cms/PrivatePage/__tests__/PagePublishingDecorator.js +33 -36
- package/models/cms/PrivatePage/__tests__/PagePublishingDecorator.js.map +1 -1
- package/models/cms/PrivatePage/__tests__/PageSeoDecorator.js +25 -26
- package/models/cms/PrivatePage/__tests__/PageSeoDecorator.js.map +1 -1
- package/models/cms/PrivatePage/abstractions.js +3 -9
- package/models/cms/PrivatePage/abstractions.js.map +1 -1
- package/models/cms/__tests__/PrivateCmsModelBuilder.test.js +173 -185
- package/models/cms/__tests__/PrivateCmsModelBuilder.test.js.map +1 -1
- package/models/cms/abstractions.js +3 -20
- package/models/cms/abstractions.js.map +1 -1
- package/models/cms/types.js +0 -3
- package/models/simple/Page/PageModelBuilder.js +15 -14
- package/models/simple/Page/PageModelBuilder.js.map +1 -1
- package/models/simple/Page/PageModelFactory.js +16 -15
- package/models/simple/Page/PageModelFactory.js.map +1 -1
- package/models/simple/Page/__tests__/PageModelBuilderDecorator.js +21 -20
- package/models/simple/Page/__tests__/PageModelBuilderDecorator.js.map +1 -1
- package/models/simple/Page/__tests__/PageModelBuilderDecorator2.js +17 -16
- package/models/simple/Page/__tests__/PageModelBuilderDecorator2.js.map +1 -1
- package/models/simple/Page/__tests__/PageModelFactory.test.js +28 -28
- package/models/simple/Page/__tests__/PageModelFactory.test.js.map +1 -1
- package/models/simple/Page/abstractions.js +9 -8
- package/models/simple/Page/abstractions.js.map +1 -1
- package/package.json +26 -27
- package/testing/environment.d.ts +14 -0
- package/testing/environment.js +18 -0
- package/testing/environment.js.map +1 -0
- package/types/core.d.ts +17 -5
- package/types/core.js +0 -3
- package/types/security.d.ts +1 -7
- package/types/security.js +0 -3
- package/types/tenancy.d.ts +0 -17
- package/types/tenancy.js +0 -3
- package/types/users.d.ts +0 -13
- package/types/users.js +0 -3
- package/createApiCore.d.ts +0 -7
- package/createApiCore.js +0 -16
- package/createApiCore.js.map +0 -1
- package/domain/tenancy/errors.js.map +0 -1
- package/exports/api/build-params.js.map +0 -1
- package/exports/api/event-publisher.js.map +0 -1
- package/exports/api/graphql.js.map +0 -1
- package/exports/api/key-value-store.js.map +0 -1
- package/exports/api/logger.js.map +0 -1
- package/exports/api/security/api-key.js.map +0 -1
- package/exports/api/security/authentication.js.map +0 -1
- package/exports/api/security/role.js.map +0 -1
- package/exports/api/security/user.js.map +0 -1
- package/exports/api/security.js.map +0 -1
- package/exports/api/system.js.map +0 -1
- package/exports/api/tasks.js.map +0 -1
- package/exports/api/tenancy.js.map +0 -1
- package/exports/api.js.map +0 -1
- package/features/ai/index.js.map +0 -1
- package/features/buildParams/index.js.map +0 -1
- package/features/encryption/index.js.map +0 -1
- package/features/eventPublisher/index.js.map +0 -1
- package/features/keyValueStore/index.js.map +0 -1
- package/features/logger/index.js.map +0 -1
- package/features/masker/index.js.map +0 -1
- package/features/security/IdentityContext/index.js.map +0 -1
- package/features/security/apiKeys/CreateApiKey/index.js.map +0 -1
- package/features/security/apiKeys/DeleteApiKey/index.js.map +0 -1
- package/features/security/apiKeys/GetApiKey/index.js.map +0 -1
- package/features/security/apiKeys/GetApiKeyBySlug/index.js.map +0 -1
- package/features/security/apiKeys/GetApiKeyByToken/index.js.map +0 -1
- package/features/security/apiKeys/ListApiKeys/index.js.map +0 -1
- package/features/security/apiKeys/UpdateApiKey/index.js.map +0 -1
- package/features/security/apiKeys/shared/types.js.map +0 -1
- package/features/security/authentication/AuthenticationContext/index.js.map +0 -1
- package/features/security/authentication/Authenticator/index.js.map +0 -1
- package/features/security/authorization/AuthorizationContext/index.js.map +0 -1
- package/features/security/authorization/Authorizer/index.js.map +0 -1
- package/features/security/login/index.js.map +0 -1
- package/features/security/permissions/index.js.map +0 -1
- package/features/security/permissions/types.js.map +0 -1
- package/features/security/roles/CreateRole/index.js.map +0 -1
- package/features/security/roles/DeleteRole/index.js.map +0 -1
- package/features/security/roles/GetRole/index.js.map +0 -1
- package/features/security/roles/ListRoles/index.js.map +0 -1
- package/features/security/roles/UpdateRole/index.js.map +0 -1
- package/features/security/roles/shared/types.js.map +0 -1
- package/features/security/shared/index.js.map +0 -1
- package/features/security/teams/CreateTeam/index.js.map +0 -1
- package/features/security/teams/DeleteTeam/index.js.map +0 -1
- package/features/security/teams/GetTeam/index.js.map +0 -1
- package/features/security/teams/ListTeams/index.js.map +0 -1
- package/features/security/teams/UpdateTeam/index.js.map +0 -1
- package/features/security/teams/shared/types.js.map +0 -1
- package/features/system/InstallSystem/index.js.map +0 -1
- package/features/task/TaskController/index.js.map +0 -1
- package/features/task/TaskDefinition/index.js.map +0 -1
- package/features/task/TaskService/index.js.map +0 -1
- package/features/tenancy/CreateTenant/index.js.map +0 -1
- package/features/tenancy/DeleteTenant/index.js.map +0 -1
- package/features/tenancy/GetRootTenant/index.js.map +0 -1
- package/features/tenancy/GetTenantById/index.js.map +0 -1
- package/features/tenancy/InstallTenant/index.js.map +0 -1
- package/features/tenancy/ListTenants/index.js.map +0 -1
- package/features/tenancy/TenantContext/index.js.map +0 -1
- package/features/tenancy/UpdateTenant/index.js.map +0 -1
- package/features/users/CreateUser/index.js.map +0 -1
- package/features/users/DeleteUser/index.js.map +0 -1
- package/features/users/ExternalIdpUserSync/index.js.map +0 -1
- package/features/users/GetIdentityProfile/index.js.map +0 -1
- package/features/users/GetIdentityProfile/types.js.map +0 -1
- package/features/users/GetUser/index.js.map +0 -1
- package/features/users/ListUserTeams/index.js.map +0 -1
- package/features/users/ListUsers/index.js.map +0 -1
- package/features/users/UpdateUser/index.js.map +0 -1
- package/features/users/shared/types.js.map +0 -1
- package/features/wcp/WcpContext/index.js.map +0 -1
- package/features/wcp/WcpContext/types.js.map +0 -1
- package/graphql/security/apiKey.gql.d.ts +0 -4
- package/graphql/security/apiKey.gql.js +0 -99
- package/graphql/security/apiKey.gql.js.map +0 -1
- package/graphql/security/base.gql.d.ts +0 -4
- package/graphql/security/base.gql.js.map +0 -1
- package/graphql/security/identity.gql.d.ts +0 -4
- package/graphql/security/identity.gql.js +0 -163
- package/graphql/security/identity.gql.js.map +0 -1
- package/graphql/security/index.d.ts +0 -1
- package/graphql/security/index.js +0 -10
- package/graphql/security/index.js.map +0 -1
- package/graphql/security/role.gql.d.ts +0 -4
- package/graphql/security/role.gql.js +0 -114
- package/graphql/security/role.gql.js.map +0 -1
- package/graphql/security/team.gql.d.ts +0 -4
- package/graphql/security/team.gql.js +0 -127
- package/graphql/security/team.gql.js.map +0 -1
- package/graphql/system/createSystemGraphQL.d.ts +0 -2
- package/graphql/system/createSystemGraphQL.js +0 -57
- package/graphql/system/createSystemGraphQL.js.map +0 -1
- package/graphql/users/user.gql.d.ts +0 -3
- package/graphql/users/user.gql.js +0 -185
- package/graphql/users/user.gql.js.map +0 -1
- package/graphql/wcp/graphql.d.ts +0 -2
- package/graphql/wcp/graphql.js +0 -89
- package/graphql/wcp/graphql.js.map +0 -1
- package/idp/index.js.map +0 -1
- package/idp/types.js.map +0 -1
- package/index.js.map +0 -1
- package/legacy/security/LegacyContext.d.ts +0 -36
- package/legacy/security/LegacyContext.js +0 -205
- package/legacy/security/LegacyContext.js.map +0 -1
- package/legacy/security/createSecurityContext.d.ts +0 -3
- package/legacy/security/createSecurityContext.js +0 -14
- package/legacy/security/createSecurityContext.js.map +0 -1
- package/legacy/security/plugins/apiKeyAuthentication.d.ts +0 -7
- package/legacy/security/plugins/apiKeyAuthentication.js +0 -29
- package/legacy/security/plugins/apiKeyAuthentication.js.map +0 -1
- package/legacy/security/plugins/apiKeyAuthorization.d.ts +0 -6
- package/legacy/security/plugins/apiKeyAuthorization.js +0 -22
- package/legacy/security/plugins/apiKeyAuthorization.js.map +0 -1
- package/legacy/security/plugins/authenticateUsingCookie.d.ts +0 -5
- package/legacy/security/plugins/authenticateUsingCookie.js +0 -27
- package/legacy/security/plugins/authenticateUsingCookie.js.map +0 -1
- package/legacy/security/plugins/authenticateUsingHttpHeader.d.ts +0 -5
- package/legacy/security/plugins/authenticateUsingHttpHeader.js +0 -23
- package/legacy/security/plugins/authenticateUsingHttpHeader.js.map +0 -1
- package/legacy/security/plugins/secureHeaders.d.ts +0 -1
- package/legacy/security/plugins/secureHeaders.js +0 -23
- package/legacy/security/plugins/secureHeaders.js.map +0 -1
- package/legacy/tenancy/LegacyContext.d.ts +0 -15
- package/legacy/tenancy/LegacyContext.js +0 -64
- package/legacy/tenancy/LegacyContext.js.map +0 -1
- package/legacy/tenancy/createTenancyContext.d.ts +0 -3
- package/legacy/tenancy/createTenancyContext.js +0 -51
- package/legacy/tenancy/createTenancyContext.js.map +0 -1
- package/legacy/users/LegacyContext.d.ts +0 -13
- package/legacy/users/LegacyContext.js +0 -70
- package/legacy/users/LegacyContext.js.map +0 -1
- package/legacy/users/createAdminUsersContext.d.ts +0 -3
- package/legacy/users/createAdminUsersContext.js +0 -12
- package/legacy/users/createAdminUsersContext.js.map +0 -1
- package/legacy/wcp/LegacyWcpContext.d.ts +0 -33
- package/legacy/wcp/LegacyWcpContext.js +0 -83
- package/legacy/wcp/LegacyWcpContext.js.map +0 -1
- package/legacy/wcp/context.d.ts +0 -5
- package/legacy/wcp/context.js +0 -52
- package/legacy/wcp/context.js.map +0 -1
- package/models/base/ModelFactory.js.map +0 -1
- package/models/base/abstractions.js.map +0 -1
- package/models/cms/types.js.map +0 -1
- package/types/core.js.map +0 -1
- package/types/security.js.map +0 -1
- package/types/tenancy.js.map +0 -1
- package/types/users.js.map +0 -1
|
@@ -0,0 +1,111 @@
|
|
|
1
|
+
import { inflateRawSync } from "node:zlib";
|
|
2
|
+
async function extractDocxText(buffer) {
|
|
3
|
+
const xml = extractFileFromZip(buffer, "word/document.xml");
|
|
4
|
+
if (!xml) throw new Error("Invalid DOCX: word/document.xml not found.");
|
|
5
|
+
const stylesXml = extractFileFromZip(buffer, "word/styles.xml");
|
|
6
|
+
const styleMap = stylesXml ? buildStyleMap(stylesXml) : new Map();
|
|
7
|
+
return convertToMarkdown(xml, styleMap);
|
|
8
|
+
}
|
|
9
|
+
function buildStyleMap(stylesXml) {
|
|
10
|
+
const map = new Map();
|
|
11
|
+
const styleRegex = /<w:style\s[^>]*w:styleId="([^"]*)"[^>]*>[\s\S]*?<\/w:style>/g;
|
|
12
|
+
let match;
|
|
13
|
+
while(null !== (match = styleRegex.exec(stylesXml))){
|
|
14
|
+
const styleId = match[1];
|
|
15
|
+
const block = match[0];
|
|
16
|
+
const nameMatch = block.match(/<w:name\s+w:val="([^"]*)"/);
|
|
17
|
+
if (nameMatch) map.set(styleId, nameMatch[1]);
|
|
18
|
+
}
|
|
19
|
+
return map;
|
|
20
|
+
}
|
|
21
|
+
function getHeadingLevel(paragraphXml, styleMap) {
|
|
22
|
+
const styleMatch = paragraphXml.match(/<w:pStyle\s+w:val="([^"]*)"/);
|
|
23
|
+
if (!styleMatch) return 0;
|
|
24
|
+
const styleId = styleMatch[1];
|
|
25
|
+
const directMatch = styleId.match(/^[Hh]eading(\d)$/);
|
|
26
|
+
if (directMatch) return parseInt(directMatch[1], 10);
|
|
27
|
+
const styleName = styleMap.get(styleId) ?? "";
|
|
28
|
+
const nameMatch = styleName.match(/^[Hh]eading\s*(\d)$/);
|
|
29
|
+
if (nameMatch) return parseInt(nameMatch[1], 10);
|
|
30
|
+
if (/title/i.test(styleName) || /title/i.test(styleId)) return 1;
|
|
31
|
+
return 0;
|
|
32
|
+
}
|
|
33
|
+
function isListItem(paragraphXml) {
|
|
34
|
+
return /<w:numId\s/.test(paragraphXml);
|
|
35
|
+
}
|
|
36
|
+
function extractRunMarkdown(runXml) {
|
|
37
|
+
const textRegex = /<w:t(?:\s[^>]*)?>([^<]*)<\/w:t>/g;
|
|
38
|
+
const texts = [];
|
|
39
|
+
let match;
|
|
40
|
+
while(null !== (match = textRegex.exec(runXml)))texts.push(match[1]);
|
|
41
|
+
if (0 === texts.length) return "";
|
|
42
|
+
const text = texts.join("");
|
|
43
|
+
const isBold = /<w:b[\s/>]/.test(runXml) && !/<w:b\s+w:val="(false|0)"/.test(runXml);
|
|
44
|
+
const isItalic = /<w:i[\s/>]/.test(runXml) && !/<w:i\s+w:val="(false|0)"/.test(runXml);
|
|
45
|
+
if (isBold && isItalic) return `***${text}***`;
|
|
46
|
+
if (isBold) return `**${text}**`;
|
|
47
|
+
if (isItalic) return `*${text}*`;
|
|
48
|
+
return text;
|
|
49
|
+
}
|
|
50
|
+
function convertToMarkdown(xml, styleMap) {
|
|
51
|
+
const paragraphs = [];
|
|
52
|
+
const paragraphRegex = /<w:p[\s>][\s\S]*?<\/w:p>/g;
|
|
53
|
+
let paragraphMatch;
|
|
54
|
+
while(null !== (paragraphMatch = paragraphRegex.exec(xml))){
|
|
55
|
+
const paragraphXml = paragraphMatch[0];
|
|
56
|
+
const runRegex = /<w:r[\s>][\s\S]*?<\/w:r>/g;
|
|
57
|
+
const runs = [];
|
|
58
|
+
let runMatch;
|
|
59
|
+
while(null !== (runMatch = runRegex.exec(paragraphXml))){
|
|
60
|
+
const md = extractRunMarkdown(runMatch[0]);
|
|
61
|
+
if (md) runs.push(md);
|
|
62
|
+
}
|
|
63
|
+
if (0 === runs.length) continue;
|
|
64
|
+
let line = runs.join("");
|
|
65
|
+
const headingLevel = getHeadingLevel(paragraphXml, styleMap);
|
|
66
|
+
if (headingLevel > 0 && headingLevel <= 6) line = `${"#".repeat(headingLevel)} ${line}`;
|
|
67
|
+
else if (isListItem(paragraphXml)) line = `- ${line}`;
|
|
68
|
+
paragraphs.push(line);
|
|
69
|
+
}
|
|
70
|
+
return paragraphs.join("\n\n");
|
|
71
|
+
}
|
|
72
|
+
function extractFileFromZip(buffer, targetPath) {
|
|
73
|
+
const eocdOffset = findEocd(buffer);
|
|
74
|
+
if (-1 === eocdOffset) throw new Error("Invalid ZIP: End of Central Directory not found.");
|
|
75
|
+
const cdOffset = buffer.readUInt32LE(eocdOffset + 16);
|
|
76
|
+
const cdSize = buffer.readUInt32LE(eocdOffset + 12);
|
|
77
|
+
const cdEnd = cdOffset + cdSize;
|
|
78
|
+
let offset = cdOffset;
|
|
79
|
+
while(offset < cdEnd){
|
|
80
|
+
const sig = buffer.readUInt32LE(offset);
|
|
81
|
+
if (0x02014b50 !== sig) break;
|
|
82
|
+
const compressionMethod = buffer.readUInt16LE(offset + 10);
|
|
83
|
+
const compressedSize = buffer.readUInt32LE(offset + 20);
|
|
84
|
+
const fileNameLen = buffer.readUInt16LE(offset + 28);
|
|
85
|
+
const extraLen = buffer.readUInt16LE(offset + 30);
|
|
86
|
+
const commentLen = buffer.readUInt16LE(offset + 32);
|
|
87
|
+
const localHeaderOffset = buffer.readUInt32LE(offset + 42);
|
|
88
|
+
const fileName = buffer.toString("utf-8", offset + 46, offset + 46 + fileNameLen);
|
|
89
|
+
if (fileName === targetPath) return readLocalFile(buffer, localHeaderOffset, compressionMethod, compressedSize);
|
|
90
|
+
offset += 46 + fileNameLen + extraLen + commentLen;
|
|
91
|
+
}
|
|
92
|
+
return null;
|
|
93
|
+
}
|
|
94
|
+
function readLocalFile(buffer, offset, compressionMethod, compressedSize) {
|
|
95
|
+
const sig = buffer.readUInt32LE(offset);
|
|
96
|
+
if (0x04034b50 !== sig) throw new Error("Invalid ZIP: bad local file header.");
|
|
97
|
+
const localFileNameLen = buffer.readUInt16LE(offset + 26);
|
|
98
|
+
const localExtraLen = buffer.readUInt16LE(offset + 28);
|
|
99
|
+
const dataOffset = offset + 30 + localFileNameLen + localExtraLen;
|
|
100
|
+
const raw = buffer.subarray(dataOffset, dataOffset + compressedSize);
|
|
101
|
+
if (0 === compressionMethod) return raw.toString("utf-8");
|
|
102
|
+
if (8 === compressionMethod) return inflateRawSync(raw).toString("utf-8");
|
|
103
|
+
throw new Error(`Unsupported ZIP compression method: ${compressionMethod}`);
|
|
104
|
+
}
|
|
105
|
+
function findEocd(buffer) {
|
|
106
|
+
for(let i = buffer.length - 22; i >= Math.max(0, buffer.length - 65557); i--)if (0x06054b50 === buffer.readUInt32LE(i)) return i;
|
|
107
|
+
return -1;
|
|
108
|
+
}
|
|
109
|
+
export { extractDocxText };
|
|
110
|
+
|
|
111
|
+
//# sourceMappingURL=docxParser.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/ai/TextExtractor/parsers/docxParser.js","sources":["../../../../../src/features/ai/TextExtractor/parsers/docxParser.ts"],"sourcesContent":["import { inflateRawSync } from \"node:zlib\";\n\nexport async function extractDocxText(buffer: Buffer): Promise<string> {\n const xml = extractFileFromZip(buffer, \"word/document.xml\");\n if (!xml) {\n throw new Error(\"Invalid DOCX: word/document.xml not found.\");\n }\n\n const stylesXml = extractFileFromZip(buffer, \"word/styles.xml\");\n const styleMap = stylesXml ? buildStyleMap(stylesXml) : new Map<string, string>();\n\n return convertToMarkdown(xml, styleMap);\n}\n\nfunction buildStyleMap(stylesXml: string): Map<string, string> {\n const map = new Map<string, string>();\n const styleRegex = /<w:style\\s[^>]*w:styleId=\"([^\"]*)\"[^>]*>[\\s\\S]*?<\\/w:style>/g;\n let match: RegExpExecArray | null;\n\n while ((match = styleRegex.exec(stylesXml)) !== null) {\n const styleId = match[1];\n const block = match[0];\n const nameMatch = block.match(/<w:name\\s+w:val=\"([^\"]*)\"/);\n if (nameMatch) {\n map.set(styleId, nameMatch[1]);\n }\n }\n\n return map;\n}\n\nfunction getHeadingLevel(paragraphXml: string, styleMap: Map<string, string>): number {\n const styleMatch = paragraphXml.match(/<w:pStyle\\s+w:val=\"([^\"]*)\"/);\n if (!styleMatch) {\n return 0;\n }\n\n const styleId = styleMatch[1];\n\n const directMatch = styleId.match(/^[Hh]eading(\\d)$/);\n if (directMatch) {\n return parseInt(directMatch[1], 10);\n }\n\n const styleName = styleMap.get(styleId) ?? \"\";\n const nameMatch = styleName.match(/^[Hh]eading\\s*(\\d)$/);\n if (nameMatch) {\n return parseInt(nameMatch[1], 10);\n }\n\n if (/title/i.test(styleName) || /title/i.test(styleId)) {\n return 1;\n }\n\n return 0;\n}\n\nfunction isListItem(paragraphXml: string): boolean {\n return /<w:numId\\s/.test(paragraphXml);\n}\n\nfunction extractRunMarkdown(runXml: string): string {\n const textRegex = /<w:t(?:\\s[^>]*)?>([^<]*)<\\/w:t>/g;\n const texts: string[] = [];\n let match: RegExpExecArray | null;\n while ((match = textRegex.exec(runXml)) !== null) {\n texts.push(match[1]);\n }\n if (texts.length === 0) {\n return \"\";\n }\n\n const text = texts.join(\"\");\n const isBold = /<w:b[\\s/>]/.test(runXml) && !/<w:b\\s+w:val=\"(false|0)\"/.test(runXml);\n const isItalic = /<w:i[\\s/>]/.test(runXml) && !/<w:i\\s+w:val=\"(false|0)\"/.test(runXml);\n\n if (isBold && isItalic) {\n return `***${text}***`;\n }\n if (isBold) {\n return `**${text}**`;\n }\n if (isItalic) {\n return `*${text}*`;\n }\n return text;\n}\n\nfunction convertToMarkdown(xml: string, styleMap: Map<string, string>): string {\n const paragraphs: string[] = [];\n const paragraphRegex = /<w:p[\\s>][\\s\\S]*?<\\/w:p>/g;\n let paragraphMatch: RegExpExecArray | null;\n\n while ((paragraphMatch = paragraphRegex.exec(xml)) !== null) {\n const paragraphXml = paragraphMatch[0];\n\n const runRegex = /<w:r[\\s>][\\s\\S]*?<\\/w:r>/g;\n const runs: string[] = [];\n let runMatch: RegExpExecArray | null;\n while ((runMatch = runRegex.exec(paragraphXml)) !== null) {\n const md = extractRunMarkdown(runMatch[0]);\n if (md) {\n runs.push(md);\n }\n }\n\n if (runs.length === 0) {\n continue;\n }\n\n let line = runs.join(\"\");\n const headingLevel = getHeadingLevel(paragraphXml, styleMap);\n\n if (headingLevel > 0 && headingLevel <= 6) {\n line = `${\"#\".repeat(headingLevel)} ${line}`;\n } else if (isListItem(paragraphXml)) {\n line = `- ${line}`;\n }\n\n paragraphs.push(line);\n }\n\n return paragraphs.join(\"\\n\\n\");\n}\n\n// --- ZIP utilities (unchanged) ---\n\nfunction extractFileFromZip(buffer: Buffer, targetPath: string): string | null {\n const eocdOffset = findEocd(buffer);\n if (eocdOffset === -1) {\n throw new Error(\"Invalid ZIP: End of Central Directory not found.\");\n }\n\n const cdOffset = buffer.readUInt32LE(eocdOffset + 16);\n const cdSize = buffer.readUInt32LE(eocdOffset + 12);\n const cdEnd = cdOffset + cdSize;\n let offset = cdOffset;\n\n while (offset < cdEnd) {\n const sig = buffer.readUInt32LE(offset);\n if (sig !== 0x02014b50) {\n break;\n }\n\n const compressionMethod = buffer.readUInt16LE(offset + 10);\n const compressedSize = buffer.readUInt32LE(offset + 20);\n const fileNameLen = buffer.readUInt16LE(offset + 28);\n const extraLen = buffer.readUInt16LE(offset + 30);\n const commentLen = buffer.readUInt16LE(offset + 32);\n const localHeaderOffset = buffer.readUInt32LE(offset + 42);\n const fileName = buffer.toString(\"utf-8\", offset + 46, offset + 46 + fileNameLen);\n\n if (fileName === targetPath) {\n return readLocalFile(buffer, localHeaderOffset, compressionMethod, compressedSize);\n }\n\n offset += 46 + fileNameLen + extraLen + commentLen;\n }\n\n return null;\n}\n\nfunction readLocalFile(\n buffer: Buffer,\n offset: number,\n compressionMethod: number,\n compressedSize: number\n): string {\n const sig = buffer.readUInt32LE(offset);\n if (sig !== 0x04034b50) {\n throw new Error(\"Invalid ZIP: bad local file header.\");\n }\n\n const localFileNameLen = buffer.readUInt16LE(offset + 26);\n const localExtraLen = buffer.readUInt16LE(offset + 28);\n const dataOffset = offset + 30 + localFileNameLen + localExtraLen;\n\n const raw = buffer.subarray(dataOffset, dataOffset + compressedSize);\n\n if (compressionMethod === 0) {\n return raw.toString(\"utf-8\");\n }\n\n if (compressionMethod === 8) {\n return inflateRawSync(raw).toString(\"utf-8\");\n }\n\n throw new Error(`Unsupported ZIP compression method: ${compressionMethod}`);\n}\n\nfunction findEocd(buffer: Buffer): number {\n for (let i = buffer.length - 22; i >= Math.max(0, buffer.length - 65557); i--) {\n if (buffer.readUInt32LE(i) === 0x06054b50) {\n return i;\n }\n }\n return -1;\n}\n"],"names":["extractDocxText","buffer","xml","extractFileFromZip","Error","stylesXml","styleMap","buildStyleMap","Map","convertToMarkdown","map","styleRegex","match","styleId","block","nameMatch","getHeadingLevel","paragraphXml","styleMatch","directMatch","parseInt","styleName","isListItem","extractRunMarkdown","runXml","textRegex","texts","text","isBold","isItalic","paragraphs","paragraphRegex","paragraphMatch","runRegex","runs","runMatch","md","line","headingLevel","targetPath","eocdOffset","findEocd","cdOffset","cdSize","cdEnd","offset","sig","compressionMethod","compressedSize","fileNameLen","extraLen","commentLen","localHeaderOffset","fileName","readLocalFile","localFileNameLen","localExtraLen","dataOffset","raw","inflateRawSync","i","Math"],"mappings":";AAEO,eAAeA,gBAAgBC,MAAc;IAChD,MAAMC,MAAMC,mBAAmBF,QAAQ;IACvC,IAAI,CAACC,KACD,MAAM,IAAIE,MAAM;IAGpB,MAAMC,YAAYF,mBAAmBF,QAAQ;IAC7C,MAAMK,WAAWD,YAAYE,cAAcF,aAAa,IAAIG;IAE5D,OAAOC,kBAAkBP,KAAKI;AAClC;AAEA,SAASC,cAAcF,SAAiB;IACpC,MAAMK,MAAM,IAAIF;IAChB,MAAMG,aAAa;IACnB,IAAIC;IAEJ,MAAQA,AAAwC,SAAxCA,CAAAA,QAAQD,WAAW,IAAI,CAACN,UAAS,EAAa;QAClD,MAAMQ,UAAUD,KAAK,CAAC,EAAE;QACxB,MAAME,QAAQF,KAAK,CAAC,EAAE;QACtB,MAAMG,YAAYD,MAAM,KAAK,CAAC;QAC9B,IAAIC,WACAL,IAAI,GAAG,CAACG,SAASE,SAAS,CAAC,EAAE;IAErC;IAEA,OAAOL;AACX;AAEA,SAASM,gBAAgBC,YAAoB,EAAEX,QAA6B;IACxE,MAAMY,aAAaD,aAAa,KAAK,CAAC;IACtC,IAAI,CAACC,YACD,OAAO;IAGX,MAAML,UAAUK,UAAU,CAAC,EAAE;IAE7B,MAAMC,cAAcN,QAAQ,KAAK,CAAC;IAClC,IAAIM,aACA,OAAOC,SAASD,WAAW,CAAC,EAAE,EAAE;IAGpC,MAAME,YAAYf,SAAS,GAAG,CAACO,YAAY;IAC3C,MAAME,YAAYM,UAAU,KAAK,CAAC;IAClC,IAAIN,WACA,OAAOK,SAASL,SAAS,CAAC,EAAE,EAAE;IAGlC,IAAI,SAAS,IAAI,CAACM,cAAc,SAAS,IAAI,CAACR,UAC1C,OAAO;IAGX,OAAO;AACX;AAEA,SAASS,WAAWL,YAAoB;IACpC,OAAO,aAAa,IAAI,CAACA;AAC7B;AAEA,SAASM,mBAAmBC,MAAc;IACtC,MAAMC,YAAY;IAClB,MAAMC,QAAkB,EAAE;IAC1B,IAAId;IACJ,MAAQA,AAAoC,SAApCA,CAAAA,QAAQa,UAAU,IAAI,CAACD,OAAM,EACjCE,MAAM,IAAI,CAACd,KAAK,CAAC,EAAE;IAEvB,IAAIc,AAAiB,MAAjBA,MAAM,MAAM,EACZ,OAAO;IAGX,MAAMC,OAAOD,MAAM,IAAI,CAAC;IACxB,MAAME,SAAS,aAAa,IAAI,CAACJ,WAAW,CAAC,2BAA2B,IAAI,CAACA;IAC7E,MAAMK,WAAW,aAAa,IAAI,CAACL,WAAW,CAAC,2BAA2B,IAAI,CAACA;IAE/E,IAAII,UAAUC,UACV,OAAO,CAAC,GAAG,EAAEF,KAAK,GAAG,CAAC;IAE1B,IAAIC,QACA,OAAO,CAAC,EAAE,EAAED,KAAK,EAAE,CAAC;IAExB,IAAIE,UACA,OAAO,CAAC,CAAC,EAAEF,KAAK,CAAC,CAAC;IAEtB,OAAOA;AACX;AAEA,SAASlB,kBAAkBP,GAAW,EAAEI,QAA6B;IACjE,MAAMwB,aAAuB,EAAE;IAC/B,MAAMC,iBAAiB;IACvB,IAAIC;IAEJ,MAAQA,AAA+C,SAA/CA,CAAAA,iBAAiBD,eAAe,IAAI,CAAC7B,IAAG,EAAa;QACzD,MAAMe,eAAee,cAAc,CAAC,EAAE;QAEtC,MAAMC,WAAW;QACjB,MAAMC,OAAiB,EAAE;QACzB,IAAIC;QACJ,MAAQA,AAA4C,SAA5CA,CAAAA,WAAWF,SAAS,IAAI,CAAChB,aAAY,EAAa;YACtD,MAAMmB,KAAKb,mBAAmBY,QAAQ,CAAC,EAAE;YACzC,IAAIC,IACAF,KAAK,IAAI,CAACE;QAElB;QAEA,IAAIF,AAAgB,MAAhBA,KAAK,MAAM,EACX;QAGJ,IAAIG,OAAOH,KAAK,IAAI,CAAC;QACrB,MAAMI,eAAetB,gBAAgBC,cAAcX;QAEnD,IAAIgC,eAAe,KAAKA,gBAAgB,GACpCD,OAAO,GAAG,IAAI,MAAM,CAACC,cAAc,CAAC,EAAED,MAAM;aACzC,IAAIf,WAAWL,eAClBoB,OAAO,CAAC,EAAE,EAAEA,MAAM;QAGtBP,WAAW,IAAI,CAACO;IACpB;IAEA,OAAOP,WAAW,IAAI,CAAC;AAC3B;AAIA,SAAS3B,mBAAmBF,MAAc,EAAEsC,UAAkB;IAC1D,MAAMC,aAAaC,SAASxC;IAC5B,IAAIuC,AAAe,OAAfA,YACA,MAAM,IAAIpC,MAAM;IAGpB,MAAMsC,WAAWzC,OAAO,YAAY,CAACuC,aAAa;IAClD,MAAMG,SAAS1C,OAAO,YAAY,CAACuC,aAAa;IAChD,MAAMI,QAAQF,WAAWC;IACzB,IAAIE,SAASH;IAEb,MAAOG,SAASD,MAAO;QACnB,MAAME,MAAM7C,OAAO,YAAY,CAAC4C;QAChC,IAAIC,AAAQ,eAARA,KACA;QAGJ,MAAMC,oBAAoB9C,OAAO,YAAY,CAAC4C,SAAS;QACvD,MAAMG,iBAAiB/C,OAAO,YAAY,CAAC4C,SAAS;QACpD,MAAMI,cAAchD,OAAO,YAAY,CAAC4C,SAAS;QACjD,MAAMK,WAAWjD,OAAO,YAAY,CAAC4C,SAAS;QAC9C,MAAMM,aAAalD,OAAO,YAAY,CAAC4C,SAAS;QAChD,MAAMO,oBAAoBnD,OAAO,YAAY,CAAC4C,SAAS;QACvD,MAAMQ,WAAWpD,OAAO,QAAQ,CAAC,SAAS4C,SAAS,IAAIA,SAAS,KAAKI;QAErE,IAAII,aAAad,YACb,OAAOe,cAAcrD,QAAQmD,mBAAmBL,mBAAmBC;QAGvEH,UAAU,KAAKI,cAAcC,WAAWC;IAC5C;IAEA,OAAO;AACX;AAEA,SAASG,cACLrD,MAAc,EACd4C,MAAc,EACdE,iBAAyB,EACzBC,cAAsB;IAEtB,MAAMF,MAAM7C,OAAO,YAAY,CAAC4C;IAChC,IAAIC,AAAQ,eAARA,KACA,MAAM,IAAI1C,MAAM;IAGpB,MAAMmD,mBAAmBtD,OAAO,YAAY,CAAC4C,SAAS;IACtD,MAAMW,gBAAgBvD,OAAO,YAAY,CAAC4C,SAAS;IACnD,MAAMY,aAAaZ,SAAS,KAAKU,mBAAmBC;IAEpD,MAAME,MAAMzD,OAAO,QAAQ,CAACwD,YAAYA,aAAaT;IAErD,IAAID,AAAsB,MAAtBA,mBACA,OAAOW,IAAI,QAAQ,CAAC;IAGxB,IAAIX,AAAsB,MAAtBA,mBACA,OAAOY,eAAeD,KAAK,QAAQ,CAAC;IAGxC,MAAM,IAAItD,MAAM,CAAC,oCAAoC,EAAE2C,mBAAmB;AAC9E;AAEA,SAASN,SAASxC,MAAc;IAC5B,IAAK,IAAI2D,IAAI3D,OAAO,MAAM,GAAG,IAAI2D,KAAKC,KAAK,GAAG,CAAC,GAAG5D,OAAO,MAAM,GAAG,QAAQ2D,IACtE,IAAI3D,AAA2B,eAA3BA,OAAO,YAAY,CAAC2D,IACpB,OAAOA;IAGf,OAAO;AACX"}
|
|
@@ -1,10 +1,23 @@
|
|
|
1
|
+
import type { Constructor } from "@webiny/di";
|
|
1
2
|
import type { generateText } from "ai";
|
|
2
3
|
import type { streamText } from "ai";
|
|
3
4
|
import type { LanguageModel } from "ai";
|
|
4
5
|
import type { FlexibleSchema, ToolSet } from "ai";
|
|
6
|
+
/**
|
|
7
|
+
* What a model accepts, as published in the model catalog. A capability that isn't listed is unknown,
|
|
8
|
+
* and unknown is treated as unsupported: a parameter the model may reject is not sent.
|
|
9
|
+
*/
|
|
10
|
+
export interface IAiModelSupports {
|
|
11
|
+
tools?: boolean;
|
|
12
|
+
vision?: boolean;
|
|
13
|
+
temperature?: boolean;
|
|
14
|
+
}
|
|
5
15
|
export interface IAiSdkModel {
|
|
6
16
|
id: string;
|
|
7
17
|
name: string;
|
|
18
|
+
deprecated?: Date;
|
|
19
|
+
endOfLife?: Date;
|
|
20
|
+
supports?: IAiModelSupports;
|
|
8
21
|
}
|
|
9
22
|
export interface IAiSdk {
|
|
10
23
|
languageModel(modelId: string): LanguageModel;
|
|
@@ -55,6 +68,9 @@ export interface AiModel {
|
|
|
55
68
|
providerName: string;
|
|
56
69
|
modelId: string;
|
|
57
70
|
modelName: string;
|
|
71
|
+
deprecated: Date | undefined;
|
|
72
|
+
endOfLife: Date | undefined;
|
|
73
|
+
supports: IAiModelSupports | undefined;
|
|
58
74
|
}
|
|
59
75
|
export interface IAi {
|
|
60
76
|
generateText(params: AiGenerateTextParams): ReturnType<typeof generateText>;
|
|
@@ -70,16 +86,95 @@ export declare namespace Ai {
|
|
|
70
86
|
type GenerateTextParams = AiGenerateTextParams;
|
|
71
87
|
type StreamTextParams = AiStreamTextParams;
|
|
72
88
|
}
|
|
73
|
-
export interface
|
|
89
|
+
export interface IAiModelRegistry {
|
|
90
|
+
listModels(): Promise<AiModel[]>;
|
|
91
|
+
}
|
|
92
|
+
/** Single source of truth for available AI models. Decoratable to restrict the model list. */
|
|
93
|
+
export declare const AiModelRegistry: import("@webiny/di").Abstraction<IAiModelRegistry>;
|
|
94
|
+
export declare namespace AiModelRegistry {
|
|
95
|
+
type Interface = IAiModelRegistry;
|
|
96
|
+
}
|
|
97
|
+
export interface AiCatalogProvider {
|
|
98
|
+
id: string;
|
|
99
|
+
name: string;
|
|
100
|
+
models: IAiSdkModel[];
|
|
101
|
+
}
|
|
102
|
+
export interface IAiModelCatalog {
|
|
103
|
+
/** Returns `undefined` when the catalog can't be loaded. */
|
|
104
|
+
listProviders(): Promise<AiCatalogProvider[] | undefined>;
|
|
105
|
+
}
|
|
106
|
+
/** The published list of providers and models Webiny supports. SDK factories still gate what is offered. */
|
|
107
|
+
export declare const AiModelCatalog: import("@webiny/di").Abstraction<IAiModelCatalog>;
|
|
108
|
+
export declare namespace AiModelCatalog {
|
|
109
|
+
type Interface = IAiModelCatalog;
|
|
110
|
+
}
|
|
111
|
+
/**
|
|
112
|
+
* Behavioural hints about a tool. Purely advisory — they never replace a permission check.
|
|
113
|
+
* Names mirror the MCP tool annotations so they can be forwarded verbatim to MCP clients,
|
|
114
|
+
* which use them to decide what to auto-approve and what to confirm with the user.
|
|
115
|
+
*/
|
|
116
|
+
export interface IAiSdkToolAnnotations {
|
|
117
|
+
/** Tool does not modify state. */
|
|
118
|
+
readOnlyHint?: boolean;
|
|
119
|
+
/** Tool may perform destructive updates (only meaningful when not read-only). */
|
|
120
|
+
destructiveHint?: boolean;
|
|
121
|
+
/** Repeated calls with the same arguments have no additional effect. */
|
|
122
|
+
idempotentHint?: boolean;
|
|
123
|
+
/** Tool interacts with entities outside its own closed world. */
|
|
124
|
+
openWorldHint?: boolean;
|
|
125
|
+
}
|
|
126
|
+
/**
|
|
127
|
+
* What a tool DOES. This is the half that injects use cases, so it is built only for a tool the
|
|
128
|
+
* model actually calls, and only at the moment it calls it.
|
|
129
|
+
*/
|
|
130
|
+
export interface IAiSdkToolHandler<TInput = any> {
|
|
131
|
+
execute(input: TInput): Promise<unknown>;
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* What a tool IS: everything the model is told about it, plus the class that runs it.
|
|
135
|
+
*
|
|
136
|
+
* Carries no behaviour and no dependencies, which is what makes the registry cheap to read.
|
|
137
|
+
* `AiSdkTools` builds every definition to assemble the tool set, and builds a handler only for a
|
|
138
|
+
* tool the model actually calls.
|
|
139
|
+
*/
|
|
140
|
+
export interface IAiSdkToolDefinition<TInput = any> {
|
|
74
141
|
readonly name: string;
|
|
75
142
|
readonly description: string;
|
|
76
143
|
readonly inputSchema: FlexibleSchema<TInput>;
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
144
|
+
/** Human-friendly display name. Falls back to `name` when omitted. */
|
|
145
|
+
readonly title?: string;
|
|
146
|
+
readonly annotations?: IAiSdkToolAnnotations;
|
|
147
|
+
readonly handler: Constructor<IAiSdkToolHandler<TInput>>;
|
|
148
|
+
}
|
|
149
|
+
export declare const AiSdkToolDefinition: import("@webiny/di").Abstraction<IAiSdkToolDefinition<any>>;
|
|
150
|
+
/**
|
|
151
|
+
* The behaviour half of a tool, built on demand through {@link AiSdkToolHandlerResolver}.
|
|
152
|
+
*
|
|
153
|
+
* Implementations are NOT registered against this abstraction. The definition points at the class
|
|
154
|
+
* directly, exactly as `HttpRouteDefinition` points at its `HttpRouteHandler`. Declaring them
|
|
155
|
+
* through it is what attaches their dependency metadata.
|
|
156
|
+
*/
|
|
157
|
+
export declare const AiSdkToolHandler: import("@webiny/di").Abstraction<IAiSdkToolHandler<any>>;
|
|
158
|
+
export declare namespace AiSdkToolDefinition {
|
|
159
|
+
type Interface<TInput = any> = IAiSdkToolDefinition<TInput>;
|
|
160
|
+
type Annotations = IAiSdkToolAnnotations;
|
|
161
|
+
}
|
|
162
|
+
export declare namespace AiSdkToolHandler {
|
|
163
|
+
type Interface<TInput = any> = IAiSdkToolHandler<TInput>;
|
|
164
|
+
}
|
|
165
|
+
export interface IAiSdkToolHandlerResolver {
|
|
166
|
+
resolve<TInput>(handler: Constructor<IAiSdkToolHandler<TInput>>): IAiSdkToolHandler<TInput>;
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* Builds the behaviour half of a tool on demand.
|
|
170
|
+
*
|
|
171
|
+
* Something has to turn `tool.handler` (a class) into an instance, and that needs the container.
|
|
172
|
+
* Rather than injecting the container into the tool registry, it lives behind this one narrow
|
|
173
|
+
* abstraction, so everything else depends on `resolve(handler)` and stays testable with a stub.
|
|
174
|
+
*/
|
|
175
|
+
export declare const AiSdkToolHandlerResolver: import("@webiny/di").Abstraction<IAiSdkToolHandlerResolver>;
|
|
176
|
+
export declare namespace AiSdkToolHandlerResolver {
|
|
177
|
+
type Interface = IAiSdkToolHandlerResolver;
|
|
83
178
|
}
|
|
84
179
|
export interface IAiSdkTools {
|
|
85
180
|
getToolSet(): ToolSet;
|
|
@@ -1,35 +1,14 @@
|
|
|
1
1
|
import { createAbstraction } from "@webiny/feature/api";
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
// AiConnection
|
|
14
|
-
|
|
15
|
-
// AiConnectionFactory
|
|
16
|
-
|
|
17
|
-
/** Factory that asynchronously produces an AiConnection. */
|
|
18
|
-
export const AiConnectionFactory = createAbstraction("AiConnectionFactory");
|
|
19
|
-
|
|
20
|
-
// Ai
|
|
21
|
-
|
|
22
|
-
/** Interact with AI language models using registered providers. */
|
|
23
|
-
export const Ai = createAbstraction("Ai");
|
|
24
|
-
|
|
25
|
-
// AiSdkTool
|
|
26
|
-
|
|
27
|
-
/** A single tool that can be provided to AI generateText/streamText calls. */
|
|
28
|
-
export const AiSdkTool = createAbstraction("AiSdkTool");
|
|
29
|
-
|
|
30
|
-
// AiSdkTools
|
|
31
|
-
|
|
32
|
-
/** Collection of AI SDK tools. Returns a ready-to-use ToolSet for generateText/streamText. */
|
|
33
|
-
export const AiSdkTools = createAbstraction("AiSdkTools");
|
|
2
|
+
const AiSdk = createAbstraction("AiSdk");
|
|
3
|
+
const AiSdkFactory = createAbstraction("AiSdkFactory");
|
|
4
|
+
const AiConnectionFactory = createAbstraction("AiConnectionFactory");
|
|
5
|
+
const Ai = createAbstraction("Ai");
|
|
6
|
+
const AiModelRegistry = createAbstraction("AiModelRegistry");
|
|
7
|
+
const AiModelCatalog = createAbstraction("AiModelCatalog");
|
|
8
|
+
const AiSdkToolDefinition = createAbstraction("AiSdkToolDefinition");
|
|
9
|
+
const AiSdkToolHandler = createAbstraction("AiSdkToolHandler");
|
|
10
|
+
const AiSdkToolHandlerResolver = createAbstraction("AiSdkToolHandlerResolver");
|
|
11
|
+
const AiSdkTools = createAbstraction("AiSdkTools");
|
|
12
|
+
export { Ai, AiConnectionFactory, AiModelCatalog, AiModelRegistry, AiSdk, AiSdkFactory, AiSdkToolDefinition, AiSdkToolHandler, AiSdkToolHandlerResolver, AiSdkTools };
|
|
34
13
|
|
|
35
14
|
//# sourceMappingURL=abstractions.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/ai/abstractions.js","sources":["../../../src/features/ai/abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport type { Constructor } from \"@webiny/di\";\nimport type { generateText } from \"ai\";\nimport type { streamText } from \"ai\";\nimport type { LanguageModel } from \"ai\";\nimport type { FlexibleSchema, ToolSet } from \"ai\";\n\n// AiSdk\n\n/**\n * What a model accepts, as published in the model catalog. A capability that isn't listed is unknown,\n * and unknown is treated as unsupported: a parameter the model may reject is not sent.\n */\nexport interface IAiModelSupports {\n tools?: boolean;\n vision?: boolean;\n temperature?: boolean;\n}\n\nexport interface IAiSdkModel {\n id: string; // raw model id, e.g. \"claude-sonnet-4-5\"\n name: string; // human-friendly name, e.g. \"Claude Sonnet 4.5\"\n deprecated?: Date;\n endOfLife?: Date;\n supports?: IAiModelSupports;\n}\n\nexport interface IAiSdk {\n languageModel(modelId: string): LanguageModel;\n}\n\n/** A single AI SDK instance (e.g. OpenAI, Anthropic) that resolves model instances. */\nexport const AiSdk = createAbstraction<IAiSdk>(\"AiSdk\");\n\nexport namespace AiSdk {\n export type Interface = IAiSdk;\n}\n\n// AiSdkFactory\n\nexport interface IAiSdkFactory {\n readonly id: string; // machine id, e.g. \"anthropic\"\n readonly name: string; // human-friendly name, e.g. \"Anthropic\"\n readonly models: readonly IAiSdkModel[]; // static model list, no API call needed\n execute(apiKey?: string): Promise<IAiSdk>;\n}\n\n/** Factory that asynchronously initialises an AI SDK. Register one per provider namespace. */\nexport const AiSdkFactory = createAbstraction<IAiSdkFactory>(\"AiSdkFactory\");\n\nexport namespace AiSdkFactory {\n export type Interface = IAiSdkFactory;\n}\n\n// AiConnection\n\nexport interface IAiConnectionInline {\n readonly sdkName: string;\n readonly apiKey?: string;\n}\n\nexport interface IAiConnection extends IAiConnectionInline {\n readonly id: string;\n}\n\n// AiConnectionFactory\n\nexport interface IAiConnectionFactory {\n execute(): Promise<IAiConnection>;\n}\n\n/** Factory that asynchronously produces an AiConnection. */\nexport const AiConnectionFactory = createAbstraction<IAiConnectionFactory>(\"AiConnectionFactory\");\n\nexport namespace AiConnectionFactory {\n export type Interface = IAiConnectionFactory;\n}\n\n// Ai\n\ntype SDKGenerateTextParams = Parameters<typeof generateText>[0];\ntype SDKStreamTextParams = Parameters<typeof streamText>[0];\n\nexport type AiGenerateTextParams = Omit<SDKGenerateTextParams, \"model\"> & {\n model: string;\n connection?: string | IAiConnectionInline;\n};\nexport type AiStreamTextParams = Omit<SDKStreamTextParams, \"model\"> & {\n model: string;\n connection?: string | IAiConnectionInline;\n};\n\nexport interface AiModel {\n providerId: string; // e.g. \"anthropic\"\n providerName: string; // e.g. \"Anthropic\"\n modelId: string; // e.g. \"claude-sonnet-4-5\"\n modelName: string; // e.g. \"Claude Sonnet 4.5\"\n deprecated: Date | undefined;\n endOfLife: Date | undefined;\n supports: IAiModelSupports | undefined;\n}\n\nexport interface IAi {\n generateText(params: AiGenerateTextParams): ReturnType<typeof generateText>;\n streamText(params: AiStreamTextParams): Promise<ReturnType<typeof streamText>>;\n listModels(): Promise<AiModel[]>;\n listModelsByConnections(): Promise<AiModel[]>;\n listModelsByConnection(connection: string | IAiConnectionInline): Promise<AiModel[]>;\n}\n\n/** Interact with AI language models using registered providers. */\nexport const Ai = createAbstraction<IAi>(\"Ai\");\n\nexport namespace Ai {\n export type Interface = IAi;\n export type GenerateTextParams = AiGenerateTextParams;\n export type StreamTextParams = AiStreamTextParams;\n}\n\n// AiModelRegistry\n\nexport interface IAiModelRegistry {\n listModels(): Promise<AiModel[]>;\n}\n\n/** Single source of truth for available AI models. Decoratable to restrict the model list. */\nexport const AiModelRegistry = createAbstraction<IAiModelRegistry>(\"AiModelRegistry\");\n\nexport namespace AiModelRegistry {\n export type Interface = IAiModelRegistry;\n}\n\n// AiModelCatalog\n\nexport interface AiCatalogProvider {\n id: string; // Matches `AiSdkFactory.id`, e.g. \"anthropic\".\n name: string; // Human-friendly name, e.g. \"Anthropic\".\n models: IAiSdkModel[];\n}\n\nexport interface IAiModelCatalog {\n /** Returns `undefined` when the catalog can't be loaded. */\n listProviders(): Promise<AiCatalogProvider[] | undefined>;\n}\n\n/** The published list of providers and models Webiny supports. SDK factories still gate what is offered. */\nexport const AiModelCatalog = createAbstraction<IAiModelCatalog>(\"AiModelCatalog\");\n\nexport namespace AiModelCatalog {\n export type Interface = IAiModelCatalog;\n}\n\n// AiSdkToolDefinition\n\n/**\n * Behavioural hints about a tool. Purely advisory — they never replace a permission check.\n * Names mirror the MCP tool annotations so they can be forwarded verbatim to MCP clients,\n * which use them to decide what to auto-approve and what to confirm with the user.\n */\nexport interface IAiSdkToolAnnotations {\n /** Tool does not modify state. */\n readOnlyHint?: boolean;\n /** Tool may perform destructive updates (only meaningful when not read-only). */\n destructiveHint?: boolean;\n /** Repeated calls with the same arguments have no additional effect. */\n idempotentHint?: boolean;\n /** Tool interacts with entities outside its own closed world. */\n openWorldHint?: boolean;\n}\n\n/**\n * What a tool DOES. This is the half that injects use cases, so it is built only for a tool the\n * model actually calls, and only at the moment it calls it.\n */\nexport interface IAiSdkToolHandler<TInput = any> {\n execute(input: TInput): Promise<unknown>;\n}\n\n/**\n * What a tool IS: everything the model is told about it, plus the class that runs it.\n *\n * Carries no behaviour and no dependencies, which is what makes the registry cheap to read.\n * `AiSdkTools` builds every definition to assemble the tool set, and builds a handler only for a\n * tool the model actually calls.\n */\nexport interface IAiSdkToolDefinition<TInput = any> {\n readonly name: string;\n readonly description: string;\n readonly inputSchema: FlexibleSchema<TInput>;\n /** Human-friendly display name. Falls back to `name` when omitted. */\n readonly title?: string;\n readonly annotations?: IAiSdkToolAnnotations;\n readonly handler: Constructor<IAiSdkToolHandler<TInput>>;\n}\n\nexport const AiSdkToolDefinition = createAbstraction<IAiSdkToolDefinition>(\"AiSdkToolDefinition\");\n\n/**\n * The behaviour half of a tool, built on demand through {@link AiSdkToolHandlerResolver}.\n *\n * Implementations are NOT registered against this abstraction. The definition points at the class\n * directly, exactly as `HttpRouteDefinition` points at its `HttpRouteHandler`. Declaring them\n * through it is what attaches their dependency metadata.\n */\nexport const AiSdkToolHandler = createAbstraction<IAiSdkToolHandler>(\"AiSdkToolHandler\");\n\nexport namespace AiSdkToolDefinition {\n export type Interface<TInput = any> = IAiSdkToolDefinition<TInput>;\n export type Annotations = IAiSdkToolAnnotations;\n}\n\nexport namespace AiSdkToolHandler {\n export type Interface<TInput = any> = IAiSdkToolHandler<TInput>;\n}\n\n// AiSdkToolHandlerResolver\n\nexport interface IAiSdkToolHandlerResolver {\n resolve<TInput>(handler: Constructor<IAiSdkToolHandler<TInput>>): IAiSdkToolHandler<TInput>;\n}\n\n/**\n * Builds the behaviour half of a tool on demand.\n *\n * Something has to turn `tool.handler` (a class) into an instance, and that needs the container.\n * Rather than injecting the container into the tool registry, it lives behind this one narrow\n * abstraction, so everything else depends on `resolve(handler)` and stays testable with a stub.\n */\nexport const AiSdkToolHandlerResolver = createAbstraction<IAiSdkToolHandlerResolver>(\n \"AiSdkToolHandlerResolver\"\n);\n\nexport namespace AiSdkToolHandlerResolver {\n export type Interface = IAiSdkToolHandlerResolver;\n}\n\n// AiSdkTools\n\nexport interface IAiSdkTools {\n getToolSet(): ToolSet;\n}\n\n/** Collection of AI SDK tools. Returns a ready-to-use ToolSet for generateText/streamText. */\nexport const AiSdkTools = createAbstraction<IAiSdkTools>(\"AiSdkTools\");\n\nexport namespace AiSdkTools {\n export type Interface = IAiSdkTools;\n}\n"],"names":["AiSdk","createAbstraction","AiSdkFactory","AiConnectionFactory","Ai","AiModelRegistry","AiModelCatalog","AiSdkToolDefinition","AiSdkToolHandler","AiSdkToolHandlerResolver","AiSdkTools"],"mappings":";AAgCO,MAAMA,QAAQC,kBAA0B;AAgBxC,MAAMC,eAAeD,kBAAiC;AAwBtD,MAAME,sBAAsBF,kBAAwC;AAuCpE,MAAMG,KAAKH,kBAAuB;AAelC,MAAMI,kBAAkBJ,kBAAoC;AAoB5D,MAAMK,iBAAiBL,kBAAmC;AAiD1D,MAAMM,sBAAsBN,kBAAwC;AASpE,MAAMO,mBAAmBP,kBAAqC;AAwB9D,MAAMQ,2BAA2BR,kBACpC;AAcG,MAAMS,aAAaT,kBAA+B"}
|
|
@@ -0,0 +1,95 @@
|
|
|
1
|
+
import { DomainEvent } from "../../features/eventPublisher/index.js";
|
|
2
|
+
import type { IEventHandler } from "../../features/eventPublisher/index.js";
|
|
3
|
+
import type { AiGenerateTextParams, AiStreamTextParams } from "./abstractions.js";
|
|
4
|
+
import type { generateText } from "ai";
|
|
5
|
+
export interface AiBeforeGenerateTextPayload {
|
|
6
|
+
requestId: string;
|
|
7
|
+
params: AiGenerateTextParams;
|
|
8
|
+
}
|
|
9
|
+
export declare class AiBeforeGenerateTextEvent extends DomainEvent<AiBeforeGenerateTextPayload> {
|
|
10
|
+
eventType: "ai.beforeGenerateText";
|
|
11
|
+
getHandlerAbstraction(): import("@webiny/di").Abstraction<IEventHandler<AiBeforeGenerateTextEvent>>;
|
|
12
|
+
}
|
|
13
|
+
export declare const AiBeforeGenerateTextEventHandler: import("@webiny/di").Abstraction<IEventHandler<AiBeforeGenerateTextEvent>>;
|
|
14
|
+
export declare namespace AiBeforeGenerateTextEventHandler {
|
|
15
|
+
type Interface = IEventHandler<AiBeforeGenerateTextEvent>;
|
|
16
|
+
type Event = AiBeforeGenerateTextEvent;
|
|
17
|
+
}
|
|
18
|
+
export interface AiAfterGenerateTextPayload {
|
|
19
|
+
requestId: string;
|
|
20
|
+
params: AiGenerateTextParams;
|
|
21
|
+
result: Awaited<ReturnType<typeof generateText>>;
|
|
22
|
+
duration: number;
|
|
23
|
+
}
|
|
24
|
+
export declare class AiAfterGenerateTextEvent extends DomainEvent<AiAfterGenerateTextPayload> {
|
|
25
|
+
eventType: "ai.afterGenerateText";
|
|
26
|
+
getHandlerAbstraction(): import("@webiny/di").Abstraction<IEventHandler<AiAfterGenerateTextEvent>>;
|
|
27
|
+
}
|
|
28
|
+
export declare const AiAfterGenerateTextEventHandler: import("@webiny/di").Abstraction<IEventHandler<AiAfterGenerateTextEvent>>;
|
|
29
|
+
export declare namespace AiAfterGenerateTextEventHandler {
|
|
30
|
+
type Interface = IEventHandler<AiAfterGenerateTextEvent>;
|
|
31
|
+
type Event = AiAfterGenerateTextEvent;
|
|
32
|
+
}
|
|
33
|
+
export interface AiGenerateTextErrorPayload {
|
|
34
|
+
requestId: string;
|
|
35
|
+
params: AiGenerateTextParams;
|
|
36
|
+
error: Error;
|
|
37
|
+
duration: number;
|
|
38
|
+
}
|
|
39
|
+
export declare class AiGenerateTextErrorEvent extends DomainEvent<AiGenerateTextErrorPayload> {
|
|
40
|
+
eventType: "ai.generateTextError";
|
|
41
|
+
getHandlerAbstraction(): import("@webiny/di").Abstraction<IEventHandler<AiGenerateTextErrorEvent>>;
|
|
42
|
+
}
|
|
43
|
+
export declare const AiGenerateTextErrorEventHandler: import("@webiny/di").Abstraction<IEventHandler<AiGenerateTextErrorEvent>>;
|
|
44
|
+
export declare namespace AiGenerateTextErrorEventHandler {
|
|
45
|
+
type Interface = IEventHandler<AiGenerateTextErrorEvent>;
|
|
46
|
+
type Event = AiGenerateTextErrorEvent;
|
|
47
|
+
}
|
|
48
|
+
export interface AiBeforeStreamTextPayload {
|
|
49
|
+
params: AiStreamTextParams;
|
|
50
|
+
}
|
|
51
|
+
export declare class AiBeforeStreamTextEvent extends DomainEvent<AiBeforeStreamTextPayload> {
|
|
52
|
+
eventType: "ai.beforeStreamText";
|
|
53
|
+
getHandlerAbstraction(): import("@webiny/di").Abstraction<IEventHandler<AiBeforeStreamTextEvent>>;
|
|
54
|
+
}
|
|
55
|
+
export declare const AiBeforeStreamTextEventHandler: import("@webiny/di").Abstraction<IEventHandler<AiBeforeStreamTextEvent>>;
|
|
56
|
+
export declare namespace AiBeforeStreamTextEventHandler {
|
|
57
|
+
type Interface = IEventHandler<AiBeforeStreamTextEvent>;
|
|
58
|
+
type Event = AiBeforeStreamTextEvent;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* A stream that finished. Published once its last chunk has arrived, with the whole call's usage —
|
|
62
|
+
* the counterpart of `AiAfterGenerateTextEvent`, so a consumer recording usage sees streamed calls too.
|
|
63
|
+
*/
|
|
64
|
+
export interface AiAfterStreamTextPayload {
|
|
65
|
+
requestId: string;
|
|
66
|
+
params: AiStreamTextParams;
|
|
67
|
+
usage: unknown;
|
|
68
|
+
finishReason: string;
|
|
69
|
+
duration: number;
|
|
70
|
+
}
|
|
71
|
+
export declare class AiAfterStreamTextEvent extends DomainEvent<AiAfterStreamTextPayload> {
|
|
72
|
+
eventType: "ai.afterStreamText";
|
|
73
|
+
getHandlerAbstraction(): import("@webiny/di").Abstraction<IEventHandler<AiAfterStreamTextEvent>>;
|
|
74
|
+
}
|
|
75
|
+
export declare const AiAfterStreamTextEventHandler: import("@webiny/di").Abstraction<IEventHandler<AiAfterStreamTextEvent>>;
|
|
76
|
+
export declare namespace AiAfterStreamTextEventHandler {
|
|
77
|
+
type Interface = IEventHandler<AiAfterStreamTextEvent>;
|
|
78
|
+
type Event = AiAfterStreamTextEvent;
|
|
79
|
+
}
|
|
80
|
+
/** A stream that failed or was aborted. The provider reports no usage for either. */
|
|
81
|
+
export interface AiStreamTextErrorPayload {
|
|
82
|
+
requestId: string;
|
|
83
|
+
params: AiStreamTextParams;
|
|
84
|
+
error: Error;
|
|
85
|
+
duration: number;
|
|
86
|
+
}
|
|
87
|
+
export declare class AiStreamTextErrorEvent extends DomainEvent<AiStreamTextErrorPayload> {
|
|
88
|
+
eventType: "ai.streamTextError";
|
|
89
|
+
getHandlerAbstraction(): import("@webiny/di").Abstraction<IEventHandler<AiStreamTextErrorEvent>>;
|
|
90
|
+
}
|
|
91
|
+
export declare const AiStreamTextErrorEventHandler: import("@webiny/di").Abstraction<IEventHandler<AiStreamTextErrorEvent>>;
|
|
92
|
+
export declare namespace AiStreamTextErrorEventHandler {
|
|
93
|
+
type Interface = IEventHandler<AiStreamTextErrorEvent>;
|
|
94
|
+
type Event = AiStreamTextErrorEvent;
|
|
95
|
+
}
|
|
@@ -0,0 +1,59 @@
|
|
|
1
|
+
import { createAbstraction } from "@webiny/feature/api";
|
|
2
|
+
import { DomainEvent } from "../eventPublisher/index.js";
|
|
3
|
+
class AiBeforeGenerateTextEvent extends DomainEvent {
|
|
4
|
+
getHandlerAbstraction() {
|
|
5
|
+
return AiBeforeGenerateTextEventHandler;
|
|
6
|
+
}
|
|
7
|
+
constructor(...args){
|
|
8
|
+
super(...args), this.eventType = "ai.beforeGenerateText";
|
|
9
|
+
}
|
|
10
|
+
}
|
|
11
|
+
const AiBeforeGenerateTextEventHandler = createAbstraction("AiBeforeGenerateTextEventHandler");
|
|
12
|
+
class AiAfterGenerateTextEvent extends DomainEvent {
|
|
13
|
+
getHandlerAbstraction() {
|
|
14
|
+
return AiAfterGenerateTextEventHandler;
|
|
15
|
+
}
|
|
16
|
+
constructor(...args){
|
|
17
|
+
super(...args), this.eventType = "ai.afterGenerateText";
|
|
18
|
+
}
|
|
19
|
+
}
|
|
20
|
+
const AiAfterGenerateTextEventHandler = createAbstraction("AiAfterGenerateTextEventHandler");
|
|
21
|
+
class AiGenerateTextErrorEvent extends DomainEvent {
|
|
22
|
+
getHandlerAbstraction() {
|
|
23
|
+
return AiGenerateTextErrorEventHandler;
|
|
24
|
+
}
|
|
25
|
+
constructor(...args){
|
|
26
|
+
super(...args), this.eventType = "ai.generateTextError";
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
const AiGenerateTextErrorEventHandler = createAbstraction("AiGenerateTextErrorEventHandler");
|
|
30
|
+
class AiBeforeStreamTextEvent extends DomainEvent {
|
|
31
|
+
getHandlerAbstraction() {
|
|
32
|
+
return AiBeforeStreamTextEventHandler;
|
|
33
|
+
}
|
|
34
|
+
constructor(...args){
|
|
35
|
+
super(...args), this.eventType = "ai.beforeStreamText";
|
|
36
|
+
}
|
|
37
|
+
}
|
|
38
|
+
const AiBeforeStreamTextEventHandler = createAbstraction("AiBeforeStreamTextEventHandler");
|
|
39
|
+
class AiAfterStreamTextEvent extends DomainEvent {
|
|
40
|
+
getHandlerAbstraction() {
|
|
41
|
+
return AiAfterStreamTextEventHandler;
|
|
42
|
+
}
|
|
43
|
+
constructor(...args){
|
|
44
|
+
super(...args), this.eventType = "ai.afterStreamText";
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
const AiAfterStreamTextEventHandler = createAbstraction("AiAfterStreamTextEventHandler");
|
|
48
|
+
class AiStreamTextErrorEvent extends DomainEvent {
|
|
49
|
+
getHandlerAbstraction() {
|
|
50
|
+
return AiStreamTextErrorEventHandler;
|
|
51
|
+
}
|
|
52
|
+
constructor(...args){
|
|
53
|
+
super(...args), this.eventType = "ai.streamTextError";
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
const AiStreamTextErrorEventHandler = createAbstraction("AiStreamTextErrorEventHandler");
|
|
57
|
+
export { AiAfterGenerateTextEvent, AiAfterGenerateTextEventHandler, AiAfterStreamTextEvent, AiAfterStreamTextEventHandler, AiBeforeGenerateTextEvent, AiBeforeGenerateTextEventHandler, AiBeforeStreamTextEvent, AiBeforeStreamTextEventHandler, AiGenerateTextErrorEvent, AiGenerateTextErrorEventHandler, AiStreamTextErrorEvent, AiStreamTextErrorEventHandler };
|
|
58
|
+
|
|
59
|
+
//# sourceMappingURL=events.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"features/ai/events.js","sources":["../../../src/features/ai/events.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport { DomainEvent } from \"~/features/eventPublisher/index.js\";\nimport type { IEventHandler } from \"~/features/eventPublisher/index.js\";\nimport type { AiGenerateTextParams, AiStreamTextParams } from \"./abstractions.js\";\nimport type { generateText } from \"ai\";\n\n// ============================================================================\n// BeforeGenerateText\n// ============================================================================\n\nexport interface AiBeforeGenerateTextPayload {\n requestId: string;\n params: AiGenerateTextParams;\n}\n\nexport class AiBeforeGenerateTextEvent extends DomainEvent<AiBeforeGenerateTextPayload> {\n eventType = \"ai.beforeGenerateText\" as const;\n\n getHandlerAbstraction() {\n return AiBeforeGenerateTextEventHandler;\n }\n}\n\nexport const AiBeforeGenerateTextEventHandler = createAbstraction<\n IEventHandler<AiBeforeGenerateTextEvent>\n>(\"AiBeforeGenerateTextEventHandler\");\n\nexport namespace AiBeforeGenerateTextEventHandler {\n export type Interface = IEventHandler<AiBeforeGenerateTextEvent>;\n export type Event = AiBeforeGenerateTextEvent;\n}\n\n// ============================================================================\n// AfterGenerateText\n// ============================================================================\n\nexport interface AiAfterGenerateTextPayload {\n requestId: string;\n params: AiGenerateTextParams;\n result: Awaited<ReturnType<typeof generateText>>;\n duration: number;\n}\n\nexport class AiAfterGenerateTextEvent extends DomainEvent<AiAfterGenerateTextPayload> {\n eventType = \"ai.afterGenerateText\" as const;\n\n getHandlerAbstraction() {\n return AiAfterGenerateTextEventHandler;\n }\n}\n\nexport const AiAfterGenerateTextEventHandler = createAbstraction<\n IEventHandler<AiAfterGenerateTextEvent>\n>(\"AiAfterGenerateTextEventHandler\");\n\nexport namespace AiAfterGenerateTextEventHandler {\n export type Interface = IEventHandler<AiAfterGenerateTextEvent>;\n export type Event = AiAfterGenerateTextEvent;\n}\n\n// ============================================================================\n// GenerateTextError\n// ============================================================================\n\nexport interface AiGenerateTextErrorPayload {\n requestId: string;\n params: AiGenerateTextParams;\n error: Error;\n duration: number;\n}\n\nexport class AiGenerateTextErrorEvent extends DomainEvent<AiGenerateTextErrorPayload> {\n eventType = \"ai.generateTextError\" as const;\n\n getHandlerAbstraction() {\n return AiGenerateTextErrorEventHandler;\n }\n}\n\nexport const AiGenerateTextErrorEventHandler = createAbstraction<\n IEventHandler<AiGenerateTextErrorEvent>\n>(\"AiGenerateTextErrorEventHandler\");\n\nexport namespace AiGenerateTextErrorEventHandler {\n export type Interface = IEventHandler<AiGenerateTextErrorEvent>;\n export type Event = AiGenerateTextErrorEvent;\n}\n\n// ============================================================================\n// BeforeStreamText\n// ============================================================================\n\nexport interface AiBeforeStreamTextPayload {\n params: AiStreamTextParams;\n}\n\nexport class AiBeforeStreamTextEvent extends DomainEvent<AiBeforeStreamTextPayload> {\n eventType = \"ai.beforeStreamText\" as const;\n\n getHandlerAbstraction() {\n return AiBeforeStreamTextEventHandler;\n }\n}\n\nexport const AiBeforeStreamTextEventHandler = createAbstraction<\n IEventHandler<AiBeforeStreamTextEvent>\n>(\"AiBeforeStreamTextEventHandler\");\n\nexport namespace AiBeforeStreamTextEventHandler {\n export type Interface = IEventHandler<AiBeforeStreamTextEvent>;\n export type Event = AiBeforeStreamTextEvent;\n}\n\n// ============================================================================\n// AfterStreamText\n// ============================================================================\n\n/**\n * A stream that finished. Published once its last chunk has arrived, with the whole call's usage —\n * the counterpart of `AiAfterGenerateTextEvent`, so a consumer recording usage sees streamed calls too.\n */\nexport interface AiAfterStreamTextPayload {\n requestId: string;\n params: AiStreamTextParams;\n usage: unknown;\n finishReason: string;\n duration: number;\n}\n\nexport class AiAfterStreamTextEvent extends DomainEvent<AiAfterStreamTextPayload> {\n eventType = \"ai.afterStreamText\" as const;\n\n getHandlerAbstraction() {\n return AiAfterStreamTextEventHandler;\n }\n}\n\nexport const AiAfterStreamTextEventHandler = createAbstraction<\n IEventHandler<AiAfterStreamTextEvent>\n>(\"AiAfterStreamTextEventHandler\");\n\nexport namespace AiAfterStreamTextEventHandler {\n export type Interface = IEventHandler<AiAfterStreamTextEvent>;\n export type Event = AiAfterStreamTextEvent;\n}\n\n// ============================================================================\n// StreamTextError\n// ============================================================================\n\n/** A stream that failed or was aborted. The provider reports no usage for either. */\nexport interface AiStreamTextErrorPayload {\n requestId: string;\n params: AiStreamTextParams;\n error: Error;\n duration: number;\n}\n\nexport class AiStreamTextErrorEvent extends DomainEvent<AiStreamTextErrorPayload> {\n eventType = \"ai.streamTextError\" as const;\n\n getHandlerAbstraction() {\n return AiStreamTextErrorEventHandler;\n }\n}\n\nexport const AiStreamTextErrorEventHandler = createAbstraction<\n IEventHandler<AiStreamTextErrorEvent>\n>(\"AiStreamTextErrorEventHandler\");\n\nexport namespace AiStreamTextErrorEventHandler {\n export type Interface = IEventHandler<AiStreamTextErrorEvent>;\n export type Event = AiStreamTextErrorEvent;\n}\n"],"names":["AiBeforeGenerateTextEvent","DomainEvent","AiBeforeGenerateTextEventHandler","createAbstraction","AiAfterGenerateTextEvent","AiAfterGenerateTextEventHandler","AiGenerateTextErrorEvent","AiGenerateTextErrorEventHandler","AiBeforeStreamTextEvent","AiBeforeStreamTextEventHandler","AiAfterStreamTextEvent","AiAfterStreamTextEventHandler","AiStreamTextErrorEvent","AiStreamTextErrorEventHandler"],"mappings":";;AAeO,MAAMA,kCAAkCC;IAG3C,wBAAwB;QACpB,OAAOC;IACX;;QALG,qBACH,SAAS,GAAG;;AAKhB;AAEO,MAAMA,mCAAmCC,kBAE9C;AAkBK,MAAMC,iCAAiCH;IAG1C,wBAAwB;QACpB,OAAOI;IACX;;QALG,qBACH,SAAS,GAAG;;AAKhB;AAEO,MAAMA,kCAAkCF,kBAE7C;AAkBK,MAAMG,iCAAiCL;IAG1C,wBAAwB;QACpB,OAAOM;IACX;;QALG,qBACH,SAAS,GAAG;;AAKhB;AAEO,MAAMA,kCAAkCJ,kBAE7C;AAeK,MAAMK,gCAAgCP;IAGzC,wBAAwB;QACpB,OAAOQ;IACX;;QALG,qBACH,SAAS,GAAG;;AAKhB;AAEO,MAAMA,iCAAiCN,kBAE5C;AAuBK,MAAMO,+BAA+BT;IAGxC,wBAAwB;QACpB,OAAOU;IACX;;QALG,qBACH,SAAS,GAAG;;AAKhB;AAEO,MAAMA,gCAAgCR,kBAE3C;AAmBK,MAAMS,+BAA+BX;IAGxC,wBAAwB;QACpB,OAAOY;IACX;;QALG,qBACH,SAAS,GAAG;;AAKhB;AAEO,MAAMA,gCAAgCV,kBAE3C"}
|
package/features/ai/feature.js
CHANGED
|
@@ -1,16 +1,31 @@
|
|
|
1
1
|
import { createFeature } from "@webiny/feature/api";
|
|
2
2
|
import { OpenAiSdkFactory } from "./OpenAiSdkFactory.js";
|
|
3
3
|
import { AnthropicSdkFactory } from "./AnthropicSdkFactory.js";
|
|
4
|
+
import { GoogleSdkFactory } from "./GoogleSdkFactory.js";
|
|
4
5
|
import { Ai } from "./Ai.js";
|
|
6
|
+
import { AiModelRegistry } from "./AiModelRegistry.js";
|
|
7
|
+
import { RemoteAiModelCatalog } from "./RemoteAiModelCatalog.js";
|
|
5
8
|
import { AiSdkTools } from "./AiSdkTools.js";
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
9
|
+
import { AiSdkToolHandlerResolver } from "./AiSdkToolHandlerResolver.js";
|
|
10
|
+
import { AiOutputToolRegistry } from "./toolPipeline/AiOutputToolRegistry.js";
|
|
11
|
+
import { AiToolPipelineRunner } from "./toolPipeline/AiToolPipelineRunner.js";
|
|
12
|
+
import { DefaultTextExtractor } from "./TextExtractor/DefaultTextExtractor.js";
|
|
13
|
+
const AiFeature = createFeature({
|
|
14
|
+
name: "AiFeature",
|
|
15
|
+
register (container) {
|
|
16
|
+
container.register(OpenAiSdkFactory);
|
|
17
|
+
container.register(AnthropicSdkFactory);
|
|
18
|
+
container.register(GoogleSdkFactory);
|
|
19
|
+
container.register(Ai);
|
|
20
|
+
container.register(RemoteAiModelCatalog);
|
|
21
|
+
container.register(AiModelRegistry);
|
|
22
|
+
container.register(AiSdkTools);
|
|
23
|
+
container.register(AiSdkToolHandlerResolver);
|
|
24
|
+
container.register(AiOutputToolRegistry);
|
|
25
|
+
container.register(AiToolPipelineRunner);
|
|
26
|
+
container.register(DefaultTextExtractor);
|
|
27
|
+
}
|
|
14
28
|
});
|
|
29
|
+
export { AiFeature };
|
|
15
30
|
|
|
16
31
|
//# sourceMappingURL=feature.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"
|
|
1
|
+
{"version":3,"file":"features/ai/feature.js","sources":["../../../src/features/ai/feature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { OpenAiSdkFactory } from \"./OpenAiSdkFactory.js\";\nimport { AnthropicSdkFactory } from \"./AnthropicSdkFactory.js\";\nimport { GoogleSdkFactory } from \"./GoogleSdkFactory.js\";\nimport { Ai } from \"./Ai.js\";\nimport { AiModelRegistry } from \"./AiModelRegistry.js\";\nimport { RemoteAiModelCatalog } from \"./RemoteAiModelCatalog.js\";\nimport { AiSdkTools } from \"./AiSdkTools.js\";\nimport { AiSdkToolHandlerResolver } from \"./AiSdkToolHandlerResolver.js\";\nimport { AiOutputToolRegistry } from \"./toolPipeline/AiOutputToolRegistry.js\";\nimport { AiToolPipelineRunner } from \"./toolPipeline/AiToolPipelineRunner.js\";\nimport { DefaultTextExtractor } from \"./TextExtractor/DefaultTextExtractor.js\";\n\nexport const AiFeature = createFeature({\n name: \"AiFeature\",\n register(container) {\n container.register(OpenAiSdkFactory);\n container.register(AnthropicSdkFactory);\n container.register(GoogleSdkFactory);\n container.register(Ai);\n container.register(RemoteAiModelCatalog);\n container.register(AiModelRegistry);\n container.register(AiSdkTools);\n container.register(AiSdkToolHandlerResolver);\n container.register(AiOutputToolRegistry);\n container.register(AiToolPipelineRunner);\n container.register(DefaultTextExtractor);\n }\n});\n"],"names":["AiFeature","createFeature","container","OpenAiSdkFactory","AnthropicSdkFactory","GoogleSdkFactory","Ai","RemoteAiModelCatalog","AiModelRegistry","AiSdkTools","AiSdkToolHandlerResolver","AiOutputToolRegistry","AiToolPipelineRunner","DefaultTextExtractor"],"mappings":";;;;;;;;;;;;AAaO,MAAMA,YAAYC,cAAc;IACnC,MAAM;IACN,UAASC,SAAS;QACdA,UAAU,QAAQ,CAACC;QACnBD,UAAU,QAAQ,CAACE;QACnBF,UAAU,QAAQ,CAACG;QACnBH,UAAU,QAAQ,CAACI;QACnBJ,UAAU,QAAQ,CAACK;QACnBL,UAAU,QAAQ,CAACM;QACnBN,UAAU,QAAQ,CAACO;QACnBP,UAAU,QAAQ,CAACQ;QACnBR,UAAU,QAAQ,CAACS;QACnBT,UAAU,QAAQ,CAACU;QACnBV,UAAU,QAAQ,CAACW;IACvB;AACJ"}
|
package/features/ai/index.d.ts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
-
export { AiSdk, AiSdkFactory, AiConnectionFactory, Ai,
|
|
2
|
-
export type { IAiConnection, IAiConnectionInline, AiModel, IAiSdkModel
|
|
1
|
+
export { AiSdk, AiSdkFactory, AiConnectionFactory, Ai, AiModelRegistry, AiModelCatalog, AiSdkToolDefinition, AiSdkToolHandler, AiSdkToolHandlerResolver, AiSdkTools } from "./abstractions.js";
|
|
2
|
+
export type { IAiConnection, IAiConnectionInline, AiModel, IAiSdkModel } from "./abstractions.js";
|
|
3
|
+
export { AiOutputTool, AiOutputToolRegistry, AiToolPipelineRunner } from "./toolPipeline/index.js";
|
|
4
|
+
export { TextExtractor, DefaultTextExtractor } from "./TextExtractor/index.js";
|
|
5
|
+
export { AiBeforeGenerateTextEvent, AiBeforeGenerateTextEventHandler, AiAfterGenerateTextEvent, AiAfterGenerateTextEventHandler, AiGenerateTextErrorEvent, AiGenerateTextErrorEventHandler, AiBeforeStreamTextEvent, AiBeforeStreamTextEventHandler, AiAfterStreamTextEvent, AiAfterStreamTextEventHandler, AiStreamTextErrorEvent, AiStreamTextErrorEventHandler } from "./events.js";
|
|
6
|
+
export type { AiBeforeGenerateTextPayload, AiAfterGenerateTextPayload, AiGenerateTextErrorPayload, AiBeforeStreamTextPayload, AiAfterStreamTextPayload, AiStreamTextErrorPayload } from "./events.js";
|
|
3
7
|
export { AiFeature } from "./feature.js";
|
package/features/ai/index.js
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
|
-
export { AiSdk, AiSdkFactory,
|
|
1
|
+
export { Ai, AiConnectionFactory, AiModelCatalog, AiModelRegistry, AiSdk, AiSdkFactory, AiSdkToolDefinition, AiSdkToolHandler, AiSdkToolHandlerResolver, AiSdkTools } from "./abstractions.js";
|
|
2
|
+
export { AiOutputTool, AiOutputToolRegistry, AiToolPipelineRunner } from "./toolPipeline/index.js";
|
|
3
|
+
export { DefaultTextExtractor, TextExtractor } from "./TextExtractor/index.js";
|
|
4
|
+
export { AiAfterGenerateTextEvent, AiAfterGenerateTextEventHandler, AiAfterStreamTextEvent, AiAfterStreamTextEventHandler, AiBeforeGenerateTextEvent, AiBeforeGenerateTextEventHandler, AiBeforeStreamTextEvent, AiBeforeStreamTextEventHandler, AiGenerateTextErrorEvent, AiGenerateTextErrorEventHandler, AiStreamTextErrorEvent, AiStreamTextErrorEventHandler } from "./events.js";
|
|
2
5
|
export { AiFeature } from "./feature.js";
|
|
3
|
-
|
|
4
|
-
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
import { type IAiOutputTool, type IAiOutputToolRegistry } from "./abstractions.js";
|
|
2
|
+
declare class AiOutputToolRegistryImpl implements IAiOutputToolRegistry {
|
|
3
|
+
private toolMap;
|
|
4
|
+
constructor(tools: IAiOutputTool[]);
|
|
5
|
+
has(name: string): boolean;
|
|
6
|
+
invoke(name: string, params: Record<string, unknown>): Promise<unknown>;
|
|
7
|
+
}
|
|
8
|
+
export declare const AiOutputToolRegistry: typeof AiOutputToolRegistryImpl & {
|
|
9
|
+
__abstraction: import("@webiny/di").Abstraction<IAiOutputToolRegistry>;
|
|
10
|
+
};
|
|
11
|
+
export {};
|