@webiny/api-core 0.0.0-unstable.a4f3e4ea8b → 0.0.0-unstable.a85ef555b2
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/ApiCoreFeature.d.ts +2 -2
- package/ApiCoreFeature.js +35 -5
- package/ApiCoreFeature.js.map +1 -1
- package/exports/api/tasks.d.ts +1 -0
- package/exports/api/tasks.js +1 -1
- package/exports/api.d.ts +2 -1
- package/exports/api.js +2 -1
- package/features/ai/Ai.js +16 -6
- package/features/ai/Ai.js.map +1 -1
- package/features/ai/AiModelRegistry.d.ts +3 -1
- package/features/ai/AiModelRegistry.js +16 -7
- package/features/ai/AiModelRegistry.js.map +1 -1
- package/features/ai/AiSdkToolHandlerResolver.d.ts +11 -0
- package/features/ai/AiSdkToolHandlerResolver.js +19 -0
- package/features/ai/AiSdkToolHandlerResolver.js.map +1 -0
- package/features/ai/AiSdkTools.d.ts +4 -3
- package/features/ai/AiSdkTools.js +11 -9
- package/features/ai/AiSdkTools.js.map +1 -1
- package/features/ai/DEVELOPERS.md +69 -12
- package/features/ai/OpenRouterSdkFactory.d.ts +10 -0
- package/features/ai/OpenRouterSdkFactory.js +112 -0
- package/features/ai/OpenRouterSdkFactory.js.map +1 -0
- package/features/ai/RemoteAiModelCatalog.d.ts +13 -0
- package/features/ai/RemoteAiModelCatalog.js +74 -0
- package/features/ai/RemoteAiModelCatalog.js.map +1 -0
- package/features/ai/abstractions.d.ts +90 -7
- package/features/ai/abstractions.js +5 -2
- package/features/ai/abstractions.js.map +1 -1
- package/features/ai/feature.js +6 -0
- package/features/ai/feature.js.map +1 -1
- package/features/ai/index.d.ts +2 -4
- package/features/ai/index.js +1 -1
- package/features/dateFormatter/DefaultDateFormatter.d.ts +15 -0
- package/features/dateFormatter/DefaultDateFormatter.js +20 -0
- package/features/dateFormatter/DefaultDateFormatter.js.map +1 -0
- package/features/dateFormatter/abstractions.d.ts +13 -0
- package/features/dateFormatter/abstractions.js +5 -0
- package/features/dateFormatter/abstractions.js.map +1 -0
- package/features/dateFormatter/feature.d.ts +4 -0
- package/features/dateFormatter/feature.js +11 -0
- package/features/dateFormatter/feature.js.map +1 -0
- package/features/dateFormatter/index.d.ts +3 -0
- package/features/dateFormatter/index.js +2 -0
- package/features/debugger/Debugger.d.ts +30 -0
- package/features/debugger/Debugger.js +142 -0
- package/features/debugger/Debugger.js.map +1 -0
- package/features/debugger/DebuggerRouteDecorator.d.ts +45 -0
- package/features/debugger/DebuggerRouteDecorator.js +107 -0
- package/features/debugger/DebuggerRouteDecorator.js.map +1 -0
- package/features/debugger/GraphQLDebuggerTransport.d.ts +28 -0
- package/features/debugger/GraphQLDebuggerTransport.js +45 -0
- package/features/debugger/GraphQLDebuggerTransport.js.map +1 -0
- package/features/debugger/__tests__/matchNamespace.test.d.ts +1 -0
- package/features/debugger/__tests__/matchNamespace.test.js +68 -0
- package/features/debugger/__tests__/matchNamespace.test.js.map +1 -0
- package/features/debugger/__tests__/serialize.test.d.ts +1 -0
- package/features/debugger/__tests__/serialize.test.js +220 -0
- package/features/debugger/__tests__/serialize.test.js.map +1 -0
- package/features/debugger/abstractions.d.ts +100 -0
- package/features/debugger/abstractions.js +6 -0
- package/features/debugger/abstractions.js.map +1 -0
- package/features/debugger/feature.d.ts +5 -0
- package/features/debugger/feature.js +15 -0
- package/features/debugger/feature.js.map +1 -0
- package/features/debugger/index.d.ts +12 -0
- package/features/debugger/index.js +7 -0
- package/features/debugger/limits.d.ts +18 -0
- package/features/debugger/limits.js +11 -0
- package/features/debugger/limits.js.map +1 -0
- package/features/debugger/matchNamespace.d.ts +14 -0
- package/features/debugger/matchNamespace.js +35 -0
- package/features/debugger/matchNamespace.js.map +1 -0
- package/features/debugger/parseNamespaceHeader.d.ts +7 -0
- package/features/debugger/parseNamespaceHeader.js +16 -0
- package/features/debugger/parseNamespaceHeader.js.map +1 -0
- package/features/debugger/permissions.d.ts +14 -0
- package/features/debugger/permissions.js +8 -0
- package/features/debugger/permissions.js.map +1 -0
- package/features/debugger/permissionsSchema.d.ts +17 -0
- package/features/debugger/permissionsSchema.js +18 -0
- package/features/debugger/permissionsSchema.js.map +1 -0
- package/features/debugger/serialize.d.ts +11 -0
- package/features/debugger/serialize.js +121 -0
- package/features/debugger/serialize.js.map +1 -0
- package/features/encryption/EncryptionKeyCacheFeature.d.ts +8 -0
- package/features/encryption/EncryptionKeyCacheFeature.js +11 -0
- package/features/encryption/EncryptionKeyCacheFeature.js.map +1 -0
- package/features/encryption/EncryptionService.d.ts +2 -1
- package/features/encryption/EncryptionService.js +11 -4
- package/features/encryption/EncryptionService.js.map +1 -1
- package/features/encryption/MemoryEncryptionKeyCache.d.ts +13 -0
- package/features/encryption/MemoryEncryptionKeyCache.js +26 -0
- package/features/encryption/MemoryEncryptionKeyCache.js.map +1 -0
- package/features/encryption/abstractions.d.ts +11 -0
- package/features/encryption/abstractions.js +2 -1
- package/features/encryption/abstractions.js.map +1 -1
- package/features/encryption/index.d.ts +1 -0
- package/features/encryption/index.js +1 -0
- package/features/featureFlags/decorators/FeatureFlagsWithLicenseDecorator.d.ts +13 -0
- package/features/featureFlags/decorators/FeatureFlagsWithLicenseDecorator.js +62 -0
- package/features/featureFlags/decorators/FeatureFlagsWithLicenseDecorator.js.map +1 -0
- package/features/hashing/ScryptHasher.d.ts +11 -0
- package/features/hashing/ScryptHasher.js +74 -0
- package/features/hashing/ScryptHasher.js.map +1 -0
- package/features/hashing/abstractions.d.ts +18 -0
- package/features/hashing/abstractions.js +5 -0
- package/features/hashing/abstractions.js.map +1 -0
- package/features/hashing/feature.d.ts +4 -0
- package/features/hashing/feature.js +11 -0
- package/features/hashing/feature.js.map +1 -0
- package/features/hashing/index.d.ts +2 -0
- package/features/hashing/index.js +1 -0
- package/features/httpClient/HttpClient.d.ts +7 -0
- package/features/httpClient/HttpClient.js +72 -0
- package/features/httpClient/HttpClient.js.map +1 -0
- package/features/httpClient/HttpRequestError.d.ts +10 -0
- package/features/httpClient/HttpRequestError.js +13 -0
- package/features/httpClient/HttpRequestError.js.map +1 -0
- package/features/httpClient/HttpStatusError.d.ts +12 -0
- package/features/httpClient/HttpStatusError.js +12 -0
- package/features/httpClient/HttpStatusError.js.map +1 -0
- package/features/httpClient/abstractions.d.ts +32 -0
- package/features/httpClient/abstractions.js +5 -0
- package/features/httpClient/abstractions.js.map +1 -0
- package/features/httpClient/feature.d.ts +4 -0
- package/features/httpClient/feature.js +11 -0
- package/features/httpClient/feature.js.map +1 -0
- package/features/httpClient/index.d.ts +3 -0
- package/features/httpClient/index.js +3 -0
- package/features/keyValueStore/GlobalKeyValueStore.d.ts +9 -3
- package/features/keyValueStore/GlobalKeyValueStore.js +12 -2
- package/features/keyValueStore/GlobalKeyValueStore.js.map +1 -1
- package/features/keyValueStore/KeyValueStore.d.ts +6 -2
- package/features/keyValueStore/KeyValueStore.js +13 -3
- package/features/keyValueStore/KeyValueStore.js.map +1 -1
- package/features/keyValueStore/KeyValueStoreRepository.d.ts +8 -2
- package/features/keyValueStore/KeyValueStoreRepository.js +82 -4
- package/features/keyValueStore/KeyValueStoreRepository.js.map +1 -1
- package/features/keyValueStore/abstractions.d.ts +132 -14
- package/features/keyValueStore/abstractions.js.map +1 -1
- package/features/keyValueStore/errors.d.ts +29 -0
- package/features/keyValueStore/errors.js +49 -1
- package/features/keyValueStore/errors.js.map +1 -1
- package/features/keyValueStore/index.d.ts +4 -1
- package/features/keyValueStore/index.js +1 -1
- package/features/publicUrls/NullPublicUrls.d.ts +11 -0
- package/features/publicUrls/NullPublicUrls.js +17 -0
- package/features/publicUrls/NullPublicUrls.js.map +1 -0
- package/features/publicUrls/PublicUrl.d.ts +24 -0
- package/features/publicUrls/PublicUrl.js +43 -0
- package/features/publicUrls/PublicUrl.js.map +1 -0
- package/features/publicUrls/__tests__/PublicUrl.test.d.ts +1 -0
- package/features/publicUrls/__tests__/PublicUrl.test.js +38 -0
- package/features/publicUrls/__tests__/PublicUrl.test.js.map +1 -0
- package/features/publicUrls/__tests__/PublicUrls.test.d.ts +1 -0
- package/features/publicUrls/__tests__/PublicUrls.test.js +14 -0
- package/features/publicUrls/__tests__/PublicUrls.test.js.map +1 -0
- package/features/publicUrls/abstractions.d.ts +27 -0
- package/features/publicUrls/abstractions.js +5 -0
- package/features/publicUrls/abstractions.js.map +1 -0
- package/features/publicUrls/feature.d.ts +8 -0
- package/features/publicUrls/feature.js +11 -0
- package/features/publicUrls/feature.js.map +1 -0
- package/features/publicUrls/index.d.ts +3 -0
- package/features/publicUrls/index.js +3 -0
- package/features/requestContext/RawAssumePermissions.d.ts +14 -0
- package/features/requestContext/RawAssumePermissions.js +19 -0
- package/features/requestContext/RawAssumePermissions.js.map +1 -0
- package/features/requestContext/RawAuthToken.d.ts +14 -0
- package/features/requestContext/RawAuthToken.js +19 -0
- package/features/requestContext/RawAuthToken.js.map +1 -0
- package/features/requestContext/RawTenantId.d.ts +14 -0
- package/features/requestContext/RawTenantId.js +19 -0
- package/features/requestContext/RawTenantId.js.map +1 -0
- package/features/requestContext/RequestIdentityLoader.d.ts +19 -0
- package/features/requestContext/RequestIdentityLoader.js +26 -0
- package/features/requestContext/RequestIdentityLoader.js.map +1 -0
- package/features/requestContext/RequestTenantLoader.d.ts +18 -0
- package/features/requestContext/RequestTenantLoader.js +52 -0
- package/features/requestContext/RequestTenantLoader.js.map +1 -0
- package/features/requestContext/abstractions.d.ts +75 -0
- package/features/requestContext/abstractions.js +9 -0
- package/features/requestContext/abstractions.js.map +1 -0
- package/features/requestContext/extractAssumePermissions.d.ts +14 -0
- package/features/requestContext/extractAssumePermissions.js +32 -0
- package/features/requestContext/extractAssumePermissions.js.map +1 -0
- package/features/requestContext/feature.d.ts +12 -0
- package/features/requestContext/feature.js +19 -0
- package/features/requestContext/feature.js.map +1 -0
- package/features/requestContext/index.d.ts +4 -0
- package/features/requestContext/index.js +3 -0
- package/features/security/IdentityContext/IdentityContext.d.ts +4 -3
- package/features/security/IdentityContext/IdentityContext.js +9 -6
- package/features/security/IdentityContext/IdentityContext.js.map +1 -1
- package/features/security/IdentityContext/abstractions.d.ts +5 -0
- package/features/security/IdentityContext/abstractions.js.map +1 -1
- package/features/security/apiKeys/ApiKeyAuthenticator.d.ts +14 -0
- package/features/security/apiKeys/ApiKeyAuthenticator.js +36 -0
- package/features/security/apiKeys/ApiKeyAuthenticator.js.map +1 -0
- package/features/security/apiKeys/ApiKeyAuthorizer.d.ts +10 -0
- package/features/security/apiKeys/ApiKeyAuthorizer.js +15 -0
- package/features/security/apiKeys/ApiKeyAuthorizer.js.map +1 -0
- package/features/security/apiKeys/CreateApiKey/CreateApiKeyUseCase.js +11 -6
- package/features/security/apiKeys/CreateApiKey/CreateApiKeyUseCase.js.map +1 -1
- package/features/security/apiKeys/GetApiKeyBySlug/GetApiKeyBySlugUseCase.d.ts +1 -1
- package/features/security/apiKeys/GetApiKeyByToken/GetApiKeyByTokenUseCase.d.ts +1 -1
- package/features/security/apiKeys/UpdateApiKey/UpdateApiKeyUseCase.js +9 -3
- package/features/security/apiKeys/UpdateApiKey/UpdateApiKeyUseCase.js.map +1 -1
- package/features/security/apiKeys/feature.js +4 -0
- package/features/security/apiKeys/feature.js.map +1 -1
- package/features/security/apiKeys/shared/schemas.d.ts +2 -2
- package/features/security/apiKeys/shared/schemas.js +2 -2
- package/features/security/apiKeys/shared/schemas.js.map +1 -1
- package/features/security/authorization/AuthorizationContext/AuthorizationContext.d.ts +12 -3
- package/features/security/authorization/AuthorizationContext/AuthorizationContext.js +31 -18
- 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.map +1 -1
- package/features/security/authorization/AuthorizationContext/feature.js +6 -1
- package/features/security/authorization/AuthorizationContext/feature.js.map +1 -1
- package/features/security/authorization/GroupsTeamsAuthorizer/AssumedPermissions.d.ts +30 -0
- package/features/security/authorization/GroupsTeamsAuthorizer/AssumedPermissions.js +60 -0
- package/features/security/authorization/GroupsTeamsAuthorizer/AssumedPermissions.js.map +1 -0
- package/features/security/authorization/GroupsTeamsAuthorizer/GetPermissionsFromIdentity.d.ts +3 -3
- package/features/security/authorization/GroupsTeamsAuthorizer/GetPermissionsFromIdentity.js +5 -5
- package/features/security/authorization/GroupsTeamsAuthorizer/GetPermissionsFromIdentity.js.map +1 -1
- package/features/security/authorization/GroupsTeamsAuthorizer/feature.js +2 -0
- package/features/security/authorization/GroupsTeamsAuthorizer/feature.js.map +1 -1
- package/features/security/roles/CreateRole/CreateRoleUseCase.js +11 -6
- package/features/security/roles/CreateRole/CreateRoleUseCase.js.map +1 -1
- package/features/security/roles/CreateRole/schema.d.ts +1 -1
- package/features/security/roles/CreateRole/schema.js +1 -1
- package/features/security/roles/CreateRole/schema.js.map +1 -1
- package/features/security/roles/UpdateRole/UpdateRoleUseCase.js +9 -3
- package/features/security/roles/UpdateRole/UpdateRoleUseCase.js.map +1 -1
- package/features/security/roles/UpdateRole/schema.d.ts +1 -1
- package/features/security/roles/UpdateRole/schema.js +1 -1
- package/features/security/roles/UpdateRole/schema.js.map +1 -1
- package/features/security/shared/description.d.ts +4 -0
- package/features/security/shared/description.js +7 -0
- package/features/security/shared/description.js.map +1 -0
- package/features/security/shared/index.d.ts +1 -0
- package/features/security/shared/index.js +1 -0
- package/features/security/teams/CreateTeam/CreateTeamUseCase.d.ts +3 -1
- package/features/security/teams/CreateTeam/CreateTeamUseCase.js +20 -8
- package/features/security/teams/CreateTeam/CreateTeamUseCase.js.map +1 -1
- package/features/security/teams/CreateTeam/schema.d.ts +1 -1
- package/features/security/teams/CreateTeam/schema.js +1 -1
- package/features/security/teams/CreateTeam/schema.js.map +1 -1
- package/features/security/teams/UpdateTeam/UpdateTeamUseCase.d.ts +3 -1
- package/features/security/teams/UpdateTeam/UpdateTeamUseCase.js +20 -5
- package/features/security/teams/UpdateTeam/UpdateTeamUseCase.js.map +1 -1
- package/features/security/teams/UpdateTeam/schema.d.ts +1 -1
- package/features/security/teams/UpdateTeam/schema.js +1 -1
- package/features/security/teams/UpdateTeam/schema.js.map +1 -1
- package/features/security/teams/shared/resolveRoleIdentifiers.d.ts +17 -0
- package/features/security/teams/shared/resolveRoleIdentifiers.js +32 -0
- package/features/security/teams/shared/resolveRoleIdentifiers.js.map +1 -0
- package/features/slugify/DefaultSlugify.d.ts +8 -0
- package/features/slugify/DefaultSlugify.js +20 -0
- package/features/slugify/DefaultSlugify.js.map +1 -0
- package/features/slugify/abstractions.d.ts +12 -0
- package/features/slugify/abstractions.js +5 -0
- package/features/slugify/abstractions.js.map +1 -0
- package/features/slugify/feature.d.ts +4 -0
- package/features/slugify/feature.js +11 -0
- package/features/slugify/feature.js.map +1 -0
- package/features/slugify/index.d.ts +3 -0
- package/features/slugify/index.js +2 -0
- package/features/storageOperations/abstractions.d.ts +21 -0
- package/features/storageOperations/abstractions.js +10 -0
- package/features/storageOperations/abstractions.js.map +1 -0
- package/features/stringFormatter/DefaultStringFormatter.d.ts +17 -0
- package/features/stringFormatter/DefaultStringFormatter.js +19 -0
- package/features/stringFormatter/DefaultStringFormatter.js.map +1 -0
- package/features/stringFormatter/abstractions.d.ts +11 -0
- package/features/stringFormatter/abstractions.js +5 -0
- package/features/stringFormatter/abstractions.js.map +1 -0
- package/features/stringFormatter/feature.d.ts +4 -0
- package/features/stringFormatter/feature.js +13 -0
- package/features/stringFormatter/feature.js.map +1 -0
- package/features/stringFormatter/index.d.ts +3 -0
- package/features/stringFormatter/index.js +2 -0
- package/features/task/TaskDefinition/abstractions.d.ts +69 -4
- package/features/task/TaskDefinition/abstractions.js +2 -1
- package/features/task/TaskDefinition/abstractions.js.map +1 -1
- package/features/tenancy/TenantContext/TenantContext.d.ts +1 -0
- package/features/tenancy/TenantContext/TenantContext.js +13 -8
- package/features/tenancy/TenantContext/TenantContext.js.map +1 -1
- package/features/users/shared/types.d.ts +9 -7
- package/features/wcp/WcpContext/WcpContext.d.ts +12 -5
- package/features/wcp/WcpContext/WcpContext.js +29 -2
- package/features/wcp/WcpContext/WcpContext.js.map +1 -1
- package/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.d.ts +11 -66
- package/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.js +71 -33
- package/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.js.map +1 -1
- package/features/wcp/WcpContext/feature.d.ts +1 -2
- package/features/wcp/WcpContext/feature.js +2 -2
- package/features/wcp/WcpContext/feature.js.map +1 -1
- package/features/wcp/WcpContext/index.d.ts +0 -1
- package/features/wcp/WcpContext/types.d.ts +0 -4
- package/features/wcp/WcpFeature.d.ts +1 -1
- package/features/wcp/WcpFeature.js +7 -2
- package/features/wcp/WcpFeature.js.map +1 -1
- package/features/wcp/WcpLicenseLoader.d.ts +25 -0
- package/features/wcp/WcpLicenseLoader.js +58 -0
- package/features/wcp/WcpLicenseLoader.js.map +1 -0
- package/features/wcp/WcpLicenseProvider.d.ts +21 -0
- package/features/wcp/WcpLicenseProvider.js +14 -0
- package/features/wcp/WcpLicenseProvider.js.map +1 -0
- package/features/wcp/resolveWcpProjectEnvironment.d.ts +9 -0
- package/features/wcp/resolveWcpProjectEnvironment.js +23 -0
- package/features/wcp/resolveWcpProjectEnvironment.js.map +1 -0
- package/graphql/ApiCoreSchemaFactory.d.ts +16 -0
- package/graphql/ApiCoreSchemaFactory.js +58 -0
- package/graphql/ApiCoreSchemaFactory.js.map +1 -0
- package/graphql/featureFlags/FeatureFlagsSchemaFactory.d.ts +10 -0
- package/graphql/featureFlags/FeatureFlagsSchemaFactory.js +53 -0
- package/graphql/featureFlags/FeatureFlagsSchemaFactory.js.map +1 -0
- package/graphql/security/NotAuthorizedResponse.d.ts +1 -1
- package/graphql/security/NotAuthorizedResponse.js +1 -1
- package/graphql/security/NotAuthorizedResponse.js.map +1 -1
- package/graphql/security/SecuritySchemaFactory.d.ts +15 -0
- package/graphql/security/SecuritySchemaFactory.js +27 -0
- package/graphql/security/SecuritySchemaFactory.js.map +1 -0
- package/graphql/security/addApiKeySchema.d.ts +2 -0
- package/graphql/security/{apiKey.gql.js → addApiKeySchema.js} +45 -27
- package/graphql/security/addApiKeySchema.js.map +1 -0
- package/graphql/security/addIdentitySchema.d.ts +2 -0
- package/graphql/security/{identity.gql.js → addIdentitySchema.js} +52 -35
- package/graphql/security/addIdentitySchema.js.map +1 -0
- package/graphql/security/addRoleSchema.d.ts +2 -0
- package/graphql/security/addRoleSchema.js +137 -0
- package/graphql/security/addRoleSchema.js.map +1 -0
- package/graphql/security/addSecurityBaseSchema.d.ts +2 -0
- package/graphql/security/{base.gql.js → addSecurityBaseSchema.js} +14 -16
- package/graphql/security/addSecurityBaseSchema.js.map +1 -0
- package/graphql/security/addTeamSchema.d.ts +2 -0
- package/graphql/security/addTeamSchema.js +157 -0
- package/graphql/security/addTeamSchema.js.map +1 -0
- package/graphql/system/SystemSchemaFactory.d.ts +10 -0
- package/graphql/system/SystemSchemaFactory.js +70 -0
- package/graphql/system/SystemSchemaFactory.js.map +1 -0
- package/graphql/users/UsersSchemaFactory.d.ts +10 -0
- package/graphql/users/UsersSchemaFactory.js +195 -0
- package/graphql/users/UsersSchemaFactory.js.map +1 -0
- package/graphql/wcp/WcpSchemaFactory.d.ts +10 -0
- package/graphql/wcp/{graphql.js → WcpSchemaFactory.js} +32 -18
- package/graphql/wcp/WcpSchemaFactory.js.map +1 -0
- package/idp/JwksCache.d.ts +14 -3
- package/idp/JwksCache.js +97 -17
- package/idp/JwksCache.js.map +1 -1
- package/idp/JwksStoreFeature.d.ts +8 -0
- package/idp/JwksStoreFeature.js +11 -0
- package/idp/JwksStoreFeature.js.map +1 -0
- package/idp/MemoryJwksStore.d.ts +14 -0
- package/idp/MemoryJwksStore.js +21 -0
- package/idp/MemoryJwksStore.js.map +1 -0
- package/idp/OidcJwtIdentityProvider.js +5 -1
- package/idp/OidcJwtIdentityProvider.js.map +1 -1
- package/idp/abstractions.d.ts +24 -0
- package/idp/abstractions.js +2 -1
- package/idp/abstractions.js.map +1 -1
- package/idp/feature.js +1 -2
- package/idp/feature.js.map +1 -1
- package/idp/index.d.ts +1 -0
- package/idp/index.js +1 -0
- package/index.d.ts +3 -1
- package/index.js +3 -1
- package/package.json +22 -22
- package/testing/environment.d.ts +14 -0
- package/testing/environment.js +18 -0
- package/testing/environment.js.map +1 -0
- package/types/core.d.ts +17 -5
- package/types/security.d.ts +0 -6
- package/types/tenancy.d.ts +0 -17
- package/types/users.d.ts +2 -16
- package/createApiCore.d.ts +0 -7
- package/createApiCore.js +0 -26
- package/createApiCore.js.map +0 -1
- package/graphql/security/apiKey.gql.d.ts +0 -4
- package/graphql/security/apiKey.gql.js.map +0 -1
- package/graphql/security/base.gql.d.ts +0 -4
- package/graphql/security/base.gql.js.map +0 -1
- package/graphql/security/identity.gql.d.ts +0 -4
- package/graphql/security/identity.gql.js.map +0 -1
- package/graphql/security/index.d.ts +0 -1
- package/graphql/security/index.js +0 -15
- package/graphql/security/index.js.map +0 -1
- package/graphql/security/role.gql.d.ts +0 -4
- package/graphql/security/role.gql.js +0 -106
- package/graphql/security/role.gql.js.map +0 -1
- package/graphql/security/team.gql.d.ts +0 -4
- package/graphql/security/team.gql.js +0 -119
- package/graphql/security/team.gql.js.map +0 -1
- package/graphql/system/createSystemGraphQL.d.ts +0 -2
- package/graphql/system/createSystemGraphQL.js +0 -54
- package/graphql/system/createSystemGraphQL.js.map +0 -1
- package/graphql/users/user.gql.d.ts +0 -3
- package/graphql/users/user.gql.js +0 -167
- package/graphql/users/user.gql.js.map +0 -1
- package/graphql/wcp/graphql.d.ts +0 -2
- package/graphql/wcp/graphql.js.map +0 -1
- package/legacy/security/LegacyContext.d.ts +0 -36
- package/legacy/security/LegacyContext.js +0 -152
- package/legacy/security/LegacyContext.js.map +0 -1
- package/legacy/security/createSecurityContext.d.ts +0 -3
- package/legacy/security/createSecurityContext.js +0 -10
- package/legacy/security/createSecurityContext.js.map +0 -1
- package/legacy/security/plugins/apiKeyAuthentication.d.ts +0 -7
- package/legacy/security/plugins/apiKeyAuthentication.js +0 -20
- package/legacy/security/plugins/apiKeyAuthentication.js.map +0 -1
- package/legacy/security/plugins/apiKeyAuthorization.d.ts +0 -6
- package/legacy/security/plugins/apiKeyAuthorization.js +0 -13
- package/legacy/security/plugins/apiKeyAuthorization.js.map +0 -1
- package/legacy/security/plugins/authenticateUsingCookie.d.ts +0 -5
- package/legacy/security/plugins/authenticateUsingCookie.js +0 -23
- package/legacy/security/plugins/authenticateUsingCookie.js.map +0 -1
- package/legacy/security/plugins/authenticateUsingHttpHeader.d.ts +0 -5
- package/legacy/security/plugins/authenticateUsingHttpHeader.js +0 -20
- package/legacy/security/plugins/authenticateUsingHttpHeader.js.map +0 -1
- package/legacy/security/plugins/secureHeaders.d.ts +0 -1
- package/legacy/security/plugins/secureHeaders.js +0 -30
- package/legacy/security/plugins/secureHeaders.js.map +0 -1
- package/legacy/tenancy/LegacyContext.d.ts +0 -15
- package/legacy/tenancy/LegacyContext.js +0 -57
- package/legacy/tenancy/LegacyContext.js.map +0 -1
- package/legacy/tenancy/createTenancyContext.d.ts +0 -3
- package/legacy/tenancy/createTenancyContext.js +0 -31
- package/legacy/tenancy/createTenancyContext.js.map +0 -1
- package/legacy/users/LegacyContext.d.ts +0 -13
- package/legacy/users/LegacyContext.js +0 -55
- package/legacy/users/LegacyContext.js.map +0 -1
- package/legacy/users/createAdminUsersContext.d.ts +0 -3
- package/legacy/users/createAdminUsersContext.js +0 -12
- package/legacy/users/createAdminUsersContext.js.map +0 -1
- package/legacy/wcp/LegacyWcpContext.d.ts +0 -37
- package/legacy/wcp/LegacyWcpContext.js +0 -96
- package/legacy/wcp/LegacyWcpContext.js.map +0 -1
- package/legacy/wcp/context.d.ts +0 -5
- package/legacy/wcp/context.js +0 -46
- package/legacy/wcp/context.js.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql/security/addTeamSchema.js","sources":["../../../src/graphql/security/addTeamSchema.ts"],"sourcesContent":["import {\n ErrorResponse,\n ListErrorResponse,\n ListResponse,\n Response\n} from \"@webiny/api-graphql/responses.js\";\nimport type { IGraphQLSchemaBuilder } from \"@webiny/api-graphql/features/GraphQLSchemaBuilder/abstractions.js\";\nimport type { Team } from \"~/types/security.js\";\nimport { ListRolesUseCase } from \"~/features/security/roles/ListRoles/index.js\";\nimport { GetTeamUseCase } from \"~/features/security/teams/GetTeam/index.js\";\nimport { ListTeamsUseCase } from \"~/features/security/teams/ListTeams/index.js\";\nimport { CreateTeam } from \"~/features/security/teams/CreateTeam/index.js\";\nimport { UpdateTeam } from \"~/features/security/teams/UpdateTeam/index.js\";\nimport { DeleteTeam } from \"~/features/security/teams/DeleteTeam/index.js\";\n\nexport const addTeamSchema = (builder: IGraphQLSchemaBuilder): void => {\n builder.addTypeDefs(/* GraphQL */ `\n type SecurityTeam {\n id: ID\n name: String\n slug: String\n createdOn: DateTime\n description: String\n roles: [SecurityRole]\n system: Boolean!\n plugin: Boolean\n }\n\n input SecurityTeamCreateInput {\n name: String!\n slug: String!\n description: String\n roles: [RefInput!]!\n }\n\n input SecurityTeamUpdateInput {\n name: String\n description: String\n roles: [RefInput!]\n }\n\n type SecurityTeamResponse {\n data: SecurityTeam\n error: SecurityError\n }\n\n type SecurityTeamListResponse {\n data: [SecurityTeam]\n error: SecurityError\n }\n\n input GetTeamWhereInput {\n id: ID\n slug: String\n }\n\n extend type SecurityQuery {\n getTeam(where: GetTeamWhereInput!): SecurityTeamResponse\n listTeams: SecurityTeamListResponse\n }\n\n extend type SecurityMutation {\n createTeam(data: SecurityTeamCreateInput!): SecurityTeamResponse\n updateTeam(id: ID!, data: SecurityTeamUpdateInput!): SecurityTeamResponse\n deleteTeam(id: ID!): SecurityBooleanResponse\n }\n `);\n\n builder.addResolver({\n path: \"SecurityTeam.roles\",\n dependencies: [ListRolesUseCase],\n resolver:\n (useCase: ListRolesUseCase.Interface) =>\n async ({ parent }: { parent: Team }) => {\n try {\n const result = await useCase.execute({ where: { id_in: parent.roles } });\n if (result.isFail()) {\n throw result.error;\n }\n return result.value;\n } catch (e) {\n return new ErrorResponse(e);\n }\n }\n });\n\n builder.addResolver<{ where: any }>({\n path: \"SecurityQuery.getTeam\",\n dependencies: [GetTeamUseCase],\n resolver:\n (useCase: GetTeamUseCase.Interface) =>\n async ({ args }) => {\n try {\n const result = await useCase.execute(args.where);\n if (result.isFail()) {\n throw result.error;\n }\n return new Response(result.value);\n } catch (e) {\n return new ErrorResponse(e);\n }\n }\n });\n\n builder.addResolver({\n path: \"SecurityQuery.listTeams\",\n dependencies: [ListTeamsUseCase],\n resolver: (useCase: ListTeamsUseCase.Interface) => async () => {\n try {\n const result = await useCase.execute();\n if (result.isFail()) {\n throw result.error;\n }\n return new ListResponse(result.value);\n } catch (e) {\n return new ListErrorResponse(e);\n }\n }\n });\n\n builder.addResolver<{ data: any }>({\n path: \"SecurityMutation.createTeam\",\n dependencies: [CreateTeam],\n resolver:\n (useCase: CreateTeam.Interface) =>\n async ({ args }) => {\n try {\n const result = await useCase.execute(args.data);\n if (result.isFail()) {\n throw result.error;\n }\n return new Response(result.value);\n } catch (e) {\n return new ErrorResponse(e);\n }\n }\n });\n\n builder.addResolver<{ id: string; data: any }>({\n path: \"SecurityMutation.updateTeam\",\n dependencies: [UpdateTeam],\n resolver:\n (useCase: UpdateTeam.Interface) =>\n async ({ args }) => {\n try {\n const result = await useCase.execute(args.id, args.data);\n if (result.isFail()) {\n throw result.error;\n }\n return new Response(result.value);\n } catch (e) {\n return new ErrorResponse(e);\n }\n }\n });\n\n builder.addResolver<{ id: string }>({\n path: \"SecurityMutation.deleteTeam\",\n dependencies: [DeleteTeam],\n resolver:\n (useCase: DeleteTeam.Interface) =>\n async ({ args }) => {\n try {\n const result = await useCase.execute(args.id);\n if (result.isFail()) {\n throw result.error;\n }\n return new Response(true);\n } catch (e) {\n return new ErrorResponse(e);\n }\n }\n });\n};\n"],"names":["addTeamSchema","builder","ListRolesUseCase","useCase","parent","result","e","ErrorResponse","GetTeamUseCase","args","Response","ListTeamsUseCase","ListResponse","ListErrorResponse","CreateTeam","UpdateTeam","DeleteTeam"],"mappings":";;;;;;;AAeO,MAAMA,gBAAgB,CAACC;IAC1BA,QAAQ,WAAW,CAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;IAkDnC,CAAC;IAEDA,QAAQ,WAAW,CAAC;QAChB,MAAM;QACN,cAAc;YAACC;SAAiB;QAChC,UACI,CAACC,UACD,OAAO,EAAEC,MAAM,EAAoB;gBAC/B,IAAI;oBACA,MAAMC,SAAS,MAAMF,QAAQ,OAAO,CAAC;wBAAE,OAAO;4BAAE,OAAOC,OAAO,KAAK;wBAAC;oBAAE;oBACtE,IAAIC,OAAO,MAAM,IACb,MAAMA,OAAO,KAAK;oBAEtB,OAAOA,OAAO,KAAK;gBACvB,EAAE,OAAOC,GAAG;oBACR,OAAO,IAAIC,cAAcD;gBAC7B;YACJ;IACR;IAEAL,QAAQ,WAAW,CAAiB;QAChC,MAAM;QACN,cAAc;YAACO;SAAe;QAC9B,UACI,CAACL,UACD,OAAO,EAAEM,IAAI,EAAE;gBACX,IAAI;oBACA,MAAMJ,SAAS,MAAMF,QAAQ,OAAO,CAACM,KAAK,KAAK;oBAC/C,IAAIJ,OAAO,MAAM,IACb,MAAMA,OAAO,KAAK;oBAEtB,OAAO,IAAIK,SAASL,OAAO,KAAK;gBACpC,EAAE,OAAOC,GAAG;oBACR,OAAO,IAAIC,cAAcD;gBAC7B;YACJ;IACR;IAEAL,QAAQ,WAAW,CAAC;QAChB,MAAM;QACN,cAAc;YAACU;SAAiB;QAChC,UAAU,CAACR,UAAwC;gBAC/C,IAAI;oBACA,MAAME,SAAS,MAAMF,QAAQ,OAAO;oBACpC,IAAIE,OAAO,MAAM,IACb,MAAMA,OAAO,KAAK;oBAEtB,OAAO,IAAIO,aAAaP,OAAO,KAAK;gBACxC,EAAE,OAAOC,GAAG;oBACR,OAAO,IAAIO,kBAAkBP;gBACjC;YACJ;IACJ;IAEAL,QAAQ,WAAW,CAAgB;QAC/B,MAAM;QACN,cAAc;YAACa;SAAW;QAC1B,UACI,CAACX,UACD,OAAO,EAAEM,IAAI,EAAE;gBACX,IAAI;oBACA,MAAMJ,SAAS,MAAMF,QAAQ,OAAO,CAACM,KAAK,IAAI;oBAC9C,IAAIJ,OAAO,MAAM,IACb,MAAMA,OAAO,KAAK;oBAEtB,OAAO,IAAIK,SAASL,OAAO,KAAK;gBACpC,EAAE,OAAOC,GAAG;oBACR,OAAO,IAAIC,cAAcD;gBAC7B;YACJ;IACR;IAEAL,QAAQ,WAAW,CAA4B;QAC3C,MAAM;QACN,cAAc;YAACc;SAAW;QAC1B,UACI,CAACZ,UACD,OAAO,EAAEM,IAAI,EAAE;gBACX,IAAI;oBACA,MAAMJ,SAAS,MAAMF,QAAQ,OAAO,CAACM,KAAK,EAAE,EAAEA,KAAK,IAAI;oBACvD,IAAIJ,OAAO,MAAM,IACb,MAAMA,OAAO,KAAK;oBAEtB,OAAO,IAAIK,SAASL,OAAO,KAAK;gBACpC,EAAE,OAAOC,GAAG;oBACR,OAAO,IAAIC,cAAcD;gBAC7B;YACJ;IACR;IAEAL,QAAQ,WAAW,CAAiB;QAChC,MAAM;QACN,cAAc;YAACe;SAAW;QAC1B,UACI,CAACb,UACD,OAAO,EAAEM,IAAI,EAAE;gBACX,IAAI;oBACA,MAAMJ,SAAS,MAAMF,QAAQ,OAAO,CAACM,KAAK,EAAE;oBAC5C,IAAIJ,OAAO,MAAM,IACb,MAAMA,OAAO,KAAK;oBAEtB,OAAO,IAAIK,SAAS;gBACxB,EAAE,OAAOJ,GAAG;oBACR,OAAO,IAAIC,cAAcD;gBAC7B;YACJ;IACR;AACJ"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
|
|
2
|
+
import type { IGraphQLSchemaBuilder } from "@webiny/api-graphql/features/GraphQLSchemaBuilder/abstractions.js";
|
|
3
|
+
declare class SystemSchemaFactoryImpl implements CoreGraphQLSchemaFactory.Interface {
|
|
4
|
+
getSchemaKey: () => string;
|
|
5
|
+
execute(builder: IGraphQLSchemaBuilder): Promise<IGraphQLSchemaBuilder>;
|
|
6
|
+
}
|
|
7
|
+
export declare const SystemSchemaFactory: typeof SystemSchemaFactoryImpl & {
|
|
8
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-graphql/graphql/abstractions.core").ICoreGraphQLSchemaFactory>;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,70 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
|
|
2
|
+
import { staticSchemaKey } from "@webiny/api-graphql/graphql/staticSchemaKey.js";
|
|
3
|
+
import { ErrorResponse, Response } from "@webiny/api-graphql";
|
|
4
|
+
import { GetRootTenantUseCase } from "../../features/tenancy/GetRootTenant/index.js";
|
|
5
|
+
import { InstallSystemUseCase } from "../../features/system/InstallSystem/index.js";
|
|
6
|
+
class SystemSchemaFactoryImpl {
|
|
7
|
+
async execute(builder) {
|
|
8
|
+
builder.addTypeDefs(`
|
|
9
|
+
type SystemQuery {
|
|
10
|
+
isSystemInstalled: BooleanResponse
|
|
11
|
+
}
|
|
12
|
+
|
|
13
|
+
type SystemMutation {
|
|
14
|
+
installSystem(installationInput: JSON!): BooleanResponse
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
extend type Query {
|
|
18
|
+
system: SystemQuery
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
extend type Mutation {
|
|
22
|
+
system: SystemMutation
|
|
23
|
+
}
|
|
24
|
+
`);
|
|
25
|
+
builder.addResolver({
|
|
26
|
+
path: "Query.system",
|
|
27
|
+
resolver: ()=>async ()=>({})
|
|
28
|
+
});
|
|
29
|
+
builder.addResolver({
|
|
30
|
+
path: "Mutation.system",
|
|
31
|
+
resolver: ()=>async ()=>({})
|
|
32
|
+
});
|
|
33
|
+
builder.addResolver({
|
|
34
|
+
path: "SystemQuery.isSystemInstalled",
|
|
35
|
+
dependencies: [
|
|
36
|
+
GetRootTenantUseCase
|
|
37
|
+
],
|
|
38
|
+
resolver: (getRootTenant)=>async ()=>{
|
|
39
|
+
const result = await getRootTenant.execute();
|
|
40
|
+
return new Response(result.isOk());
|
|
41
|
+
}
|
|
42
|
+
});
|
|
43
|
+
builder.addResolver({
|
|
44
|
+
path: "SystemMutation.installSystem",
|
|
45
|
+
dependencies: [
|
|
46
|
+
InstallSystemUseCase
|
|
47
|
+
],
|
|
48
|
+
resolver: (installSystem)=>async ({ args })=>{
|
|
49
|
+
const result = await installSystem.execute(args.installationInput);
|
|
50
|
+
if (result.isOk()) return new Response(true);
|
|
51
|
+
return new ErrorResponse({
|
|
52
|
+
code: result.error.code,
|
|
53
|
+
message: result.error.message,
|
|
54
|
+
data: result.error.data
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
});
|
|
58
|
+
return builder;
|
|
59
|
+
}
|
|
60
|
+
constructor(){
|
|
61
|
+
this.getSchemaKey = staticSchemaKey("api-core/SystemSchemaFactoryImpl");
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
const SystemSchemaFactory = CoreGraphQLSchemaFactory.createImplementation({
|
|
65
|
+
implementation: SystemSchemaFactoryImpl,
|
|
66
|
+
dependencies: []
|
|
67
|
+
});
|
|
68
|
+
export { SystemSchemaFactory };
|
|
69
|
+
|
|
70
|
+
//# sourceMappingURL=SystemSchemaFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql/system/SystemSchemaFactory.js","sources":["../../../src/graphql/system/SystemSchemaFactory.ts"],"sourcesContent":["import { CoreGraphQLSchemaFactory } from \"@webiny/api-graphql/graphql/abstractions.js\";\nimport { staticSchemaKey } from \"@webiny/api-graphql/graphql/staticSchemaKey.js\";\nimport type { IGraphQLSchemaBuilder } from \"@webiny/api-graphql/features/GraphQLSchemaBuilder/abstractions.js\";\nimport { ErrorResponse, Response } from \"@webiny/api-graphql\";\nimport { type AppInstallationData } from \"~/features/tenancy/InstallTenant/index.js\";\nimport { GetRootTenantUseCase } from \"~/features/tenancy/GetRootTenant/index.js\";\nimport { InstallSystemUseCase } from \"~/features/system/InstallSystem/index.js\";\n\ninterface InstallTenantArgs {\n installationInput: AppInstallationData[];\n}\n\nclass SystemSchemaFactoryImpl implements CoreGraphQLSchemaFactory.Interface {\n public getSchemaKey = staticSchemaKey(\"api-core/SystemSchemaFactoryImpl\");\n\n async execute(builder: IGraphQLSchemaBuilder): Promise<IGraphQLSchemaBuilder> {\n builder.addTypeDefs(/* GraphQL */ `\n type SystemQuery {\n isSystemInstalled: BooleanResponse\n }\n\n type SystemMutation {\n installSystem(installationInput: JSON!): BooleanResponse\n }\n\n extend type Query {\n system: SystemQuery\n }\n\n extend type Mutation {\n system: SystemMutation\n }\n `);\n\n builder.addResolver({\n path: \"Query.system\",\n resolver: () => async () => ({})\n });\n\n builder.addResolver({\n path: \"Mutation.system\",\n resolver: () => async () => ({})\n });\n\n builder.addResolver({\n path: \"SystemQuery.isSystemInstalled\",\n dependencies: [GetRootTenantUseCase],\n resolver: (getRootTenant: GetRootTenantUseCase.Interface) => async () => {\n const result = await getRootTenant.execute();\n\n return new Response(result.isOk());\n }\n });\n\n builder.addResolver<InstallTenantArgs>({\n path: \"SystemMutation.installSystem\",\n dependencies: [InstallSystemUseCase],\n resolver:\n (installSystem: InstallSystemUseCase.Interface) =>\n async ({ args }) => {\n const result = await installSystem.execute(args.installationInput);\n\n if (result.isOk()) {\n return new Response(true);\n }\n\n return new ErrorResponse({\n code: result.error.code,\n message: result.error.message,\n data: result.error.data\n });\n }\n });\n\n return builder;\n }\n}\n\nexport const SystemSchemaFactory = CoreGraphQLSchemaFactory.createImplementation({\n implementation: SystemSchemaFactoryImpl,\n dependencies: []\n});\n"],"names":["SystemSchemaFactoryImpl","builder","GetRootTenantUseCase","getRootTenant","result","Response","InstallSystemUseCase","installSystem","args","ErrorResponse","staticSchemaKey","SystemSchemaFactory","CoreGraphQLSchemaFactory"],"mappings":";;;;;AAYA,MAAMA;IAGF,MAAM,QAAQC,OAA8B,EAAkC;QAC1EA,QAAQ,WAAW,CAAe,CAAC;;;;;;;;;;;;;;;;QAgBnC,CAAC;QAEDA,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,UAAU,IAAM,UAAa,EAAC;QAClC;QAEAA,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,UAAU,IAAM,UAAa,EAAC;QAClC;QAEAA,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,cAAc;gBAACC;aAAqB;YACpC,UAAU,CAACC,gBAAkD;oBACzD,MAAMC,SAAS,MAAMD,cAAc,OAAO;oBAE1C,OAAO,IAAIE,SAASD,OAAO,IAAI;gBACnC;QACJ;QAEAH,QAAQ,WAAW,CAAoB;YACnC,MAAM;YACN,cAAc;gBAACK;aAAqB;YACpC,UACI,CAACC,gBACD,OAAO,EAAEC,IAAI,EAAE;oBACX,MAAMJ,SAAS,MAAMG,cAAc,OAAO,CAACC,KAAK,iBAAiB;oBAEjE,IAAIJ,OAAO,IAAI,IACX,OAAO,IAAIC,SAAS;oBAGxB,OAAO,IAAII,cAAc;wBACrB,MAAML,OAAO,KAAK,CAAC,IAAI;wBACvB,SAASA,OAAO,KAAK,CAAC,OAAO;wBAC7B,MAAMA,OAAO,KAAK,CAAC,IAAI;oBAC3B;gBACJ;QACR;QAEA,OAAOH;IACX;;aA9DO,YAAY,GAAGS,gBAAgB;;AA+D1C;AAEO,MAAMC,sBAAsBC,yBAAyB,oBAAoB,CAAC;IAC7E,gBAAgBZ;IAChB,cAAc,EAAE;AACpB"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
|
|
2
|
+
import type { IGraphQLSchemaBuilder } from "@webiny/api-graphql/features/GraphQLSchemaBuilder/abstractions.js";
|
|
3
|
+
declare class UsersSchemaFactoryImpl implements CoreGraphQLSchemaFactory.Interface {
|
|
4
|
+
getSchemaKey: () => string;
|
|
5
|
+
execute(builder: IGraphQLSchemaBuilder): Promise<IGraphQLSchemaBuilder>;
|
|
6
|
+
}
|
|
7
|
+
export declare const UsersSchemaFactory: typeof UsersSchemaFactoryImpl & {
|
|
8
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-graphql/graphql/abstractions.core").ICoreGraphQLSchemaFactory>;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -0,0 +1,195 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
|
|
2
|
+
import { staticSchemaKey } from "@webiny/api-graphql/graphql/staticSchemaKey.js";
|
|
3
|
+
import { ErrorResponse, ListErrorResponse, ListResponse, NotFoundResponse, Response } from "@webiny/api-graphql/responses.js";
|
|
4
|
+
import { GetUserUseCase } from "../../features/users/GetUser/index.js";
|
|
5
|
+
import NotAuthorizedResponse from "../security/NotAuthorizedResponse.js";
|
|
6
|
+
import { ListUsersUseCase } from "../../features/users/ListUsers/index.js";
|
|
7
|
+
import { IdentityContext } from "../../features/security/IdentityContext/abstractions.js";
|
|
8
|
+
import { ListRolesUseCase } from "../../features/security/roles/ListRoles/index.js";
|
|
9
|
+
import { ListTeamsUseCase } from "../../features/security/teams/ListTeams/index.js";
|
|
10
|
+
class UsersSchemaFactoryImpl {
|
|
11
|
+
async execute(builder) {
|
|
12
|
+
builder.addTypeDefs(`
|
|
13
|
+
type AdminUsersQuery {
|
|
14
|
+
_empty: String
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
type AdminUsersMutation {
|
|
18
|
+
_empty: String
|
|
19
|
+
}
|
|
20
|
+
|
|
21
|
+
extend type Query {
|
|
22
|
+
adminUsers: AdminUsersQuery
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
extend type Mutation {
|
|
26
|
+
adminUsers: AdminUsersMutation
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
type AdminUsersCreatedBy {
|
|
30
|
+
id: ID
|
|
31
|
+
displayName: String
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
type AdminUsersError {
|
|
35
|
+
code: String
|
|
36
|
+
message: String
|
|
37
|
+
data: JSON
|
|
38
|
+
stack: String
|
|
39
|
+
}
|
|
40
|
+
|
|
41
|
+
type AdminUsersBooleanResponse {
|
|
42
|
+
data: Boolean
|
|
43
|
+
error: AdminUsersError
|
|
44
|
+
}
|
|
45
|
+
|
|
46
|
+
type AdminUser {
|
|
47
|
+
id: ID!
|
|
48
|
+
displayName: String!
|
|
49
|
+
email: String!
|
|
50
|
+
|
|
51
|
+
roles: [SecurityRole]
|
|
52
|
+
firstName: String
|
|
53
|
+
lastName: String
|
|
54
|
+
avatar: JSON
|
|
55
|
+
external: Boolean
|
|
56
|
+
createdOn: DateTime
|
|
57
|
+
}
|
|
58
|
+
|
|
59
|
+
type AdminUsersResponse {
|
|
60
|
+
data: AdminUser
|
|
61
|
+
error: AdminUsersError
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
type AdminUsersListResponse {
|
|
65
|
+
data: [AdminUser]
|
|
66
|
+
error: AdminUsersError
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
input AdminUsersGetUserWhereInput {
|
|
70
|
+
id: ID
|
|
71
|
+
email: String
|
|
72
|
+
}
|
|
73
|
+
|
|
74
|
+
extend type AdminUsersQuery {
|
|
75
|
+
getUser(where: AdminUsersGetUserWhereInput): AdminUsersResponse
|
|
76
|
+
getCurrentUser: AdminUsersResponse
|
|
77
|
+
listUsers: AdminUsersListResponse
|
|
78
|
+
}
|
|
79
|
+
|
|
80
|
+
extend type AdminUser {
|
|
81
|
+
teams: [SecurityTeam]
|
|
82
|
+
}
|
|
83
|
+
`);
|
|
84
|
+
builder.addResolver({
|
|
85
|
+
path: "Query.adminUsers",
|
|
86
|
+
resolver: ()=>async ()=>({})
|
|
87
|
+
});
|
|
88
|
+
builder.addResolver({
|
|
89
|
+
path: "Mutation.adminUsers",
|
|
90
|
+
resolver: ()=>async ()=>({})
|
|
91
|
+
});
|
|
92
|
+
builder.addResolver({
|
|
93
|
+
path: "AdminUser.roles",
|
|
94
|
+
dependencies: [
|
|
95
|
+
ListRolesUseCase
|
|
96
|
+
],
|
|
97
|
+
resolver: (listRoles)=>async ({ parent })=>{
|
|
98
|
+
if (!parent.roles) return null;
|
|
99
|
+
const result = await listRoles.execute({
|
|
100
|
+
where: {
|
|
101
|
+
id_in: parent.roles
|
|
102
|
+
}
|
|
103
|
+
});
|
|
104
|
+
if (result.isFail()) throw result.error;
|
|
105
|
+
return result.value;
|
|
106
|
+
}
|
|
107
|
+
});
|
|
108
|
+
builder.addResolver({
|
|
109
|
+
path: "AdminUser.teams",
|
|
110
|
+
dependencies: [
|
|
111
|
+
ListTeamsUseCase
|
|
112
|
+
],
|
|
113
|
+
resolver: (listTeams)=>async ({ parent })=>{
|
|
114
|
+
const hasTeams = Array.isArray(parent.teams) && parent.teams.length > 0;
|
|
115
|
+
if (!hasTeams) return [];
|
|
116
|
+
const result = await listTeams.execute({
|
|
117
|
+
where: {
|
|
118
|
+
id_in: parent.teams
|
|
119
|
+
}
|
|
120
|
+
});
|
|
121
|
+
if (result.isFail()) throw result.error;
|
|
122
|
+
return result.value;
|
|
123
|
+
}
|
|
124
|
+
});
|
|
125
|
+
builder.addResolver({
|
|
126
|
+
path: "AdminUsersQuery.getUser",
|
|
127
|
+
dependencies: [
|
|
128
|
+
GetUserUseCase
|
|
129
|
+
],
|
|
130
|
+
resolver: (getUser)=>async ({ args })=>{
|
|
131
|
+
const { where } = args;
|
|
132
|
+
const userResult = await getUser.execute({
|
|
133
|
+
id: where.id,
|
|
134
|
+
email: where.email
|
|
135
|
+
});
|
|
136
|
+
if (userResult.isFail()) {
|
|
137
|
+
const error = userResult.error;
|
|
138
|
+
if ("AdminUser/NotFound" === error.code) return new NotFoundResponse(`User "${JSON.stringify(where)}" was not found!`);
|
|
139
|
+
return new ErrorResponse({
|
|
140
|
+
message: error.message,
|
|
141
|
+
code: error.code,
|
|
142
|
+
data: error.data
|
|
143
|
+
});
|
|
144
|
+
}
|
|
145
|
+
return new Response(userResult.value);
|
|
146
|
+
}
|
|
147
|
+
});
|
|
148
|
+
builder.addResolver({
|
|
149
|
+
path: "AdminUsersQuery.getCurrentUser",
|
|
150
|
+
dependencies: [
|
|
151
|
+
IdentityContext,
|
|
152
|
+
GetUserUseCase
|
|
153
|
+
],
|
|
154
|
+
resolver: (identityContext, getUser)=>async ()=>{
|
|
155
|
+
const identity = identityContext.getIdentity();
|
|
156
|
+
if (!identity.isAdmin()) throw new NotAuthorizedResponse();
|
|
157
|
+
const userResponse = await identityContext.withoutAuthorization(async ()=>await getUser.execute({
|
|
158
|
+
id: identity.id
|
|
159
|
+
}));
|
|
160
|
+
if (userResponse.isFail()) {
|
|
161
|
+
const error = userResponse.error;
|
|
162
|
+
if ("AdminUser/NotFound" === error.code) return new NotFoundResponse(`User with ID ${identity.id} was not found!`);
|
|
163
|
+
return new ErrorResponse({
|
|
164
|
+
message: error.message,
|
|
165
|
+
code: error.code,
|
|
166
|
+
data: error.data
|
|
167
|
+
});
|
|
168
|
+
}
|
|
169
|
+
return new Response(userResponse.value);
|
|
170
|
+
}
|
|
171
|
+
});
|
|
172
|
+
builder.addResolver({
|
|
173
|
+
path: "AdminUsersQuery.listUsers",
|
|
174
|
+
dependencies: [
|
|
175
|
+
ListUsersUseCase
|
|
176
|
+
],
|
|
177
|
+
resolver: (listUsers)=>async ()=>{
|
|
178
|
+
const users = await listUsers.execute();
|
|
179
|
+
if (users.isFail()) return new ListErrorResponse(users.error);
|
|
180
|
+
return new ListResponse(users.value);
|
|
181
|
+
}
|
|
182
|
+
});
|
|
183
|
+
return builder;
|
|
184
|
+
}
|
|
185
|
+
constructor(){
|
|
186
|
+
this.getSchemaKey = staticSchemaKey("api-core/UsersSchemaFactoryImpl");
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
const UsersSchemaFactory = CoreGraphQLSchemaFactory.createImplementation({
|
|
190
|
+
implementation: UsersSchemaFactoryImpl,
|
|
191
|
+
dependencies: []
|
|
192
|
+
});
|
|
193
|
+
export { UsersSchemaFactory };
|
|
194
|
+
|
|
195
|
+
//# sourceMappingURL=UsersSchemaFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql/users/UsersSchemaFactory.js","sources":["../../../src/graphql/users/UsersSchemaFactory.ts"],"sourcesContent":["import { CoreGraphQLSchemaFactory } from \"@webiny/api-graphql/graphql/abstractions.js\";\nimport { staticSchemaKey } from \"@webiny/api-graphql/graphql/staticSchemaKey.js\";\nimport {\n ErrorResponse,\n ListErrorResponse,\n ListResponse,\n NotFoundResponse,\n Response\n} from \"@webiny/api-graphql/responses.js\";\nimport type { IGraphQLSchemaBuilder } from \"@webiny/api-graphql/features/GraphQLSchemaBuilder/abstractions.js\";\nimport type { AdminUser } from \"~/types/users.js\";\nimport { GetUserUseCase } from \"~/features/users/GetUser/index.js\";\nimport NotAuthorizedResponse from \"~/graphql/security/NotAuthorizedResponse.js\";\nimport { ListUsersUseCase } from \"~/features/users/ListUsers/index.js\";\nimport { IdentityContext } from \"~/features/security/IdentityContext/abstractions.js\";\nimport { ListRolesUseCase } from \"~/features/security/roles/ListRoles/index.js\";\nimport { ListTeamsUseCase } from \"~/features/security/teams/ListTeams/index.js\";\n\nclass UsersSchemaFactoryImpl implements CoreGraphQLSchemaFactory.Interface {\n public getSchemaKey = staticSchemaKey(\"api-core/UsersSchemaFactoryImpl\");\n\n async execute(builder: IGraphQLSchemaBuilder): Promise<IGraphQLSchemaBuilder> {\n builder.addTypeDefs(/* GraphQL */ `\n type AdminUsersQuery {\n _empty: String\n }\n\n type AdminUsersMutation {\n _empty: String\n }\n\n extend type Query {\n adminUsers: AdminUsersQuery\n }\n\n extend type Mutation {\n adminUsers: AdminUsersMutation\n }\n\n type AdminUsersCreatedBy {\n id: ID\n displayName: String\n }\n\n type AdminUsersError {\n code: String\n message: String\n data: JSON\n stack: String\n }\n\n type AdminUsersBooleanResponse {\n data: Boolean\n error: AdminUsersError\n }\n\n type AdminUser {\n id: ID!\n displayName: String!\n email: String!\n\n roles: [SecurityRole]\n firstName: String\n lastName: String\n avatar: JSON\n external: Boolean\n createdOn: DateTime\n }\n\n type AdminUsersResponse {\n data: AdminUser\n error: AdminUsersError\n }\n\n type AdminUsersListResponse {\n data: [AdminUser]\n error: AdminUsersError\n }\n\n input AdminUsersGetUserWhereInput {\n id: ID\n email: String\n }\n\n extend type AdminUsersQuery {\n getUser(where: AdminUsersGetUserWhereInput): AdminUsersResponse\n getCurrentUser: AdminUsersResponse\n listUsers: AdminUsersListResponse\n }\n\n extend type AdminUser {\n teams: [SecurityTeam]\n }\n `);\n\n builder.addResolver({\n path: \"Query.adminUsers\",\n resolver: () => async () => ({})\n });\n\n builder.addResolver({\n path: \"Mutation.adminUsers\",\n resolver: () => async () => ({})\n });\n\n builder.addResolver({\n path: \"AdminUser.roles\",\n dependencies: [ListRolesUseCase],\n resolver:\n (listRoles: ListRolesUseCase.Interface) =>\n async ({ parent }: { parent: AdminUser }) => {\n if (!parent.roles) {\n return null;\n }\n\n const result = await listRoles.execute({ where: { id_in: parent.roles } });\n if (result.isFail()) {\n throw result.error;\n }\n return result.value;\n }\n });\n\n builder.addResolver({\n path: \"AdminUser.teams\",\n dependencies: [ListTeamsUseCase],\n resolver:\n (listTeams: ListTeamsUseCase.Interface) =>\n async ({ parent }: { parent: AdminUser }) => {\n const hasTeams = Array.isArray(parent.teams) && parent.teams.length > 0;\n if (!hasTeams) {\n return [];\n }\n\n const result = await listTeams.execute({ where: { id_in: parent.teams } });\n if (result.isFail()) {\n throw result.error;\n }\n return result.value;\n }\n });\n\n builder.addResolver<{ where: any }>({\n path: \"AdminUsersQuery.getUser\",\n dependencies: [GetUserUseCase],\n resolver:\n (getUser: GetUserUseCase.Interface) =>\n async ({ args }) => {\n const { where } = args;\n const userResult = await getUser.execute({\n id: where.id,\n email: where.email\n });\n\n if (userResult.isFail()) {\n const error = userResult.error;\n if (error.code === \"AdminUser/NotFound\") {\n return new NotFoundResponse(\n `User \"${JSON.stringify(where)}\" was not found!`\n );\n }\n\n return new ErrorResponse({\n message: error.message,\n code: error.code,\n data: error.data\n });\n }\n\n return new Response(userResult.value);\n }\n });\n\n builder.addResolver({\n path: \"AdminUsersQuery.getCurrentUser\",\n dependencies: [IdentityContext, GetUserUseCase],\n resolver:\n (identityContext: IdentityContext.Interface, getUser: GetUserUseCase.Interface) =>\n async () => {\n const identity = identityContext.getIdentity();\n\n if (!identity.isAdmin()) {\n throw new NotAuthorizedResponse();\n }\n\n // Current user might not have permissions to execute `getUser` (this method can load any user in the system),\n // but loading your own user record should be allowed. For that reason, let's temporarily disable authorization.\n const userResponse = await identityContext.withoutAuthorization(async () => {\n // Get user record using the identity ID.\n return await getUser.execute({ id: identity.id });\n });\n\n if (userResponse.isFail()) {\n const error = userResponse.error;\n if (error.code === \"AdminUser/NotFound\") {\n return new NotFoundResponse(\n `User with ID ${identity.id} was not found!`\n );\n }\n\n return new ErrorResponse({\n message: error.message,\n code: error.code,\n data: error.data\n });\n }\n\n return new Response(userResponse.value);\n }\n });\n\n builder.addResolver({\n path: \"AdminUsersQuery.listUsers\",\n dependencies: [ListUsersUseCase],\n resolver: (listUsers: ListUsersUseCase.Interface) => async () => {\n const users = await listUsers.execute();\n\n if (users.isFail()) {\n return new ListErrorResponse(users.error);\n }\n\n return new ListResponse(users.value);\n }\n });\n\n return builder;\n }\n}\n\nexport const UsersSchemaFactory = CoreGraphQLSchemaFactory.createImplementation({\n implementation: UsersSchemaFactoryImpl,\n dependencies: []\n});\n"],"names":["UsersSchemaFactoryImpl","builder","ListRolesUseCase","listRoles","parent","result","ListTeamsUseCase","listTeams","hasTeams","Array","GetUserUseCase","getUser","args","where","userResult","error","NotFoundResponse","JSON","ErrorResponse","Response","IdentityContext","identityContext","identity","NotAuthorizedResponse","userResponse","ListUsersUseCase","listUsers","users","ListErrorResponse","ListResponse","staticSchemaKey","UsersSchemaFactory","CoreGraphQLSchemaFactory"],"mappings":"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"}
|
|
@@ -0,0 +1,10 @@
|
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
|
|
2
|
+
import type { IGraphQLSchemaBuilder } from "@webiny/api-graphql/features/GraphQLSchemaBuilder/abstractions.js";
|
|
3
|
+
declare class WcpSchemaFactoryImpl implements CoreGraphQLSchemaFactory.Interface {
|
|
4
|
+
getSchemaKey: () => string;
|
|
5
|
+
execute(builder: IGraphQLSchemaBuilder): Promise<IGraphQLSchemaBuilder>;
|
|
6
|
+
}
|
|
7
|
+
export declare const WcpSchemaFactory: typeof WcpSchemaFactoryImpl & {
|
|
8
|
+
__abstraction: import("@webiny/di").Abstraction<import("@webiny/api-graphql/graphql/abstractions.core").ICoreGraphQLSchemaFactory>;
|
|
9
|
+
};
|
|
10
|
+
export {};
|
|
@@ -1,9 +1,10 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
1
|
+
import { CoreGraphQLSchemaFactory } from "@webiny/api-graphql/graphql/abstractions.js";
|
|
2
|
+
import { staticSchemaKey } from "@webiny/api-graphql/graphql/staticSchemaKey.js";
|
|
3
|
+
import { ErrorResponse, Response } from "@webiny/api-graphql/responses.js";
|
|
3
4
|
import { WcpContext } from "../../features/wcp/WcpContext/index.js";
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
5
|
+
class WcpSchemaFactoryImpl {
|
|
6
|
+
async execute(builder) {
|
|
7
|
+
builder.addTypeDefs(`
|
|
7
8
|
type WcpProjectPackageFeaturesFeature {
|
|
8
9
|
enabled: Boolean
|
|
9
10
|
options: JSON
|
|
@@ -18,6 +19,8 @@ const createWcpGraphQL = ()=>new GraphQLSchemaPlugin({
|
|
|
18
19
|
recordLocking: WcpProjectPackageFeaturesFeature
|
|
19
20
|
fileManager: WcpProjectPackageFeaturesFeature
|
|
20
21
|
aiPowerups: WcpProjectPackageFeaturesFeature
|
|
22
|
+
abTesting: WcpProjectPackageFeaturesFeature
|
|
23
|
+
collaboration: WcpProjectPackageFeaturesFeature
|
|
21
24
|
}
|
|
22
25
|
|
|
23
26
|
type WcpProjectPackage {
|
|
@@ -57,15 +60,18 @@ const createWcpGraphQL = ()=>new GraphQLSchemaPlugin({
|
|
|
57
60
|
extend type Mutation {
|
|
58
61
|
wcp: WcpMutation
|
|
59
62
|
}
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
63
|
+
`);
|
|
64
|
+
builder.addResolver({
|
|
65
|
+
path: "Query.wcp",
|
|
66
|
+
resolver: ()=>async ()=>({})
|
|
67
|
+
});
|
|
68
|
+
builder.addResolver({
|
|
69
|
+
path: "WcpQuery.getProject",
|
|
70
|
+
dependencies: [
|
|
71
|
+
WcpContext
|
|
72
|
+
],
|
|
73
|
+
resolver: (wcpContext)=>async ()=>{
|
|
67
74
|
try {
|
|
68
|
-
const wcpContext = context.container.resolve(WcpContext);
|
|
69
75
|
const project = wcpContext.getProjectWithFeatureFlags();
|
|
70
76
|
if (!project) throw Error("Could not get project!");
|
|
71
77
|
return new Response(project);
|
|
@@ -78,9 +84,17 @@ const createWcpGraphQL = ()=>new GraphQLSchemaPlugin({
|
|
|
78
84
|
});
|
|
79
85
|
}
|
|
80
86
|
}
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
}
|
|
84
|
-
|
|
87
|
+
});
|
|
88
|
+
return builder;
|
|
89
|
+
}
|
|
90
|
+
constructor(){
|
|
91
|
+
this.getSchemaKey = staticSchemaKey("api-core/WcpSchemaFactoryImpl");
|
|
92
|
+
}
|
|
93
|
+
}
|
|
94
|
+
const WcpSchemaFactory = CoreGraphQLSchemaFactory.createImplementation({
|
|
95
|
+
implementation: WcpSchemaFactoryImpl,
|
|
96
|
+
dependencies: []
|
|
97
|
+
});
|
|
98
|
+
export { WcpSchemaFactory };
|
|
85
99
|
|
|
86
|
-
//# sourceMappingURL=
|
|
100
|
+
//# sourceMappingURL=WcpSchemaFactory.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"graphql/wcp/WcpSchemaFactory.js","sources":["../../../src/graphql/wcp/WcpSchemaFactory.ts"],"sourcesContent":["import { CoreGraphQLSchemaFactory } from \"@webiny/api-graphql/graphql/abstractions.js\";\nimport { staticSchemaKey } from \"@webiny/api-graphql/graphql/staticSchemaKey.js\";\nimport type { IGraphQLSchemaBuilder } from \"@webiny/api-graphql/features/GraphQLSchemaBuilder/abstractions.js\";\nimport { ErrorResponse, Response } from \"@webiny/api-graphql/responses.js\";\nimport { WcpContext } from \"~/features/wcp/WcpContext/index.js\";\n\nclass WcpSchemaFactoryImpl implements CoreGraphQLSchemaFactory.Interface {\n public getSchemaKey = staticSchemaKey(\"api-core/WcpSchemaFactoryImpl\");\n\n async execute(builder: IGraphQLSchemaBuilder): Promise<IGraphQLSchemaBuilder> {\n builder.addTypeDefs(/* 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 abTesting: WcpProjectPackageFeaturesFeature\n collaboration: 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\n builder.addResolver({\n path: \"Query.wcp\",\n resolver: () => async () => ({})\n });\n\n builder.addResolver({\n path: \"WcpQuery.getProject\",\n dependencies: [WcpContext],\n resolver: (wcpContext: WcpContext.Interface) => async () => {\n try {\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 return builder;\n }\n}\n\nexport const WcpSchemaFactory = CoreGraphQLSchemaFactory.createImplementation({\n implementation: WcpSchemaFactoryImpl,\n dependencies: []\n});\n"],"names":["WcpSchemaFactoryImpl","builder","WcpContext","wcpContext","project","Error","Response","e","ErrorResponse","staticSchemaKey","WcpSchemaFactory","CoreGraphQLSchemaFactory"],"mappings":";;;;AAMA,MAAMA;IAGF,MAAM,QAAQC,OAA8B,EAAkC;QAC1EA,QAAQ,WAAW,CAAe,CAAC;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;QAwDnC,CAAC;QAEDA,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,UAAU,IAAM,UAAa,EAAC;QAClC;QAEAA,QAAQ,WAAW,CAAC;YAChB,MAAM;YACN,cAAc;gBAACC;aAAW;YAC1B,UAAU,CAACC,aAAqC;oBAC5C,IAAI;wBACA,MAAMC,UAAUD,WAAW,0BAA0B;wBAErD,IAAI,CAACC,SACD,MAAMC,MAAM;wBAGhB,OAAO,IAAIC,SAASF;oBACxB,EAAE,OAAOG,GAAG;wBACR,OAAO,IAAIC,cAAc;4BACrB,MAAM;4BACN,SAASD,EAAE,OAAO;4BAClB,MAAM;4BACN,OAAOA,EAAE,KAAK;wBAClB;oBACJ;gBACJ;QACJ;QAEA,OAAON;IACX;;aA1FO,YAAY,GAAGQ,gBAAgB;;AA2F1C;AAEO,MAAMC,mBAAmBC,yBAAyB,oBAAoB,CAAC;IAC1E,gBAAgBX;IAChB,cAAc,EAAE;AACpB"}
|
package/idp/JwksCache.d.ts
CHANGED
|
@@ -1,7 +1,18 @@
|
|
|
1
1
|
import type { Jwk } from "../features/security/utils/verifyJwtUsingJwk.js";
|
|
2
|
+
import { HttpClient } from "../features/httpClient/index.js";
|
|
2
3
|
import { JwkCache } from "./abstractions.js";
|
|
3
|
-
|
|
4
|
-
|
|
4
|
+
import { JwksStore } from "./abstractions.js";
|
|
5
|
+
declare class JwksCacheImpl implements JwkCache.Interface {
|
|
6
|
+
private readonly httpClient;
|
|
7
|
+
private readonly store;
|
|
8
|
+
private readonly states;
|
|
9
|
+
constructor(httpClient: HttpClient.Interface, store: JwksStore.Interface | undefined);
|
|
5
10
|
getKeys(issuer: string): Promise<Jwk[]>;
|
|
6
|
-
|
|
11
|
+
refreshKeys(issuer: string): Promise<Jwk[] | null>;
|
|
12
|
+
private getState;
|
|
13
|
+
private fetchKeys;
|
|
14
|
+
private loadKeys;
|
|
15
|
+
private fetchJson;
|
|
7
16
|
}
|
|
17
|
+
export declare const JwksCache: import("@webiny/di").Implementation<typeof JwksCacheImpl>;
|
|
18
|
+
export {};
|
package/idp/JwksCache.js
CHANGED
|
@@ -1,26 +1,106 @@
|
|
|
1
|
-
|
|
1
|
+
import { createImplementation } from "@webiny/feature/api";
|
|
2
|
+
import { z } from "zod";
|
|
3
|
+
import { HttpClient } from "../features/httpClient/index.js";
|
|
4
|
+
import { JwkCache, JwksStore } from "./abstractions.js";
|
|
5
|
+
const MAX_AGE_MS = 600000;
|
|
6
|
+
const MIN_REFETCH_INTERVAL_MS = 60000;
|
|
7
|
+
const oidcConfigurationSchema = z.object({
|
|
8
|
+
jwks_uri: z.string()
|
|
9
|
+
});
|
|
10
|
+
const jwksSchema = z.object({
|
|
11
|
+
keys: z.array(z.looseObject({
|
|
12
|
+
kid: z.string().optional()
|
|
13
|
+
}))
|
|
14
|
+
});
|
|
15
|
+
function getOpenidConfigurationUrl(issuer) {
|
|
16
|
+
const openidUrl = new URL(issuer);
|
|
17
|
+
const pathname = openidUrl.pathname + "/.well-known/openid-configuration";
|
|
18
|
+
openidUrl.pathname = pathname.replace(/\/+/g, "/");
|
|
19
|
+
return openidUrl.toString();
|
|
20
|
+
}
|
|
21
|
+
function attemptedRecently(state) {
|
|
22
|
+
if (!state.lastAttemptAt) return false;
|
|
23
|
+
return Date.now() - state.lastAttemptAt < MIN_REFETCH_INTERVAL_MS;
|
|
24
|
+
}
|
|
25
|
+
class JwksCacheImpl {
|
|
26
|
+
constructor(httpClient, store){
|
|
27
|
+
this.httpClient = httpClient;
|
|
28
|
+
this.store = store;
|
|
29
|
+
this.states = new Map();
|
|
30
|
+
}
|
|
2
31
|
async getKeys(issuer) {
|
|
3
|
-
const
|
|
4
|
-
if (
|
|
5
|
-
const
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
32
|
+
const state = this.getState(issuer);
|
|
33
|
+
if (!state.keys) return this.fetchKeys(issuer, state);
|
|
34
|
+
const age = Date.now() - (state.fetchedAt ?? 0);
|
|
35
|
+
if (age < MAX_AGE_MS || attemptedRecently(state)) return state.keys;
|
|
36
|
+
try {
|
|
37
|
+
return await this.fetchKeys(issuer, state);
|
|
38
|
+
} catch {
|
|
39
|
+
return state.keys;
|
|
40
|
+
}
|
|
41
|
+
}
|
|
42
|
+
async refreshKeys(issuer) {
|
|
43
|
+
const state = this.getState(issuer);
|
|
44
|
+
if (attemptedRecently(state)) return null;
|
|
45
|
+
try {
|
|
46
|
+
return await this.fetchKeys(issuer, state);
|
|
47
|
+
} catch {
|
|
48
|
+
return null;
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
getState(issuer) {
|
|
52
|
+
if (this.store) return this.store.get(issuer);
|
|
53
|
+
let state = this.states.get(issuer);
|
|
54
|
+
if (!state) {
|
|
55
|
+
state = {};
|
|
56
|
+
this.states.set(issuer, state);
|
|
57
|
+
}
|
|
58
|
+
return state;
|
|
59
|
+
}
|
|
60
|
+
fetchKeys(issuer, state) {
|
|
61
|
+
if (state.pending) return state.pending;
|
|
62
|
+
state.lastAttemptAt = Date.now();
|
|
63
|
+
const pending = this.loadKeys(issuer).then((keys)=>{
|
|
64
|
+
state.keys = keys;
|
|
65
|
+
state.fetchedAt = Date.now();
|
|
66
|
+
return keys;
|
|
14
67
|
});
|
|
15
|
-
|
|
68
|
+
state.pending = pending;
|
|
69
|
+
const clearPending = ()=>{
|
|
70
|
+
state.pending = void 0;
|
|
71
|
+
};
|
|
72
|
+
pending.then(clearPending, clearPending);
|
|
73
|
+
return pending;
|
|
16
74
|
}
|
|
17
|
-
|
|
18
|
-
|
|
75
|
+
async loadKeys(issuer) {
|
|
76
|
+
const openidConfigurationUrl = getOpenidConfigurationUrl(issuer);
|
|
77
|
+
const oidcConfig = await this.fetchJson(openidConfigurationUrl, oidcConfigurationSchema);
|
|
78
|
+
const jwksResponse = await this.fetchJson(oidcConfig.jwks_uri, jwksSchema);
|
|
79
|
+
return jwksResponse.keys;
|
|
19
80
|
}
|
|
20
|
-
|
|
21
|
-
|
|
81
|
+
async fetchJson(url, schema) {
|
|
82
|
+
const response = await this.httpClient.requestJson({
|
|
83
|
+
url
|
|
84
|
+
});
|
|
85
|
+
if (response.isFail()) throw response.error;
|
|
86
|
+
const result = schema.safeParse(response.value);
|
|
87
|
+
if (!result.success) throw new Error(`Invalid response from "${url}": ${result.error.message}`);
|
|
88
|
+
return result.data;
|
|
22
89
|
}
|
|
23
90
|
}
|
|
91
|
+
const JwksCache = createImplementation({
|
|
92
|
+
abstraction: JwkCache,
|
|
93
|
+
implementation: JwksCacheImpl,
|
|
94
|
+
dependencies: [
|
|
95
|
+
HttpClient,
|
|
96
|
+
[
|
|
97
|
+
JwksStore,
|
|
98
|
+
{
|
|
99
|
+
optional: true
|
|
100
|
+
}
|
|
101
|
+
]
|
|
102
|
+
]
|
|
103
|
+
});
|
|
24
104
|
export { JwksCache };
|
|
25
105
|
|
|
26
106
|
//# sourceMappingURL=JwksCache.js.map
|
package/idp/JwksCache.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"idp/JwksCache.js","sources":["../../src/idp/JwksCache.ts"],"sourcesContent":["import type { Jwk } from \"~/features/security/utils/verifyJwtUsingJwk.js\";\nimport { JwkCache } from \"./abstractions.js\";\n\
|
|
1
|
+
{"version":3,"file":"idp/JwksCache.js","sources":["../../src/idp/JwksCache.ts"],"sourcesContent":["import { createImplementation } from \"@webiny/feature/api\";\nimport { z } from \"zod\";\nimport type { Jwk } from \"~/features/security/utils/verifyJwtUsingJwk.js\";\nimport { HttpClient } from \"~/features/httpClient/index.js\";\nimport { JwkCache } from \"./abstractions.js\";\nimport { JwksStore } from \"./abstractions.js\";\n\n// Keys older than this are fetched again, so a key the issuer removes stops verifying tokens.\nconst MAX_AGE_MS = 10 * 60_000;\n\n// The shortest time between two fetches that aren't for missing keys: refreshes for unknown key\n// ids, and retries after a failed fetch.\nconst MIN_REFETCH_INTERVAL_MS = 60_000;\n\nconst oidcConfigurationSchema = z.object({\n jwks_uri: z.string()\n});\n\nconst jwksSchema = z.object({\n keys: z.array(z.looseObject({ kid: z.string().optional() }))\n});\n\nfunction getOpenidConfigurationUrl(issuer: string): string {\n const openidUrl = new URL(issuer);\n const pathname = openidUrl.pathname + \"/.well-known/openid-configuration\";\n openidUrl.pathname = pathname.replace(/\\/+/g, \"/\");\n return openidUrl.toString();\n}\n\nfunction attemptedRecently(state: JwksStore.IssuerState): boolean {\n if (!state.lastAttemptAt) {\n return false;\n }\n return Date.now() - state.lastAttemptAt < MIN_REFETCH_INTERVAL_MS;\n}\n\nclass JwksCacheImpl implements JwkCache.Interface {\n // Used when no JwksStore is registered: the keys then last for this instance only.\n private readonly states = new Map<string, JwksStore.IssuerState>();\n\n constructor(\n private readonly httpClient: HttpClient.Interface,\n private readonly store: JwksStore.Interface | undefined\n ) {}\n\n async getKeys(issuer: string): Promise<Jwk[]> {\n const state = this.getState(issuer);\n\n // No keys yet: fetch them, and let a failure fail the token verification.\n if (!state.keys) {\n return this.fetchKeys(issuer, state);\n }\n\n const age = Date.now() - (state.fetchedAt ?? 0);\n if (age < MAX_AGE_MS || attemptedRecently(state)) {\n return state.keys;\n }\n\n /*\n * Expired. Fetch again, but keep using the old keys if the issuer can't be reached, so an\n * outage doesn't fail every login. The failed attempt counts, so the next try waits.\n */\n try {\n return await this.fetchKeys(issuer, state);\n } catch {\n return state.keys;\n }\n }\n\n async refreshKeys(issuer: string): Promise<Jwk[] | null> {\n const state = this.getState(issuer);\n if (attemptedRecently(state)) {\n return null;\n }\n\n try {\n return await this.fetchKeys(issuer, state);\n } catch {\n return null;\n }\n }\n\n private getState(issuer: string): JwksStore.IssuerState {\n if (this.store) {\n return this.store.get(issuer);\n }\n\n let state = this.states.get(issuer);\n if (!state) {\n state = {};\n this.states.set(issuer, state);\n }\n return state;\n }\n\n // One fetch per issuer at a time: concurrent callers share the one in progress.\n private fetchKeys(issuer: string, state: JwksStore.IssuerState): Promise<Jwk[]> {\n if (state.pending) {\n return state.pending;\n }\n\n state.lastAttemptAt = Date.now();\n const pending = this.loadKeys(issuer).then(keys => {\n state.keys = keys;\n state.fetchedAt = Date.now();\n return keys;\n });\n state.pending = pending;\n\n const clearPending = () => {\n state.pending = undefined;\n };\n pending.then(clearPending, clearPending);\n\n return pending;\n }\n\n private async loadKeys(issuer: string): Promise<Jwk[]> {\n const openidConfigurationUrl = getOpenidConfigurationUrl(issuer);\n const oidcConfig = await this.fetchJson(openidConfigurationUrl, oidcConfigurationSchema);\n const jwksResponse = await this.fetchJson(oidcConfig.jwks_uri, jwksSchema);\n return jwksResponse.keys;\n }\n\n // Throws, so a failed fetch fails the token verification instead of caching a bad answer.\n private async fetchJson<T>(url: string, schema: z.ZodType<T>): Promise<T> {\n const response = await this.httpClient.requestJson({ url });\n if (response.isFail()) {\n throw response.error;\n }\n\n const result = schema.safeParse(response.value);\n if (!result.success) {\n throw new Error(`Invalid response from \"${url}\": ${result.error.message}`);\n }\n\n return result.data;\n }\n}\n\nexport const JwksCache = createImplementation({\n abstraction: JwkCache,\n implementation: JwksCacheImpl,\n dependencies: [HttpClient, [JwksStore, { optional: true }]]\n});\n"],"names":["MAX_AGE_MS","MIN_REFETCH_INTERVAL_MS","oidcConfigurationSchema","z","jwksSchema","getOpenidConfigurationUrl","issuer","openidUrl","URL","pathname","attemptedRecently","state","Date","JwksCacheImpl","httpClient","store","Map","age","pending","keys","clearPending","undefined","openidConfigurationUrl","oidcConfig","jwksResponse","url","schema","response","result","Error","JwksCache","createImplementation","JwkCache","HttpClient","JwksStore"],"mappings":"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"}
|