@webiny/project 0.0.0-unstable.9f53ea597d → 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/ProjectSdk.d.ts +6 -5
- package/ProjectSdk.js +10 -6
- package/ProjectSdk.js.map +1 -1
- package/abstractions/features/DeployApp.d.ts +2 -2
- package/abstractions/features/DeployApp.js.map +1 -1
- package/abstractions/features/DestroyApp.d.ts +2 -2
- package/abstractions/features/DestroyApp.js.map +1 -1
- package/abstractions/features/GetAppOutput.d.ts +2 -2
- package/abstractions/features/GetAppOutput.js.map +1 -1
- package/abstractions/features/GetAppStackOutput.d.ts +3 -2
- package/abstractions/features/GetAppStackOutput.js.map +1 -1
- package/abstractions/features/RefreshApp.d.ts +2 -2
- package/abstractions/features/RefreshApp.js.map +1 -1
- package/abstractions/features/RunPulumiCommand.d.ts +2 -2
- package/abstractions/features/RunPulumiCommand.js.map +1 -1
- package/abstractions/features/Serve.d.ts +27 -0
- package/abstractions/features/Serve.js +5 -0
- package/abstractions/features/Serve.js.map +1 -0
- package/abstractions/features/Watch.d.ts +10 -0
- package/abstractions/features/Watch.js.map +1 -1
- package/abstractions/features/index.d.ts +1 -0
- package/abstractions/features/index.js +1 -0
- package/components/FeatureFlag.d.ts +43 -0
- package/components/FeatureFlag.js +60 -0
- package/components/FeatureFlag.js.map +1 -0
- package/createProjectSdkContainer.d.ts +1 -1
- package/createProjectSdkContainer.js +28 -41
- package/createProjectSdkContainer.js.map +1 -1
- package/decorators/DestroyAppClearStackOutputCache.d.ts +1 -1
- package/decorators/GetFeatureFlagsWithLicense.d.ts +0 -1
- package/decorators/GetFeatureFlagsWithLicense.js +28 -21
- package/decorators/GetFeatureFlagsWithLicense.js.map +1 -1
- package/extensions/AdminApiUrl.d.ts +10 -0
- package/extensions/AdminApiUrl.js +21 -0
- package/extensions/AdminApiUrl.js.map +1 -0
- package/extensions/AdminExtension.d.ts +1 -1
- package/extensions/AdminExtension.js +3 -3
- package/extensions/AdminExtension.js.map +1 -1
- package/extensions/AdminWebsocketsUrl.d.ts +12 -0
- package/extensions/AdminWebsocketsUrl.js +21 -0
- package/extensions/AdminWebsocketsUrl.js.map +1 -0
- package/extensions/ApiBuildParam.js +6 -4
- package/extensions/ApiBuildParam.js.map +1 -1
- package/extensions/ApiExtension.d.ts +1 -1
- package/extensions/ApiExtension.js +7 -5
- package/extensions/ApiExtension.js.map +1 -1
- package/extensions/BugReporter.d.ts +6 -0
- package/extensions/BugReporter.js +33 -0
- package/extensions/BugReporter.js.map +1 -0
- package/extensions/FeatureFlags.d.ts +21 -17
- package/extensions/FeatureFlags.js +23 -9
- package/extensions/FeatureFlags.js.map +1 -1
- package/extensions/Project/SetAdminAppEnvVarsBeforeBuild.js +1 -0
- package/extensions/Project/SetAdminAppEnvVarsBeforeBuild.js.map +1 -1
- package/extensions/Project/SetAdminAppEnvVarsBeforeWatch.js +1 -0
- package/extensions/Project/SetAdminAppEnvVarsBeforeWatch.js.map +1 -1
- package/extensions/Project/ShowConfigChangeInfoBeforeAdminWatch.js +2 -1
- package/extensions/Project/ShowConfigChangeInfoBeforeAdminWatch.js.map +1 -1
- package/extensions/Project/ShowConfigChangeInfoBeforeApiWatch.js +2 -1
- package/extensions/Project/ShowConfigChangeInfoBeforeApiWatch.js.map +1 -1
- package/extensions/Project/WcpInjectTelemetryClientAfterBuild.js +2 -1
- package/extensions/Project/WcpInjectTelemetryClientAfterBuild.js.map +1 -1
- package/extensions/Project/showConfigChangeNotice.d.ts +7 -0
- package/extensions/Project/showConfigChangeNotice.js +9 -0
- package/extensions/Project/showConfigChangeNotice.js.map +1 -0
- package/extensions/Project.js +1 -17
- package/extensions/Project.js.map +1 -1
- package/extensions/hasDefaultExport.d.ts +2 -0
- package/extensions/hasDefaultExport.js +17 -0
- package/extensions/hasDefaultExport.js.map +1 -0
- package/extensions/index.d.ts +66 -35
- package/extensions/index.js +12 -2
- package/extensions/index.js.map +1 -1
- package/extensions/infra/Encryption.d.ts +10 -0
- package/extensions/infra/Encryption.js +36 -0
- package/extensions/infra/Encryption.js.map +1 -0
- package/extensions/infra/Hashing.d.ts +5 -0
- package/extensions/infra/Hashing.js +27 -0
- package/extensions/infra/Hashing.js.map +1 -0
- package/features/DestroyApp/DestroyApp.d.ts +1 -1
- package/features/GetAppOutput/GetAppOutput.d.ts +1 -1
- package/features/RefreshApp/RefreshApp.d.ts +1 -1
- package/features/RunPulumiCommand/RunPulumiCommand.d.ts +1 -1
- package/features/Serve/Serve.d.ts +10 -0
- package/features/Serve/Serve.js +15 -0
- package/features/Serve/Serve.js.map +1 -0
- package/features/Serve/index.d.ts +1 -0
- package/features/Serve/index.js +1 -0
- package/features/Watch/Watch.d.ts +3 -16
- package/features/Watch/Watch.js +4 -86
- package/features/Watch/Watch.js.map +1 -1
- package/features/Watch/watchers/ServersWatcher.d.ts +36 -0
- package/features/Watch/watchers/ServersWatcher.js +38 -0
- package/features/Watch/watchers/ServersWatcher.js.map +1 -0
- package/features/Watch/watchers/worker.js +3 -0
- package/features/Watch/watchers/worker.js.map +1 -1
- package/features/index.d.ts +1 -0
- package/features/index.js +1 -0
- package/index.d.ts +3 -1
- package/index.js +3 -1
- package/index.js.map +1 -1
- package/package.json +25 -25
- package/services/BuildAppWorkspaceService/BuildAppWorkspaceService.d.ts +2 -3
- package/services/BuildAppWorkspaceService/BuildAppWorkspaceService.js +11 -44
- package/services/BuildAppWorkspaceService/BuildAppWorkspaceService.js.map +1 -1
- package/services/BuildProjectWorkspaceService/BuildProjectWorkspaceService.js +4 -6
- package/services/BuildProjectWorkspaceService/BuildProjectWorkspaceService.js.map +1 -1
- package/services/GetProjectConfigService/ConfigRenderErrorBoundary.d.ts +15 -0
- package/services/GetProjectConfigService/ConfigRenderErrorBoundary.js +23 -0
- package/services/GetProjectConfigService/ConfigRenderErrorBoundary.js.map +1 -0
- package/services/GetProjectConfigService/EnvContext.d.ts +3 -2
- package/services/GetProjectConfigService/EnvContext.js +4 -6
- package/services/GetProjectConfigService/EnvContext.js.map +1 -1
- package/services/GetProjectConfigService/FeatureFlagsContext.d.ts +26 -0
- package/services/GetProjectConfigService/FeatureFlagsContext.js +41 -0
- package/services/GetProjectConfigService/FeatureFlagsContext.js.map +1 -0
- package/services/GetProjectConfigService/GetProjectConfigService.js +14 -11
- package/services/GetProjectConfigService/GetProjectConfigService.js.map +1 -1
- package/services/GetProjectConfigService/LicenseDecoratedFeatureFlags.d.ts +8 -0
- package/services/GetProjectConfigService/LicenseDecoratedFeatureFlags.js +28 -0
- package/services/GetProjectConfigService/LicenseDecoratedFeatureFlags.js.map +1 -0
- package/services/GetProjectConfigService/WcpProjectLicenseContext.d.ts +1 -0
- package/services/GetProjectConfigService/WcpProjectLicenseContext.js +1 -0
- package/services/GetProjectConfigService/WcpProjectLicenseContext.js.map +1 -1
- package/services/GetProjectConfigService/getRenderCacheKey.d.ts +1 -0
- package/services/GetProjectConfigService/getRenderCacheKey.js +13 -0
- package/services/GetProjectConfigService/getRenderCacheKey.js.map +1 -0
- package/services/GetProjectConfigService/nullRenderer.d.ts +4 -0
- package/services/GetProjectConfigService/nullRenderer.js +51 -0
- package/services/GetProjectConfigService/nullRenderer.js.map +1 -0
- package/services/GetProjectConfigService/renderConfig.d.ts +3 -12
- package/services/GetProjectConfigService/renderConfig.js +10 -35
- package/services/GetProjectConfigService/renderConfig.js.map +1 -1
- package/services/GetProjectConfigService/renderExtensions.d.ts +8 -0
- package/services/GetProjectConfigService/renderExtensions.js +52 -0
- package/services/GetProjectConfigService/renderExtensions.js.map +1 -0
- package/services/InitProjectSdkService/InitProjectSdkService.js +5 -8
- package/services/InitProjectSdkService/InitProjectSdkService.js.map +1 -1
- package/services/InitProjectSdkService/applyWcpEnvVars.js +27 -9
- package/services/InitProjectSdkService/applyWcpEnvVars.js.map +1 -1
- package/services/ProjectInfoService/GetPulumiVersionService.js +3 -3
- package/services/ProjectInfoService/GetPulumiVersionService.js.map +1 -1
- package/services/PulumiExportService/PulumiExportService.js.map +1 -1
- package/services/PulumiGetStackOutputService/PulumiGetStackOutputService.js.map +1 -1
- package/services/PulumiSelectStackService/PulumiSelectStackService.js.map +1 -1
- package/services/UiService/UiService.d.ts +18 -0
- package/services/UiService/UiService.js +18 -2
- package/services/UiService/UiService.js.map +1 -1
- package/services/ValidateProjectConfigService/ValidateProjectConfigService.js +10 -7
- package/services/ValidateProjectConfigService/ValidateProjectConfigService.js.map +1 -1
- package/services/WcpService/GetProjectEnvironment.js +16 -5
- package/services/WcpService/GetProjectEnvironment.js.map +1 -1
- package/services/WcpService/WcpGqlClient.js +2 -2
- package/services/WcpService/WcpGqlClient.js.map +1 -1
- package/services/WcpService/fetchProjectEnvironmentByApiKey.d.ts +8 -0
- package/services/WcpService/fetchProjectEnvironmentByApiKey.js +21 -0
- package/services/WcpService/fetchProjectEnvironmentByApiKey.js.map +1 -0
- package/services/index.d.ts +0 -1
- package/services/index.js +0 -1
- package/utils/apiRuntimeEnv.d.ts +20 -0
- package/utils/apiRuntimeEnv.js +51 -0
- package/utils/apiRuntimeEnv.js.map +1 -0
- package/utils/index.d.ts +2 -1
- package/utils/index.js +2 -1
- package/utils/trace/TraceRecorder.d.ts +17 -0
- package/utils/trace/TraceRecorder.js +51 -0
- package/utils/trace/TraceRecorder.js.map +1 -0
- package/utils/trace/formatTraceReport.d.ts +2 -0
- package/utils/trace/formatTraceReport.js +53 -0
- package/utils/trace/formatTraceReport.js.map +1 -0
- package/utils/trace/index.d.ts +6 -0
- package/utils/trace/index.js +6 -0
- package/utils/trace/isTraceRequested.d.ts +1 -0
- package/utils/trace/isTraceRequested.js +12 -0
- package/utils/trace/isTraceRequested.js.map +1 -0
- package/utils/trace/startTrace.d.ts +1 -0
- package/utils/trace/startTrace.js +19 -0
- package/utils/trace/startTrace.js.map +1 -0
- package/utils/trace/trace.d.ts +1 -0
- package/utils/trace/trace.js +13 -0
- package/utils/trace/trace.js.map +1 -0
- package/utils/trace/traceAsync.d.ts +1 -0
- package/utils/trace/traceAsync.js +13 -0
- package/utils/trace/traceAsync.js.map +1 -0
- package/components/Wcp.d.ts +0 -19
- package/components/Wcp.js +0 -37
- package/components/Wcp.js.map +0 -1
- package/extensions/Project/EnsureApiDeployedBeforeAdminBuild.d.ts +0 -11
- package/extensions/Project/EnsureApiDeployedBeforeAdminBuild.js +0 -30
- package/extensions/Project/EnsureApiDeployedBeforeAdminBuild.js.map +0 -1
- package/extensions/Project/EnsureApiDeployedBeforeAdminWatch.d.ts +0 -11
- package/extensions/Project/EnsureApiDeployedBeforeAdminWatch.js +0 -30
- package/extensions/Project/EnsureApiDeployedBeforeAdminWatch.js.map +0 -1
- package/extensions/Project/EnsureApiDeployedBeforeWatch.d.ts +0 -11
- package/extensions/Project/EnsureApiDeployedBeforeWatch.js +0 -30
- package/extensions/Project/EnsureApiDeployedBeforeWatch.js.map +0 -1
- package/extensions/Project/EnsureCoreDeployedBeforeApiDeploy.d.ts +0 -11
- package/extensions/Project/EnsureCoreDeployedBeforeApiDeploy.js +0 -31
- package/extensions/Project/EnsureCoreDeployedBeforeApiDeploy.js.map +0 -1
- package/extensions/Project/EnsureTelemetryEnabledForOss.d.ts +0 -13
- package/extensions/Project/EnsureTelemetryEnabledForOss.js +0 -34
- package/extensions/Project/EnsureTelemetryEnabledForOss.js.map +0 -1
- package/extensions/Project/TelemetryNoLongerNewUser.d.ts +0 -8
- package/extensions/Project/TelemetryNoLongerNewUser.js +0 -14
- package/extensions/Project/TelemetryNoLongerNewUser.js.map +0 -1
- package/extensions/Project/ValidateEncryptionBeforeDeploy.d.ts +0 -12
- package/extensions/Project/ValidateEncryptionBeforeDeploy.js +0 -31
- package/extensions/Project/ValidateEncryptionBeforeDeploy.js.map +0 -1
- package/extensions/Project/ValidateProductionPulumiState.d.ts +0 -12
- package/extensions/Project/ValidateProductionPulumiState.js +0 -33
- package/extensions/Project/ValidateProductionPulumiState.js.map +0 -1
- package/features/Watch/getIotEndpoint.d.ts +0 -2
- package/features/Watch/getIotEndpoint.js +0 -18
- package/features/Watch/getIotEndpoint.js.map +0 -1
- package/features/Watch/replaceLambdaFunctions.d.ts +0 -19
- package/features/Watch/replaceLambdaFunctions.js +0 -72
- package/features/Watch/replaceLambdaFunctions.js.map +0 -1
- package/rslib-runtime.js +0 -14
- package/rslib-runtime.js.map +0 -1
- package/services/GetProjectConfigService/renderConfigWorker.d.ts +0 -1
- package/services/GetProjectConfigService/renderConfigWorker.js +0 -63
- package/services/GetProjectConfigService/renderConfigWorker.js.map +0 -1
- package/services/GetPulumiService/GetPulumiService.d.ts +0 -9
- package/services/GetPulumiService/GetPulumiService.js +0 -44
- package/services/GetPulumiService/GetPulumiService.js.map +0 -1
- package/services/GetPulumiService/index.d.ts +0 -1
- package/services/GetPulumiService/index.js +0 -1
- package/utils/getTemplatesFolderPath.d.ts +0 -1
- package/utils/getTemplatesFolderPath.js +0 -11
- package/utils/getTemplatesFolderPath.js.map +0 -1
package/ProjectSdk.d.ts
CHANGED
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import { type Container } from "@webiny/di";
|
|
2
|
-
import { BuildApp, DeployApp, DestroyApp, ExportStack, GetApp, GetAppOutput, GetAppStackOutput, SetProjectIdService, GetProjectConfig, type ProjectSdkParamsService, RefreshApp, RunPulumiCommand, ValidateProjectConfig, Watch } from "./abstractions/index.js";
|
|
2
|
+
import { BuildApp, DeployApp, DestroyApp, ExportStack, GetApp, GetAppOutput, GetAppStackOutput, SetProjectIdService, GetProjectConfig, type ProjectSdkParamsService, RefreshApp, RunPulumiCommand, ValidateProjectConfig, Watch, Serve } from "./abstractions/index.js";
|
|
3
3
|
import { type AppName } from "./abstractions/types.js";
|
|
4
4
|
export declare class ProjectSdk {
|
|
5
5
|
container: Container;
|
|
6
6
|
protected constructor(container: Container);
|
|
7
|
-
static init(params?: Partial<ProjectSdkParamsService.Params
|
|
7
|
+
static init(params?: Partial<ProjectSdkParamsService.Params>, register?: (container: Container) => void): Promise<ProjectSdk>;
|
|
8
8
|
private static getCacheKey;
|
|
9
9
|
getProject(): import("./index.js").IProjectModel;
|
|
10
10
|
getProjectConfig(params?: GetProjectConfig.Params): Promise<import("./index.js").IProjectConfigModel>;
|
|
@@ -17,22 +17,23 @@ export declare class ProjectSdk {
|
|
|
17
17
|
getFeatureFlags(): Promise<import("@webiny/feature-flags/FeatureFlags.js").FeatureFlags>;
|
|
18
18
|
getApp(appName: GetApp.Params): Promise<import("./index.js").IAppModel>;
|
|
19
19
|
getAppOutput(params: GetAppOutput.Params): Promise<{
|
|
20
|
-
pulumiProcess: import("
|
|
20
|
+
pulumiProcess: import("@webiny/pulumi-sdk/Pulumi.js").PulumiProcess;
|
|
21
21
|
}>;
|
|
22
22
|
getAppStackOutput<TOutput extends GetAppStackOutput.StackOutput = GetAppStackOutput.StackOutput>(appName: AppName): Promise<import("./abstractions/features/GetAppStackOutput.js").IGetAppStackOutputResult<TOutput>>;
|
|
23
23
|
getAppStackExport<TExport extends ExportStack.StackExport = ExportStack.StackExport>(params: ExportStack.Params): Promise<import("./abstractions/features/ExportStack.js").IExportStackResult<TExport>>;
|
|
24
24
|
buildApp(params: BuildApp.Params): Promise<import("./index.js").IPackagesBuilder>;
|
|
25
25
|
deployApp(params: DeployApp.Params): Promise<void>;
|
|
26
26
|
destroyApp(params: DestroyApp.Params): Promise<{
|
|
27
|
-
pulumiProcess: import("
|
|
27
|
+
pulumiProcess: import("@webiny/pulumi-sdk/Pulumi.js").PulumiProcess;
|
|
28
28
|
}>;
|
|
29
29
|
refreshApp(params: RefreshApp.Params): Promise<{
|
|
30
30
|
pulumiProcess: import("./abstractions/features/RefreshApp.js").IPulumiProcess;
|
|
31
31
|
}>;
|
|
32
32
|
runPulumiCommand(params: RunPulumiCommand.Params): Promise<{
|
|
33
|
-
pulumiProcess: import("
|
|
33
|
+
pulumiProcess: import("@webiny/pulumi-sdk/Pulumi.js").PulumiProcess;
|
|
34
34
|
}>;
|
|
35
35
|
watch(params: Watch.Params): Promise<import("./abstractions/features/Watch.js").IWatchResult>;
|
|
36
|
+
serve(params: Serve.Params): Promise<import("./abstractions/features/Serve.js").IServeResult>;
|
|
36
37
|
get wcp(): import("./abstractions/services/WcpService.js").IWcpService;
|
|
37
38
|
get localStorage(): import("./abstractions/services/LocalStorageService.js").ILocalStorageService;
|
|
38
39
|
getPulumiResourceNamePrefix(): Promise<string>;
|
package/ProjectSdk.js
CHANGED
|
@@ -1,26 +1,27 @@
|
|
|
1
1
|
import { createProjectSdkContainer } from "./createProjectSdkContainer.js";
|
|
2
|
-
import { BuildApp, DeployApp, DestroyApp, ExportStack, GetApp, GetAppOutput, GetAppStackOutput, GetFeatureFlags, GetProductionEnvironments, GetProject, GetProjectConfig, GetProjectIdService, GetProjectInfo, GetProjectInstallationIdService, GetProjectVersionService, GetPulumiResourceNamePrefix, InstallExtension, IsCi, IsTelemetryEnabled, ListDeployedEnvironmentsService, LocalStorageService, LoggerService, RefreshApp, RunPulumiCommand, SetProjectIdService, ValidateProjectConfig, Watch, WcpService } from "./abstractions/index.js";
|
|
2
|
+
import { BuildApp, DeployApp, DestroyApp, ExportStack, GetApp, GetAppOutput, GetAppStackOutput, GetFeatureFlags, GetProductionEnvironments, GetProject, GetProjectConfig, GetProjectIdService, GetProjectInfo, GetProjectInstallationIdService, GetProjectVersionService, GetPulumiResourceNamePrefix, InstallExtension, IsCi, IsTelemetryEnabled, ListDeployedEnvironmentsService, LocalStorageService, LoggerService, RefreshApp, RunPulumiCommand, Serve, SetProjectIdService, ValidateProjectConfig, Watch, WcpService } from "./abstractions/index.js";
|
|
3
3
|
import { getProjectSdkContextFromEnv, isValidRegionName, isValidVariantName } from "./utils/index.js";
|
|
4
4
|
const projectSdkCache = new Map();
|
|
5
5
|
class ProjectSdk {
|
|
6
6
|
constructor(container){
|
|
7
7
|
this.container = container;
|
|
8
8
|
}
|
|
9
|
-
static async init(params = {}) {
|
|
9
|
+
static async init(params = {}, register) {
|
|
10
10
|
const envContext = getProjectSdkContextFromEnv();
|
|
11
11
|
if (envContext && 0 === Object.keys(params).length) params = envContext;
|
|
12
|
-
const cacheKey = ProjectSdk.getCacheKey(params);
|
|
12
|
+
const cacheKey = ProjectSdk.getCacheKey(params, register);
|
|
13
13
|
if (projectSdkCache.has(cacheKey)) return projectSdkCache.get(cacheKey);
|
|
14
|
-
const container = await createProjectSdkContainer(params);
|
|
14
|
+
const container = await createProjectSdkContainer(params, register);
|
|
15
15
|
const instance = new ProjectSdk(container);
|
|
16
16
|
projectSdkCache.set(cacheKey, instance);
|
|
17
17
|
return instance;
|
|
18
18
|
}
|
|
19
|
-
static getCacheKey(params) {
|
|
19
|
+
static getCacheKey(params, register) {
|
|
20
20
|
const env = params.env || "";
|
|
21
21
|
const variant = params.variant || "";
|
|
22
22
|
const region = params.region || "";
|
|
23
|
-
|
|
23
|
+
const hostingType = register?.name || "";
|
|
24
|
+
return `${env}:${variant}:${region}:${hostingType}`;
|
|
24
25
|
}
|
|
25
26
|
getProject() {
|
|
26
27
|
return this.container.resolve(GetProject).execute();
|
|
@@ -79,6 +80,9 @@ class ProjectSdk {
|
|
|
79
80
|
watch(params) {
|
|
80
81
|
return this.container.resolve(Watch).execute(params);
|
|
81
82
|
}
|
|
83
|
+
serve(params) {
|
|
84
|
+
return this.container.resolve(Serve).execute(params);
|
|
85
|
+
}
|
|
82
86
|
get wcp() {
|
|
83
87
|
return this.container.resolve(WcpService);
|
|
84
88
|
}
|
package/ProjectSdk.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"ProjectSdk.js","sources":["../src/ProjectSdk.ts"],"sourcesContent":["import { type Container } from \"@webiny/di\";\nimport { createProjectSdkContainer } from \"./createProjectSdkContainer.js\";\nimport {\n BuildApp,\n DeployApp,\n DestroyApp,\n ExportStack,\n GetApp,\n GetAppOutput,\n GetAppStackOutput,\n GetFeatureFlags,\n GetProductionEnvironments,\n GetProject,\n GetProjectIdService,\n GetProjectInstallationIdService,\n SetProjectIdService,\n GetProjectConfig,\n GetProjectInfo,\n GetPulumiResourceNamePrefix,\n InstallExtension,\n IsCi,\n IsTelemetryEnabled,\n LocalStorageService,\n LoggerService,\n type ProjectSdkParamsService,\n RefreshApp,\n RunPulumiCommand,\n ValidateProjectConfig,\n ListDeployedEnvironmentsService,\n Watch,\n WcpService,\n GetProjectVersionService\n} from \"~/abstractions/index.js\";\nimport { type AppName } from \"~/abstractions/types.js\";\nimport {\n isValidRegionName,\n isValidVariantName,\n getProjectSdkContextFromEnv\n} from \"./utils/index.js\";\n\nconst projectSdkCache = new Map<string, ProjectSdk>();\n\nexport class ProjectSdk {\n container: Container;\n\n protected constructor(container: Container) {\n this.container = container;\n }\n\n static async init(params: Partial<ProjectSdkParamsService.Params> = {}) {\n // If no params provided, check if we have context from parent process via env var\n const envContext = getProjectSdkContextFromEnv();\n if (envContext && Object.keys(params).length === 0) {\n params = envContext;\n }\n\n const cacheKey = ProjectSdk.getCacheKey(params);\n\n if (projectSdkCache.has(cacheKey)) {\n return projectSdkCache.get(cacheKey)!;\n }\n\n const container = await createProjectSdkContainer(params);\n const instance = new ProjectSdk(container);\n projectSdkCache.set(cacheKey, instance);\n\n return instance;\n }\n\n private static getCacheKey(params: Partial<ProjectSdkParamsService.Params>): string {\n const env = params.env || \"\";\n const variant = params.variant || \"\";\n const region = params.region || \"\";\n return `${env}:${variant}:${region}`;\n }\n\n // Project-related methods.\n getProject() {\n return this.container.resolve(GetProject).execute();\n }\n\n getProjectConfig(params?: GetProjectConfig.Params) {\n return this.container.resolve(GetProjectConfig).execute(params);\n }\n\n validateProjectConfig(projectConfig: ValidateProjectConfig.Params) {\n return this.container.resolve(ValidateProjectConfig).execute(projectConfig);\n }\n\n async getProjectId() {\n return this.container.resolve(GetProjectIdService).execute();\n }\n async setProjectId(projectId: string, options: SetProjectIdService.Options = {}) {\n return this.container.resolve(SetProjectIdService).execute(projectId, options);\n }\n getProjectVersion() {\n return this.container.resolve(GetProjectVersionService).execute();\n }\n getProjectInstallationId() {\n return this.container.resolve(GetProjectInstallationIdService).execute();\n }\n\n getProjectInfo() {\n return this.container.resolve(GetProjectInfo).execute();\n }\n\n getFeatureFlags() {\n return this.container.resolve(GetFeatureFlags).execute();\n }\n\n // App-related methods.\n async getApp(appName: GetApp.Params) {\n return this.container.resolve(GetApp).execute(appName);\n }\n\n // Here we have two stack output methods. Both do the same thing, but one is returning\n // raw Pulumi output, while the other is returning a JSON, which is far more suitable\n // in multiple places throughout the codebase (like Pulumi code, deploy hooks, ...).\n // TODO: we could probably merge these two methods into one, and have an option to return\n // TODO: raw or JSON output. For now, just writing it here.\n async getAppOutput(params: GetAppOutput.Params) {\n return this.container.resolve(GetAppOutput).execute(params);\n }\n\n async getAppStackOutput<\n TOutput extends GetAppStackOutput.StackOutput = GetAppStackOutput.StackOutput\n >(appName: AppName) {\n return this.container.resolve(GetAppStackOutput).execute<TOutput>(appName);\n }\n\n async getAppStackExport<TExport extends ExportStack.StackExport = ExportStack.StackExport>(\n params: ExportStack.Params\n ) {\n return this.container.resolve(ExportStack).execute<TExport>(params);\n }\n\n buildApp(params: BuildApp.Params) {\n return this.container.resolve(BuildApp).execute(params);\n }\n\n deployApp(params: DeployApp.Params) {\n return this.container.resolve(DeployApp).execute(params);\n }\n\n destroyApp(params: DestroyApp.Params) {\n return this.container.resolve(DestroyApp).execute(params);\n }\n\n refreshApp(params: RefreshApp.Params) {\n return this.container.resolve(RefreshApp).execute(params);\n }\n\n runPulumiCommand(params: RunPulumiCommand.Params) {\n return this.container.resolve(RunPulumiCommand).execute(params);\n }\n\n watch(params: Watch.Params) {\n return this.container.resolve(Watch).execute(params);\n }\n\n get wcp() {\n return this.container.resolve(WcpService);\n }\n\n get localStorage() {\n return this.container.resolve(LocalStorageService);\n }\n\n getPulumiResourceNamePrefix() {\n return this.container.resolve(GetPulumiResourceNamePrefix).execute();\n }\n\n getProductionEnvironments() {\n return this.container.resolve(GetProductionEnvironments).execute();\n }\n\n listDeployedEnvironments() {\n return this.container.resolve(ListDeployedEnvironmentsService).execute();\n }\n\n installExtension(source: string) {\n return this.container.resolve(InstallExtension).execute(source);\n }\n\n // Utility methods.\n isValidRegionName(name?: string) {\n return isValidRegionName(name);\n }\n\n isValidVariantName(name?: string) {\n return isValidVariantName(name);\n }\n\n isTelemetryEnabled() {\n return this.container.resolve(IsTelemetryEnabled).execute();\n }\n\n isCi() {\n return this.container.resolve(IsCi).execute();\n }\n\n getLogger() {\n return this.container.resolve(LoggerService);\n }\n\n getContainer() {\n return this.container;\n }\n}\n"],"names":["projectSdkCache","Map","ProjectSdk","container","params","envContext","getProjectSdkContextFromEnv","Object","cacheKey","createProjectSdkContainer","instance","env","variant","region","GetProject","GetProjectConfig","projectConfig","ValidateProjectConfig","GetProjectIdService","projectId","options","SetProjectIdService","GetProjectVersionService","GetProjectInstallationIdService","GetProjectInfo","GetFeatureFlags","appName","GetApp","GetAppOutput","GetAppStackOutput","ExportStack","BuildApp","DeployApp","DestroyApp","RefreshApp","RunPulumiCommand","Watch","WcpService","LocalStorageService","GetPulumiResourceNamePrefix","GetProductionEnvironments","ListDeployedEnvironmentsService","source","InstallExtension","name","isValidRegionName","isValidVariantName","IsTelemetryEnabled","IsCi","LoggerService"],"mappings":";;;AAwCA,MAAMA,kBAAkB,IAAIC;AAErB,MAAMC;IAGT,YAAsBC,SAAoB,CAAE;QACxC,IAAI,CAAC,SAAS,GAAGA;IACrB;IAEA,aAAa,KAAKC,SAAkD,CAAC,CAAC,EAAE;QAEpE,MAAMC,aAAaC;QACnB,IAAID,cAAcE,AAA+B,MAA/BA,OAAO,IAAI,CAACH,QAAQ,MAAM,EACxCA,SAASC;QAGb,MAAMG,WAAWN,WAAW,WAAW,CAACE;QAExC,IAAIJ,gBAAgB,GAAG,CAACQ,WACpB,OAAOR,gBAAgB,GAAG,CAACQ;QAG/B,MAAML,YAAY,MAAMM,0BAA0BL;QAClD,MAAMM,WAAW,IAAIR,WAAWC;QAChCH,gBAAgB,GAAG,CAACQ,UAAUE;QAE9B,OAAOA;IACX;IAEA,OAAe,YA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SAAS,CAAC,OAAO,CAACC,iCAAiC,OAAO;IAC1E;IAEA,iBAAiBC,MAAc,EAAE;QAC7B,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAACC,kBAAkB,OAAO,CAACD;IAC5D;IAGA,kBAAkBE,IAAa,EAAE;QAC7B,OAAOC,kBAAkBD;IAC7B;IAEA,mBAAmBA,IAAa,EAAE;QAC9B,OAAOE,mBAAmBF;IAC9B;IAEA,qBAAqB;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAACG,oBAAoB,OAAO;IAC7D;IAEA,OAAO;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAACC,MAAM,OAAO;IAC/C;IAEA,YAAY;QACR,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAACC;IAClC;IAEA,eAAe;QACX,OAAO,IAAI,CAAC,SAAS;IACzB;AACJ"}
|
|
1
|
+
{"version":3,"file":"ProjectSdk.js","sources":["../src/ProjectSdk.ts"],"sourcesContent":["import { type Container } from \"@webiny/di\";\nimport { createProjectSdkContainer } from \"./createProjectSdkContainer.js\";\nimport {\n BuildApp,\n DeployApp,\n DestroyApp,\n ExportStack,\n GetApp,\n GetAppOutput,\n GetAppStackOutput,\n GetFeatureFlags,\n GetProductionEnvironments,\n GetProject,\n GetProjectIdService,\n GetProjectInstallationIdService,\n SetProjectIdService,\n GetProjectConfig,\n GetProjectInfo,\n GetPulumiResourceNamePrefix,\n InstallExtension,\n IsCi,\n IsTelemetryEnabled,\n LocalStorageService,\n LoggerService,\n type ProjectSdkParamsService,\n RefreshApp,\n RunPulumiCommand,\n ValidateProjectConfig,\n ListDeployedEnvironmentsService,\n Watch,\n Serve,\n WcpService,\n GetProjectVersionService\n} from \"~/abstractions/index.js\";\nimport { type AppName } from \"~/abstractions/types.js\";\nimport {\n isValidRegionName,\n isValidVariantName,\n getProjectSdkContextFromEnv\n} from \"./utils/index.js\";\n\nconst projectSdkCache = new Map<string, ProjectSdk>();\n\nexport class ProjectSdk {\n container: Container;\n\n protected constructor(container: Container) {\n this.container = container;\n }\n\n static async init(\n params: Partial<ProjectSdkParamsService.Params> = {},\n register?: (container: Container) => void\n ) {\n // If no params provided, check if we have context from parent process via env var\n const envContext = getProjectSdkContextFromEnv();\n if (envContext && Object.keys(params).length === 0) {\n params = envContext;\n }\n\n const cacheKey = ProjectSdk.getCacheKey(params, register);\n\n if (projectSdkCache.has(cacheKey)) {\n return projectSdkCache.get(cacheKey)!;\n }\n\n const container = await createProjectSdkContainer(params, register);\n const instance = new ProjectSdk(container);\n projectSdkCache.set(cacheKey, instance);\n\n return instance;\n }\n\n private static getCacheKey(\n params: Partial<ProjectSdkParamsService.Params>,\n register?: (container: Container) => void\n ): string {\n const env = params.env || \"\";\n const variant = params.variant || \"\";\n const region = params.region || \"\";\n const hostingType = register?.name || \"\";\n return `${env}:${variant}:${region}:${hostingType}`;\n }\n\n // Project-related methods.\n getProject() {\n return this.container.resolve(GetProject).execute();\n }\n\n getProjectConfig(params?: GetProjectConfig.Params) {\n return this.container.resolve(GetProjectConfig).execute(params);\n }\n\n validateProjectConfig(projectConfig: ValidateProjectConfig.Params) {\n return this.container.resolve(ValidateProjectConfig).execute(projectConfig);\n }\n\n async getProjectId() {\n return this.container.resolve(GetProjectIdService).execute();\n }\n async setProjectId(projectId: string, options: SetProjectIdService.Options = {}) {\n return this.container.resolve(SetProjectIdService).execute(projectId, options);\n }\n getProjectVersion() {\n return this.container.resolve(GetProjectVersionService).execute();\n }\n getProjectInstallationId() {\n return this.container.resolve(GetProjectInstallationIdService).execute();\n }\n\n getProjectInfo() {\n return this.container.resolve(GetProjectInfo).execute();\n }\n\n getFeatureFlags() {\n return this.container.resolve(GetFeatureFlags).execute();\n }\n\n // App-related methods.\n async getApp(appName: GetApp.Params) {\n return this.container.resolve(GetApp).execute(appName);\n }\n\n // Here we have two stack output methods. Both do the same thing, but one is returning\n // raw Pulumi output, while the other is returning a JSON, which is far more suitable\n // in multiple places throughout the codebase (like Pulumi code, deploy hooks, ...).\n // TODO: we could probably merge these two methods into one, and have an option to return\n // TODO: raw or JSON output. For now, just writing it here.\n async getAppOutput(params: GetAppOutput.Params) {\n return this.container.resolve(GetAppOutput).execute(params);\n }\n\n async getAppStackOutput<\n TOutput extends GetAppStackOutput.StackOutput = GetAppStackOutput.StackOutput\n >(appName: AppName) {\n return this.container.resolve(GetAppStackOutput).execute<TOutput>(appName);\n }\n\n async getAppStackExport<TExport extends ExportStack.StackExport = ExportStack.StackExport>(\n params: ExportStack.Params\n ) {\n return this.container.resolve(ExportStack).execute<TExport>(params);\n }\n\n buildApp(params: BuildApp.Params) {\n return this.container.resolve(BuildApp).execute(params);\n }\n\n deployApp(params: DeployApp.Params) {\n return this.container.resolve(DeployApp).execute(params);\n }\n\n destroyApp(params: DestroyApp.Params) {\n return this.container.resolve(DestroyApp).execute(params);\n }\n\n refreshApp(params: RefreshApp.Params) {\n return this.container.resolve(RefreshApp).execute(params);\n }\n\n runPulumiCommand(params: RunPulumiCommand.Params) {\n return this.container.resolve(RunPulumiCommand).execute(params);\n }\n\n watch(params: Watch.Params) {\n return this.container.resolve(Watch).execute(params);\n }\n\n serve(params: Serve.Params) {\n return this.container.resolve(Serve).execute(params);\n }\n\n get wcp() {\n return this.container.resolve(WcpService);\n }\n\n get localStorage() {\n return this.container.resolve(LocalStorageService);\n }\n\n getPulumiResourceNamePrefix() {\n return this.container.resolve(GetPulumiResourceNamePrefix).execute();\n }\n\n getProductionEnvironments() {\n return this.container.resolve(GetProductionEnvironments).execute();\n }\n\n listDeployedEnvironments() {\n return this.container.resolve(ListDeployedEnvironmentsService).execute();\n }\n\n installExtension(source: string) {\n return this.container.resolve(InstallExtension).execute(source);\n }\n\n // Utility methods.\n isValidRegionName(name?: string) {\n return isValidRegionName(name);\n }\n\n isValidVariantName(name?: string) {\n return isValidVariantName(name);\n }\n\n isTelemetryEnabled() {\n return this.container.resolve(IsTelemetryEnabled).execute();\n }\n\n isCi() {\n return this.container.resolve(IsCi).execute();\n }\n\n getLogger() {\n return this.container.resolve(LoggerService);\n }\n\n getContainer() {\n return this.container;\n }\n}\n"],"names":["projectSdkCache","Map","ProjectSdk","container","params","register","envContext","getProjectSdkContextFromEnv","Object","cacheKey","createProjectSdkContainer","instance","env","variant","region","hostingType","GetProject","GetProjectConfig","projectConfig","ValidateProjectConfig","GetProjectIdService","projectId","options","SetProjectIdService","GetProjectVersionService","GetProjectInstallationIdService","GetProjectInfo","GetFeatureFlags","appName","GetApp","GetAppOutput","GetAppStackOutput","ExportStack","BuildApp","DeployApp","DestroyApp","RefreshApp","RunPulumiCommand","Watch","Serve","WcpService","LocalStorageService","GetPulumiResourceNamePrefix","GetProductionEnvironments","ListDeployedEnvironmentsService","source","InstallExtension","name","isValidRegionName","isValidVariantName","IsTelemetryEnabled","IsCi","LoggerService"],"mappings":";;;AAyCA,MAAMA,kBAAkB,IAAIC;AAErB,MAAMC;IAGT,YAAsBC,SAAoB,CAAE;QACxC,IAAI,CAAC,SAAS,GAAGA;IACrB;IAEA,aAAa,KACTC,SAAkD,CAAC,CAAC,EACpDC,QAAyC,EAC3C;QAEE,MAAMC,aAAaC;QACnB,IAAID,cAAcE,AAA+B,MAA/BA,OAAO,IAAI,CAACJ,QAAQ,MAAM,EACxCA,SAASE;QAGb,MAAMG,WAAWP,WAAW,WAAW,CAACE,QAAQC;QAEhD,IAAIL,gBAAgB,GAAG,CAACS,WACpB,OAAOT,gBAAgB,GAAG,CAACS;QAG/B,MAAMN,YAAY,MAAMO,0BAA0BN,QAAQC;QAC1D,MAAMM,WAAW,IAAIT,WAAWC;QAChCH,gBAAgB,GAAG,CAACS,UAAUE;QAE9B,OAAOA;IACX;IAEA,OAAe,YACXP,MAA+C,EAC/CC,QAAyC,EACnC;QACN,MAAMO,MAAMR,OAAO,GAAG,IAAI;QAC1B,MAAMS,UAAUT,OAAO,OAAO,IAAI;QAClC,MAAMU,SAASV,OAAO,MAAM,IAAI;QAChC,MAAMW,cAAcV,UAAU,QAAQ;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O,CAACC,iCAAiC,OAAO;IAC1E;IAEA,iBAAiBC,MAAc,EAAE;QAC7B,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAACC,kBAAkB,OAAO,CAACD;IAC5D;IAGA,kBAAkBE,IAAa,EAAE;QAC7B,OAAOC,kBAAkBD;IAC7B;IAEA,mBAAmBA,IAAa,EAAE;QAC9B,OAAOE,mBAAmBF;IAC9B;IAEA,qBAAqB;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAACG,oBAAoB,OAAO;IAC7D;IAEA,OAAO;QACH,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAACC,MAAM,OAAO;IAC/C;IAEA,YAAY;QACR,OAAO,IAAI,CAAC,SAAS,CAAC,OAAO,CAACC;IAClC;IAEA,eAAe;QACX,OAAO,IAAI,CAAC,SAAS;IACzB;AACJ"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type AppName } from "../../abstractions/types.js";
|
|
2
|
-
import { type
|
|
3
|
-
type IPulumiProcess =
|
|
2
|
+
import { type PulumiProcess } from "@webiny/pulumi-sdk";
|
|
3
|
+
type IPulumiProcess = PulumiProcess;
|
|
4
4
|
interface IDeployAppParams {
|
|
5
5
|
app: AppName;
|
|
6
6
|
preview?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstractions/features/DeployApp.js","sources":["../../../src/abstractions/features/DeployApp.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\nimport { type AppName } from \"~/abstractions/types.js\";\nimport { type
|
|
1
|
+
{"version":3,"file":"abstractions/features/DeployApp.js","sources":["../../../src/abstractions/features/DeployApp.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\nimport { type AppName } from \"~/abstractions/types.js\";\nimport { type PulumiProcess } from \"@webiny/pulumi-sdk\";\n\ntype IPulumiProcess = PulumiProcess;\n\ninterface IDeployAppParams {\n app: AppName;\n preview?: boolean;\n pulumiArgs?: Record<string, string | boolean | string[] | undefined>;\n allowLocalStateFiles?: boolean;\n output?: (pulumiProcess: IPulumiProcess) => Promise<void>;\n}\n\nexport interface IDeployApp {\n execute(params: IDeployAppParams): Promise<void>;\n}\n\nexport const DeployApp = createAbstraction<IDeployApp>(\"DeployApp\");\n\nexport namespace DeployApp {\n export type Interface = IDeployApp;\n\n export type Params = IDeployAppParams;\n\n export type PulumiProcess = IPulumiProcess;\n}\n"],"names":["DeployApp","createAbstraction"],"mappings":";AAkBO,MAAMA,YAAYC,kBAA8B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type AppName } from "../../abstractions/types.js";
|
|
2
|
-
import { type
|
|
3
|
-
type IPulumiProcess =
|
|
2
|
+
import { type PulumiProcess } from "@webiny/pulumi-sdk";
|
|
3
|
+
type IPulumiProcess = PulumiProcess;
|
|
4
4
|
export interface IDestroyAppParams {
|
|
5
5
|
app: AppName;
|
|
6
6
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstractions/features/DestroyApp.js","sources":["../../../src/abstractions/features/DestroyApp.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\nimport { type AppName } from \"~/abstractions/types.js\";\nimport { type
|
|
1
|
+
{"version":3,"file":"abstractions/features/DestroyApp.js","sources":["../../../src/abstractions/features/DestroyApp.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\nimport { type AppName } from \"~/abstractions/types.js\";\nimport { type PulumiProcess } from \"@webiny/pulumi-sdk\";\n\ntype IPulumiProcess = PulumiProcess;\n\nexport interface IDestroyAppParams {\n app: AppName;\n}\n\nexport interface IDestroyApp {\n execute(params: IDestroyAppParams): Promise<{ pulumiProcess: IPulumiProcess }>;\n}\n\nexport const DestroyApp = createAbstraction<IDestroyApp>(\"DestroyApp\");\n\nexport namespace DestroyApp {\n export type Interface = IDestroyApp;\n\n export type Params = IDestroyAppParams;\n\n export type PulumiProcess = IPulumiProcess;\n}\n"],"names":["DestroyApp","createAbstraction"],"mappings":";AAcO,MAAMA,aAAaC,kBAA+B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type AppName } from "../../abstractions/types.js";
|
|
2
|
-
import { type
|
|
3
|
-
type IPulumiProcess =
|
|
2
|
+
import { type PulumiProcess } from "@webiny/pulumi-sdk";
|
|
3
|
+
type IPulumiProcess = PulumiProcess;
|
|
4
4
|
export interface IGetAppOutputParams {
|
|
5
5
|
app: AppName;
|
|
6
6
|
json?: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstractions/features/GetAppOutput.js","sources":["../../../src/abstractions/features/GetAppOutput.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\nimport { type AppName } from \"~/abstractions/types.js\";\nimport { type
|
|
1
|
+
{"version":3,"file":"abstractions/features/GetAppOutput.js","sources":["../../../src/abstractions/features/GetAppOutput.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\nimport { type AppName } from \"~/abstractions/types.js\";\nimport { type PulumiProcess } from \"@webiny/pulumi-sdk\";\n\ntype IPulumiProcess = PulumiProcess;\n\nexport interface IGetAppOutputParams {\n app: AppName;\n json?: boolean;\n}\n\nexport interface IGetAppOutput {\n execute(params: IGetAppOutputParams): Promise<{ pulumiProcess: IPulumiProcess }>;\n}\n\nexport const GetAppOutput = createAbstraction<IGetAppOutput>(\"GetAppOutput\");\n\nexport namespace GetAppOutput {\n export type Interface = IGetAppOutput;\n\n export type Params = IGetAppOutputParams;\n}\n"],"names":["GetAppOutput","createAbstraction"],"mappings":";AAeO,MAAMA,eAAeC,kBAAiC"}
|
|
@@ -1,9 +1,10 @@
|
|
|
1
1
|
import { type AppName } from "../../abstractions/types.js";
|
|
2
2
|
export interface IStackOutput {
|
|
3
3
|
/**
|
|
4
|
-
* There is a possibility for a user to add stuff to the stack output.
|
|
4
|
+
* There is a possibility for a user to add stuff to the stack output. Pulumi outputs can be
|
|
5
|
+
* objects too, for example the Cognito user pool's password policy.
|
|
5
6
|
*/
|
|
6
|
-
[key: string]: string | string[] | undefined | number | number[] | boolean;
|
|
7
|
+
[key: string]: string | string[] | undefined | number | number[] | boolean | object;
|
|
7
8
|
}
|
|
8
9
|
export interface ICoreStackOutput extends IStackOutput {
|
|
9
10
|
deploymentId: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstractions/features/GetAppStackOutput.js","sources":["../../../src/abstractions/features/GetAppStackOutput.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\nimport { type AppName } from \"~/abstractions/types.js\";\n\nexport interface IStackOutput {\n /**\n * There is a possibility for a user to add stuff to the stack output.\n */\n [key: string]: string | string[] | undefined | number | number[] | boolean;\n}\n\n// This interface is later extended in downstream packages (e.g., @webiny/project-aws).\n// TODO: because some of these are AWS specific, we should consider moving these to\n// TODO: @webiny/project-aws. Would've done it, but didn't have time.\nexport interface ICoreStackOutput extends IStackOutput {\n deploymentId: string;\n iotAuthorizerName: string;\n}\n\nexport type IGetAppStackOutputResult<TOutput extends IStackOutput = IStackOutput> = TOutput | null;\n\nexport interface IGetAppStackOutput {\n execute<TOutput extends IStackOutput = IStackOutput>(\n appName: AppName\n ): Promise<IGetAppStackOutputResult<TOutput>>;\n}\n\nexport const GetAppStackOutput = createAbstraction<IGetAppStackOutput>(\"GetAppStackOutput\");\n\nexport namespace GetAppStackOutput {\n export type Interface = IGetAppStackOutput;\n export type Result = IGetAppStackOutputResult;\n export type StackOutput = IStackOutput;\n}\n"],"names":["GetAppStackOutput","createAbstraction"],"mappings":";
|
|
1
|
+
{"version":3,"file":"abstractions/features/GetAppStackOutput.js","sources":["../../../src/abstractions/features/GetAppStackOutput.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\nimport { type AppName } from \"~/abstractions/types.js\";\n\nexport interface IStackOutput {\n /**\n * There is a possibility for a user to add stuff to the stack output. Pulumi outputs can be\n * objects too, for example the Cognito user pool's password policy.\n */\n [key: string]: string | string[] | undefined | number | number[] | boolean | object;\n}\n\n// This interface is later extended in downstream packages (e.g., @webiny/project-aws).\n// TODO: because some of these are AWS specific, we should consider moving these to\n// TODO: @webiny/project-aws. Would've done it, but didn't have time.\nexport interface ICoreStackOutput extends IStackOutput {\n deploymentId: string;\n iotAuthorizerName: string;\n}\n\nexport type IGetAppStackOutputResult<TOutput extends IStackOutput = IStackOutput> = TOutput | null;\n\nexport interface IGetAppStackOutput {\n execute<TOutput extends IStackOutput = IStackOutput>(\n appName: AppName\n ): Promise<IGetAppStackOutputResult<TOutput>>;\n}\n\nexport const GetAppStackOutput = createAbstraction<IGetAppStackOutput>(\"GetAppStackOutput\");\n\nexport namespace GetAppStackOutput {\n export type Interface = IGetAppStackOutput;\n export type Result = IGetAppStackOutputResult;\n export type StackOutput = IStackOutput;\n}\n"],"names":["GetAppStackOutput","createAbstraction"],"mappings":";AA2BO,MAAMA,oBAAoBC,kBAAsC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type AppName } from "../../abstractions/types.js";
|
|
2
|
-
import { type
|
|
3
|
-
export type IPulumiProcess =
|
|
2
|
+
import { type PulumiProcess } from "@webiny/pulumi-sdk";
|
|
3
|
+
export type IPulumiProcess = PulumiProcess;
|
|
4
4
|
export type IRefreshAppParams = {
|
|
5
5
|
app: AppName;
|
|
6
6
|
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstractions/features/RefreshApp.js","sources":["../../../src/abstractions/features/RefreshApp.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\nimport { type AppName } from \"~/abstractions/types.js\";\nimport { type
|
|
1
|
+
{"version":3,"file":"abstractions/features/RefreshApp.js","sources":["../../../src/abstractions/features/RefreshApp.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\nimport { type AppName } from \"~/abstractions/types.js\";\nimport { type PulumiProcess } from \"@webiny/pulumi-sdk\";\n\nexport type IPulumiProcess = PulumiProcess;\n\nexport type IRefreshAppParams = { app: AppName };\n\ninterface IRefreshApp {\n execute(params: IRefreshAppParams): Promise<{ pulumiProcess: IPulumiProcess }>;\n}\n\nexport const RefreshApp = createAbstraction<IRefreshApp>(\"RefreshApp\");\n\nexport namespace RefreshApp {\n export type Interface = IRefreshApp;\n\n export type Params = IRefreshAppParams;\n\n export type PulumiProcess = IPulumiProcess;\n}\n"],"names":["RefreshApp","createAbstraction"],"mappings":";AAYO,MAAMA,aAAaC,kBAA+B"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { type AppName } from "../../abstractions/types.js";
|
|
2
|
-
import { type
|
|
3
|
-
type IPulumiProcess =
|
|
2
|
+
import { type PulumiProcess } from "@webiny/pulumi-sdk";
|
|
3
|
+
type IPulumiProcess = PulumiProcess;
|
|
4
4
|
interface IRunPulumiCommandParams {
|
|
5
5
|
app: AppName;
|
|
6
6
|
command: string[];
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstractions/features/RunPulumiCommand.js","sources":["../../../src/abstractions/features/RunPulumiCommand.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\nimport { type AppName } from \"~/abstractions/types.js\";\nimport { type
|
|
1
|
+
{"version":3,"file":"abstractions/features/RunPulumiCommand.js","sources":["../../../src/abstractions/features/RunPulumiCommand.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\nimport { type AppName } from \"~/abstractions/types.js\";\nimport { type PulumiProcess } from \"@webiny/pulumi-sdk\";\n\ntype IPulumiProcess = PulumiProcess;\n\ninterface IRunPulumiCommandParams {\n app: AppName;\n command: string[];\n}\n\ninterface IRunPulumiCommand {\n execute(params: IRunPulumiCommandParams): Promise<{ pulumiProcess: IPulumiProcess }>;\n}\n\nexport const RunPulumiCommand = createAbstraction<IRunPulumiCommand>(\"RunPulumiCommand\");\n\nexport namespace RunPulumiCommand {\n export type Interface = IRunPulumiCommand;\n\n export type Params = IRunPulumiCommandParams;\n\n export type PulumiProcess = IPulumiProcess;\n}\n"],"names":["RunPulumiCommand","createAbstraction"],"mappings":";AAeO,MAAMA,mBAAmBC,kBAAqC"}
|
|
@@ -0,0 +1,27 @@
|
|
|
1
|
+
import { type GetApp } from "../../abstractions/index.js";
|
|
2
|
+
import { type ServersWatcher, type RunnableServerProcess } from "../../features/Watch/watchers/ServersWatcher.js";
|
|
3
|
+
export interface IServeParams {
|
|
4
|
+
/**
|
|
5
|
+
* App to serve. Omit to serve all servable apps at once. Which apps are servable (and how) is
|
|
6
|
+
* hosting-specific — the base hosting type supports none.
|
|
7
|
+
*/
|
|
8
|
+
app?: GetApp.AppName;
|
|
9
|
+
}
|
|
10
|
+
export interface IServeResult {
|
|
11
|
+
/**
|
|
12
|
+
* The server process(es) to serve, wrapped like the watch command's `packagesWatcher`. The caller
|
|
13
|
+
* (e.g. the CLI) prepares + runs them, owning terminal rendering + lifecycle. Implementations
|
|
14
|
+
* assume the apps are already built.
|
|
15
|
+
*/
|
|
16
|
+
serversWatcher: ServersWatcher;
|
|
17
|
+
}
|
|
18
|
+
export interface IServe {
|
|
19
|
+
execute(params: IServeParams): Promise<IServeResult>;
|
|
20
|
+
}
|
|
21
|
+
export declare const Serve: import("@webiny/di").Abstraction<IServe>;
|
|
22
|
+
export declare namespace Serve {
|
|
23
|
+
type Interface = IServe;
|
|
24
|
+
type Params = IServeParams;
|
|
25
|
+
type Result = IServeResult;
|
|
26
|
+
type Process = RunnableServerProcess;
|
|
27
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"abstractions/features/Serve.js","sources":["../../../src/abstractions/features/Serve.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\nimport { type GetApp } from \"~/abstractions/index.js\";\nimport {\n type ServersWatcher,\n type RunnableServerProcess\n} from \"~/features/Watch/watchers/ServersWatcher.js\";\n\nexport interface IServeParams {\n /**\n * App to serve. Omit to serve all servable apps at once. Which apps are servable (and how) is\n * hosting-specific — the base hosting type supports none.\n */\n app?: GetApp.AppName;\n}\n\nexport interface IServeResult {\n /**\n * The server process(es) to serve, wrapped like the watch command's `packagesWatcher`. The caller\n * (e.g. the CLI) prepares + runs them, owning terminal rendering + lifecycle. Implementations\n * assume the apps are already built.\n */\n serversWatcher: ServersWatcher;\n}\n\nexport interface IServe {\n execute(params: IServeParams): Promise<IServeResult>;\n}\n\nexport const Serve = createAbstraction<IServe>(\"Serve\");\n\nexport namespace Serve {\n export type Interface = IServe;\n export type Params = IServeParams;\n export type Result = IServeResult;\n export type Process = RunnableServerProcess;\n}\n"],"names":["Serve","createAbstraction"],"mappings":";AA4BO,MAAMA,QAAQC,kBAA0B"}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { type GetApp } from "../../abstractions/index.js";
|
|
2
2
|
import { type WebinyConfigWatcher } from "../../features/Watch/watchers/WebinyConfigWatcher.js";
|
|
3
3
|
import { type PackagesWatcher } from "../../features/Watch/watchers/PackagesWatcher.js";
|
|
4
|
+
import { type ServersWatcher, type RunnableServerProcess } from "../../features/Watch/watchers/ServersWatcher.js";
|
|
4
5
|
export interface IWatchNoAppParams {
|
|
5
6
|
package?: string | string[];
|
|
6
7
|
function?: string | string[];
|
|
@@ -17,6 +18,12 @@ export type IWatchParams = IWatchNoAppParams | IWatchWithAppParams;
|
|
|
17
18
|
export type IWatchResult = {
|
|
18
19
|
packagesWatcher: PackagesWatcher;
|
|
19
20
|
webinyConfigWatcher?: WebinyConfigWatcher;
|
|
21
|
+
/**
|
|
22
|
+
* Long-running server process(es) the hosting type attached to this watch session (e.g. the api HTTP
|
|
23
|
+
* server). The serve-side counterpart to `packagesWatcher`; the caller (e.g. the CLI) renders +
|
|
24
|
+
* awaits them alongside the build watchers.
|
|
25
|
+
*/
|
|
26
|
+
serversWatcher?: ServersWatcher;
|
|
20
27
|
};
|
|
21
28
|
export interface IWatch {
|
|
22
29
|
execute(params: IWatchParams): Promise<IWatchResult>;
|
|
@@ -28,4 +35,7 @@ export declare namespace Watch {
|
|
|
28
35
|
type WatchWithAppParams = IWatchWithAppParams;
|
|
29
36
|
type Params = IWatchParams;
|
|
30
37
|
type Result = IWatchResult;
|
|
38
|
+
type Process = RunnableServerProcess;
|
|
39
|
+
/** The prepared (not yet running) build processes of a `packagesWatcher`. */
|
|
40
|
+
type BuildProcesses = ReturnType<PackagesWatcher["prepare"]>;
|
|
31
41
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"abstractions/features/Watch.js","sources":["../../../src/abstractions/features/Watch.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\nimport { type GetApp } from \"~/abstractions/index.js\";\nimport { type WebinyConfigWatcher } from \"~/features/Watch/watchers/WebinyConfigWatcher.js\";\nimport { type PackagesWatcher } from \"~/features/Watch/watchers/PackagesWatcher.js\";\n\nexport interface IWatchNoAppParams {\n package?: string | string[];\n function?: string | string[];\n}\n\nexport interface IWatchWithAppParams extends IWatchNoAppParams {\n app: GetApp.AppName;\n allowProduction?: boolean;\n deploymentChecks?: boolean;\n\n // Local AWS Lambda development (https://webiny.link/local-aws-lambda-development)\n inspect?: boolean;\n increaseTimeout?: number;\n increaseHandshakeTimeout?: number;\n}\n\nexport type IWatchParams = IWatchNoAppParams | IWatchWithAppParams;\nexport type IWatchResult = {\n packagesWatcher: PackagesWatcher;\n webinyConfigWatcher?: WebinyConfigWatcher;\n};\n\nexport interface IWatch {\n execute(params: IWatchParams): Promise<IWatchResult>;\n}\n\nexport const Watch = createAbstraction<IWatch>(\"Watch\");\n\nexport namespace Watch {\n export type Interface = IWatch;\n\n export type WatchNoAppParams = IWatchNoAppParams;\n export type WatchWithAppParams = IWatchWithAppParams;\n export type Params = IWatchParams;\n export type Result = IWatchResult;\n}\n"],"names":["Watch","createAbstraction"],"mappings":";
|
|
1
|
+
{"version":3,"file":"abstractions/features/Watch.js","sources":["../../../src/abstractions/features/Watch.ts"],"sourcesContent":["import { createAbstraction } from \"~/abstractions/createAbstraction.js\";\nimport { type GetApp } from \"~/abstractions/index.js\";\nimport { type WebinyConfigWatcher } from \"~/features/Watch/watchers/WebinyConfigWatcher.js\";\nimport { type PackagesWatcher } from \"~/features/Watch/watchers/PackagesWatcher.js\";\nimport {\n type ServersWatcher,\n type RunnableServerProcess\n} from \"~/features/Watch/watchers/ServersWatcher.js\";\n\nexport interface IWatchNoAppParams {\n package?: string | string[];\n function?: string | string[];\n}\n\nexport interface IWatchWithAppParams extends IWatchNoAppParams {\n app: GetApp.AppName;\n allowProduction?: boolean;\n deploymentChecks?: boolean;\n\n // Local AWS Lambda development (https://webiny.link/local-aws-lambda-development)\n inspect?: boolean;\n increaseTimeout?: number;\n increaseHandshakeTimeout?: number;\n}\n\nexport type IWatchParams = IWatchNoAppParams | IWatchWithAppParams;\n\nexport type IWatchResult = {\n packagesWatcher: PackagesWatcher;\n webinyConfigWatcher?: WebinyConfigWatcher;\n /**\n * Long-running server process(es) the hosting type attached to this watch session (e.g. the api HTTP\n * server). The serve-side counterpart to `packagesWatcher`; the caller (e.g. the CLI) renders +\n * awaits them alongside the build watchers.\n */\n serversWatcher?: ServersWatcher;\n};\n\nexport interface IWatch {\n execute(params: IWatchParams): Promise<IWatchResult>;\n}\n\nexport const Watch = createAbstraction<IWatch>(\"Watch\");\n\nexport namespace Watch {\n export type Interface = IWatch;\n\n export type WatchNoAppParams = IWatchNoAppParams;\n export type WatchWithAppParams = IWatchWithAppParams;\n export type Params = IWatchParams;\n export type Result = IWatchResult;\n export type Process = RunnableServerProcess;\n\n /** The prepared (not yet running) build processes of a `packagesWatcher`. */\n export type BuildProcesses = ReturnType<PackagesWatcher[\"prepare\"]>;\n}\n"],"names":["Watch","createAbstraction"],"mappings":";AA0CO,MAAMA,QAAQC,kBAA0B"}
|
|
@@ -22,4 +22,5 @@ export { RefreshApp } from "./RefreshApp.js";
|
|
|
22
22
|
export { RunPulumiCommand } from "./RunPulumiCommand.js";
|
|
23
23
|
export { ValidateProjectConfig } from "./ValidateProjectConfig.js";
|
|
24
24
|
export { Watch } from "./Watch.js";
|
|
25
|
+
export { Serve } from "./Serve.js";
|
|
25
26
|
export { GetFeatureFlags } from "./GetFeatureFlags.js";
|
|
@@ -22,4 +22,5 @@ export { RefreshApp } from "./RefreshApp.js";
|
|
|
22
22
|
export { RunPulumiCommand } from "./RunPulumiCommand.js";
|
|
23
23
|
export { ValidateProjectConfig } from "./ValidateProjectConfig.js";
|
|
24
24
|
export { Watch } from "./Watch.js";
|
|
25
|
+
export { Serve } from "./Serve.js";
|
|
25
26
|
export { GetFeatureFlags } from "./GetFeatureFlags.js";
|
|
@@ -0,0 +1,43 @@
|
|
|
1
|
+
import React from "react";
|
|
2
|
+
import type { FeatureFlagName } from "@webiny/feature-flags";
|
|
3
|
+
interface CanUseProps {
|
|
4
|
+
name: FeatureFlagName;
|
|
5
|
+
children: React.ReactNode;
|
|
6
|
+
}
|
|
7
|
+
declare function CanUse({ name, children }: CanUseProps): React.JSX.Element | null;
|
|
8
|
+
declare function CanUseMultiTenancy({ children }: {
|
|
9
|
+
children: React.ReactNode;
|
|
10
|
+
}): React.JSX.Element;
|
|
11
|
+
declare function CanUseWorkflows({ children }: {
|
|
12
|
+
children: React.ReactNode;
|
|
13
|
+
}): React.JSX.Element;
|
|
14
|
+
declare function CanUseTeams({ children }: {
|
|
15
|
+
children: React.ReactNode;
|
|
16
|
+
}): React.JSX.Element;
|
|
17
|
+
declare function CanUsePrivateFiles({ children }: {
|
|
18
|
+
children: React.ReactNode;
|
|
19
|
+
}): React.JSX.Element;
|
|
20
|
+
declare function CanUseFileManagerThreatDetection({ children }: {
|
|
21
|
+
children: React.ReactNode;
|
|
22
|
+
}): React.JSX.Element;
|
|
23
|
+
declare function CanUseHcmsFieldPermissions({ children }: {
|
|
24
|
+
children: React.ReactNode;
|
|
25
|
+
}): React.JSX.Element;
|
|
26
|
+
declare function CanUseRemoteComponents({ children }: {
|
|
27
|
+
children: React.ReactNode;
|
|
28
|
+
}): React.JSX.Element;
|
|
29
|
+
declare function CanUseAiPowerups({ children }: {
|
|
30
|
+
children: React.ReactNode;
|
|
31
|
+
}): React.JSX.Element;
|
|
32
|
+
export declare const FeatureFlag: {
|
|
33
|
+
CanUse: typeof CanUse;
|
|
34
|
+
CanUseMultiTenancy: typeof CanUseMultiTenancy;
|
|
35
|
+
CanUseWorkflows: typeof CanUseWorkflows;
|
|
36
|
+
CanUseTeams: typeof CanUseTeams;
|
|
37
|
+
CanUsePrivateFiles: typeof CanUsePrivateFiles;
|
|
38
|
+
CanUseFileManagerThreatDetection: typeof CanUseFileManagerThreatDetection;
|
|
39
|
+
CanUseHcmsFieldPermissions: typeof CanUseHcmsFieldPermissions;
|
|
40
|
+
CanUseRemoteComponents: typeof CanUseRemoteComponents;
|
|
41
|
+
CanUseAiPowerups: typeof CanUseAiPowerups;
|
|
42
|
+
};
|
|
43
|
+
export {};
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import react from "react";
|
|
2
|
+
import { useProjectFeatureFlags } from "../services/GetProjectConfigService/FeatureFlagsContext.js";
|
|
3
|
+
function CanUse({ name, children }) {
|
|
4
|
+
const flags = useProjectFeatureFlags();
|
|
5
|
+
return flags.isEnabled(name) ? /*#__PURE__*/ react.createElement(react.Fragment, null, children) : null;
|
|
6
|
+
}
|
|
7
|
+
function CanUseMultiTenancy({ children }) {
|
|
8
|
+
return /*#__PURE__*/ react.createElement(CanUse, {
|
|
9
|
+
name: "multiTenancy"
|
|
10
|
+
}, children);
|
|
11
|
+
}
|
|
12
|
+
function CanUseWorkflows({ children }) {
|
|
13
|
+
return /*#__PURE__*/ react.createElement(CanUse, {
|
|
14
|
+
name: "advancedPublishingWorkflow"
|
|
15
|
+
}, children);
|
|
16
|
+
}
|
|
17
|
+
function CanUseTeams({ children }) {
|
|
18
|
+
return /*#__PURE__*/ react.createElement(CanUse, {
|
|
19
|
+
name: "advancedAccessControlLayer.teams"
|
|
20
|
+
}, children);
|
|
21
|
+
}
|
|
22
|
+
function CanUsePrivateFiles({ children }) {
|
|
23
|
+
return /*#__PURE__*/ react.createElement(CanUse, {
|
|
24
|
+
name: "advancedAccessControlLayer.privateFiles"
|
|
25
|
+
}, children);
|
|
26
|
+
}
|
|
27
|
+
function CanUseFileManagerThreatDetection({ children }) {
|
|
28
|
+
return /*#__PURE__*/ react.createElement(CanUse, {
|
|
29
|
+
name: "fileManager.threatDetection"
|
|
30
|
+
}, children);
|
|
31
|
+
}
|
|
32
|
+
function CanUseHcmsFieldPermissions({ children }) {
|
|
33
|
+
return /*#__PURE__*/ react.createElement(CanUse, {
|
|
34
|
+
name: "advancedAccessControlLayer.hcmsFieldPermissions"
|
|
35
|
+
}, children);
|
|
36
|
+
}
|
|
37
|
+
function CanUseRemoteComponents({ children }) {
|
|
38
|
+
return /*#__PURE__*/ react.createElement(CanUse, {
|
|
39
|
+
name: "aiPowerups.remoteComponents"
|
|
40
|
+
}, children);
|
|
41
|
+
}
|
|
42
|
+
function CanUseAiPowerups({ children }) {
|
|
43
|
+
return /*#__PURE__*/ react.createElement(CanUse, {
|
|
44
|
+
name: "aiPowerups"
|
|
45
|
+
}, children);
|
|
46
|
+
}
|
|
47
|
+
const FeatureFlag = {
|
|
48
|
+
CanUse: CanUse,
|
|
49
|
+
CanUseMultiTenancy: CanUseMultiTenancy,
|
|
50
|
+
CanUseWorkflows: CanUseWorkflows,
|
|
51
|
+
CanUseTeams: CanUseTeams,
|
|
52
|
+
CanUsePrivateFiles: CanUsePrivateFiles,
|
|
53
|
+
CanUseFileManagerThreatDetection: CanUseFileManagerThreatDetection,
|
|
54
|
+
CanUseHcmsFieldPermissions: CanUseHcmsFieldPermissions,
|
|
55
|
+
CanUseRemoteComponents: CanUseRemoteComponents,
|
|
56
|
+
CanUseAiPowerups: CanUseAiPowerups
|
|
57
|
+
};
|
|
58
|
+
export { FeatureFlag };
|
|
59
|
+
|
|
60
|
+
//# sourceMappingURL=FeatureFlag.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"components/FeatureFlag.js","sources":["../../src/components/FeatureFlag.tsx"],"sourcesContent":["import React from \"react\";\nimport type { FeatureFlagName } from \"@webiny/feature-flags\";\nimport { useProjectFeatureFlags } from \"~/services/GetProjectConfigService/FeatureFlagsContext.js\";\n\ninterface CanUseProps {\n name: FeatureFlagName;\n children: React.ReactNode;\n}\n\nfunction CanUse({ name, children }: CanUseProps) {\n const flags = useProjectFeatureFlags();\n return flags.isEnabled(name) ? <>{children}</> : null;\n}\n\nfunction CanUseMultiTenancy({ children }: { children: React.ReactNode }) {\n return <CanUse name=\"multiTenancy\">{children}</CanUse>;\n}\n\nfunction CanUseWorkflows({ children }: { children: React.ReactNode }) {\n return <CanUse name=\"advancedPublishingWorkflow\">{children}</CanUse>;\n}\n\nfunction CanUseTeams({ children }: { children: React.ReactNode }) {\n return <CanUse name=\"advancedAccessControlLayer.teams\">{children}</CanUse>;\n}\n\nfunction CanUsePrivateFiles({ children }: { children: React.ReactNode }) {\n return <CanUse name=\"advancedAccessControlLayer.privateFiles\">{children}</CanUse>;\n}\n\nfunction CanUseFileManagerThreatDetection({ children }: { children: React.ReactNode }) {\n return <CanUse name=\"fileManager.threatDetection\">{children}</CanUse>;\n}\n\nfunction CanUseHcmsFieldPermissions({ children }: { children: React.ReactNode }) {\n return <CanUse name=\"advancedAccessControlLayer.hcmsFieldPermissions\">{children}</CanUse>;\n}\n\nfunction CanUseRemoteComponents({ children }: { children: React.ReactNode }) {\n return <CanUse name=\"aiPowerups.remoteComponents\">{children}</CanUse>;\n}\n\nfunction CanUseAiPowerups({ children }: { children: React.ReactNode }) {\n return <CanUse name=\"aiPowerups\">{children}</CanUse>;\n}\n\nexport const FeatureFlag = {\n CanUse,\n CanUseMultiTenancy,\n CanUseWorkflows,\n CanUseTeams,\n CanUsePrivateFiles,\n CanUseFileManagerThreatDetection,\n CanUseHcmsFieldPermissions,\n CanUseRemoteComponents,\n CanUseAiPowerups\n};\n"],"names":["CanUse","name","children","flags","useProjectFeatureFlags","CanUseMultiTenancy","CanUseWorkflows","CanUseTeams","CanUsePrivateFiles","CanUseFileManagerThreatDetection","CanUseHcmsFieldPermissions","CanUseRemoteComponents","CanUseAiPowerups","FeatureFlag"],"mappings":";;AASA,SAASA,OAAO,EAAEC,IAAI,EAAEC,QAAQ,EAAe;IAC3C,MAAMC,QAAQC;IACd,OAAOD,MAAM,SAAS,CAACF,QAAQ,WAARA,GAAQ,0CAAGC,YAAe;AACrD;AAEA,SAASG,mBAAmB,EAAEH,QAAQ,EAAiC;IACnE,OAAO,WAAP,GAAO,oBAACF,QAAMA;QAAC,MAAK;OAAgBE;AACxC;AAEA,SAASI,gBAAgB,EAAEJ,QAAQ,EAAiC;IAChE,OAAO,WAAP,GAAO,oBAACF,QAAMA;QAAC,MAAK;OAA8BE;AACtD;AAEA,SAASK,YAAY,EAAEL,QAAQ,EAAiC;IAC5D,OAAO,WAAP,GAAO,oBAACF,QAAMA;QAAC,MAAK;OAAoCE;AAC5D;AAEA,SAASM,mBAAmB,EAAEN,QAAQ,EAAiC;IACnE,OAAO,WAAP,GAAO,oBAACF,QAAMA;QAAC,MAAK;OAA2CE;AACnE;AAEA,SAASO,iCAAiC,EAAEP,QAAQ,EAAiC;IACjF,OAAO,WAAP,GAAO,oBAACF,QAAMA;QAAC,MAAK;OAA+BE;AACvD;AAEA,SAASQ,2BAA2B,EAAER,QAAQ,EAAiC;IAC3E,OAAO,WAAP,GAAO,oBAACF,QAAMA;QAAC,MAAK;OAAmDE;AAC3E;AAEA,SAASS,uBAAuB,EAAET,QAAQ,EAAiC;IACvE,OAAO,WAAP,GAAO,oBAACF,QAAMA;QAAC,MAAK;OAA+BE;AACvD;AAEA,SAASU,iBAAiB,EAAEV,QAAQ,EAAiC;IACjE,OAAO,WAAP,GAAO,oBAACF,QAAMA;QAAC,MAAK;OAAcE;AACtC;AAEO,MAAMW,cAAc;IACvBb,QAAAA;IACAK,oBAAAA;IACAC,iBAAAA;IACAC,aAAAA;IACAC,oBAAAA;IACAC,kCAAAA;IACAC,4BAAAA;IACAC,wBAAAA;IACAC,kBAAAA;AACJ"}
|
|
@@ -1,3 +1,3 @@
|
|
|
1
1
|
import { Container } from "@webiny/di";
|
|
2
2
|
import { ProjectSdkParamsService } from "./abstractions/index.js";
|
|
3
|
-
export declare const createProjectSdkContainer: (params: Partial<ProjectSdkParamsService.Params
|
|
3
|
+
export declare const createProjectSdkContainer: (params: Partial<ProjectSdkParamsService.Params>, register?: (container: Container) => void) => Promise<Container>;
|