@webiny/api-core 0.0.0-unstable.e2758ee1cf → 0.0.0-unstable.e6f0dc8ca7
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 +5 -1
- package/ApiCoreFeature.js +6 -0
- package/ApiCoreFeature.js.map +1 -1
- package/createApiCore.d.ts +1 -1
- package/createApiCore.js +2 -3
- package/createApiCore.js.map +1 -1
- package/domain/security/ApiToken.d.ts +1 -0
- package/domain/security/ApiToken.js +1 -0
- package/domain/security/ApiToken.js.map +1 -1
- package/exports/api/build-params.d.ts +1 -0
- package/exports/api/build-params.js +1 -0
- package/exports/api/build-params.js.map +1 -1
- package/exports/api/event-publisher.d.ts +1 -0
- package/exports/api/event-publisher.js +1 -0
- package/exports/api/event-publisher.js.map +1 -1
- package/exports/api/key-value-store.d.ts +1 -0
- package/exports/api/key-value-store.js +1 -0
- package/exports/api/key-value-store.js.map +1 -1
- package/exports/api/logger.d.ts +1 -0
- package/exports/api/logger.js +1 -0
- package/exports/api/logger.js.map +1 -1
- package/exports/api/security/api-key.d.ts +3 -3
- package/exports/api/security/api-key.js +3 -3
- package/exports/api/security/api-key.js.map +1 -1
- package/exports/api/security/authentication.d.ts +1 -1
- package/exports/api/security/authentication.js +1 -1
- package/exports/api/security/authentication.js.map +1 -1
- package/exports/api/security/role.d.ts +3 -3
- package/exports/api/security/role.js +3 -3
- package/exports/api/security/role.js.map +1 -1
- package/exports/api/security/user.d.ts +3 -3
- package/exports/api/security/user.js +3 -3
- package/exports/api/security/user.js.map +1 -1
- package/exports/api/security.d.ts +6 -0
- package/exports/api/security.js +5 -0
- package/exports/api/security.js.map +1 -1
- package/exports/api/system.d.ts +1 -1
- package/exports/api/system.js +1 -1
- package/exports/api/system.js.map +1 -1
- package/exports/api/tenancy.d.ts +4 -4
- package/exports/api/tenancy.js +4 -4
- package/exports/api/tenancy.js.map +1 -1
- package/exports/api.d.ts +7 -0
- package/exports/api.js +8 -0
- package/exports/api.js.map +1 -0
- package/features/ai/Ai.d.ts +26 -0
- package/features/ai/Ai.js +133 -0
- package/features/ai/Ai.js.map +1 -0
- package/features/ai/AiSdkTools.d.ts +11 -0
- package/features/ai/AiSdkTools.js +25 -0
- package/features/ai/AiSdkTools.js.map +1 -0
- package/features/ai/AnthropicSdkFactory.d.ts +10 -0
- package/features/ai/AnthropicSdkFactory.js +71 -0
- package/features/ai/AnthropicSdkFactory.js.map +1 -0
- package/features/ai/OpenAiSdkFactory.d.ts +10 -0
- package/features/ai/OpenAiSdkFactory.js +187 -0
- package/features/ai/OpenAiSdkFactory.js.map +1 -0
- package/features/ai/abstractions.d.ts +92 -0
- package/features/ai/abstractions.js +35 -0
- package/features/ai/abstractions.js.map +1 -0
- package/features/ai/feature.d.ts +4 -0
- package/features/ai/feature.js +16 -0
- package/features/ai/feature.js.map +1 -0
- package/features/ai/index.d.ts +3 -0
- package/features/ai/index.js +4 -0
- package/features/ai/index.js.map +1 -0
- package/features/buildParams/abstractions.d.ts +2 -0
- package/features/buildParams/abstractions.js +2 -0
- package/features/buildParams/abstractions.js.map +1 -1
- package/features/buildParams/feature.d.ts +5 -1
- package/features/encryption/EncryptionService.d.ts +10 -0
- package/features/encryption/EncryptionService.js +58 -0
- package/features/encryption/EncryptionService.js.map +1 -0
- package/features/encryption/abstractions.d.ts +9 -0
- package/features/encryption/abstractions.js +5 -0
- package/features/encryption/abstractions.js.map +1 -0
- package/features/encryption/feature.d.ts +4 -0
- package/features/encryption/feature.js +10 -0
- package/features/encryption/feature.js.map +1 -0
- package/features/encryption/index.d.ts +1 -0
- package/features/encryption/index.js +3 -0
- package/features/encryption/index.js.map +1 -0
- package/features/eventPublisher/abstractions.d.ts +2 -0
- package/features/eventPublisher/abstractions.js +3 -0
- package/features/eventPublisher/abstractions.js.map +1 -1
- package/features/eventPublisher/feature.d.ts +5 -1
- package/features/featureFlags/feature.d.ts +5 -1
- package/features/keyValueStore/GlobalKeyValueStore.js +3 -1
- package/features/keyValueStore/GlobalKeyValueStore.js.map +1 -1
- package/features/keyValueStore/KeyValueStoreRepository.d.ts +2 -2
- package/features/keyValueStore/KeyValueStoreRepository.js +2 -2
- package/features/keyValueStore/KeyValueStoreRepository.js.map +1 -1
- package/features/keyValueStore/abstractions.d.ts +10 -2
- package/features/keyValueStore/abstractions.js +4 -0
- package/features/keyValueStore/abstractions.js.map +1 -1
- package/features/keyValueStore/feature.d.ts +4 -1
- package/features/keyValueStore/feature.js.map +1 -1
- package/features/logger/abstractions.d.ts +1 -0
- package/features/logger/abstractions.js +1 -0
- package/features/logger/abstractions.js.map +1 -1
- package/features/logger/feature.d.ts +4 -1
- package/features/masker/Masker.d.ts +8 -0
- package/features/masker/Masker.js +21 -0
- package/features/masker/Masker.js.map +1 -0
- package/features/masker/abstractions.d.ts +11 -0
- package/features/masker/abstractions.js +4 -0
- package/features/masker/abstractions.js.map +1 -0
- package/features/masker/feature.d.ts +4 -0
- package/features/masker/feature.js +10 -0
- package/features/masker/feature.js.map +1 -0
- package/features/masker/index.d.ts +1 -0
- package/features/masker/index.js +3 -0
- package/features/masker/index.js.map +1 -0
- package/features/security/IdentityContext/abstractions.d.ts +1 -0
- package/features/security/IdentityContext/abstractions.js +1 -0
- package/features/security/IdentityContext/abstractions.js.map +1 -1
- package/features/security/IdentityContext/feature.d.ts +4 -1
- package/features/security/SecurityFeature.d.ts +5 -1
- package/features/security/apiKeys/CreateApiKey/CreateApiKeyUseCase.js +1 -1
- package/features/security/apiKeys/CreateApiKey/CreateApiKeyUseCase.js.map +1 -1
- package/features/security/apiKeys/CreateApiKey/abstractions.d.ts +1 -0
- package/features/security/apiKeys/CreateApiKey/abstractions.js +1 -0
- package/features/security/apiKeys/CreateApiKey/abstractions.js.map +1 -1
- package/features/security/apiKeys/CreateApiKey/events.d.ts +6 -4
- package/features/security/apiKeys/CreateApiKey/events.js +8 -4
- package/features/security/apiKeys/CreateApiKey/events.js.map +1 -1
- package/features/security/apiKeys/CreateApiKey/feature.d.ts +4 -1
- package/features/security/apiKeys/DeleteApiKey/abstractions.d.ts +1 -0
- package/features/security/apiKeys/DeleteApiKey/abstractions.js +1 -0
- package/features/security/apiKeys/DeleteApiKey/abstractions.js.map +1 -1
- package/features/security/apiKeys/DeleteApiKey/events.d.ts +6 -4
- package/features/security/apiKeys/DeleteApiKey/events.js +8 -4
- package/features/security/apiKeys/DeleteApiKey/events.js.map +1 -1
- package/features/security/apiKeys/DeleteApiKey/feature.d.ts +4 -1
- package/features/security/apiKeys/GetApiKey/abstractions.d.ts +1 -0
- package/features/security/apiKeys/GetApiKey/abstractions.js +1 -0
- package/features/security/apiKeys/GetApiKey/abstractions.js.map +1 -1
- package/features/security/apiKeys/GetApiKey/feature.d.ts +4 -1
- package/features/security/apiKeys/GetApiKeyBySlug/abstractions.d.ts +1 -0
- package/features/security/apiKeys/GetApiKeyBySlug/abstractions.js +1 -0
- package/features/security/apiKeys/GetApiKeyBySlug/abstractions.js.map +1 -1
- package/features/security/apiKeys/GetApiKeyBySlug/feature.d.ts +4 -1
- package/features/security/apiKeys/GetApiKeyByToken/abstractions.d.ts +1 -0
- package/features/security/apiKeys/GetApiKeyByToken/abstractions.js +1 -0
- package/features/security/apiKeys/GetApiKeyByToken/abstractions.js.map +1 -1
- package/features/security/apiKeys/GetApiKeyByToken/feature.d.ts +4 -1
- package/features/security/apiKeys/ListApiKeys/ListApiKeysUseCase.js +1 -1
- package/features/security/apiKeys/ListApiKeys/ListApiKeysUseCase.js.map +1 -1
- package/features/security/apiKeys/ListApiKeys/abstractions.d.ts +1 -0
- package/features/security/apiKeys/ListApiKeys/abstractions.js +1 -0
- package/features/security/apiKeys/ListApiKeys/abstractions.js.map +1 -1
- package/features/security/apiKeys/ListApiKeys/feature.d.ts +4 -1
- package/features/security/apiKeys/UpdateApiKey/UpdateApiKeyUseCase.js +1 -1
- package/features/security/apiKeys/UpdateApiKey/UpdateApiKeyUseCase.js.map +1 -1
- package/features/security/apiKeys/UpdateApiKey/abstractions.d.ts +1 -0
- package/features/security/apiKeys/UpdateApiKey/abstractions.js +1 -0
- package/features/security/apiKeys/UpdateApiKey/abstractions.js.map +1 -1
- package/features/security/apiKeys/UpdateApiKey/events.d.ts +6 -4
- package/features/security/apiKeys/UpdateApiKey/events.js +8 -4
- package/features/security/apiKeys/UpdateApiKey/events.js.map +1 -1
- package/features/security/apiKeys/UpdateApiKey/feature.d.ts +4 -1
- package/features/security/apiKeys/feature.d.ts +4 -1
- package/features/security/apiKeys/shared/abstractions.d.ts +5 -2
- package/features/security/apiKeys/shared/abstractions.js +3 -0
- package/features/security/apiKeys/shared/abstractions.js.map +1 -1
- package/features/security/apiKeys/shared/schemas.d.ts +10 -71
- package/features/security/apiKeys/shared/schemas.js +4 -4
- package/features/security/apiKeys/shared/schemas.js.map +1 -1
- package/features/security/authentication/AuthenticationContext/SetIdTokenCookie.d.ts +2 -2
- package/features/security/authentication/AuthenticationContext/SetIdTokenCookie.js +2 -2
- package/features/security/authentication/AuthenticationContext/SetIdTokenCookie.js.map +1 -1
- package/features/security/authentication/AuthenticationContext/abstractions.d.ts +1 -0
- package/features/security/authentication/AuthenticationContext/abstractions.js +1 -0
- package/features/security/authentication/AuthenticationContext/abstractions.js.map +1 -1
- package/features/security/authentication/AuthenticationContext/events.d.ts +6 -4
- package/features/security/authentication/AuthenticationContext/events.js +8 -4
- package/features/security/authentication/AuthenticationContext/events.js.map +1 -1
- package/features/security/authentication/AuthenticationContext/feature.d.ts +4 -1
- package/features/security/authentication/Authenticator/abstractions.d.ts +1 -0
- package/features/security/authentication/Authenticator/abstractions.js +1 -0
- package/features/security/authentication/Authenticator/abstractions.js.map +1 -1
- package/features/security/authorization/AuthorizationContext/AuthorizationContext.d.ts +1 -0
- package/features/security/authorization/AuthorizationContext/AuthorizationContext.js +14 -2
- package/features/security/authorization/AuthorizationContext/AuthorizationContext.js.map +1 -1
- package/features/security/authorization/AuthorizationContext/abstractions.d.ts +2 -0
- package/features/security/authorization/AuthorizationContext/abstractions.js +2 -0
- package/features/security/authorization/AuthorizationContext/abstractions.js.map +1 -1
- package/features/security/authorization/AuthorizationContext/feature.d.ts +4 -1
- package/features/security/authorization/Authorizer/abstractions.d.ts +1 -0
- package/features/security/authorization/Authorizer/abstractions.js +1 -0
- package/features/security/authorization/Authorizer/abstractions.js.map +1 -1
- package/features/security/authorization/GroupsTeamsAuthorizer/feature.d.ts +4 -1
- package/features/security/login/abstractions.d.ts +3 -2
- package/features/security/login/abstractions.js +4 -2
- package/features/security/login/abstractions.js.map +1 -1
- package/features/security/permissions/createPermissionSchema.d.ts +2 -0
- package/features/security/permissions/createPermissionSchema.js +8 -0
- package/features/security/permissions/createPermissionSchema.js.map +1 -0
- package/features/security/permissions/createPermissions.d.ts +5 -5
- package/features/security/permissions/createPermissions.js +198 -188
- package/features/security/permissions/createPermissions.js.map +1 -1
- package/features/security/permissions/index.d.ts +2 -1
- package/features/security/permissions/index.js +2 -1
- package/features/security/permissions/index.js.map +1 -1
- package/features/security/roles/CreateRole/CreateRoleUseCase.d.ts +1 -3
- package/features/security/roles/CreateRole/CreateRoleUseCase.js +3 -7
- package/features/security/roles/CreateRole/CreateRoleUseCase.js.map +1 -1
- package/features/security/roles/CreateRole/abstractions.d.ts +1 -0
- package/features/security/roles/CreateRole/abstractions.js +1 -0
- package/features/security/roles/CreateRole/abstractions.js.map +1 -1
- package/features/security/roles/CreateRole/events.d.ts +6 -4
- package/features/security/roles/CreateRole/events.js +8 -4
- package/features/security/roles/CreateRole/events.js.map +1 -1
- package/features/security/roles/CreateRole/feature.d.ts +4 -1
- package/features/security/roles/CreateRole/schema.d.ts +2 -20
- package/features/security/roles/CreateRole/schema.js +2 -2
- package/features/security/roles/CreateRole/schema.js.map +1 -1
- package/features/security/roles/DeleteRole/abstractions.d.ts +1 -0
- package/features/security/roles/DeleteRole/abstractions.js +1 -0
- package/features/security/roles/DeleteRole/abstractions.js.map +1 -1
- package/features/security/roles/DeleteRole/events.d.ts +6 -4
- package/features/security/roles/DeleteRole/events.js +8 -4
- package/features/security/roles/DeleteRole/events.js.map +1 -1
- package/features/security/roles/DeleteRole/feature.d.ts +4 -1
- package/features/security/roles/GetRole/abstractions.d.ts +1 -0
- package/features/security/roles/GetRole/abstractions.js +1 -0
- package/features/security/roles/GetRole/abstractions.js.map +1 -1
- package/features/security/roles/GetRole/feature.d.ts +4 -1
- package/features/security/roles/ListRoles/abstractions.d.ts +1 -0
- package/features/security/roles/ListRoles/abstractions.js +1 -0
- package/features/security/roles/ListRoles/abstractions.js.map +1 -1
- package/features/security/roles/ListRoles/feature.d.ts +4 -1
- package/features/security/roles/UpdateRole/UpdateRoleUseCase.js +1 -1
- package/features/security/roles/UpdateRole/UpdateRoleUseCase.js.map +1 -1
- package/features/security/roles/UpdateRole/abstractions.d.ts +1 -0
- package/features/security/roles/UpdateRole/abstractions.js +1 -0
- package/features/security/roles/UpdateRole/abstractions.js.map +1 -1
- package/features/security/roles/UpdateRole/events.d.ts +6 -4
- package/features/security/roles/UpdateRole/events.js +8 -4
- package/features/security/roles/UpdateRole/events.js.map +1 -1
- package/features/security/roles/UpdateRole/feature.d.ts +4 -1
- package/features/security/roles/UpdateRole/schema.d.ts +2 -18
- package/features/security/roles/UpdateRole/schema.js +2 -2
- package/features/security/roles/UpdateRole/schema.js.map +1 -1
- package/features/security/roles/feature.d.ts +4 -1
- package/features/security/roles/feature.js +2 -0
- package/features/security/roles/feature.js.map +1 -1
- package/features/security/roles/shared/RoleProvider.d.ts +13 -0
- package/features/security/roles/shared/RoleProvider.js +29 -0
- package/features/security/roles/shared/RoleProvider.js.map +1 -0
- package/features/security/roles/shared/RolesRepository.d.ts +3 -1
- package/features/security/roles/shared/RolesRepository.js +19 -18
- package/features/security/roles/shared/RolesRepository.js.map +1 -1
- package/features/security/roles/shared/abstractions.d.ts +19 -0
- package/features/security/roles/shared/abstractions.js +3 -0
- package/features/security/roles/shared/abstractions.js.map +1 -1
- package/features/security/shared/abstractions.d.ts +5 -14
- package/features/security/shared/abstractions.js +3 -16
- package/features/security/shared/abstractions.js.map +1 -1
- package/features/security/teams/CreateTeam/CreateTeamUseCase.d.ts +1 -3
- package/features/security/teams/CreateTeam/CreateTeamUseCase.js +3 -7
- package/features/security/teams/CreateTeam/CreateTeamUseCase.js.map +1 -1
- package/features/security/teams/CreateTeam/abstractions.d.ts +1 -0
- package/features/security/teams/CreateTeam/abstractions.js +1 -0
- package/features/security/teams/CreateTeam/abstractions.js.map +1 -1
- package/features/security/teams/CreateTeam/events.d.ts +6 -4
- package/features/security/teams/CreateTeam/events.js +8 -4
- package/features/security/teams/CreateTeam/events.js.map +1 -1
- package/features/security/teams/CreateTeam/feature.d.ts +4 -1
- package/features/security/teams/CreateTeam/index.d.ts +1 -1
- package/features/security/teams/CreateTeam/index.js +1 -1
- package/features/security/teams/CreateTeam/index.js.map +1 -1
- package/features/security/teams/CreateTeam/schema.d.ts +2 -12
- package/features/security/teams/DeleteTeam/abstractions.d.ts +1 -0
- package/features/security/teams/DeleteTeam/abstractions.js +1 -0
- package/features/security/teams/DeleteTeam/abstractions.js.map +1 -1
- package/features/security/teams/DeleteTeam/events.d.ts +6 -4
- package/features/security/teams/DeleteTeam/events.js +8 -4
- package/features/security/teams/DeleteTeam/events.js.map +1 -1
- package/features/security/teams/DeleteTeam/feature.d.ts +4 -1
- package/features/security/teams/GetTeam/abstractions.d.ts +1 -0
- package/features/security/teams/GetTeam/abstractions.js +1 -0
- package/features/security/teams/GetTeam/abstractions.js.map +1 -1
- package/features/security/teams/GetTeam/feature.d.ts +4 -1
- package/features/security/teams/ListTeams/abstractions.d.ts +1 -0
- package/features/security/teams/ListTeams/abstractions.js +1 -0
- package/features/security/teams/ListTeams/abstractions.js.map +1 -1
- package/features/security/teams/ListTeams/feature.d.ts +4 -1
- package/features/security/teams/UpdateTeam/UpdateTeamUseCase.js +1 -1
- package/features/security/teams/UpdateTeam/UpdateTeamUseCase.js.map +1 -1
- package/features/security/teams/UpdateTeam/abstractions.d.ts +1 -0
- package/features/security/teams/UpdateTeam/abstractions.js +1 -0
- package/features/security/teams/UpdateTeam/abstractions.js.map +1 -1
- package/features/security/teams/UpdateTeam/events.d.ts +6 -4
- package/features/security/teams/UpdateTeam/events.js +8 -4
- package/features/security/teams/UpdateTeam/events.js.map +1 -1
- package/features/security/teams/UpdateTeam/feature.d.ts +4 -1
- package/features/security/teams/UpdateTeam/schema.d.ts +2 -10
- package/features/security/teams/feature.d.ts +4 -1
- package/features/security/teams/feature.js +6 -0
- package/features/security/teams/feature.js.map +1 -1
- package/features/security/teams/shared/TeamProvider.d.ts +13 -0
- package/features/security/teams/shared/TeamProvider.js +29 -0
- package/features/security/teams/shared/TeamProvider.js.map +1 -0
- package/features/security/teams/shared/TeamsRepository.js +20 -18
- package/features/security/teams/shared/TeamsRepository.js.map +1 -1
- package/features/security/teams/shared/abstractions.d.ts +18 -0
- package/features/security/teams/shared/abstractions.js +3 -0
- package/features/security/teams/shared/abstractions.js.map +1 -1
- package/features/security/teams/shared/decorators/TeamsRepositoryCachingDecorator.d.ts +17 -0
- package/features/security/teams/shared/decorators/TeamsRepositoryCachingDecorator.js +76 -0
- package/features/security/teams/shared/decorators/TeamsRepositoryCachingDecorator.js.map +1 -0
- package/features/security/utils/verifyJwtUsingJwk.d.ts +2 -4
- package/features/security/utils/verifyJwtUsingJwk.js +1 -1
- package/features/security/utils/verifyJwtUsingJwk.js.map +1 -1
- package/features/system/InstallSystem/abstractions.d.ts +4 -5
- package/features/system/InstallSystem/abstractions.js +3 -4
- package/features/system/InstallSystem/abstractions.js.map +1 -1
- package/features/system/InstallSystem/events.js +2 -2
- package/features/system/InstallSystem/events.js.map +1 -1
- package/features/system/InstallSystem/feature.d.ts +5 -1
- package/features/system/InstallSystem/index.d.ts +1 -1
- package/features/system/InstallSystem/index.js +1 -1
- package/features/system/InstallSystem/index.js.map +1 -1
- package/features/system/SystemFeature.d.ts +4 -1
- package/features/task/TaskController/abstractions.d.ts +1 -0
- package/features/task/TaskController/abstractions.js +1 -0
- package/features/task/TaskController/abstractions.js.map +1 -1
- package/features/task/TaskDefinition/abstractions.d.ts +7 -1
- package/features/task/TaskDefinition/abstractions.js +1 -0
- package/features/task/TaskDefinition/abstractions.js.map +1 -1
- package/features/task/TaskService/abstractions.d.ts +1 -0
- package/features/task/TaskService/abstractions.js +1 -0
- package/features/task/TaskService/abstractions.js.map +1 -1
- package/features/tenancy/CreateTenant/abstractions.d.ts +9 -7
- package/features/tenancy/CreateTenant/abstractions.js +7 -5
- package/features/tenancy/CreateTenant/abstractions.js.map +1 -1
- package/features/tenancy/CreateTenant/events.js +3 -3
- package/features/tenancy/CreateTenant/events.js.map +1 -1
- package/features/tenancy/CreateTenant/feature.d.ts +5 -1
- package/features/tenancy/CreateTenant/index.d.ts +1 -1
- package/features/tenancy/CreateTenant/index.js +1 -1
- package/features/tenancy/CreateTenant/index.js.map +1 -1
- package/features/tenancy/DeleteTenant/abstractions.d.ts +9 -4
- package/features/tenancy/DeleteTenant/abstractions.js +7 -2
- package/features/tenancy/DeleteTenant/abstractions.js.map +1 -1
- package/features/tenancy/DeleteTenant/events.js +3 -3
- package/features/tenancy/DeleteTenant/events.js.map +1 -1
- package/features/tenancy/DeleteTenant/feature.d.ts +5 -1
- package/features/tenancy/DeleteTenant/index.d.ts +1 -1
- package/features/tenancy/DeleteTenant/index.js +1 -1
- package/features/tenancy/DeleteTenant/index.js.map +1 -1
- package/features/tenancy/GetRootTenant/feature.d.ts +5 -1
- package/features/tenancy/GetTenantById/abstractions.d.ts +3 -0
- package/features/tenancy/GetTenantById/abstractions.js +3 -9
- package/features/tenancy/GetTenantById/abstractions.js.map +1 -1
- package/features/tenancy/GetTenantById/feature.d.ts +5 -1
- package/features/tenancy/InstallTenant/abstractions.d.ts +5 -11
- package/features/tenancy/InstallTenant/abstractions.js +4 -13
- package/features/tenancy/InstallTenant/abstractions.js.map +1 -1
- package/features/tenancy/InstallTenant/events.js +2 -2
- package/features/tenancy/InstallTenant/events.js.map +1 -1
- package/features/tenancy/InstallTenant/feature.d.ts +5 -1
- package/features/tenancy/InstallTenant/index.d.ts +1 -1
- package/features/tenancy/InstallTenant/index.js +1 -1
- package/features/tenancy/InstallTenant/index.js.map +1 -1
- package/features/tenancy/ListTenants/feature.d.ts +5 -1
- package/features/tenancy/TenancyFeature.d.ts +4 -1
- package/features/tenancy/TenancyFeature.js.map +1 -1
- package/features/tenancy/TenantContext/abstractions.d.ts +1 -0
- package/features/tenancy/TenantContext/abstractions.js +1 -0
- package/features/tenancy/TenantContext/abstractions.js.map +1 -1
- package/features/tenancy/TenantContext/feature.d.ts +4 -1
- package/features/tenancy/UpdateTenant/abstractions.d.ts +9 -4
- package/features/tenancy/UpdateTenant/abstractions.js +7 -2
- package/features/tenancy/UpdateTenant/abstractions.js.map +1 -1
- package/features/tenancy/UpdateTenant/events.js +3 -3
- package/features/tenancy/UpdateTenant/events.js.map +1 -1
- package/features/tenancy/UpdateTenant/feature.d.ts +5 -1
- package/features/tenancy/UpdateTenant/index.d.ts +1 -1
- package/features/tenancy/UpdateTenant/index.js +1 -1
- package/features/tenancy/UpdateTenant/index.js.map +1 -1
- package/features/users/AdminUsersFeature.d.ts +4 -1
- package/features/users/AdminUsersFeature.js.map +1 -1
- package/features/users/CreateUser/CreateUserUseCase.js +1 -1
- package/features/users/CreateUser/CreateUserUseCase.js.map +1 -1
- package/features/users/CreateUser/abstractions.d.ts +1 -0
- package/features/users/CreateUser/abstractions.js +1 -1
- package/features/users/CreateUser/abstractions.js.map +1 -1
- package/features/users/CreateUser/events.d.ts +6 -4
- package/features/users/CreateUser/events.js +8 -4
- package/features/users/CreateUser/events.js.map +1 -1
- package/features/users/CreateUser/feature.d.ts +4 -1
- package/features/users/CreateUser/schema.d.ts +4 -36
- package/features/users/DeleteUser/abstractions.d.ts +1 -0
- package/features/users/DeleteUser/abstractions.js +1 -1
- package/features/users/DeleteUser/abstractions.js.map +1 -1
- package/features/users/DeleteUser/events.d.ts +6 -4
- package/features/users/DeleteUser/events.js +8 -4
- package/features/users/DeleteUser/events.js.map +1 -1
- package/features/users/DeleteUser/feature.d.ts +4 -1
- package/features/users/ExternalIdpUserSync/ExternalIdpUserSyncHandler.d.ts +3 -3
- package/features/users/ExternalIdpUserSync/ExternalIdpUserSyncHandler.js +2 -2
- package/features/users/ExternalIdpUserSync/ExternalIdpUserSyncHandler.js.map +1 -1
- package/features/users/ExternalIdpUserSync/feature.d.ts +4 -1
- package/features/users/GetIdentityProfile/feature.d.ts +4 -1
- package/features/users/GetUser/abstractions.d.ts +1 -0
- package/features/users/GetUser/abstractions.js +1 -1
- package/features/users/GetUser/abstractions.js.map +1 -1
- package/features/users/GetUser/feature.d.ts +4 -1
- package/features/users/ListUserTeams/abstractions.d.ts +1 -0
- package/features/users/ListUserTeams/abstractions.js +1 -1
- package/features/users/ListUserTeams/abstractions.js.map +1 -1
- package/features/users/ListUserTeams/feature.d.ts +4 -1
- package/features/users/ListUsers/abstractions.d.ts +1 -0
- package/features/users/ListUsers/abstractions.js +1 -1
- package/features/users/ListUsers/abstractions.js.map +1 -1
- package/features/users/ListUsers/feature.d.ts +4 -1
- package/features/users/UpdateUser/UpdateUserUseCase.js +1 -1
- package/features/users/UpdateUser/UpdateUserUseCase.js.map +1 -1
- package/features/users/UpdateUser/abstractions.d.ts +1 -0
- package/features/users/UpdateUser/abstractions.js +1 -1
- package/features/users/UpdateUser/abstractions.js.map +1 -1
- package/features/users/UpdateUser/events.d.ts +6 -4
- package/features/users/UpdateUser/events.js +8 -4
- package/features/users/UpdateUser/events.js.map +1 -1
- package/features/users/UpdateUser/feature.d.ts +4 -1
- package/features/users/UpdateUser/schema.d.ts +4 -30
- package/features/users/shared/abstractions.d.ts +1 -0
- package/features/users/shared/abstractions.js +1 -1
- package/features/users/shared/abstractions.js.map +1 -1
- package/features/wcp/WcpContext/WcpContext.d.ts +3 -0
- package/features/wcp/WcpContext/WcpContext.js +9 -0
- package/features/wcp/WcpContext/WcpContext.js.map +1 -1
- package/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.d.ts +15 -0
- package/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.js +24 -3
- package/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.js.map +1 -1
- package/features/wcp/WcpContext/feature.d.ts +5 -1
- package/features/wcp/WcpFeature.d.ts +4 -1
- package/features/wcp/WcpFeature.js.map +1 -1
- package/graphql/security/NotAuthorizedResponse.d.ts +1 -0
- package/graphql/security/NotAuthorizedResponse.js +1 -0
- package/graphql/security/NotAuthorizedResponse.js.map +1 -1
- package/graphql/wcp/graphql.js +1 -0
- package/graphql/wcp/graphql.js.map +1 -1
- package/idp/abstractions.d.ts +4 -0
- package/idp/abstractions.js +4 -0
- package/idp/abstractions.js.map +1 -1
- package/idp/feature.d.ts +4 -1
- package/legacy/security/createSecurityContext.js +0 -11
- package/legacy/security/createSecurityContext.js.map +1 -1
- package/legacy/security/plugins/authenticateUsingHttpHeader.d.ts +1 -1
- package/legacy/wcp/LegacyWcpContext.d.ts +3 -0
- package/legacy/wcp/LegacyWcpContext.js +9 -0
- package/legacy/wcp/LegacyWcpContext.js.map +1 -1
- package/legacy/wcp/context.d.ts +1 -3
- package/legacy/wcp/context.js +4 -2
- package/legacy/wcp/context.js.map +1 -1
- package/models/base/BaseModel.js +2 -2
- package/models/base/BaseModel.js.map +1 -1
- package/models/base/ModelBuilder.d.ts +2 -2
- package/models/base/ModelBuilder.js +21 -2
- package/models/base/ModelBuilder.js.map +1 -1
- package/models/cms/FieldBuilder.d.ts +3 -2
- package/models/cms/FieldBuilder.js +12 -17
- package/models/cms/FieldBuilder.js.map +1 -1
- package/models/cms/FieldBuilderRegistry.d.ts +1 -1
- package/models/cms/FieldBuilderRegistry.js.map +1 -1
- package/models/cms/FieldDefinitionsBuilder.d.ts +1 -0
- package/models/cms/FieldDefinitionsBuilder.js +15 -17
- package/models/cms/FieldDefinitionsBuilder.js.map +1 -1
- package/models/cms/PrivateCmsModelBuilder.js +1 -1
- package/models/cms/PrivateCmsModelBuilder.js.map +1 -1
- package/models/cms/abstractions.d.ts +1 -1
- package/models/cms/abstractions.js.map +1 -1
- package/models/cms/fieldsBuilder.md +4 -2
- package/models/simple/Page/abstractions.d.ts +1 -11
- package/package.json +27 -68
- package/types/security.d.ts +13 -10
- package/types/security.js.map +1 -1
- package/features/security/shared/abstractions.ts.bak +0 -52
- package/legacy/security/plugins/SecurityRolePlugin.d.ts +0 -16
- package/legacy/security/plugins/SecurityRolePlugin.js +0 -33
- package/legacy/security/plugins/SecurityRolePlugin.js.map +0 -1
- package/legacy/security/plugins/SecurityTeamPlugin.d.ts +0 -16
- package/legacy/security/plugins/SecurityTeamPlugin.js +0 -33
- package/legacy/security/plugins/SecurityTeamPlugin.js.map +0 -1
|
@@ -17,6 +17,7 @@ export interface IAdminUsersRepository {
|
|
|
17
17
|
id: string;
|
|
18
18
|
}>): void;
|
|
19
19
|
}
|
|
20
|
+
/** Persist and retrieve admin users. */
|
|
20
21
|
export declare const AdminUsersRepository: import("@webiny/di").Abstraction<IAdminUsersRepository>;
|
|
21
22
|
export declare namespace AdminUsersRepository {
|
|
22
23
|
type Interface = IAdminUsersRepository;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createAbstraction","AdminUsersRepository"],"sources":["abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport { Result } from \"@webiny/feature/api\";\nimport type { AdminUser } from \"~/types/users.js\";\nimport type { GetUserInput, ListUsersInput } from \"./types.js\";\nimport { UserNotFoundError, UserStorageError } from \"./errors.js\";\n\n// Repository error interface\nexport interface IAdminUsersRepositoryErrors {\n base: UserNotFoundError | UserStorageError;\n}\n\nexport type RepositoryError = IAdminUsersRepositoryErrors[keyof IAdminUsersRepositoryErrors];\n\n// Repository interface\nexport interface IAdminUsersRepository {\n get(params: GetUserInput): Promise<Result<AdminUser, RepositoryError>>;\n list(params: ListUsersInput): Promise<Result<AdminUser[], RepositoryError>>;\n create(user: AdminUser): Promise<Result<AdminUser, RepositoryError>>;\n update(user: AdminUser): Promise<Result<AdminUser, RepositoryError>>;\n delete(user: AdminUser): Promise<Result<void, RepositoryError>>;\n clearCache(keys: Array<{ tenant: string; id: string }>): void;\n}\n\n
|
|
1
|
+
{"version":3,"names":["createAbstraction","AdminUsersRepository"],"sources":["abstractions.ts"],"sourcesContent":["import { createAbstraction } from \"@webiny/feature/api\";\nimport { Result } from \"@webiny/feature/api\";\nimport type { AdminUser } from \"~/types/users.js\";\nimport type { GetUserInput, ListUsersInput } from \"./types.js\";\nimport { UserNotFoundError, UserStorageError } from \"./errors.js\";\n\n// Repository error interface\nexport interface IAdminUsersRepositoryErrors {\n base: UserNotFoundError | UserStorageError;\n}\n\nexport type RepositoryError = IAdminUsersRepositoryErrors[keyof IAdminUsersRepositoryErrors];\n\n// Repository interface\nexport interface IAdminUsersRepository {\n get(params: GetUserInput): Promise<Result<AdminUser, RepositoryError>>;\n list(params: ListUsersInput): Promise<Result<AdminUser[], RepositoryError>>;\n create(user: AdminUser): Promise<Result<AdminUser, RepositoryError>>;\n update(user: AdminUser): Promise<Result<AdminUser, RepositoryError>>;\n delete(user: AdminUser): Promise<Result<void, RepositoryError>>;\n clearCache(keys: Array<{ tenant: string; id: string }>): void;\n}\n\n/** Persist and retrieve admin users. */\nexport const AdminUsersRepository =\n createAbstraction<IAdminUsersRepository>(\"AdminUsersRepository\");\n\n// Namespace exports\nexport namespace AdminUsersRepository {\n export type Interface = IAdminUsersRepository;\n export type Error = RepositoryError;\n}\n"],"mappings":"AAAA,SAASA,iBAAiB,QAAQ,qBAAqB;;AAMvD;;AAOA;;AAUA;AACA,OAAO,MAAMC,oBAAoB,GAC7BD,iBAAiB,CAAwB,sBAAsB,CAAC;;AAEpE","ignoreList":[]}
|
|
@@ -25,6 +25,9 @@ export declare class WcpContextImpl implements WcpContext.Interface {
|
|
|
25
25
|
canUseFileManagerThreatDetection(): boolean;
|
|
26
26
|
canUseWorkflows(): boolean;
|
|
27
27
|
canUseHcmsFieldPermissions(): boolean;
|
|
28
|
+
canUseAiImageEnrichment(): boolean;
|
|
29
|
+
canUseAiPageGeneration(): boolean;
|
|
30
|
+
canUseAiLexicalGeneration(): boolean;
|
|
28
31
|
ensureCanUseFeature(wcpFeatureId: keyof typeof WCP_FEATURE_LABEL): void;
|
|
29
32
|
incrementSeats(): Promise<void>;
|
|
30
33
|
decrementSeats(): Promise<void>;
|
|
@@ -102,6 +102,15 @@ export class WcpContextImpl {
|
|
|
102
102
|
canUseHcmsFieldPermissions() {
|
|
103
103
|
return this.license.canUseHcmsFieldPermissions();
|
|
104
104
|
}
|
|
105
|
+
canUseAiImageEnrichment() {
|
|
106
|
+
return this.license.canUseAiImageEnrichment();
|
|
107
|
+
}
|
|
108
|
+
canUseAiPageGeneration() {
|
|
109
|
+
return this.license.canUseAiPageGeneration();
|
|
110
|
+
}
|
|
111
|
+
canUseAiLexicalGeneration() {
|
|
112
|
+
return this.license.canUseAiLexicalGeneration();
|
|
113
|
+
}
|
|
105
114
|
ensureCanUseFeature(wcpFeatureId) {
|
|
106
115
|
if (this.license.canUseFeature(wcpFeatureId)) {
|
|
107
116
|
return;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["getWcpApiUrl","getWcpAppUrl","getWcpProjectEnvironment","WError","wcpFetch","wcpProjectEnvironment","WcpContextImpl","constructor","license","getWcpProjectUrl","path","orgId","org","id","projectId","project","url","filter","Boolean","join","updateSeats","operation","updateSeatsUrl","response","authorization","apiKey","body","meta","action","error","message","console","status","statusText","updateTenants","updateTenantsUrl","getRawLicense","getProject","getProjectWithFeatureFlags","getProjectEnvironment","getProjectLicense","canUseFeature","wcpFeatureId","canUseAacl","canUseTeams","canUseFolderLevelPermissions","canUsePrivateFiles","canUseAuditLogs","canUseRecordLocking","canUseFileManagerThreatDetection","canUseWorkflows","canUseHcmsFieldPermissions","ensureCanUseFeature","upgradeProjectLicenseLink","incrementSeats","decrementSeats","incrementTenants","decrementTenants","toDto"],"sources":["WcpContext.ts"],"sourcesContent":["import type { WCP_FEATURE_LABEL } from \"@webiny/wcp\";\nimport { getWcpApiUrl, getWcpAppUrl, getWcpProjectEnvironment } from \"@webiny/wcp\";\nimport WError from \"@webiny/error\";\nimport type {\n DecryptedWcpProjectLicense,\n ILicense,\n WcpProjectEnvironment,\n WcpProject\n} from \"@webiny/wcp/types.js\";\nimport { WcpContext } from \"./abstractions.js\";\nimport { wcpFetch } from \"./utils.js\";\n\nconst wcpProjectEnvironment = getWcpProjectEnvironment();\n\nexport interface CreateWcpContextParams {\n testProjectLicense?: DecryptedWcpProjectLicense;\n}\n\nexport class WcpContextImpl implements WcpContext.Interface {\n constructor(private license: ILicense) {}\n\n private getWcpProjectUrl(path = \"\"): string | null {\n if (!wcpProjectEnvironment) {\n return null;\n }\n\n const orgId = wcpProjectEnvironment.org.id;\n const projectId = wcpProjectEnvironment.project.id;\n const url = [\"/orgs\", orgId, \"projects\", projectId, path].filter(Boolean).join(\"/\");\n return getWcpApiUrl(url);\n }\n\n private async updateSeats(operation: \"increment\" | \"decrement\"): Promise<void> {\n if (!wcpProjectEnvironment) {\n return;\n }\n\n const updateSeatsUrl = this.getWcpProjectUrl(\"package/seats\");\n\n const response = await wcpFetch({\n url: updateSeatsUrl!,\n authorization: wcpProjectEnvironment.apiKey,\n body: { operation },\n meta: {\n action: operation + \"Seats\"\n }\n });\n\n if (response.error) {\n const message = response.message || `Failed to ${operation} user seats.`;\n console.error(message, response.status, response.statusText);\n throw new WError(message, \"WCP_CANNOT_UPDATE_USER_TENANTS\");\n }\n }\n\n private async updateTenants(operation: \"increment\" | \"decrement\"): Promise<void> {\n if (!wcpProjectEnvironment) {\n return;\n }\n\n const updateTenantsUrl = this.getWcpProjectUrl(\"package/tenants\");\n\n const response = await wcpFetch({\n url: updateTenantsUrl!,\n authorization: wcpProjectEnvironment.apiKey,\n body: { operation },\n meta: {\n action: operation + \"Tenants\"\n }\n });\n\n if (response.error) {\n const message = response.message || `Failed to ${operation} tenants.`;\n console.error(message, response.status, response.statusText);\n throw new WError(message, \"WCP_CANNOT_UPDATE_USER_TENANTS\");\n }\n }\n\n getRawLicense(): DecryptedWcpProjectLicense | null {\n return this.license.getRawLicense();\n }\n\n getProject(): WcpProject | null {\n return this.license.getProject();\n }\n\n getProjectWithFeatureFlags(): WcpProject | null {\n return this.getProject();\n }\n\n getProjectEnvironment(): WcpProjectEnvironment | null {\n return wcpProjectEnvironment;\n }\n\n getProjectLicense(): ILicense {\n return this.license;\n }\n\n canUseFeature(wcpFeatureId: keyof typeof WCP_FEATURE_LABEL): boolean {\n return this.license.canUseFeature(wcpFeatureId);\n }\n\n canUseAacl(): boolean {\n return this.license.canUseAacl();\n }\n\n canUseTeams(): boolean {\n return this.license.canUseTeams();\n }\n\n canUseFolderLevelPermissions(): boolean {\n return this.license.canUseFolderLevelPermissions();\n }\n\n canUsePrivateFiles(): boolean {\n return this.license.canUsePrivateFiles();\n }\n\n canUseAuditLogs(): boolean {\n return this.license.canUseAuditLogs();\n }\n\n canUseRecordLocking(): boolean {\n return this.license.canUseRecordLocking();\n }\n\n canUseFileManagerThreatDetection(): boolean {\n return this.license.canUseFileManagerThreatDetection();\n }\n\n canUseWorkflows(): boolean {\n return this.license.canUseWorkflows();\n }\n\n canUseHcmsFieldPermissions(): boolean {\n return this.license.canUseHcmsFieldPermissions();\n }\n\n ensureCanUseFeature(wcpFeatureId: keyof typeof WCP_FEATURE_LABEL): void {\n if (this.license.canUseFeature(wcpFeatureId)) {\n return;\n }\n\n let message = `The ${wcpFeatureId} Webiny Control Panel feature cannot be used because your project license does not permit it.`;\n if (wcpProjectEnvironment) {\n const { org, project } = wcpProjectEnvironment;\n const upgradeProjectLicenseLink = getWcpAppUrl(`/${org.id}/${project.id}/settings`);\n message += ` To upgrade your project license, please use the following link: ${upgradeProjectLicenseLink}.`;\n }\n\n throw new WError(message, \"WCP_CANNOT_USE_FEATURE\", { wcpFeatureId });\n }\n\n async incrementSeats(): Promise<void> {\n await this.updateSeats(\"increment\");\n }\n\n async decrementSeats(): Promise<void> {\n await this.updateSeats(\"decrement\");\n }\n\n async incrementTenants(): Promise<void> {\n await this.updateTenants(\"increment\");\n }\n\n async decrementTenants(): Promise<void> {\n await this.updateTenants(\"decrement\");\n }\n\n toDto() {\n return this.getRawLicense();\n }\n}\n"],"mappings":"AACA,SAASA,YAAY,EAAEC,YAAY,EAAEC,wBAAwB,QAAQ,aAAa;AAClF,OAAOC,MAAM,MAAM,eAAe;AAQlC,SAASC,QAAQ;AAEjB,MAAMC,qBAAqB,GAAGH,wBAAwB,CAAC,CAAC;AAMxD,OAAO,MAAMI,cAAc,CAAiC;EACxDC,WAAWA,CAASC,OAAiB,EAAE;IAAA,KAAnBA,OAAiB,GAAjBA,OAAiB;EAAG;EAEhCC,gBAAgBA,CAACC,IAAI,GAAG,EAAE,EAAiB;IAC/C,IAAI,CAACL,qBAAqB,EAAE;MACxB,OAAO,IAAI;IACf;IAEA,MAAMM,KAAK,GAAGN,qBAAqB,CAACO,GAAG,CAACC,EAAE;IAC1C,MAAMC,SAAS,GAAGT,qBAAqB,CAACU,OAAO,CAACF,EAAE;IAClD,MAAMG,GAAG,GAAG,CAAC,OAAO,EAAEL,KAAK,EAAE,UAAU,EAAEG,SAAS,EAAEJ,IAAI,CAAC,CAACO,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;IACnF,OAAOnB,YAAY,CAACgB,GAAG,CAAC;EAC5B;EAEA,MAAcI,WAAWA,CAACC,SAAoC,EAAiB;IAC3E,IAAI,CAAChB,qBAAqB,EAAE;MACxB;IACJ;IAEA,MAAMiB,cAAc,GAAG,IAAI,CAACb,gBAAgB,CAAC,eAAe,CAAC;IAE7D,MAAMc,QAAQ,GAAG,MAAMnB,QAAQ,CAAC;MAC5BY,GAAG,EAAEM,cAAe;MACpBE,aAAa,EAAEnB,qBAAqB,CAACoB,MAAM;MAC3CC,IAAI,EAAE;QAAEL;MAAU,CAAC;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AAC,EAAE;MAC1C;IACJ;IAEA,IAAIZ,OAAO,GAAG,OAAOY,YAAY,+FAA+F;IAChI,IAAIrC,qBAAqB,EAAE;MACvB,MAAM;QAAEO,GAAG;QAAEG;MAAQ,CAAC,GAAGV,qBAAqB;MAC9C,MAAMgD,yBAAyB,GAAGpD,YAAY,CAAC,IAAIW,GAAG,CAACC,EAAE,IAAIE,OAAO,CAACF,EAAE,WAAW,CAAC;MACnFiB,OAAO,IAAI,oEAAoEuB,yBAAyB,GAAG;IAC/G;IAEA,MAAM,IAAIlD,MAAM,CAAC2B,OAAO,EAAE,wBAAwB,EAAE;MAAEY;IAAa,CAAC,CAAC;EACzE;EAEA,MAAMY,cAAcA,CAAA,EAAkB;IAClC,MAAM,IAAI,CAAClC,WAAW,CAAC,WAAW,CAAC;EACvC;EAEA,MAAMmC,cAAcA,CAAA,EAAkB;IAClC,MAAM,IAAI,CAACnC,WAAW,CAAC,WAAW,CAAC;EACvC;EAEA,MAAMoC,gBAAgBA,CAAA,EAAkB;IACpC,MAAM,IAAI,CAACtB,aAAa,CAAC,WAAW,CAAC;EACzC;EAEA,MAAMuB,gBAAgBA,CAAA,EAAkB;IACpC,MAAM,IAAI,CAACvB,aAAa,CAAC,WAAW,CAAC;EACzC;EAEAwB,KAAKA,CAAA,EAAG;IACJ,OAAO,IAAI,CAACtB,aAAa,CAAC,CAAC;EAC/B;AACJ","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["getWcpApiUrl","getWcpAppUrl","getWcpProjectEnvironment","WError","wcpFetch","wcpProjectEnvironment","WcpContextImpl","constructor","license","getWcpProjectUrl","path","orgId","org","id","projectId","project","url","filter","Boolean","join","updateSeats","operation","updateSeatsUrl","response","authorization","apiKey","body","meta","action","error","message","console","status","statusText","updateTenants","updateTenantsUrl","getRawLicense","getProject","getProjectWithFeatureFlags","getProjectEnvironment","getProjectLicense","canUseFeature","wcpFeatureId","canUseAacl","canUseTeams","canUseFolderLevelPermissions","canUsePrivateFiles","canUseAuditLogs","canUseRecordLocking","canUseFileManagerThreatDetection","canUseWorkflows","canUseHcmsFieldPermissions","canUseAiImageEnrichment","canUseAiPageGeneration","canUseAiLexicalGeneration","ensureCanUseFeature","upgradeProjectLicenseLink","incrementSeats","decrementSeats","incrementTenants","decrementTenants","toDto"],"sources":["WcpContext.ts"],"sourcesContent":["import type { WCP_FEATURE_LABEL } from \"@webiny/wcp\";\nimport { getWcpApiUrl, getWcpAppUrl, getWcpProjectEnvironment } from \"@webiny/wcp\";\nimport WError from \"@webiny/error\";\nimport type {\n DecryptedWcpProjectLicense,\n ILicense,\n WcpProjectEnvironment,\n WcpProject\n} from \"@webiny/wcp/types.js\";\nimport { WcpContext } from \"./abstractions.js\";\nimport { wcpFetch } from \"./utils.js\";\n\nconst wcpProjectEnvironment = getWcpProjectEnvironment();\n\nexport interface CreateWcpContextParams {\n testProjectLicense?: DecryptedWcpProjectLicense;\n}\n\nexport class WcpContextImpl implements WcpContext.Interface {\n constructor(private license: ILicense) {}\n\n private getWcpProjectUrl(path = \"\"): string | null {\n if (!wcpProjectEnvironment) {\n return null;\n }\n\n const orgId = wcpProjectEnvironment.org.id;\n const projectId = wcpProjectEnvironment.project.id;\n const url = [\"/orgs\", orgId, \"projects\", projectId, path].filter(Boolean).join(\"/\");\n return getWcpApiUrl(url);\n }\n\n private async updateSeats(operation: \"increment\" | \"decrement\"): Promise<void> {\n if (!wcpProjectEnvironment) {\n return;\n }\n\n const updateSeatsUrl = this.getWcpProjectUrl(\"package/seats\");\n\n const response = await wcpFetch({\n url: updateSeatsUrl!,\n authorization: wcpProjectEnvironment.apiKey,\n body: { operation },\n meta: {\n action: operation + \"Seats\"\n }\n });\n\n if (response.error) {\n const message = response.message || `Failed to ${operation} user seats.`;\n console.error(message, response.status, response.statusText);\n throw new WError(message, \"WCP_CANNOT_UPDATE_USER_TENANTS\");\n }\n }\n\n private async updateTenants(operation: \"increment\" | \"decrement\"): Promise<void> {\n if (!wcpProjectEnvironment) {\n return;\n }\n\n const updateTenantsUrl = this.getWcpProjectUrl(\"package/tenants\");\n\n const response = await wcpFetch({\n url: updateTenantsUrl!,\n authorization: wcpProjectEnvironment.apiKey,\n body: { operation },\n meta: {\n action: operation + \"Tenants\"\n }\n });\n\n if (response.error) {\n const message = response.message || `Failed to ${operation} tenants.`;\n console.error(message, response.status, response.statusText);\n throw new WError(message, \"WCP_CANNOT_UPDATE_USER_TENANTS\");\n }\n }\n\n getRawLicense(): DecryptedWcpProjectLicense | null {\n return this.license.getRawLicense();\n }\n\n getProject(): WcpProject | null {\n return this.license.getProject();\n }\n\n getProjectWithFeatureFlags(): WcpProject | null {\n return this.getProject();\n }\n\n getProjectEnvironment(): WcpProjectEnvironment | null {\n return wcpProjectEnvironment;\n }\n\n getProjectLicense(): ILicense {\n return this.license;\n }\n\n canUseFeature(wcpFeatureId: keyof typeof WCP_FEATURE_LABEL): boolean {\n return this.license.canUseFeature(wcpFeatureId);\n }\n\n canUseAacl(): boolean {\n return this.license.canUseAacl();\n }\n\n canUseTeams(): boolean {\n return this.license.canUseTeams();\n }\n\n canUseFolderLevelPermissions(): boolean {\n return this.license.canUseFolderLevelPermissions();\n }\n\n canUsePrivateFiles(): boolean {\n return this.license.canUsePrivateFiles();\n }\n\n canUseAuditLogs(): boolean {\n return this.license.canUseAuditLogs();\n }\n\n canUseRecordLocking(): boolean {\n return this.license.canUseRecordLocking();\n }\n\n canUseFileManagerThreatDetection(): boolean {\n return this.license.canUseFileManagerThreatDetection();\n }\n\n canUseWorkflows(): boolean {\n return this.license.canUseWorkflows();\n }\n\n canUseHcmsFieldPermissions(): boolean {\n return this.license.canUseHcmsFieldPermissions();\n }\n\n canUseAiImageEnrichment(): boolean {\n return this.license.canUseAiImageEnrichment();\n }\n\n canUseAiPageGeneration(): boolean {\n return this.license.canUseAiPageGeneration();\n }\n\n canUseAiLexicalGeneration(): boolean {\n return this.license.canUseAiLexicalGeneration();\n }\n\n ensureCanUseFeature(wcpFeatureId: keyof typeof WCP_FEATURE_LABEL): void {\n if (this.license.canUseFeature(wcpFeatureId)) {\n return;\n }\n\n let message = `The ${wcpFeatureId} Webiny Control Panel feature cannot be used because your project license does not permit it.`;\n if (wcpProjectEnvironment) {\n const { org, project } = wcpProjectEnvironment;\n const upgradeProjectLicenseLink = getWcpAppUrl(`/${org.id}/${project.id}/settings`);\n message += ` To upgrade your project license, please use the following link: ${upgradeProjectLicenseLink}.`;\n }\n\n throw new WError(message, \"WCP_CANNOT_USE_FEATURE\", { wcpFeatureId });\n }\n\n async incrementSeats(): Promise<void> {\n await this.updateSeats(\"increment\");\n }\n\n async decrementSeats(): Promise<void> {\n await this.updateSeats(\"decrement\");\n }\n\n async incrementTenants(): Promise<void> {\n await this.updateTenants(\"increment\");\n }\n\n async decrementTenants(): Promise<void> {\n await this.updateTenants(\"decrement\");\n }\n\n toDto() {\n return this.getRawLicense();\n }\n}\n"],"mappings":"AACA,SAASA,YAAY,EAAEC,YAAY,EAAEC,wBAAwB,QAAQ,aAAa;AAClF,OAAOC,MAAM,MAAM,eAAe;AAQlC,SAASC,QAAQ;AAEjB,MAAMC,qBAAqB,GAAGH,wBAAwB,CAAC,CAAC;AAMxD,OAAO,MAAMI,cAAc,CAAiC;EACxDC,WAAWA,CAASC,OAAiB,EAAE;IAAA,KAAnBA,OAAiB,GAAjBA,OAAiB;EAAG;EAEhCC,gBAAgBA,CAACC,IAAI,GAAG,EAAE,EAAiB;IAC/C,IAAI,CAACL,qBAAqB,EAAE;MACxB,OAAO,IAAI;IACf;IAEA,MAAMM,KAAK,GAAGN,qBAAqB,CAACO,GAAG,CAACC,EAAE;IAC1C,MAAMC,SAAS,GAAGT,qBAAqB,CAACU,OAAO,CAACF,EAAE;IAClD,MAAMG,GAAG,GAAG,CAAC,OAAO,EAAEL,KAAK,EAAE,UAAU,EAAEG,SAAS,EAAEJ,IAAI,CAAC,CAACO,MAAM,CAACC,OAAO,CAAC,CAACC,IAAI,CAAC,GAAG,CAAC;IACnF,OAAOnB,YAAY,CAAC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uC,gBAAgBA,CAAA,EAAkB;IACpC,MAAM,IAAI,CAACzB,aAAa,CAAC,WAAW,CAAC;EACzC;EAEA,MAAM0B,gBAAgBA,CAAA,EAAkB;IACpC,MAAM,IAAI,CAAC1B,aAAa,CAAC,WAAW,CAAC;EACzC;EAEA2B,KAAKA,CAAA,EAAG;IACJ,OAAO,IAAI,CAACzB,aAAa,CAAC,CAAC;EAC/B;AACJ","ignoreList":[]}
|
|
@@ -43,6 +43,18 @@ declare class WcpContextWithFeatureFlagsDecoratorImpl implements WcpContext.Inte
|
|
|
43
43
|
threatDetection: boolean;
|
|
44
44
|
};
|
|
45
45
|
};
|
|
46
|
+
aiPowerups: {
|
|
47
|
+
enabled: boolean;
|
|
48
|
+
options: {
|
|
49
|
+
websiteBuilder: {
|
|
50
|
+
pageGeneration: boolean | undefined;
|
|
51
|
+
};
|
|
52
|
+
fileManager: {
|
|
53
|
+
imageEnrichment: boolean | undefined;
|
|
54
|
+
};
|
|
55
|
+
lexicalGeneration: boolean | undefined;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
46
58
|
seats: {
|
|
47
59
|
enabled: true;
|
|
48
60
|
options: {
|
|
@@ -66,6 +78,9 @@ declare class WcpContextWithFeatureFlagsDecoratorImpl implements WcpContext.Inte
|
|
|
66
78
|
canUseFileManagerThreatDetection(): boolean;
|
|
67
79
|
canUseWorkflows(): boolean;
|
|
68
80
|
canUseHcmsFieldPermissions(): boolean;
|
|
81
|
+
canUseAiImageEnrichment(): boolean;
|
|
82
|
+
canUseAiPageGeneration(): boolean;
|
|
83
|
+
canUseAiLexicalGeneration(): boolean;
|
|
69
84
|
ensureCanUseFeature(featureId: keyof typeof WCP_FEATURE_LABEL): void;
|
|
70
85
|
incrementSeats(): Promise<void>;
|
|
71
86
|
decrementSeats(): Promise<void>;
|
|
@@ -17,7 +17,6 @@ class WcpContextWithFeatureFlagsDecoratorImpl {
|
|
|
17
17
|
return null;
|
|
18
18
|
}
|
|
19
19
|
const flags = this.featureFlags.get();
|
|
20
|
-
console.log("flags", flags);
|
|
21
20
|
return {
|
|
22
21
|
...project,
|
|
23
22
|
package: {
|
|
@@ -36,7 +35,7 @@ class WcpContextWithFeatureFlagsDecoratorImpl {
|
|
|
36
35
|
teams: flags.isTeamsEnabled() ? project.package.features.advancedAccessControlLayer.options.teams : false,
|
|
37
36
|
privateFiles: flags.isPrivateFilesEnabled() ? project.package.features.advancedAccessControlLayer.options.privateFiles : false,
|
|
38
37
|
folderLevelPermissions: flags.isFolderLevelPermissionsEnabled() ? project.package.features.advancedAccessControlLayer.options.folderLevelPermissions : false,
|
|
39
|
-
hcmsFieldPermissions: project.package.features.advancedAccessControlLayer.options.hcmsFieldPermissions
|
|
38
|
+
hcmsFieldPermissions: flags.isHcmsFieldPermissionsEnabled() ? project.package.features.advancedAccessControlLayer.options.hcmsFieldPermissions : false
|
|
40
39
|
}
|
|
41
40
|
},
|
|
42
41
|
auditLogs: {
|
|
@@ -53,6 +52,19 @@ class WcpContextWithFeatureFlagsDecoratorImpl {
|
|
|
53
52
|
options: {
|
|
54
53
|
threatDetection: flags.isFileManagerThreatDetectionEnabled() ? project.package.features.fileManager.options.threatDetection : false
|
|
55
54
|
}
|
|
55
|
+
},
|
|
56
|
+
aiPowerups: {
|
|
57
|
+
...project.package.features.aiPowerups,
|
|
58
|
+
enabled: flags.isAiPowerupsEnabled() ? project.package.features.aiPowerups?.enabled : false,
|
|
59
|
+
options: {
|
|
60
|
+
websiteBuilder: {
|
|
61
|
+
pageGeneration: flags.isAiPageGenerationEnabled() ? project.package.features.aiPowerups?.options?.websiteBuilder?.pageGeneration : false
|
|
62
|
+
},
|
|
63
|
+
fileManager: {
|
|
64
|
+
imageEnrichment: flags.isAiImageEnrichmentEnabled() ? project.package.features.aiPowerups?.options?.fileManager?.imageEnrichment : false
|
|
65
|
+
},
|
|
66
|
+
lexicalGeneration: flags.isAiLexicalGenerationEnabled() ? project.package.features.aiPowerups?.options?.lexicalGeneration : false
|
|
67
|
+
}
|
|
56
68
|
}
|
|
57
69
|
}
|
|
58
70
|
}
|
|
@@ -92,7 +104,16 @@ class WcpContextWithFeatureFlagsDecoratorImpl {
|
|
|
92
104
|
return this.decoratee.canUseWorkflows() && this.featureFlags.get().isWorkflowsEnabled();
|
|
93
105
|
}
|
|
94
106
|
canUseHcmsFieldPermissions() {
|
|
95
|
-
return this.decoratee.canUseHcmsFieldPermissions();
|
|
107
|
+
return this.decoratee.canUseHcmsFieldPermissions() && this.featureFlags.get().isHcmsFieldPermissionsEnabled();
|
|
108
|
+
}
|
|
109
|
+
canUseAiImageEnrichment() {
|
|
110
|
+
return this.decoratee.canUseAiImageEnrichment() && this.featureFlags.get().isAiImageEnrichmentEnabled();
|
|
111
|
+
}
|
|
112
|
+
canUseAiPageGeneration() {
|
|
113
|
+
return this.decoratee.canUseAiPageGeneration() && this.featureFlags.get().isAiPageGenerationEnabled();
|
|
114
|
+
}
|
|
115
|
+
canUseAiLexicalGeneration() {
|
|
116
|
+
return this.decoratee.canUseAiLexicalGeneration() && this.featureFlags.get().isAiLexicalGenerationEnabled();
|
|
96
117
|
}
|
|
97
118
|
ensureCanUseFeature(featureId) {
|
|
98
119
|
return this.decoratee.ensureCanUseFeature(featureId);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WcpContext","FeatureFlags","WcpContextWithFeatureFlagsDecoratorImpl","constructor","featureFlags","decoratee","getRawLicense","getProject","getProjectWithFeatureFlags","project","flags","get","console","log","package","features","multiTenancy","advancedPublishingWorkflow","enabled","isWorkflowsEnabled","advancedAccessControlLayer","isAaclEnabled","options","teams","isTeamsEnabled","privateFiles","isPrivateFilesEnabled","folderLevelPermissions","isFolderLevelPermissionsEnabled","hcmsFieldPermissions","auditLogs","isAuditLogsEnabled","recordLocking","isRecordLockingEnabled","fileManager","threatDetection","isFileManagerThreatDetectionEnabled","getProjectEnvironment","getProjectLicense","canUseFeature","wcpFeatureId","canUseAacl","canUseTeams","canUseFolderLevelPermissions","canUsePrivateFiles","canUseAuditLogs","canUseRecordLocking","canUseFileManagerThreatDetection","canUseWorkflows","canUseHcmsFieldPermissions","ensureCanUseFeature","featureId","incrementSeats","decrementSeats","incrementTenants","decrementTenants","toDto","WcpContextWithFeatureFlagsDecorator","createDecorator","decorator","dependencies"],"sources":["WcpContextWithFeatureFlagsDecorator.ts"],"sourcesContent":["import type { WCP_FEATURE_LABEL } from \"@webiny/wcp\";\nimport { WcpContext } from \"../abstractions.js\";\nimport { FeatureFlags } from \"../../../featureFlags/abstractions.js\";\n\nclass WcpContextWithFeatureFlagsDecoratorImpl implements WcpContext.Interface {\n constructor(\n private featureFlags: FeatureFlags.Interface,\n private decoratee: WcpContext.Interface\n ) {}\n\n getRawLicense() {\n return this.decoratee.getRawLicense();\n }\n\n getProject() {\n return this.decoratee.getProject();\n }\n\n getProjectWithFeatureFlags() {\n const project = this.decoratee.getProjectWithFeatureFlags();\n if (!project) {\n return null;\n }\n\n const flags = this.featureFlags.get();\n\n console.log(\"flags\", flags);\n return {\n ...project,\n package: {\n ...project.package,\n features: {\n ...project.package.features,\n multiTenancy: project.package.features.multiTenancy,\n advancedPublishingWorkflow: {\n ...project.package.features.advancedPublishingWorkflow,\n enabled: flags.isWorkflowsEnabled()\n ? project.package.features.advancedPublishingWorkflow.enabled\n : false\n },\n advancedAccessControlLayer: {\n ...project.package.features.advancedAccessControlLayer,\n enabled: flags.isAaclEnabled()\n ? project.package.features.advancedAccessControlLayer.enabled\n : false,\n options: {\n teams: flags.isTeamsEnabled()\n ? project.package.features.advancedAccessControlLayer.options.teams\n : false,\n privateFiles: flags.isPrivateFilesEnabled()\n ? project.package.features.advancedAccessControlLayer.options\n .privateFiles\n : false,\n folderLevelPermissions: flags.isFolderLevelPermissionsEnabled()\n ? project.package.features.advancedAccessControlLayer.options\n .folderLevelPermissions\n : false,\n hcmsFieldPermissions:\n project.package.features.advancedAccessControlLayer.options\n .hcmsFieldPermissions\n }\n },\n auditLogs: {\n ...project.package.features.auditLogs,\n enabled: flags.isAuditLogsEnabled()\n ? project.package.features.auditLogs.enabled\n : false\n },\n recordLocking: {\n ...project.package.features.recordLocking,\n enabled: flags.isRecordLockingEnabled()\n ? project.package.features.recordLocking.enabled\n : false\n },\n fileManager: {\n ...project.package.features.fileManager,\n enabled: project.package.features.fileManager.enabled,\n options: {\n threatDetection: flags.isFileManagerThreatDetectionEnabled()\n ? project.package.features.fileManager.options.threatDetection\n : false\n }\n }\n }\n }\n };\n }\n\n getProjectEnvironment() {\n return this.decoratee.getProjectEnvironment();\n }\n\n getProjectLicense() {\n return this.decoratee.getProjectLicense();\n }\n\n canUseFeature(wcpFeatureId: keyof typeof WCP_FEATURE_LABEL) {\n return this.decoratee.canUseFeature(wcpFeatureId);\n }\n\n canUseAacl() {\n return this.decoratee.canUseAacl() && this.featureFlags.get().isAaclEnabled();\n }\n\n canUseTeams() {\n return this.decoratee.canUseTeams() && this.featureFlags.get().isTeamsEnabled();\n }\n\n canUseFolderLevelPermissions() {\n return (\n this.decoratee.canUseFolderLevelPermissions() &&\n this.featureFlags.get().isFolderLevelPermissionsEnabled()\n );\n }\n\n canUsePrivateFiles() {\n return (\n this.decoratee.canUsePrivateFiles() && this.featureFlags.get().isPrivateFilesEnabled()\n );\n }\n\n canUseAuditLogs() {\n return this.decoratee.canUseAuditLogs() && this.featureFlags.get().isAuditLogsEnabled();\n }\n\n canUseRecordLocking() {\n return (\n this.decoratee.canUseRecordLocking() && this.featureFlags.get().isRecordLockingEnabled()\n );\n }\n\n canUseFileManagerThreatDetection() {\n return (\n this.decoratee.canUseFileManagerThreatDetection() &&\n this.featureFlags.get().isFileManagerThreatDetectionEnabled()\n );\n }\n\n canUseWorkflows() {\n return this.decoratee.canUseWorkflows() && this.featureFlags.get().isWorkflowsEnabled();\n }\n\n canUseHcmsFieldPermissions() {\n return this.decoratee.canUseHcmsFieldPermissions();\n }\n\n ensureCanUseFeature(featureId: keyof typeof WCP_FEATURE_LABEL) {\n return this.decoratee.ensureCanUseFeature(featureId);\n }\n\n async incrementSeats() {\n return this.decoratee.incrementSeats();\n }\n\n async decrementSeats() {\n return this.decoratee.decrementSeats();\n }\n\n async incrementTenants() {\n return this.decoratee.incrementTenants();\n }\n\n async decrementTenants() {\n return this.decoratee.decrementTenants();\n }\n\n toDto() {\n return this.decoratee.toDto();\n }\n}\n\nexport const WcpContextWithFeatureFlagsDecorator = WcpContext.createDecorator({\n decorator: WcpContextWithFeatureFlagsDecoratorImpl,\n dependencies: [FeatureFlags]\n});\n"],"mappings":"AACA,SAASA,UAAU;AACnB,SAASC,YAAY;AAErB,MAAMC,uCAAuC,CAAiC;EAC1EC,WAAWA,CACCC,YAAoC,EACpCC,SAA+B,EACzC;IAAA,KAFUD,YAAoC,GAApCA,YAAoC;IAAA,KACpCC,SAA+B,GAA/BA,SAA+B;EACxC;EAEHC,aAAaA,CAAA,EAAG;IACZ,OAAO,IAAI,CAACD,SAAS,CAACC,aAAa,CAAC,CAAC;EACzC;EAEAC,UAAUA,CAAA,EAAG;IACT,OAAO,IAAI,CAACF,SAAS,CAACE,UAAU,CAAC,CAAC;EACtC;EAEAC,0BAA0BA,CAAA,EAAG;IACzB,MAAMC,OAAO,GAAG,IAAI,CAACJ,SAAS,CAACG,0BAA0B,CAAC,CAAC;IAC3D,IAAI,CAACC,OAAO,EAAE;MACV,OAAO,IAAI;IACf;IAEA,MAAMC,KAAK,GAAG,IAAI,CAACN,YAAY,CAACO,GAAG,CAAC,CAAC;IAErCC,OAAO,CAACC,GAAG,CAAC,OAAO,EAAEH,KAAK,CAAC;IAC3B,OAAO;MACH,GAAGD,OAAO;MACVK,OAAO,EAAE;QACL,GAAGL,OAAO,CAACK,OAAO;QAClBC,QAAQ,EAAE;UACN,GAAGN,OAAO,CAACK,OAAO,CAACC,QAAQ;UAC3BC,YAAY,EAAEP,OAAO,CAACK,OAAO,CAACC,QAAQ,CAACC,YAAY;UACnDC,0BAA0B,EAAE;YACxB,GAAGR,OAAO,CAACK,OAAO,CAACC,QAAQ,CA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ChD,SAAS,CAACgD,cAAc,CAAC,CAAC;EAC1C;EAEA,MAAMC,gBAAgBA,CAAA,EAAG;IACrB,OAAO,IAAI,CAACjD,SAAS,CAACiD,gBAAgB,CAAC,CAAC;EAC5C;EAEA,MAAMC,gBAAgBA,CAAA,EAAG;IACrB,OAAO,IAAI,CAAClD,SAAS,CAACkD,gBAAgB,CAAC,CAAC;EAC5C;EAEAC,KAAKA,CAAA,EAAG;IACJ,OAAO,IAAI,CAACnD,SAAS,CAACmD,KAAK,CAAC,CAAC;EACjC;AACJ;AAEA,OAAO,MAAMC,mCAAmC,GAAGzD,UAAU,CAAC0D,eAAe,CAAC;EAC1EC,SAAS,EAAEzD,uCAAuC;EAClD0D,YAAY,EAAE,CAAC3D,YAAY;AAC/B,CAAC,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["WcpContext","FeatureFlags","WcpContextWithFeatureFlagsDecoratorImpl","constructor","featureFlags","decoratee","getRawLicense","getProject","getProjectWithFeatureFlags","project","flags","get","package","features","multiTenancy","advancedPublishingWorkflow","enabled","isWorkflowsEnabled","advancedAccessControlLayer","isAaclEnabled","options","teams","isTeamsEnabled","privateFiles","isPrivateFilesEnabled","folderLevelPermissions","isFolderLevelPermissionsEnabled","hcmsFieldPermissions","isHcmsFieldPermissionsEnabled","auditLogs","isAuditLogsEnabled","recordLocking","isRecordLockingEnabled","fileManager","threatDetection","isFileManagerThreatDetectionEnabled","aiPowerups","isAiPowerupsEnabled","websiteBuilder","pageGeneration","isAiPageGenerationEnabled","imageEnrichment","isAiImageEnrichmentEnabled","lexicalGeneration","isAiLexicalGenerationEnabled","getProjectEnvironment","getProjectLicense","canUseFeature","wcpFeatureId","canUseAacl","canUseTeams","canUseFolderLevelPermissions","canUsePrivateFiles","canUseAuditLogs","canUseRecordLocking","canUseFileManagerThreatDetection","canUseWorkflows","canUseHcmsFieldPermissions","canUseAiImageEnrichment","canUseAiPageGeneration","canUseAiLexicalGeneration","ensureCanUseFeature","featureId","incrementSeats","decrementSeats","incrementTenants","decrementTenants","toDto","WcpContextWithFeatureFlagsDecorator","createDecorator","decorator","dependencies"],"sources":["WcpContextWithFeatureFlagsDecorator.ts"],"sourcesContent":["import type { WCP_FEATURE_LABEL } from \"@webiny/wcp\";\nimport { WcpContext } from \"../abstractions.js\";\nimport { FeatureFlags } from \"../../../featureFlags/abstractions.js\";\n\nclass WcpContextWithFeatureFlagsDecoratorImpl implements WcpContext.Interface {\n constructor(\n private featureFlags: FeatureFlags.Interface,\n private decoratee: WcpContext.Interface\n ) {}\n\n getRawLicense() {\n return this.decoratee.getRawLicense();\n }\n\n getProject() {\n return this.decoratee.getProject();\n }\n\n getProjectWithFeatureFlags() {\n const project = this.decoratee.getProjectWithFeatureFlags();\n if (!project) {\n return null;\n }\n\n const flags = this.featureFlags.get();\n\n return {\n ...project,\n package: {\n ...project.package,\n features: {\n ...project.package.features,\n multiTenancy: project.package.features.multiTenancy,\n advancedPublishingWorkflow: {\n ...project.package.features.advancedPublishingWorkflow,\n enabled: flags.isWorkflowsEnabled()\n ? project.package.features.advancedPublishingWorkflow.enabled\n : false\n },\n advancedAccessControlLayer: {\n ...project.package.features.advancedAccessControlLayer,\n enabled: flags.isAaclEnabled()\n ? project.package.features.advancedAccessControlLayer.enabled\n : false,\n options: {\n teams: flags.isTeamsEnabled()\n ? project.package.features.advancedAccessControlLayer.options.teams\n : false,\n privateFiles: flags.isPrivateFilesEnabled()\n ? project.package.features.advancedAccessControlLayer.options\n .privateFiles\n : false,\n folderLevelPermissions: flags.isFolderLevelPermissionsEnabled()\n ? project.package.features.advancedAccessControlLayer.options\n .folderLevelPermissions\n : false,\n hcmsFieldPermissions: flags.isHcmsFieldPermissionsEnabled()\n ? project.package.features.advancedAccessControlLayer.options\n .hcmsFieldPermissions\n : false\n }\n },\n auditLogs: {\n ...project.package.features.auditLogs,\n enabled: flags.isAuditLogsEnabled()\n ? project.package.features.auditLogs.enabled\n : false\n },\n recordLocking: {\n ...project.package.features.recordLocking,\n enabled: flags.isRecordLockingEnabled()\n ? project.package.features.recordLocking.enabled\n : false\n },\n fileManager: {\n ...project.package.features.fileManager,\n enabled: project.package.features.fileManager.enabled,\n options: {\n threatDetection: flags.isFileManagerThreatDetectionEnabled()\n ? project.package.features.fileManager.options.threatDetection\n : false\n }\n },\n aiPowerups: {\n ...project.package.features.aiPowerups,\n enabled: flags.isAiPowerupsEnabled()\n ? project.package.features.aiPowerups?.enabled\n : false,\n options: {\n websiteBuilder: {\n pageGeneration: flags.isAiPageGenerationEnabled()\n ? project.package.features.aiPowerups?.options?.websiteBuilder\n ?.pageGeneration\n : false\n },\n fileManager: {\n imageEnrichment: flags.isAiImageEnrichmentEnabled()\n ? project.package.features.aiPowerups?.options?.fileManager\n ?.imageEnrichment\n : false\n },\n lexicalGeneration: flags.isAiLexicalGenerationEnabled()\n ? project.package.features.aiPowerups?.options?.lexicalGeneration\n : false\n }\n }\n }\n }\n };\n }\n\n getProjectEnvironment() {\n return this.decoratee.getProjectEnvironment();\n }\n\n getProjectLicense() {\n return this.decoratee.getProjectLicense();\n }\n\n canUseFeature(wcpFeatureId: keyof typeof WCP_FEATURE_LABEL) {\n return this.decoratee.canUseFeature(wcpFeatureId);\n }\n\n canUseAacl() {\n return this.decoratee.canUseAacl() && this.featureFlags.get().isAaclEnabled();\n }\n\n canUseTeams() {\n return this.decoratee.canUseTeams() && this.featureFlags.get().isTeamsEnabled();\n }\n\n canUseFolderLevelPermissions() {\n return (\n this.decoratee.canUseFolderLevelPermissions() &&\n this.featureFlags.get().isFolderLevelPermissionsEnabled()\n );\n }\n\n canUsePrivateFiles() {\n return (\n this.decoratee.canUsePrivateFiles() && this.featureFlags.get().isPrivateFilesEnabled()\n );\n }\n\n canUseAuditLogs() {\n return this.decoratee.canUseAuditLogs() && this.featureFlags.get().isAuditLogsEnabled();\n }\n\n canUseRecordLocking() {\n return (\n this.decoratee.canUseRecordLocking() && this.featureFlags.get().isRecordLockingEnabled()\n );\n }\n\n canUseFileManagerThreatDetection() {\n return (\n this.decoratee.canUseFileManagerThreatDetection() &&\n this.featureFlags.get().isFileManagerThreatDetectionEnabled()\n );\n }\n\n canUseWorkflows() {\n return this.decoratee.canUseWorkflows() && this.featureFlags.get().isWorkflowsEnabled();\n }\n\n canUseHcmsFieldPermissions() {\n return (\n this.decoratee.canUseHcmsFieldPermissions() &&\n this.featureFlags.get().isHcmsFieldPermissionsEnabled()\n );\n }\n\n canUseAiImageEnrichment() {\n return (\n this.decoratee.canUseAiImageEnrichment() &&\n this.featureFlags.get().isAiImageEnrichmentEnabled()\n );\n }\n\n canUseAiPageGeneration() {\n return (\n this.decoratee.canUseAiPageGeneration() &&\n this.featureFlags.get().isAiPageGenerationEnabled()\n );\n }\n\n canUseAiLexicalGeneration() {\n return (\n this.decoratee.canUseAiLexicalGeneration() &&\n this.featureFlags.get().isAiLexicalGenerationEnabled()\n );\n }\n\n ensureCanUseFeature(featureId: keyof typeof WCP_FEATURE_LABEL) {\n return this.decoratee.ensureCanUseFeature(featureId);\n }\n\n async incrementSeats() {\n return this.decoratee.incrementSeats();\n }\n\n async decrementSeats() {\n return this.decoratee.decrementSeats();\n }\n\n async incrementTenants() {\n return this.decoratee.incrementTenants();\n }\n\n async decrementTenants() {\n return this.decoratee.decrementTenants();\n }\n\n toDto() {\n return this.decoratee.toDto();\n }\n}\n\nexport const WcpContextWithFeatureFlagsDecorator = WcpContext.createDecorator({\n decorator: WcpContextWithFeatureFlagsDecoratorImpl,\n dependencies: [FeatureFlags]\n});\n"],"mappings":"AACA,SAASA,UAAU;AACnB,SAASC,YAAY;AAErB,MAAMC,uCAAuC,CAAiC;EAC1EC,WAAWA,CACCC,YAAoC,EACpCC,SAA+B,EACzC;IAAA,KAFUD,YAAoC,GAApCA,YAAoC;IAAA,KACpCC,SAA+B,GAA/BA,SAA+B;EACxC;EAEHC,aAAaA,CAAA,EAAG;IACZ,OAAO,IAAI,CAACD,SAAS,CAACC,aAAa,CAAC,CAAC;EACzC;EAEAC,UAAUA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CAACtE,YAAY;AAC/B,CAAC,CAAC","ignoreList":[]}
|
|
@@ -1,2 +1,6 @@
|
|
|
1
|
+
import type { Container } from "@webiny/di";
|
|
1
2
|
import type { ILicense } from "@webiny/wcp/types.js";
|
|
2
|
-
export declare const WcpContextFeature:
|
|
3
|
+
export declare const WcpContextFeature: {
|
|
4
|
+
name: string;
|
|
5
|
+
register(container: Container, context: ILicense): void;
|
|
6
|
+
};
|
|
@@ -1,2 +1,5 @@
|
|
|
1
1
|
import type { ILicense } from "@webiny/wcp/types.js";
|
|
2
|
-
export declare const WcpFeature:
|
|
2
|
+
export declare const WcpFeature: {
|
|
3
|
+
name: string;
|
|
4
|
+
register(container: import("@webiny/di").Container, context: ILicense): void;
|
|
5
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createFeature","WcpContextFeature","WcpContextWithFeatureFlagsDecorator","WcpFeature","name","register","container","license","registerDecorator"],"sources":["WcpFeature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { WcpContextFeature } from \"./WcpContext/feature.js\";\nimport { WcpContextWithFeatureFlagsDecorator } from \"./WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.js\";\nimport type { ILicense } from \"@webiny/wcp/types.js\";\n\nexport const WcpFeature = createFeature({\n name: \"WebinyControlPanel\",\n register(container, license
|
|
1
|
+
{"version":3,"names":["createFeature","WcpContextFeature","WcpContextWithFeatureFlagsDecorator","WcpFeature","name","register","container","license","registerDecorator"],"sources":["WcpFeature.ts"],"sourcesContent":["import { createFeature } from \"@webiny/feature/api\";\nimport { WcpContextFeature } from \"./WcpContext/feature.js\";\nimport { WcpContextWithFeatureFlagsDecorator } from \"./WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.js\";\nimport type { ILicense } from \"@webiny/wcp/types.js\";\n\nexport const WcpFeature = createFeature<ILicense>({\n name: \"WebinyControlPanel\",\n register(container, license) {\n WcpContextFeature.register(container, license);\n container.registerDecorator(WcpContextWithFeatureFlagsDecorator);\n }\n});\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,qBAAqB;AACnD,SAASC,iBAAiB;AAC1B,SAASC,mCAAmC;AAG5C,OAAO,MAAMC,UAAU,GAAGH,aAAa,CAAW;EAC9CI,IAAI,EAAE,oBAAoB;EAC1BC,QAAQA,CAACC,SAAS,EAAEC,OAAO,EAAE;IACzBN,iBAAiB,CAACI,QAAQ,CAACC,SAAS,EAAEC,OAAO,CAAC;IAC9CD,SAAS,CAACE,iBAAiB,CAACN,mCAAmC,CAAC;EACpE;AACJ,CAAC,CAAC","ignoreList":[]}
|
|
@@ -4,6 +4,7 @@ interface NotAuthorizedResponseArgsType {
|
|
|
4
4
|
code: string | null;
|
|
5
5
|
data: any | null;
|
|
6
6
|
}
|
|
7
|
+
/** GraphQL not-authorized response helper. */
|
|
7
8
|
export declare class NotAuthorizedResponse extends ErrorResponse {
|
|
8
9
|
constructor({ message, code, data }?: Partial<NotAuthorizedResponseArgsType>);
|
|
9
10
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ErrorResponse","NotAuthorizedResponse","constructor","message","code","data"],"sources":["NotAuthorizedResponse.ts"],"sourcesContent":["import { ErrorResponse } from \"@webiny/handler-graphql/responses.js\";\n\ninterface NotAuthorizedResponseArgsType {\n message: string;\n code: string | null;\n data: any | null;\n}\n\nexport class NotAuthorizedResponse extends ErrorResponse {\n constructor({ message, code, data }: Partial<NotAuthorizedResponseArgsType> = {}) {\n super({\n message: message || \"Not authorized!\",\n code: code || \"SECURITY_NOT_AUTHORIZED\",\n data\n });\n }\n}\n\nexport default NotAuthorizedResponse;\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,sCAAsC;AAQpE,OAAO,MAAMC,qBAAqB,SAASD,aAAa,CAAC;EACrDE,WAAWA,CAAC;IAAEC,OAAO;IAAEC,IAAI;IAAEC;EAA6C,CAAC,GAAG,CAAC,CAAC,EAAE;IAC9E,KAAK,CAAC;MACFF,OAAO,EAAEA,OAAO,IAAI,iBAAiB;MACrCC,IAAI,EAAEA,IAAI,IAAI,yBAAyB;MACvCC;IACJ,CAAC,CAAC;EACN;AACJ;AAEA,eAAeJ,qBAAqB","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["ErrorResponse","NotAuthorizedResponse","constructor","message","code","data"],"sources":["NotAuthorizedResponse.ts"],"sourcesContent":["import { ErrorResponse } from \"@webiny/handler-graphql/responses.js\";\n\ninterface NotAuthorizedResponseArgsType {\n message: string;\n code: string | null;\n data: any | null;\n}\n\n/** GraphQL not-authorized response helper. */\nexport class NotAuthorizedResponse extends ErrorResponse {\n constructor({ message, code, data }: Partial<NotAuthorizedResponseArgsType> = {}) {\n super({\n message: message || \"Not authorized!\",\n code: code || \"SECURITY_NOT_AUTHORIZED\",\n data\n });\n }\n}\n\nexport default NotAuthorizedResponse;\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,sCAAsC;AAQpE;AACA,OAAO,MAAMC,qBAAqB,SAASD,aAAa,CAAC;EACrDE,WAAWA,CAAC;IAAEC,OAAO;IAAEC,IAAI;IAAEC;EAA6C,CAAC,GAAG,CAAC,CAAC,EAAE;IAC9E,KAAK,CAAC;MACFF,OAAO,EAAEA,OAAO,IAAI,iBAAiB;MACrCC,IAAI,EAAEA,IAAI,IAAI,yBAAyB;MACvCC;IACJ,CAAC,CAAC;EACN;AACJ;AAEA,eAAeJ,qBAAqB","ignoreList":[]}
|
package/graphql/wcp/graphql.js
CHANGED
|
@@ -18,6 +18,7 @@ export const createWcpGraphQL = () => {
|
|
|
18
18
|
auditLogs: WcpProjectPackageFeaturesFeature
|
|
19
19
|
recordLocking: WcpProjectPackageFeaturesFeature
|
|
20
20
|
fileManager: WcpProjectPackageFeaturesFeature
|
|
21
|
+
aiPowerups: WcpProjectPackageFeaturesFeature
|
|
21
22
|
}
|
|
22
23
|
|
|
23
24
|
type WcpProjectPackage {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["GraphQLSchemaPlugin","ErrorResponse","Response","WcpContext","emptyResolver","createWcpGraphQL","typeDefs","resolvers","Query","wcp","WcpQuery","getProject","_","__","context","wcpContext","container","resolve","project","getProjectWithFeatureFlags","Error","e","code","message","data","stack"],"sources":["graphql.ts"],"sourcesContent":["import { GraphQLSchemaPlugin } from \"@webiny/handler-graphql/plugins/index.js\";\nimport { ErrorResponse, Response } from \"@webiny/handler-graphql/responses.js\";\nimport { WcpContext } from \"~/features/wcp/WcpContext/index.js\";\n\nconst emptyResolver = () => ({});\n\nexport const createWcpGraphQL = () => {\n return new GraphQLSchemaPlugin({\n typeDefs: /* GraphQL */ `\n type WcpProjectPackageFeaturesFeature {\n enabled: Boolean\n options: JSON\n }\n\n type WcpProjectPackageFeatures {\n seats: WcpProjectPackageFeaturesFeature\n multiTenancy: WcpProjectPackageFeaturesFeature\n advancedPublishingWorkflow: WcpProjectPackageFeaturesFeature\n advancedAccessControlLayer: WcpProjectPackageFeaturesFeature\n auditLogs: WcpProjectPackageFeaturesFeature\n recordLocking: WcpProjectPackageFeaturesFeature\n fileManager: WcpProjectPackageFeaturesFeature\n }\n\n type WcpProjectPackage {\n features: WcpProjectPackageFeatures\n }\n\n type WcpProject {\n orgId: ID\n projectId: ID\n package: WcpProjectPackage\n }\n\n type WcpError {\n code: String\n message: String\n data: JSON\n stack: String\n }\n\n type WcpProjectResponse {\n data: WcpProject\n error: WcpError\n }\n\n type WcpQuery {\n getProject: WcpProjectResponse\n }\n\n type WcpMutation {\n updateProject: WcpProjectResponse\n }\n\n extend type Query {\n wcp: WcpQuery\n }\n\n extend type Mutation {\n wcp: WcpMutation\n }\n `,\n resolvers: {\n Query: {\n wcp: emptyResolver\n },\n WcpQuery: {\n getProject: async (_, __, context) => {\n try {\n const wcpContext = context.container.resolve(WcpContext);\n const project = wcpContext.getProjectWithFeatureFlags();\n\n if (!project) {\n throw Error(`Could not get project!`);\n }\n\n return new Response(project);\n } catch (e) {\n return new ErrorResponse({\n code: \"COULD_NOT_GET_PROJECT\",\n message: e.message,\n data: null,\n stack: e.stack\n });\n }\n }\n }\n }\n });\n};\n"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,0CAA0C;AAC9E,SAASC,aAAa,EAAEC,QAAQ,QAAQ,sCAAsC;AAC9E,SAASC,UAAU;AAEnB,MAAMC,aAAa,GAAGA,CAAA,MAAO,CAAC,CAAC,CAAC;AAEhC,OAAO,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;EAClC,OAAO,IAAIL,mBAAmB,CAAC;IAC3BM,QAAQ,EAAE,aAAc;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;IACDC,SAAS,EAAE;MACPC,KAAK,EAAE;QACHC,GAAG,EAAEL;MACT,CAAC;MACDM,QAAQ,EAAE;QACNC,UAAU,EAAE,MAAAA,CAAOC,CAAC,EAAEC,EAAE,EAAEC,OAAO,KAAK;UAClC,IAAI;YACA,MAAMC,UAAU,GAAGD,OAAO,CAACE,SAAS,CAACC,OAAO,CAACd,UAAU,CAAC;YACxD,MAAMe,OAAO,GAAGH,UAAU,CAACI,0BAA0B,CAAC,CAAC;YAEvD,IAAI,CAACD,OAAO,EAAE;cACV,MAAME,KAAK,CAAC,wBAAwB,CAAC;YACzC;YAEA,OAAO,IAAIlB,QAAQ,CAACgB,OAAO,CAAC;UAChC,CAAC,CAAC,OAAOG,CAAC,EAAE;YACR,OAAO,IAAIpB,aAAa,CAAC;cACrBqB,IAAI,EAAE,uBAAuB;cAC7BC,OAAO,EAAEF,CAAC,CAACE,OAAO;cAClBC,IAAI,EAAE,IAAI;cACVC,KAAK,EAAEJ,CAAC,CAACI;YACb,CAAC,CAAC;UACN;QACJ;MACJ;IACJ;EACJ,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["GraphQLSchemaPlugin","ErrorResponse","Response","WcpContext","emptyResolver","createWcpGraphQL","typeDefs","resolvers","Query","wcp","WcpQuery","getProject","_","__","context","wcpContext","container","resolve","project","getProjectWithFeatureFlags","Error","e","code","message","data","stack"],"sources":["graphql.ts"],"sourcesContent":["import { GraphQLSchemaPlugin } from \"@webiny/handler-graphql/plugins/index.js\";\nimport { ErrorResponse, Response } from \"@webiny/handler-graphql/responses.js\";\nimport { WcpContext } from \"~/features/wcp/WcpContext/index.js\";\n\nconst emptyResolver = () => ({});\n\nexport const createWcpGraphQL = () => {\n return new GraphQLSchemaPlugin({\n typeDefs: /* GraphQL */ `\n type WcpProjectPackageFeaturesFeature {\n enabled: Boolean\n options: JSON\n }\n\n type WcpProjectPackageFeatures {\n seats: WcpProjectPackageFeaturesFeature\n multiTenancy: WcpProjectPackageFeaturesFeature\n advancedPublishingWorkflow: WcpProjectPackageFeaturesFeature\n advancedAccessControlLayer: WcpProjectPackageFeaturesFeature\n auditLogs: WcpProjectPackageFeaturesFeature\n recordLocking: WcpProjectPackageFeaturesFeature\n fileManager: WcpProjectPackageFeaturesFeature\n aiPowerups: WcpProjectPackageFeaturesFeature\n }\n\n type WcpProjectPackage {\n features: WcpProjectPackageFeatures\n }\n\n type WcpProject {\n orgId: ID\n projectId: ID\n package: WcpProjectPackage\n }\n\n type WcpError {\n code: String\n message: String\n data: JSON\n stack: String\n }\n\n type WcpProjectResponse {\n data: WcpProject\n error: WcpError\n }\n\n type WcpQuery {\n getProject: WcpProjectResponse\n }\n\n type WcpMutation {\n updateProject: WcpProjectResponse\n }\n\n extend type Query {\n wcp: WcpQuery\n }\n\n extend type Mutation {\n wcp: WcpMutation\n }\n `,\n resolvers: {\n Query: {\n wcp: emptyResolver\n },\n WcpQuery: {\n getProject: async (_, __, context) => {\n try {\n const wcpContext = context.container.resolve(WcpContext);\n const project = wcpContext.getProjectWithFeatureFlags();\n\n if (!project) {\n throw Error(`Could not get project!`);\n }\n\n return new Response(project);\n } catch (e) {\n return new ErrorResponse({\n code: \"COULD_NOT_GET_PROJECT\",\n message: e.message,\n data: null,\n stack: e.stack\n });\n }\n }\n }\n }\n });\n};\n"],"mappings":"AAAA,SAASA,mBAAmB,QAAQ,0CAA0C;AAC9E,SAASC,aAAa,EAAEC,QAAQ,QAAQ,sCAAsC;AAC9E,SAASC,UAAU;AAEnB,MAAMC,aAAa,GAAGA,CAAA,MAAO,CAAC,CAAC,CAAC;AAEhC,OAAO,MAAMC,gBAAgB,GAAGA,CAAA,KAAM;EAClC,OAAO,IAAIL,mBAAmB,CAAC;IAC3BM,QAAQ,EAAE,aAAc;AAChC;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA;AACA,SAAS;IACDC,SAAS,EAAE;MACPC,KAAK,EAAE;QACHC,GAAG,EAAEL;MACT,CAAC;MACDM,QAAQ,EAAE;QACNC,UAAU,EAAE,MAAAA,CAAOC,CAAC,EAAEC,EAAE,EAAEC,OAAO,KAAK;UAClC,IAAI;YACA,MAAMC,UAAU,GAAGD,OAAO,CAACE,SAAS,CAACC,OAAO,CAACd,UAAU,CAAC;YACxD,MAAMe,OAAO,GAAGH,UAAU,CAACI,0BAA0B,CAAC,CAAC;YAEvD,IAAI,CAACD,OAAO,EAAE;cACV,MAAME,KAAK,CAAC,wBAAwB,CAAC;YACzC;YAEA,OAAO,IAAIlB,QAAQ,CAACgB,OAAO,CAAC;UAChC,CAAC,CAAC,OAAOG,CAAC,EAAE;YACR,OAAO,IAAIpB,aAAa,CAAC;cACrBqB,IAAI,EAAE,uBAAuB;cAC7BC,OAAO,EAAEF,CAAC,CAACE,OAAO;cAClBC,IAAI,EAAE,IAAI;cACVC,KAAK,EAAEJ,CAAC,CAACI;YACb,CAAC,CAAC;UACN;QACJ;MACJ;IACJ;EACJ,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|
package/idp/abstractions.d.ts
CHANGED
|
@@ -19,6 +19,7 @@ export interface IIdentityProvider {
|
|
|
19
19
|
isApplicable(token: string): boolean;
|
|
20
20
|
getIdentity(token: string): Promise<IProviderIdentityData | null>;
|
|
21
21
|
}
|
|
22
|
+
/** Generic identity provider for token-based authentication. */
|
|
22
23
|
export declare const IdentityProvider: import("@webiny/di").Abstraction<IIdentityProvider>;
|
|
23
24
|
export declare namespace IdentityProvider {
|
|
24
25
|
type Interface = IIdentityProvider;
|
|
@@ -29,6 +30,7 @@ export interface IJwtIdentityProvider {
|
|
|
29
30
|
isApplicable(token: IJwtPayload): boolean;
|
|
30
31
|
getIdentity(token: string, jwt: IJwt): Promise<IProviderIdentityData | null>;
|
|
31
32
|
}
|
|
33
|
+
/** JWT-specific identity provider for token validation. */
|
|
32
34
|
export declare const JwtIdentityProvider: import("@webiny/di").Abstraction<IJwtIdentityProvider>;
|
|
33
35
|
export declare namespace JwtIdentityProvider {
|
|
34
36
|
type Interface = IJwtIdentityProvider;
|
|
@@ -45,6 +47,7 @@ export interface IOidcIdentityProvider {
|
|
|
45
47
|
verifyToken?(token: string): Promise<IJwtPayload | undefined>;
|
|
46
48
|
verifyTokenClaims?(token: IJwtPayload): Promise<void>;
|
|
47
49
|
}
|
|
50
|
+
/** OIDC-compliant identity provider with issuer validation. */
|
|
48
51
|
export declare const OidcIdentityProvider: import("@webiny/di").Abstraction<IOidcIdentityProvider>;
|
|
49
52
|
export declare namespace OidcIdentityProvider {
|
|
50
53
|
type Interface = IOidcIdentityProvider;
|
|
@@ -54,6 +57,7 @@ export declare namespace OidcIdentityProvider {
|
|
|
54
57
|
interface IJwkCache {
|
|
55
58
|
getKeys(issuer: string): Promise<IJwk[]>;
|
|
56
59
|
}
|
|
60
|
+
/** Cache for JSON Web Keys used in JWT verification. */
|
|
57
61
|
export declare const JwkCache: import("@webiny/di").Abstraction<IJwkCache>;
|
|
58
62
|
export declare namespace JwkCache {
|
|
59
63
|
type Interface = IJwkCache;
|
package/idp/abstractions.js
CHANGED
|
@@ -2,12 +2,16 @@ import { createAbstraction } from "@webiny/feature/api";
|
|
|
2
2
|
|
|
3
3
|
// Generic Idp Provider
|
|
4
4
|
|
|
5
|
+
/** Generic identity provider for token-based authentication. */
|
|
5
6
|
export const IdentityProvider = createAbstraction("IdentityProvider");
|
|
7
|
+
/** JWT-specific identity provider for token validation. */
|
|
6
8
|
export const JwtIdentityProvider = createAbstraction("JwtIdentityProvider");
|
|
7
9
|
|
|
8
10
|
// OIDC Provider
|
|
9
11
|
|
|
12
|
+
/** OIDC-compliant identity provider with issuer validation. */
|
|
10
13
|
export const OidcIdentityProvider = createAbstraction("OidcIdentityProvider");
|
|
14
|
+
/** Cache for JSON Web Keys used in JWT verification. */
|
|
11
15
|
export const JwkCache = createAbstraction("JwkCache");
|
|
12
16
|
|
|
13
17
|
//# sourceMappingURL=abstractions.js.map
|
package/idp/abstractions.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["createAbstraction","IdentityProvider","JwtIdentityProvider","OidcIdentityProvider","JwkCache"],"sources":["abstractions.ts"],"sourcesContent":["import type { JwtPayload as IJwtPayload, JwtHeader as IJwtHeader } from \"jsonwebtoken\";\nimport { createAbstraction } from \"@webiny/feature/api\";\nimport type { IdentityData as IIdentityData } from \"~/features/security/IdentityContext/Identity.js\";\nimport type { Jwk as IJwk } from \"~/features/security/utils/verifyJwtUsingJwk.js\";\n\nexport type IJwt = {\n header: IJwtHeader;\n payload: IJwtPayload;\n};\n\nexport type OptionalExternal<T> = Omit<T, \"external\"> & { external?: boolean };\n\nexport type IProviderIdentityData = Omit<IIdentityData, \"type\" | \"profile\"> & {\n /**\n * Defaults to `admin` it omitted.\n */\n type?: string;\n profile?: OptionalExternal<NonNullable<IIdentityData[\"profile\"]>>;\n};\n\n// Generic Idp Provider\nexport interface IIdentityProvider {\n isApplicable(token: string): boolean;\n getIdentity(token: string): Promise<IProviderIdentityData | null>;\n}\n\nexport const IdentityProvider = createAbstraction<IIdentityProvider>(\"IdentityProvider\");\n\nexport namespace IdentityProvider {\n export type Interface = IIdentityProvider;\n export type IdentityData = IProviderIdentityData;\n export type JwtPayload = IJwtPayload;\n}\n\nexport interface IJwtIdentityProvider {\n isApplicable(token: IJwtPayload): boolean;\n getIdentity(token: string, jwt: IJwt): Promise<IProviderIdentityData | null>;\n}\n\nexport const JwtIdentityProvider = createAbstraction<IJwtIdentityProvider>(\"JwtIdentityProvider\");\n\nexport namespace JwtIdentityProvider {\n export type Interface = IJwtIdentityProvider;\n export type Jwt = IJwt;\n export type JwtPayload = IJwtPayload;\n export type JwtHeader = IJwtHeader;\n export type IdentityData = IProviderIdentityData;\n}\n\n// OIDC Provider\nexport interface IOidcIdentityProvider {\n issuer: string;\n clientId: string;\n isApplicable(token: IJwtPayload): boolean;\n getIdentity(jwt: IJwtPayload): Promise<IProviderIdentityData>;\n verifyToken?(token: string): Promise<IJwtPayload | undefined>;\n verifyTokenClaims?(token: IJwtPayload): Promise<void>;\n}\n\nexport const OidcIdentityProvider =\n createAbstraction<IOidcIdentityProvider>(\"OidcIdentityProvider\");\n\nexport namespace OidcIdentityProvider {\n export type Interface = IOidcIdentityProvider;\n export type JwtPayload = IJwtPayload;\n export type IdentityData = IProviderIdentityData;\n}\n\ninterface IJwkCache {\n getKeys(issuer: string): Promise<IJwk[]>;\n}\n\nexport const JwkCache = createAbstraction<IJwkCache>(\"JwkCache\");\nexport namespace JwkCache {\n export type Interface = IJwkCache;\n export type Jwk = IJwk;\n}\n"],"mappings":"AACA,SAASA,iBAAiB,QAAQ,qBAAqB;;AAmBvD;;AAMA,OAAO,MAAMC,gBAAgB,GAAGD,iBAAiB,CAAoB,kBAAkB,CAAC;AAaxF,OAAO,MAAME,mBAAmB,GAAGF,iBAAiB,CAAuB,qBAAqB,CAAC;;AAUjG;;AAUA,OAAO,MAAMG,oBAAoB,GAC7BH,iBAAiB,CAAwB,sBAAsB,CAAC;AAYpE,OAAO,MAAMI,QAAQ,GAAGJ,iBAAiB,CAAY,UAAU,CAAC","ignoreList":[]}
|
|
1
|
+
{"version":3,"names":["createAbstraction","IdentityProvider","JwtIdentityProvider","OidcIdentityProvider","JwkCache"],"sources":["abstractions.ts"],"sourcesContent":["import type { JwtPayload as IJwtPayload, JwtHeader as IJwtHeader } from \"jsonwebtoken\";\nimport { createAbstraction } from \"@webiny/feature/api\";\nimport type { IdentityData as IIdentityData } from \"~/features/security/IdentityContext/Identity.js\";\nimport type { Jwk as IJwk } from \"~/features/security/utils/verifyJwtUsingJwk.js\";\n\nexport type IJwt = {\n header: IJwtHeader;\n payload: IJwtPayload;\n};\n\nexport type OptionalExternal<T> = Omit<T, \"external\"> & { external?: boolean };\n\nexport type IProviderIdentityData = Omit<IIdentityData, \"type\" | \"profile\"> & {\n /**\n * Defaults to `admin` it omitted.\n */\n type?: string;\n profile?: OptionalExternal<NonNullable<IIdentityData[\"profile\"]>>;\n};\n\n// Generic Idp Provider\nexport interface IIdentityProvider {\n isApplicable(token: string): boolean;\n getIdentity(token: string): Promise<IProviderIdentityData | null>;\n}\n\n/** Generic identity provider for token-based authentication. */\nexport const IdentityProvider = createAbstraction<IIdentityProvider>(\"IdentityProvider\");\n\nexport namespace IdentityProvider {\n export type Interface = IIdentityProvider;\n export type IdentityData = IProviderIdentityData;\n export type JwtPayload = IJwtPayload;\n}\n\nexport interface IJwtIdentityProvider {\n isApplicable(token: IJwtPayload): boolean;\n getIdentity(token: string, jwt: IJwt): Promise<IProviderIdentityData | null>;\n}\n\n/** JWT-specific identity provider for token validation. */\nexport const JwtIdentityProvider = createAbstraction<IJwtIdentityProvider>(\"JwtIdentityProvider\");\n\nexport namespace JwtIdentityProvider {\n export type Interface = IJwtIdentityProvider;\n export type Jwt = IJwt;\n export type JwtPayload = IJwtPayload;\n export type JwtHeader = IJwtHeader;\n export type IdentityData = IProviderIdentityData;\n}\n\n// OIDC Provider\nexport interface IOidcIdentityProvider {\n issuer: string;\n clientId: string;\n isApplicable(token: IJwtPayload): boolean;\n getIdentity(jwt: IJwtPayload): Promise<IProviderIdentityData>;\n verifyToken?(token: string): Promise<IJwtPayload | undefined>;\n verifyTokenClaims?(token: IJwtPayload): Promise<void>;\n}\n\n/** OIDC-compliant identity provider with issuer validation. */\nexport const OidcIdentityProvider =\n createAbstraction<IOidcIdentityProvider>(\"OidcIdentityProvider\");\n\nexport namespace OidcIdentityProvider {\n export type Interface = IOidcIdentityProvider;\n export type JwtPayload = IJwtPayload;\n export type IdentityData = IProviderIdentityData;\n}\n\ninterface IJwkCache {\n getKeys(issuer: string): Promise<IJwk[]>;\n}\n\n/** Cache for JSON Web Keys used in JWT verification. */\nexport const JwkCache = createAbstraction<IJwkCache>(\"JwkCache\");\nexport namespace JwkCache {\n export type Interface = IJwkCache;\n export type Jwk = IJwk;\n}\n"],"mappings":"AACA,SAASA,iBAAiB,QAAQ,qBAAqB;;AAmBvD;;AAMA;AACA,OAAO,MAAMC,gBAAgB,GAAGD,iBAAiB,CAAoB,kBAAkB,CAAC;AAaxF;AACA,OAAO,MAAME,mBAAmB,GAAGF,iBAAiB,CAAuB,qBAAqB,CAAC;;AAUjG;;AAUA;AACA,OAAO,MAAMG,oBAAoB,GAC7BH,iBAAiB,CAAwB,sBAAsB,CAAC;AAYpE;AACA,OAAO,MAAMI,QAAQ,GAAGJ,iBAAiB,CAAY,UAAU,CAAC","ignoreList":[]}
|
package/idp/feature.d.ts
CHANGED
|
@@ -1,19 +1,8 @@
|
|
|
1
1
|
import { ContextPlugin } from "@webiny/api";
|
|
2
|
-
import { RolesProvider, TeamsProvider } from "../../features/security/shared/abstractions.js";
|
|
3
|
-
import { SecurityRolePlugin } from "./plugins/SecurityRolePlugin.js";
|
|
4
|
-
import { SecurityTeamPlugin } from "./plugins/SecurityTeamPlugin.js";
|
|
5
2
|
import { LegacyContext } from "./LegacyContext.js";
|
|
6
3
|
import { createSecurityGraphQL } from "../../graphql/security/index.js";
|
|
7
4
|
export const createSecurityContext = () => {
|
|
8
5
|
return new ContextPlugin(async context => {
|
|
9
|
-
// Register roles and teams providers for plugin-defined roles/teams
|
|
10
|
-
context.container.registerFactory(RolesProvider, () => {
|
|
11
|
-
return async () => context.plugins.byType(SecurityRolePlugin.type).map(plugin => plugin.securityRole);
|
|
12
|
-
});
|
|
13
|
-
context.container.registerFactory(TeamsProvider, () => {
|
|
14
|
-
return async () => context.plugins.byType(SecurityTeamPlugin.type).map(plugin => plugin.securityTeam);
|
|
15
|
-
});
|
|
16
|
-
|
|
17
6
|
// Create a legacy context that delegates to new features
|
|
18
7
|
context.security = new LegacyContext(context.container);
|
|
19
8
|
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["ContextPlugin","
|
|
1
|
+
{"version":3,"names":["ContextPlugin","LegacyContext","createSecurityGraphQL","createSecurityContext","context","security","container","plugins","register"],"sources":["createSecurityContext.ts"],"sourcesContent":["import { ContextPlugin } from \"@webiny/api\";\nimport type { ApiCoreContext } from \"~/types/core.js\";\nimport { LegacyContext } from \"~/legacy/security/LegacyContext.js\";\nimport { createSecurityGraphQL } from \"~/graphql/security/index.js\";\n\nexport const createSecurityContext = () => {\n return new ContextPlugin<ApiCoreContext>(async context => {\n // Create a legacy context that delegates to new features\n context.security = new LegacyContext(context.container);\n\n // Register GraphQL plugins\n context.plugins.register(createSecurityGraphQL());\n });\n};\n"],"mappings":"AAAA,SAASA,aAAa,QAAQ,aAAa;AAE3C,SAASC,aAAa;AACtB,SAASC,qBAAqB;AAE9B,OAAO,MAAMC,qBAAqB,GAAGA,CAAA,KAAM;EACvC,OAAO,IAAIH,aAAa,CAAiB,MAAMI,OAAO,IAAI;IACtD;IACAA,OAAO,CAACC,QAAQ,GAAG,IAAIJ,aAAa,CAACG,OAAO,CAACE,SAAS,CAAC;;IAEvD;IACAF,OAAO,CAACG,OAAO,CAACC,QAAQ,CAACN,qBAAqB,CAAC,CAAC,CAAC;EACrD,CAAC,CAAC;AACN,CAAC","ignoreList":[]}
|
|
@@ -2,4 +2,4 @@ import type { ApiCoreContext } from "../../../types/core.js";
|
|
|
2
2
|
export interface GetHeader {
|
|
3
3
|
(context: ApiCoreContext): string | null | undefined;
|
|
4
4
|
}
|
|
5
|
-
export declare const authenticateUsingHttpHeader: () => (import("@webiny/handler").
|
|
5
|
+
export declare const authenticateUsingHttpHeader: () => (import("@webiny/handler").BeforeHandlerPlugin<ApiCoreContext> | (import("@webiny/api/index.js").ContextPlugin<ApiCoreContext> | import("@webiny/handler").BeforeHandlerPlugin<ApiCoreContext>)[] | import("@webiny/handler").HandlerOnRequestPlugin<import("@webiny/handler/types.js").Context>)[];
|
|
@@ -21,6 +21,9 @@ export declare class LegacyWcpContext implements WcpContextObject {
|
|
|
21
21
|
canUseFileManagerThreatDetection(): boolean;
|
|
22
22
|
canUseWorkflows(): boolean;
|
|
23
23
|
canUseHcmsFieldPermissions(): boolean;
|
|
24
|
+
canUseAiImageEnrichment(): boolean;
|
|
25
|
+
canUseAiPageGeneration(): boolean;
|
|
26
|
+
canUseAiLexicalGeneration(): boolean;
|
|
24
27
|
ensureCanUseFeature(featureId: keyof typeof WCP_FEATURE_LABEL): void;
|
|
25
28
|
incrementSeats(): Promise<void>;
|
|
26
29
|
decrementSeats(): Promise<void>;
|
|
@@ -51,6 +51,15 @@ export class LegacyWcpContext {
|
|
|
51
51
|
canUseHcmsFieldPermissions() {
|
|
52
52
|
return this.getWcpContext().canUseHcmsFieldPermissions();
|
|
53
53
|
}
|
|
54
|
+
canUseAiImageEnrichment() {
|
|
55
|
+
return this.getWcpContext().canUseAiImageEnrichment();
|
|
56
|
+
}
|
|
57
|
+
canUseAiPageGeneration() {
|
|
58
|
+
return this.getWcpContext().canUseAiPageGeneration();
|
|
59
|
+
}
|
|
60
|
+
canUseAiLexicalGeneration() {
|
|
61
|
+
return this.getWcpContext().canUseAiLexicalGeneration();
|
|
62
|
+
}
|
|
54
63
|
ensureCanUseFeature(featureId) {
|
|
55
64
|
this.getWcpContext().ensureCanUseFeature(featureId);
|
|
56
65
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["WcpContext","LegacyWcpContext","constructor","container","getWcpContext","resolve","getRawLicense","getProject","getProjectWithFeatureFlags","getProjectLicense","getProjectEnvironment","canUseFeature","wcpFeatureId","canUseAacl","canUseTeams","canUseFolderLevelPermissions","canUsePrivateFiles","canUseAuditLogs","canUseRecordLocking","canUseFileManagerThreatDetection","canUseWorkflows","canUseHcmsFieldPermissions","ensureCanUseFeature","featureId","incrementSeats","decrementSeats","incrementTenants","decrementTenants","toDto"],"sources":["LegacyWcpContext.ts"],"sourcesContent":["import { Container } from \"@webiny/di\";\nimport type { WCP_FEATURE_LABEL } from \"@webiny/wcp\";\nimport type {\n DecryptedWcpProjectLicense,\n ILicense,\n WcpProject,\n WcpProjectEnvironment\n} from \"@webiny/wcp/types.js\";\nimport { WcpContextObject } from \"~/features/wcp/WcpContext/types.js\";\nimport { WcpContext } from \"~/features/wcp/WcpContext/index.js\";\n\nexport class LegacyWcpContext implements WcpContextObject {\n constructor(private container: Container) {}\n\n private getWcpContext(): WcpContext.Interface {\n return this.container.resolve(WcpContext);\n }\n\n getRawLicense(): DecryptedWcpProjectLicense | null {\n return this.getWcpContext().getRawLicense();\n }\n\n getProject(): WcpProject | null {\n return this.getWcpContext().getProject();\n }\n\n getProjectWithFeatureFlags(): WcpProject | null {\n return this.getWcpContext().getProjectWithFeatureFlags();\n }\n\n getProjectLicense(): ILicense {\n return this.getWcpContext().getProjectLicense();\n }\n\n getProjectEnvironment(): WcpProjectEnvironment | null {\n return this.getWcpContext().getProjectEnvironment();\n }\n\n canUseFeature(wcpFeatureId: keyof typeof WCP_FEATURE_LABEL): boolean {\n return this.getWcpContext().canUseFeature(wcpFeatureId);\n }\n\n canUseAacl(): boolean {\n return this.getWcpContext().canUseAacl();\n }\n\n canUseTeams(): boolean {\n return this.getWcpContext().canUseTeams();\n }\n\n canUseFolderLevelPermissions(): boolean {\n return this.getWcpContext().canUseFolderLevelPermissions();\n }\n\n canUsePrivateFiles(): boolean {\n return this.getWcpContext().canUsePrivateFiles();\n }\n\n canUseAuditLogs(): boolean {\n return this.getWcpContext().canUseAuditLogs();\n }\n\n canUseRecordLocking(): boolean {\n return this.getWcpContext().canUseRecordLocking();\n }\n\n canUseFileManagerThreatDetection(): boolean {\n return this.getWcpContext().canUseFileManagerThreatDetection();\n }\n\n canUseWorkflows(): boolean {\n return this.getWcpContext().canUseWorkflows();\n }\n\n canUseHcmsFieldPermissions(): boolean {\n return this.getWcpContext().canUseHcmsFieldPermissions();\n }\n\n ensureCanUseFeature(featureId: keyof typeof WCP_FEATURE_LABEL): void {\n this.getWcpContext().ensureCanUseFeature(featureId);\n }\n\n async incrementSeats(): Promise<void> {\n await this.getWcpContext().incrementSeats();\n }\n\n async decrementSeats(): Promise<void> {\n await this.getWcpContext().decrementSeats();\n }\n\n async incrementTenants(): Promise<void> {\n await this.getWcpContext().incrementTenants();\n }\n\n async decrementTenants(): Promise<void> {\n await this.getWcpContext().decrementTenants();\n }\n\n toDto(): DecryptedWcpProjectLicense | null {\n return this.getWcpContext().toDto();\n }\n}\n"],"mappings":"AASA,SAASA,UAAU;AAEnB,OAAO,MAAMC,gBAAgB,CAA6B;EACtDC,WAAWA,CAASC,SAAoB,EAAE;IAAA,KAAtBA,SAAoB,GAApBA,SAAoB;EAAG;EAEnCC,aAAaA,CAAA,EAAyB;IAC1C,OAAO,IAAI,CAACD,SAAS,CAACE,OAAO,CAACL,UAAU,CAAC;EAC7C;EAEAM,aAAaA,CAAA,EAAsC;IAC/C,OAAO,IAAI,CAACF,aAAa,CAAC,CAAC,CAACE,aAAa,CAAC,CA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e,gCAAgC,CAAC,CAAC;EAClE;EAEAC,eAAeA,CAAA,EAAY;IACvB,OAAO,IAAI,CAAChB,aAAa,CAAC,CAAC,CAACgB,eAAe,CAAC,CAAC;EACjD;EAEAC,0BAA0BA,CAAA,EAAY;IAClC,OAAO,IAAI,CAACjB,aAAa,CAAC,CAAC,CAACiB,0BAA0B,CAAC,CAAC;EAC5D;EAEAC,mBAAmBA,CAACC,SAAyC,EAAQ;IACjE,IAAI,
|
|
1
|
+
{"version":3,"names":["WcpContext","LegacyWcpContext","constructor","container","getWcpContext","resolve","getRawLicense","getProject","getProjectWithFeatureFlags","getProjectLicense","getProjectEnvironment","canUseFeature","wcpFeatureId","canUseAacl","canUseTeams","canUseFolderLevelPermissions","canUsePrivateFiles","canUseAuditLogs","canUseRecordLocking","canUseFileManagerThreatDetection","canUseWorkflows","canUseHcmsFieldPermissions","canUseAiImageEnrichment","canUseAiPageGeneration","canUseAiLexicalGeneration","ensureCanUseFeature","featureId","incrementSeats","decrementSeats","incrementTenants","decrementTenants","toDto"],"sources":["LegacyWcpContext.ts"],"sourcesContent":["import { Container } from \"@webiny/di\";\nimport type { WCP_FEATURE_LABEL } from \"@webiny/wcp\";\nimport type {\n DecryptedWcpProjectLicense,\n ILicense,\n WcpProject,\n WcpProjectEnvironment\n} from \"@webiny/wcp/types.js\";\nimport { WcpContextObject } from \"~/features/wcp/WcpContext/types.js\";\nimport { WcpContext } from \"~/features/wcp/WcpContext/index.js\";\n\nexport class LegacyWcpContext implements WcpContextObject {\n constructor(private container: Container) {}\n\n private getWcpContext(): WcpContext.Interface {\n return this.container.resolve(WcpContext);\n }\n\n getRawLicense(): DecryptedWcpProjectLicense | null {\n return this.getWcpContext().getRawLicense();\n }\n\n getProject(): WcpProject | null {\n return this.getWcpContext().getProject();\n }\n\n getProjectWithFeatureFlags(): WcpProject | null {\n return this.getWcpContext().getProjectWithFeatureFlags();\n }\n\n getProjectLicense(): ILicense {\n return this.getWcpContext().getProjectLicense();\n }\n\n getProjectEnvironment(): WcpProjectEnvironment | null {\n return this.getWcpContext().getProjectEnvironment();\n }\n\n canUseFeature(wcpFeatureId: keyof typeof WCP_FEATURE_LABEL): boolean {\n return this.getWcpContext().canUseFeature(wcpFeatureId);\n }\n\n canUseAacl(): boolean {\n return this.getWcpContext().canUseAacl();\n }\n\n canUseTeams(): boolean {\n return this.getWcpContext().canUseTeams();\n }\n\n canUseFolderLevelPermissions(): boolean {\n return this.getWcpContext().canUseFolderLevelPermissions();\n }\n\n canUsePrivateFiles(): boolean {\n return this.getWcpContext().canUsePrivateFiles();\n }\n\n canUseAuditLogs(): boolean {\n return this.getWcpContext().canUseAuditLogs();\n }\n\n canUseRecordLocking(): boolean {\n return this.getWcpContext().canUseRecordLocking();\n }\n\n canUseFileManagerThreatDetection(): boolean {\n return this.getWcpContext().canUseFileManagerThreatDetection();\n }\n\n canUseWorkflows(): boolean {\n return this.getWcpContext().canUseWorkflows();\n }\n\n canUseHcmsFieldPermissions(): boolean {\n return this.getWcpContext().canUseHcmsFieldPermissions();\n }\n\n canUseAiImageEnrichment(): boolean {\n return this.getWcpContext().canUseAiImageEnrichment();\n }\n\n canUseAiPageGeneration(): boolean {\n return this.getWcpContext().canUseAiPageGeneration();\n }\n\n canUseAiLexicalGeneration(): boolean {\n return this.getWcpContext().canUseAiLexicalGeneration();\n }\n\n ensureCanUseFeature(featureId: keyof typeof WCP_FEATURE_LABEL): void {\n this.getWcpContext().ensureCanUseFeature(featureId);\n }\n\n async incrementSeats(): Promise<void> {\n await this.getWcpContext().incrementSeats();\n }\n\n async decrementSeats(): Promise<void> {\n await this.getWcpContext().decrementSeats();\n }\n\n async incrementTenants(): Promise<void> {\n await this.getWcpContext().incrementTenants();\n }\n\n async decrementTenants(): Promise<void> {\n await this.getWcpContext().decrementTenants();\n }\n\n toDto(): DecryptedWcpProjectLicense | null {\n return this.getWcpContext().toDto();\n }\n}\n"],"mappings":"AASA,SAASA,UAAU;AAEnB,OAAO,MAAMC,gBAAgB,C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AC,CAAC,CAACyB,gBAAgB,CAAC,CAAC;EACjD;EAEA,MAAMC,gBAAgBA,CAAA,EAAkB;IACpC,MAAM,IAAI,CAAC1B,aAAa,CAAC,CAAC,CAAC0B,gBAAgB,CAAC,CAAC;EACjD;EAEAC,KAAKA,CAAA,EAAsC;IACvC,OAAO,IAAI,CAAC3B,aAAa,CAAC,CAAC,CAAC2B,KAAK,CAAC,CAAC;EACvC;AACJ","ignoreList":[]}
|
package/legacy/wcp/context.d.ts
CHANGED
|
@@ -1,7 +1,5 @@
|
|
|
1
|
-
import { ContextPlugin } from "@webiny/api";
|
|
2
1
|
import type { DecryptedWcpProjectLicense } from "@webiny/wcp/types.js";
|
|
3
|
-
import type { WcpContext } from "../../features/wcp/WcpContext/types.js";
|
|
4
2
|
export interface CreateWcpContextParams {
|
|
5
3
|
testProjectLicense?: DecryptedWcpProjectLicense;
|
|
6
4
|
}
|
|
7
|
-
export declare const createWcpContext: (params?: CreateWcpContextParams) =>
|
|
5
|
+
export declare const createWcpContext: (params?: CreateWcpContextParams) => import("@webiny/handler/index.js").RegisterExtensionPlugin<import("@webiny/handler/types.js").Context>;
|
package/legacy/wcp/context.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
|
-
import { ContextPlugin } from "@webiny/api";
|
|
2
1
|
import { getWcpProjectLicense, getWcpProjectEnvironment, NullLicense } from "@webiny/wcp";
|
|
3
2
|
import { License } from "@webiny/wcp";
|
|
3
|
+
import { createRegisterExtensionPlugin } from "@webiny/handler/plugins/RegisterExtensionPlugin.js";
|
|
4
4
|
import { getWcpProjectLicenseCacheKey } from "../../features/wcp/WcpContext/utils.js";
|
|
5
5
|
import { WcpFeature } from "../../features/wcp/WcpFeature.js";
|
|
6
6
|
import { LegacyWcpContext } from "./LegacyWcpContext.js";
|
|
@@ -37,9 +37,11 @@ async function loadLicense(testProjectLicense) {
|
|
|
37
37
|
return cachedLicense.license;
|
|
38
38
|
}
|
|
39
39
|
export const createWcpContext = (params = {}) => {
|
|
40
|
-
const plugin =
|
|
40
|
+
const plugin = createRegisterExtensionPlugin(async context => {
|
|
41
41
|
const license = await loadLicense(params.testProjectLicense);
|
|
42
42
|
WcpFeature.register(context.container, license);
|
|
43
|
+
|
|
44
|
+
// @ts-expect-error This is a legacy property
|
|
43
45
|
context.wcp = new LegacyWcpContext(context.container);
|
|
44
46
|
context.plugins.register(createWcpGraphQL());
|
|
45
47
|
});
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"names":["
|
|
1
|
+
{"version":3,"names":["getWcpProjectLicense","getWcpProjectEnvironment","NullLicense","License","createRegisterExtensionPlugin","getWcpProjectLicenseCacheKey","WcpFeature","LegacyWcpContext","createWcpGraphQL","wcpProjectEnvironment","cachedLicense","cacheKey","project","license","loadLicense","testProjectLicense","fromLicenseDto","currentCacheKey","decryptedLicenseDto","orgId","org","id","projectId","projectEnvironmentApiKey","apiKey","package","createWcpContext","params","plugin","context","register","container","wcp","plugins","name"],"sources":["context.ts"],"sourcesContent":["import { getWcpProjectLicense, getWcpProjectEnvironment, NullLicense } from \"@webiny/wcp\";\nimport type { DecryptedWcpProjectLicense, ILicense } from \"@webiny/wcp/types.js\";\nimport { License } from \"@webiny/wcp\";\nimport { createRegisterExtensionPlugin } from \"@webiny/handler/plugins/RegisterExtensionPlugin.js\";\nimport type { CachedWcpProjectLicense } from \"~/features/wcp/WcpContext/types.js\";\nimport { getWcpProjectLicenseCacheKey } from \"~/features/wcp/WcpContext/utils.js\";\nimport { WcpFeature } from \"~/features/wcp/WcpFeature.js\";\nimport { LegacyWcpContext } from \"./LegacyWcpContext.js\";\nimport { createWcpGraphQL } from \"~/graphql/wcp/graphql.js\";\n\nconst wcpProjectEnvironment = getWcpProjectEnvironment();\n\nconst cachedLicense: CachedWcpProjectLicense = {\n cacheKey: null,\n project: null,\n license: new NullLicense()\n};\n\nasync function loadLicense(testProjectLicense?: DecryptedWcpProjectLicense): Promise<ILicense> {\n if (testProjectLicense) {\n cachedLicense.license = License.fromLicenseDto(testProjectLicense);\n } else if (wcpProjectEnvironment) {\n const currentCacheKey = getWcpProjectLicenseCacheKey();\n if (cachedLicense.cacheKey !== currentCacheKey) {\n cachedLicense.cacheKey = currentCacheKey;\n // Pull the project license from the WCP API.\n const decryptedLicenseDto = await getWcpProjectLicense({\n orgId: wcpProjectEnvironment.org.id,\n projectId: wcpProjectEnvironment.project.id,\n projectEnvironmentApiKey: wcpProjectEnvironment.apiKey\n });\n\n if (decryptedLicenseDto) {\n cachedLicense.project = {\n orgId: decryptedLicenseDto.orgId,\n projectId: decryptedLicenseDto.projectId,\n package: decryptedLicenseDto.package\n };\n }\n\n cachedLicense.license = License.fromLicenseDto(decryptedLicenseDto);\n }\n }\n\n return cachedLicense.license;\n}\n\nexport interface CreateWcpContextParams {\n testProjectLicense?: DecryptedWcpProjectLicense;\n}\n\nexport const createWcpContext = (params: CreateWcpContextParams = {}) => {\n const plugin = createRegisterExtensionPlugin(async context => {\n const license = await loadLicense(params.testProjectLicense);\n\n WcpFeature.register(context.container, license);\n\n // @ts-expect-error This is a legacy property\n context.wcp = new LegacyWcpContext(context.container);\n\n context.plugins.register(createWcpGraphQL());\n });\n\n plugin.name = \"wcp.context.create\";\n\n return plugin;\n};\n"],"mappings":"AAAA,SAASA,oBAAoB,EAAEC,wBAAwB,EAAEC,WAAW,QAAQ,aAAa;AAEzF,SAASC,OAAO,QAAQ,aAAa;AACrC,SAASC,6BAA6B,QAAQ,oDAAoD;AAElG,SAASC,4BAA4B;AACrC,SAASC,UAAU;AACnB,SAASC,gBAAgB;AACzB,SAASC,gBAAgB;AAEzB,MAAMC,qBAAqB,GAAGR,wBAAwB,CAAC,CAAC;AAExD,MAAMS,aAAsC,GAAG;EAC3CC,QAAQ,EAAE,IAAI;EACdC,OAAO,EAAE,IAAI;EACbC,OAAO,EAAE,IAAIX,WAAW,CAAC;AAC7B,CAAC;AAED,eAAeY,WAAWA,CAACC,kBAA+C,EAAqB;EAC3F,IAAIA,kBAAkB,EAA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