@webiny/api-core 6.4.5 → 6.6.0-alpha.0
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 +23 -5
- package/ApiCoreFeature.js.map +1 -1
- package/exports/api.d.ts +2 -1
- package/exports/api.js +2 -1
- package/features/ai/feature.js +4 -0
- package/features/ai/feature.js.map +1 -1
- package/features/ai/index.d.ts +2 -0
- package/features/ai/index.js +1 -0
- package/features/ai/toolPipeline/AiOutputToolRegistry.d.ts +11 -0
- package/features/ai/toolPipeline/AiOutputToolRegistry.js +31 -0
- package/features/ai/toolPipeline/AiOutputToolRegistry.js.map +1 -0
- package/features/ai/toolPipeline/AiToolPipelineRunner.d.ts +10 -0
- package/features/ai/toolPipeline/AiToolPipelineRunner.js +36 -0
- package/features/ai/toolPipeline/AiToolPipelineRunner.js.map +1 -0
- package/features/ai/toolPipeline/abstractions.d.ts +23 -0
- package/features/ai/toolPipeline/abstractions.js +7 -0
- package/features/ai/toolPipeline/abstractions.js.map +1 -0
- package/features/ai/toolPipeline/index.d.ts +2 -0
- package/features/ai/toolPipeline/index.js +1 -0
- package/features/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/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 +53 -0
- package/features/requestContext/abstractions.js +8 -0
- package/features/requestContext/abstractions.js.map +1 -0
- package/features/requestContext/feature.d.ts +11 -0
- package/features/requestContext/feature.js +17 -0
- package/features/requestContext/feature.js.map +1 -0
- package/features/requestContext/index.d.ts +2 -0
- package/features/requestContext/index.js +2 -0
- 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/feature.js +4 -0
- package/features/security/apiKeys/feature.js.map +1 -1
- package/features/security/authorization/GroupsTeamsAuthorizer/GetPermissionsFromIdentity.d.ts +1 -1
- package/features/security/utils/getPermissionsFromRoles.d.ts +1 -1
- package/features/serviceDiscovery/ServiceDiscovery.d.ts +17 -0
- package/features/serviceDiscovery/ServiceDiscovery.js +22 -0
- package/features/serviceDiscovery/ServiceDiscovery.js.map +1 -0
- package/features/serviceDiscovery/__tests__/ServiceDiscovery.test.d.ts +1 -0
- package/features/serviceDiscovery/__tests__/ServiceDiscovery.test.js +111 -0
- package/features/serviceDiscovery/__tests__/ServiceDiscovery.test.js.map +1 -0
- package/features/serviceDiscovery/index.d.ts +3 -0
- package/features/serviceDiscovery/index.js +1 -0
- package/features/storageOperations/abstractions.d.ts +21 -0
- package/features/storageOperations/abstractions.js +10 -0
- package/features/storageOperations/abstractions.js.map +1 -0
- package/features/tenancy/CreateTenant/CreateTenantUseCase.d.ts +1 -1
- package/features/tenancy/InstallTenant/InstallTenantUseCase.d.ts +1 -1
- package/features/tenancy/UpdateTenant/UpdateTenantUseCase.d.ts +2 -2
- package/features/users/CreateUser/decorators/CreateUserWithWcpIncrement.d.ts +1 -1
- package/features/wcp/WcpContext/WcpContext.d.ts +4 -5
- package/features/wcp/WcpContext/WcpContext.js +5 -2
- package/features/wcp/WcpContext/WcpContext.js.map +1 -1
- package/features/wcp/WcpContext/decorators/WcpContextWithFeatureFlagsDecorator.d.ts +8 -8
- 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 +5 -2
- package/features/wcp/WcpFeature.js.map +1 -1
- package/features/wcp/WcpLicenseProvider.d.ts +29 -0
- package/features/wcp/WcpLicenseProvider.js +18 -0
- package/features/wcp/WcpLicenseProvider.js.map +1 -0
- package/features/wcp/loadWcpLicense.d.ts +2 -0
- package/{legacy/wcp/context.js → features/wcp/loadWcpLicense.js} +24 -19
- package/features/wcp/loadWcpLicense.js.map +1 -0
- package/graphql/ApiCoreSchemaFactory.d.ts +15 -0
- package/graphql/ApiCoreSchemaFactory.js +52 -0
- package/graphql/ApiCoreSchemaFactory.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 +14 -0
- package/graphql/security/SecuritySchemaFactory.js +23 -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 +9 -0
- package/graphql/system/SystemSchemaFactory.js +66 -0
- package/graphql/system/SystemSchemaFactory.js.map +1 -0
- package/graphql/users/UsersSchemaFactory.d.ts +9 -0
- package/graphql/users/UsersSchemaFactory.js +191 -0
- package/graphql/users/UsersSchemaFactory.js.map +1 -0
- package/graphql/wcp/WcpSchemaFactory.d.ts +9 -0
- package/graphql/wcp/{graphql.js → WcpSchemaFactory.js} +26 -18
- package/graphql/wcp/WcpSchemaFactory.js.map +1 -0
- package/index.d.ts +3 -1
- package/index.js +3 -1
- package/package.json +19 -22
- 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 +0 -13
- package/createApiCore.d.ts +0 -7
- package/createApiCore.js +0 -22
- 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 -33
- package/legacy/wcp/LegacyWcpContext.js +0 -84
- package/legacy/wcp/LegacyWcpContext.js.map +0 -1
- package/legacy/wcp/context.d.ts +0 -5
- package/legacy/wcp/context.js.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"legacy/users/createAdminUsersContext.js","sources":["../../../src/legacy/users/createAdminUsersContext.ts"],"sourcesContent":["import { ContextPlugin } from \"@webiny/api\";\nimport { LegacyContext } from \"./LegacyContext.js\";\nimport { createUsersGraphQL } from \"~/graphql/users/user.gql.js\";\nimport type { ApiCoreContext } from \"~/types/core.js\";\n\nexport const createAdminUsersContext = () => {\n return [\n new ContextPlugin<ApiCoreContext>(async context => {\n // Attach legacy context interface\n context.adminUsers = new LegacyContext(context.container);\n\n context.plugins.register(createUsersGraphQL());\n })\n ];\n};\n"],"names":["createAdminUsersContext","ContextPlugin","context","LegacyContext","createUsersGraphQL"],"mappings":";;;AAKO,MAAMA,0BAA0B,IAC5B;QACH,IAAIC,cAA8B,OAAMC;YAEpCA,QAAQ,UAAU,GAAG,IAAIC,cAAcD,QAAQ,SAAS;YAExDA,QAAQ,OAAO,CAAC,QAAQ,CAACE;QAC7B;KACH"}
|
|
@@ -1,33 +0,0 @@
|
|
|
1
|
-
import { Container } from "@webiny/di";
|
|
2
|
-
import type { WCP_FEATURE_LABEL } from "@webiny/wcp";
|
|
3
|
-
import type { DecryptedWcpProjectLicense, ILicense, WcpProject, WcpProjectEnvironment } from "@webiny/wcp/types.js";
|
|
4
|
-
import { WcpContextObject } from "../../features/wcp/WcpContext/types.js";
|
|
5
|
-
export declare class LegacyWcpContext implements WcpContextObject {
|
|
6
|
-
private container;
|
|
7
|
-
constructor(container: Container);
|
|
8
|
-
private getWcpContext;
|
|
9
|
-
getRawLicense(): DecryptedWcpProjectLicense | null;
|
|
10
|
-
getProject(): WcpProject | null;
|
|
11
|
-
getProjectWithFeatureFlags(): WcpProject | null;
|
|
12
|
-
getProjectLicense(): ILicense;
|
|
13
|
-
getProjectEnvironment(): WcpProjectEnvironment | null;
|
|
14
|
-
canUseFeature(wcpFeatureId: keyof typeof WCP_FEATURE_LABEL): boolean;
|
|
15
|
-
canUseAacl(): boolean;
|
|
16
|
-
canUseTeams(): boolean;
|
|
17
|
-
canUseFolderLevelPermissions(): boolean;
|
|
18
|
-
canUsePrivateFiles(): boolean;
|
|
19
|
-
canUseAuditLogs(): boolean;
|
|
20
|
-
canUseRecordLocking(): boolean;
|
|
21
|
-
canUseFileManagerThreatDetection(): boolean;
|
|
22
|
-
canUseWorkflows(): boolean;
|
|
23
|
-
canUseHcmsFieldPermissions(): boolean;
|
|
24
|
-
canUseAiImageEnrichment(): boolean;
|
|
25
|
-
canUseAiPageGeneration(): boolean;
|
|
26
|
-
canUseAiLexicalGeneration(): boolean;
|
|
27
|
-
ensureCanUseFeature(featureId: keyof typeof WCP_FEATURE_LABEL): void;
|
|
28
|
-
incrementSeats(): Promise<void>;
|
|
29
|
-
decrementSeats(): Promise<void>;
|
|
30
|
-
incrementTenants(): Promise<void>;
|
|
31
|
-
decrementTenants(): Promise<void>;
|
|
32
|
-
toDto(): DecryptedWcpProjectLicense | null;
|
|
33
|
-
}
|
|
@@ -1,84 +0,0 @@
|
|
|
1
|
-
import { WcpContext } from "../../features/wcp/WcpContext/index.js";
|
|
2
|
-
class LegacyWcpContext {
|
|
3
|
-
constructor(container){
|
|
4
|
-
this.container = container;
|
|
5
|
-
}
|
|
6
|
-
getWcpContext() {
|
|
7
|
-
return this.container.resolve(WcpContext);
|
|
8
|
-
}
|
|
9
|
-
getRawLicense() {
|
|
10
|
-
return this.getWcpContext().getRawLicense();
|
|
11
|
-
}
|
|
12
|
-
getProject() {
|
|
13
|
-
return this.getWcpContext().getProject();
|
|
14
|
-
}
|
|
15
|
-
getProjectWithFeatureFlags() {
|
|
16
|
-
return this.getWcpContext().getProjectWithFeatureFlags();
|
|
17
|
-
}
|
|
18
|
-
getProjectLicense() {
|
|
19
|
-
return this.getWcpContext().getProjectLicense();
|
|
20
|
-
}
|
|
21
|
-
getProjectEnvironment() {
|
|
22
|
-
return this.getWcpContext().getProjectEnvironment();
|
|
23
|
-
}
|
|
24
|
-
canUseFeature(wcpFeatureId) {
|
|
25
|
-
return this.getWcpContext().canUseFeature(wcpFeatureId);
|
|
26
|
-
}
|
|
27
|
-
canUseAacl() {
|
|
28
|
-
return this.getWcpContext().canUseAacl();
|
|
29
|
-
}
|
|
30
|
-
canUseTeams() {
|
|
31
|
-
return this.getWcpContext().canUseTeams();
|
|
32
|
-
}
|
|
33
|
-
canUseFolderLevelPermissions() {
|
|
34
|
-
return this.getWcpContext().canUseFolderLevelPermissions();
|
|
35
|
-
}
|
|
36
|
-
canUsePrivateFiles() {
|
|
37
|
-
return this.getWcpContext().canUsePrivateFiles();
|
|
38
|
-
}
|
|
39
|
-
canUseAuditLogs() {
|
|
40
|
-
return this.getWcpContext().canUseAuditLogs();
|
|
41
|
-
}
|
|
42
|
-
canUseRecordLocking() {
|
|
43
|
-
return this.getWcpContext().canUseRecordLocking();
|
|
44
|
-
}
|
|
45
|
-
canUseFileManagerThreatDetection() {
|
|
46
|
-
return this.getWcpContext().canUseFileManagerThreatDetection();
|
|
47
|
-
}
|
|
48
|
-
canUseWorkflows() {
|
|
49
|
-
return this.getWcpContext().canUseWorkflows();
|
|
50
|
-
}
|
|
51
|
-
canUseHcmsFieldPermissions() {
|
|
52
|
-
return this.getWcpContext().canUseHcmsFieldPermissions();
|
|
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
|
-
}
|
|
63
|
-
ensureCanUseFeature(featureId) {
|
|
64
|
-
this.getWcpContext().ensureCanUseFeature(featureId);
|
|
65
|
-
}
|
|
66
|
-
async incrementSeats() {
|
|
67
|
-
await this.getWcpContext().incrementSeats();
|
|
68
|
-
}
|
|
69
|
-
async decrementSeats() {
|
|
70
|
-
await this.getWcpContext().decrementSeats();
|
|
71
|
-
}
|
|
72
|
-
async incrementTenants() {
|
|
73
|
-
await this.getWcpContext().incrementTenants();
|
|
74
|
-
}
|
|
75
|
-
async decrementTenants() {
|
|
76
|
-
await this.getWcpContext().decrementTenants();
|
|
77
|
-
}
|
|
78
|
-
toDto() {
|
|
79
|
-
return this.getWcpContext().toDto();
|
|
80
|
-
}
|
|
81
|
-
}
|
|
82
|
-
export { LegacyWcpContext };
|
|
83
|
-
|
|
84
|
-
//# sourceMappingURL=LegacyWcpContext.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"legacy/wcp/LegacyWcpContext.js","sources":["../../../src/legacy/wcp/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"],"names":["LegacyWcpContext","container","WcpContext","wcpFeatureId","featureId"],"mappings":";AAWO,MAAMA;IACT,YAAoBC,SAAoB,CAAE;aAAtBA,SAAS,GAATA;IAAuB;IAEnC,gBAAsC;QAC1C,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAACC;IAClC;IAEA,gBAAmD;QAC/C,OAAO,IAAI,CAAC,aAAa,GAAG,aAAa;IAC7C;IAEA,aAAgC;QAC5B,OAAO,IAAI,CAAC,aAAa,GAAG,UAAU;IAC1C;IAEA,6BAAgD;QAC5C,OAAO,IAAI,CAAC,aAAa,GAAG,0BAA0B;IAC1D;IAEA,oBAA8B;QAC1B,OAAO,IAAI,CAAC,aAAa,GAAG,iBAAiB;IACjD;IAEA,wBAAsD;QAClD,OAAO,IAAI,CAAC,aAAa,GAAG,qBAAqB;IACrD;IAEA,cAAcC,YAA4C,EAAW;QACjE,OAAO,IAAI,CAAC,aAAa,GAAG,aAAa,CAACA;IAC9C;IAEA,aAAsB;QAClB,OAAO,IAAI,CAAC,aAAa,GAAG,UAAU;IAC1C;IAEA,cAAuB;QACnB,OAAO,IAAI,CAAC,aAAa,GAAG,WAAW;IAC3C;IAEA,+BAAwC;QACpC,OAAO,IAAI,CAAC,aAAa,GAAG,4BAA4B;IAC5D;IAEA,qBAA8B;QAC1B,OAAO,IAAI,CAAC,aAAa,GAAG,kBAAkB;IAClD;IAEA,kBAA2B;QACvB,OAAO,IAAI,CAAC,aAAa,GAAG,eAAe;IAC/C;IAEA,sBAA+B;QAC3B,OAAO,IAAI,CAAC,aAAa,GAAG,mBAAmB;IACnD;IAEA,mCAA4C;QACxC,OAAO,IAAI,CAAC,aAAa,GAAG,gCAAgC;IAChE;IAEA,kBAA2B;QACvB,OAAO,IAAI,CAAC,aAAa,GAAG,eAAe;IAC/C;IAEA,6BAAsC;QAClC,OAAO,IAAI,CAAC,aAAa,GAAG,0BAA0B;IAC1D;IAEA,0BAAmC;QAC/B,OAAO,IAAI,CAAC,aAAa,GAAG,uBAAuB;IACvD;IAEA,yBAAkC;QAC9B,OAAO,IAAI,CAAC,aAAa,GAAG,sBAAsB;IACtD;IAEA,4BAAqC;QACjC,OAAO,IAAI,CAAC,aAAa,GAAG,yBAAyB;IACzD;IAEA,oBAAoBC,SAAyC,EAAQ;QACjE,IAAI,CAAC,aAAa,GAAG,mBAAmB,CAACA;IAC7C;IAEA,MAAM,iBAAgC;QAClC,MAAM,IAAI,CAAC,aAAa,GAAG,cAAc;IAC7C;IAEA,MAAM,iBAAgC;QAClC,MAAM,IAAI,CAAC,aAAa,GAAG,cAAc;IAC7C;IAEA,MAAM,mBAAkC;QACpC,MAAM,IAAI,CAAC,aAAa,GAAG,gBAAgB;IAC/C;IAEA,MAAM,mBAAkC;QACpC,MAAM,IAAI,CAAC,aAAa,GAAG,gBAAgB;IAC/C;IAEA,QAA2C;QACvC,OAAO,IAAI,CAAC,aAAa,GAAG,KAAK;IACrC;AACJ"}
|
package/legacy/wcp/context.d.ts
DELETED
|
@@ -1,5 +0,0 @@
|
|
|
1
|
-
import type { DecryptedWcpProjectLicense } from "@webiny/wcp/types.js";
|
|
2
|
-
export interface CreateWcpContextParams {
|
|
3
|
-
testProjectLicense?: DecryptedWcpProjectLicense;
|
|
4
|
-
}
|
|
5
|
-
export declare const createWcpContext: (params?: CreateWcpContextParams) => import("@webiny/handler/index.js").RegisterExtensionPlugin<import("@webiny/handler/types.js").Context>;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"legacy/wcp/context.js","sources":["../../../src/legacy/wcp/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"],"names":["wcpProjectEnvironment","getWcpProjectEnvironment","cachedLicense","NullLicense","loadLicense","testProjectLicense","License","currentCacheKey","getWcpProjectLicenseCacheKey","decryptedLicenseDto","getWcpProjectLicense","createWcpContext","params","plugin","createRegisterExtensionPlugin","context","license","WcpFeature","LegacyWcpContext","createWcpGraphQL"],"mappings":";;;;;;AAUA,MAAMA,wBAAwBC;AAE9B,MAAMC,gBAAyC;IAC3C,UAAU;IACV,SAAS;IACT,SAAS,IAAIC;AACjB;AAEA,eAAeC,YAAYC,kBAA+C;IACtE,IAAIA,oBACAH,cAAc,OAAO,GAAGI,QAAQ,cAAc,CAACD;SAC5C,IAAIL,uBAAuB;QAC9B,MAAMO,kBAAkBC;QACxB,IAAIN,cAAc,QAAQ,KAAKK,iBAAiB;YAC5CL,cAAc,QAAQ,GAAGK;YAEzB,MAAME,sBAAsB,MAAMC,qBAAqB;gBACnD,OAAOV,sBAAsB,GAAG,CAAC,EAAE;gBACnC,WAAWA,sBAAsB,OAAO,CAAC,EAAE;gBAC3C,0BAA0BA,sBAAsB,MAAM;YAC1D;YAEA,IAAIS,qBACAP,cAAc,OAAO,GAAG;gBACpB,OAAOO,oBAAoB,KAAK;gBAChC,WAAWA,oBAAoB,SAAS;gBACxC,SAASA,oBAAoB,OAAO;YACxC;YAGJP,cAAc,OAAO,GAAGI,QAAQ,cAAc,CAACG;QACnD;IACJ;IAEA,OAAOP,cAAc,OAAO;AAChC;AAMO,MAAMS,mBAAmB,CAACC,SAAiC,CAAC,CAAC;IAChE,MAAMC,SAASC,8BAA8B,OAAMC;QAC/C,MAAMC,UAAU,MAAMZ,YAAYQ,OAAO,kBAAkB;QAE3DK,WAAW,QAAQ,CAACF,QAAQ,SAAS,EAAEC;QAGvCD,QAAQ,GAAG,GAAG,IAAIG,iBAAiBH,QAAQ,SAAS;QAEpDA,QAAQ,OAAO,CAAC,QAAQ,CAACI;IAC7B;IAEAN,OAAO,IAAI,GAAG;IAEd,OAAOA;AACX"}
|