@webiny/project-aws 6.4.11 → 6.6.0-alpha.1

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.
Files changed (162) hide show
  1. package/_templates/appTemplates/api/graphql/package.json +3 -11
  2. package/_templates/appTemplates/api/graphql/src/index.ts +19 -78
  3. package/_templates/extensions/OpenSearch/api/graphql/src/index.ts +17 -92
  4. package/_templates/extensions/OpenSearch/coreDdbToEsHandler/dynamoToElastic/src/index.ts +19 -12
  5. package/abstractions/ApiGqlClient.js +1 -1
  6. package/abstractions/ApiGqlClient.js.map +1 -1
  7. package/abstractions/InvokeLambdaFunction.js +1 -1
  8. package/abstractions/InvokeLambdaFunction.js.map +1 -1
  9. package/admin.d.ts +6 -0
  10. package/admin.js +4 -2
  11. package/admin.js.map +1 -1
  12. package/api.d.ts +4 -4
  13. package/apps/createAdminApp.d.ts +1 -1
  14. package/apps/createApiApp.d.ts +8 -0
  15. package/apps/createCoreApp.d.ts +13 -13
  16. package/extensions/ApiRoute.d.ts +5 -5
  17. package/extensions/ApiRoute.js +14 -30
  18. package/extensions/ApiRoute.js.map +1 -1
  19. package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.d.ts +1 -1
  20. package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js +1 -2
  21. package/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js.map +1 -1
  22. package/extensions/ProjectAws/BuildAppWorkspace.d.ts +3 -2
  23. package/extensions/ProjectAws/BuildAppWorkspace.js +38 -11
  24. package/extensions/ProjectAws/BuildAppWorkspace.js.map +1 -1
  25. package/extensions/ProjectAws/BuildProjectWorkspace.d.ts +12 -0
  26. package/extensions/ProjectAws/BuildProjectWorkspace.js +30 -0
  27. package/extensions/ProjectAws/BuildProjectWorkspace.js.map +1 -0
  28. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.d.ts +11 -0
  29. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.js +30 -0
  30. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.js.map +1 -0
  31. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.d.ts +11 -0
  32. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.js +30 -0
  33. package/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.js.map +1 -0
  34. package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.d.ts +11 -0
  35. package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.js +30 -0
  36. package/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.js.map +1 -0
  37. package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js +1 -1
  38. package/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js.map +1 -1
  39. package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.d.ts +11 -0
  40. package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.js +31 -0
  41. package/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.js.map +1 -0
  42. package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.d.ts +13 -0
  43. package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.js +34 -0
  44. package/extensions/ProjectAws/EnsureTelemetryEnabledForOss.js.map +1 -0
  45. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js +1 -2
  46. package/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js.map +1 -1
  47. package/extensions/ProjectAws/TelemetryNoLongerNewUser.d.ts +8 -0
  48. package/extensions/ProjectAws/TelemetryNoLongerNewUser.js +14 -0
  49. package/extensions/ProjectAws/TelemetryNoLongerNewUser.js.map +1 -0
  50. package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.d.ts +12 -0
  51. package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.js +31 -0
  52. package/extensions/ProjectAws/ValidateEncryptionBeforeDeploy.js.map +1 -0
  53. package/extensions/ProjectAws/ValidateProductionPulumiState.d.ts +12 -0
  54. package/extensions/ProjectAws/ValidateProductionPulumiState.js +33 -0
  55. package/extensions/ProjectAws/ValidateProductionPulumiState.js.map +1 -0
  56. package/extensions/ProjectAws/definitions.js +1 -3
  57. package/extensions/ProjectAws/definitions.js.map +1 -1
  58. package/extensions/ProjectAws.js +18 -4
  59. package/extensions/ProjectAws.js.map +1 -1
  60. package/extensions/RegisterRoutesPulumi.js +2 -5
  61. package/extensions/RegisterRoutesPulumi.js.map +1 -1
  62. package/extensions/definitions.js +0 -2
  63. package/extensions/definitions.js.map +1 -1
  64. package/extensions/index.d.ts +0 -1
  65. package/extensions/index.js +0 -1
  66. package/extensions/routePath.d.ts +20 -0
  67. package/extensions/routePath.js +13 -0
  68. package/extensions/routePath.js.map +1 -0
  69. package/features/Watch/AwsWatch.d.ts +17 -0
  70. package/features/Watch/AwsWatch.js +108 -0
  71. package/features/Watch/AwsWatch.js.map +1 -0
  72. package/features/Watch/getIotEndpoint.d.ts +2 -0
  73. package/features/Watch/getIotEndpoint.js +18 -0
  74. package/features/Watch/getIotEndpoint.js.map +1 -0
  75. package/features/Watch/handler/handler.zip +0 -0
  76. package/features/Watch/replaceLambdaFunctions.d.ts +19 -0
  77. package/features/Watch/replaceLambdaFunctions.js +72 -0
  78. package/features/Watch/replaceLambdaFunctions.js.map +1 -0
  79. package/index.d.ts +1 -0
  80. package/index.js +1 -0
  81. package/infra.d.ts +15 -18
  82. package/infra.js +5 -2
  83. package/infra.js.map +1 -1
  84. package/package.json +20 -17
  85. package/project.d.ts +16 -11
  86. package/pulumi/apps/admin/createAdminPulumiApp.d.ts +1 -1
  87. package/pulumi/apps/admin/createAdminPulumiApp.js +4 -5
  88. package/pulumi/apps/admin/createAdminPulumiApp.js.map +1 -1
  89. package/pulumi/apps/api/ApiCloudfront.js +103 -1
  90. package/pulumi/apps/api/ApiCloudfront.js.map +1 -1
  91. package/pulumi/apps/api/ApiGraphqlStream.d.ts +29 -0
  92. package/pulumi/apps/api/ApiGraphqlStream.js +58 -0
  93. package/pulumi/apps/api/ApiGraphqlStream.js.map +1 -0
  94. package/pulumi/apps/api/ApiOutput.js +1 -1
  95. package/pulumi/apps/api/ApiOutput.js.map +1 -1
  96. package/pulumi/apps/api/createApiPulumiApp.d.ts +8 -0
  97. package/pulumi/apps/api/createApiPulumiApp.js +30 -24
  98. package/pulumi/apps/api/createApiPulumiApp.js.map +1 -1
  99. package/pulumi/apps/api/index.d.ts +1 -0
  100. package/pulumi/apps/api/index.js +1 -0
  101. package/pulumi/apps/awsUtils.d.ts +1 -1
  102. package/pulumi/apps/awsUtils.js +2 -2
  103. package/pulumi/apps/awsUtils.js.map +1 -1
  104. package/pulumi/apps/blueGreen/createBlueGreenPulumiApp.js +2 -2
  105. package/pulumi/apps/blueGreen/createBlueGreenPulumiApp.js.map +1 -1
  106. package/pulumi/apps/blueGreen/domains/getApplicationDomains.js +1 -1
  107. package/pulumi/apps/blueGreen/domains/getApplicationDomains.js.map +1 -1
  108. package/pulumi/apps/common/CoreOutput.js +2 -2
  109. package/pulumi/apps/common/CoreOutput.js.map +1 -1
  110. package/pulumi/apps/core/CoreOpenSearch.d.ts +1 -1
  111. package/pulumi/apps/core/createCorePulumiApp.d.ts +13 -13
  112. package/pulumi/apps/core/createCorePulumiApp.js +5 -5
  113. package/pulumi/apps/core/createCorePulumiApp.js.map +1 -1
  114. package/pulumi/apps/core/webinyWatchCommand/handler.d.ts +1 -1
  115. package/pulumi/apps/customDomain.d.ts +0 -15
  116. package/pulumi/apps/customDomain.js +2 -14
  117. package/pulumi/apps/customDomain.js.map +1 -1
  118. package/pulumi/apps/extensions/getVpcConfigFromExtension.d.ts +4 -4
  119. package/pulumi/apps/react/createReactPulumiApp.d.ts +1 -1
  120. package/pulumi/apps/react/createReactPulumiApp.js +2 -2
  121. package/pulumi/apps/react/createReactPulumiApp.js.map +1 -1
  122. package/pulumi/apps/syncSystem/SyncSystemLambda.d.ts +1 -1
  123. package/pulumi/apps/syncSystem/SyncSystemLambda.js +1 -1
  124. package/pulumi/apps/syncSystem/SyncSystemLambda.js.map +1 -1
  125. package/pulumi/apps/syncSystem/createSyncSystemPulumiApp.js +2 -2
  126. package/pulumi/apps/syncSystem/createSyncSystemPulumiApp.js.map +1 -1
  127. package/pulumi/apps/syncSystem/getSyncSystemOutput.d.ts +1 -1
  128. package/pulumi/apps/syncSystem/getSyncSystemOutput.js +1 -1
  129. package/pulumi/apps/syncSystem/getSyncSystemOutput.js.map +1 -1
  130. package/pulumi/extensions/AdminCustomDomains.d.ts +0 -9
  131. package/pulumi/extensions/AdminCustomDomains.js +1 -3
  132. package/pulumi/extensions/AdminCustomDomains.js.map +1 -1
  133. package/pulumi/extensions/ApiCustomDomains.d.ts +0 -9
  134. package/pulumi/extensions/ApiCustomDomains.js +1 -3
  135. package/pulumi/extensions/ApiCustomDomains.js.map +1 -1
  136. package/pulumi/extensions/index.d.ts +16 -25
  137. package/pulumi/getAwsProjectSdk.d.ts +12 -0
  138. package/pulumi/getAwsProjectSdk.js +6 -0
  139. package/pulumi/getAwsProjectSdk.js.map +1 -0
  140. package/pulumi/getStackOutput.d.ts +7 -0
  141. package/pulumi/getStackOutput.js +8 -0
  142. package/pulumi/getStackOutput.js.map +1 -0
  143. package/pulumi/utils/lambdaEnvVariables.js +4 -16
  144. package/pulumi/utils/lambdaEnvVariables.js.map +1 -1
  145. package/registerAwsProjectFeatures.d.ts +8 -0
  146. package/registerAwsProjectFeatures.js +55 -0
  147. package/registerAwsProjectFeatures.js.map +1 -0
  148. package/services/GetPulumiService/GetPulumiService.d.ts +9 -0
  149. package/services/GetPulumiService/GetPulumiService.js +44 -0
  150. package/services/GetPulumiService/GetPulumiService.js.map +1 -0
  151. package/utils/getPulumiBaseTemplatesFolderPath.d.ts +1 -0
  152. package/utils/getPulumiBaseTemplatesFolderPath.js +10 -0
  153. package/utils/getPulumiBaseTemplatesFolderPath.js.map +1 -0
  154. package/utils/index.d.ts +1 -0
  155. package/utils/index.js +1 -0
  156. package/_templates/appTemplates/api/graphql/src/security.ts +0 -43
  157. package/extensions/Encryption.d.ts +0 -10
  158. package/extensions/Encryption.js +0 -36
  159. package/extensions/Encryption.js.map +0 -1
  160. package/pulumi/apps/extensions/isVpcEnabled.d.ts +0 -14
  161. package/pulumi/apps/extensions/isVpcEnabled.js +0 -8
  162. package/pulumi/apps/extensions/isVpcEnabled.js.map +0 -1
@@ -1,7 +1,6 @@
1
- import { ApiAfterDeploy } from "@webiny/project/abstractions/index.js";
1
+ import { ApiAfterDeploy, GetProjectConfigService } from "@webiny/project/abstractions/index.js";
2
2
  import { UiService } from "@webiny/project/abstractions/services/UiService.js";
3
3
  import { LoggerService } from "@webiny/project/abstractions/services/LoggerService.js";
4
- import { GetProjectConfigService } from "@webiny/project/abstractions";
5
4
  import { ApiGqlClient } from "../../../abstractions/ApiGqlClient.js";
6
5
  const IS_INSTALLED_QUERY = `
7
6
  query IsSystemInstalled {
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js","sources":["../../../../src/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.ts"],"sourcesContent":["import { ApiAfterDeploy } from \"@webiny/project/abstractions/index.js\";\nimport { UiService } from \"@webiny/project/abstractions/services/UiService.js\";\nimport { LoggerService } from \"@webiny/project/abstractions/services/LoggerService.js\";\nimport { GetProjectConfigService } from \"@webiny/project/abstractions\";\nimport { ApiGqlClient } from \"~/abstractions/ApiGqlClient.js\";\n\nconst IS_INSTALLED_QUERY = `\n query IsSystemInstalled {\n system {\n isSystemInstalled {\n data\n error {\n message\n code\n }\n }\n }\n }\n`;\n\nconst INSTALL_MUTATION = `\n mutation InstallSystem($installationInput: JSON!) {\n system {\n installSystem(installationInput: $installationInput) {\n data\n error {\n message\n code\n }\n }\n }\n }\n`;\n\ninterface IsInstalledResponse {\n system: {\n isSystemInstalled: {\n data: boolean;\n error?: {\n message: string;\n code: string;\n };\n };\n };\n}\n\ninterface InstallResponse {\n system: {\n installSystem: {\n data: boolean;\n error?: {\n message: string;\n code: string;\n };\n };\n };\n}\n\nclass AutoInstallAfterApiDeployImpl implements ApiAfterDeploy.Interface {\n constructor(\n private apiGqlClient: ApiGqlClient.Interface,\n private ui: UiService.Interface,\n private getProjectConfig: GetProjectConfigService.Interface,\n private logger: LoggerService.Interface\n ) {}\n\n async execute(params: ApiAfterDeploy.Params): Promise<void> {\n if (params.preview) {\n // Skip auto-install on preview deployments\n return;\n }\n\n const projectConfig = await this.getProjectConfig.execute();\n const adminAutoInstallExtensions = projectConfig.extensionsByType(\"Project/AutoInstall\");\n\n if (adminAutoInstallExtensions.length === 0) {\n return;\n }\n\n const config = adminAutoInstallExtensions[0].params;\n\n // Check if system is already installed\n this.ui.info(\"Checking if system is already installed...\");\n\n try {\n const isInstalledResponse = await this.apiGqlClient.query<IsInstalledResponse>({\n query: IS_INSTALLED_QUERY\n });\n\n if (isInstalledResponse.data?.system.isSystemInstalled.data === true) {\n this.ui.info(\"System is already installed, skipping auto-install.\");\n return;\n }\n } catch (error: any) {\n this.logger.error(\"Failed to check installation status\", { error });\n this.ui.warning(`Could not check installation status: ${error.message}`);\n return;\n }\n\n this.ui.info(\"Auto-installing...\");\n /**\n * Type Error introduced with Zod v4. V3 had any type.\n */\n // @ts-expect-error\n const adminUser = config.adminUser || {\n firstName: \"John\",\n lastName: \"Smith\",\n email: \"admin@webiny.com\",\n password: \"12345678\"\n };\n\n const variables = {\n installationInput: [\n {\n app: \"Cognito\",\n data: adminUser\n }\n ]\n };\n\n const installResponse = await this.apiGqlClient.mutation<InstallResponse>({\n mutation: INSTALL_MUTATION,\n variables\n });\n\n if (installResponse.data?.system.installSystem.error) {\n const { message, code } = installResponse.data.system.installSystem.error;\n this.logger.error(\"Installation failed\", { message, code });\n this.ui.error(`Installation failed: ${message} (${code})`);\n throw new Error(message);\n }\n\n this.ui.success(\"System installed successfully!\");\n this.ui.info(\"Admin credentials:\");\n this.ui.info(` Email: ${adminUser.email}`);\n this.ui.info(` Password: ${adminUser.password}`);\n }\n}\n\nexport const AutoInstallAfterApiDeploy = ApiAfterDeploy.createImplementation({\n implementation: AutoInstallAfterApiDeployImpl,\n dependencies: [ApiGqlClient, UiService, GetProjectConfigService, LoggerService]\n});\n"],"names":["IS_INSTALLED_QUERY","INSTALL_MUTATION","AutoInstallAfterApiDeployImpl","apiGqlClient","ui","getProjectConfig","logger","params","projectConfig","adminAutoInstallExtensions","config","isInstalledResponse","error","adminUser","variables","installResponse","message","code","Error","AutoInstallAfterApiDeploy","ApiAfterDeploy","ApiGqlClient","UiService","GetProjectConfigService","LoggerService"],"mappings":";;;;;AAMA,MAAMA,qBAAqB,CAAC;;;;;;;;;;;;AAY5B,CAAC;AAED,MAAMC,mBAAmB,CAAC;;;;;;;;;;;;AAY1B,CAAC;AA0BD,MAAMC;IACF,YACYC,YAAoC,EACpCC,EAAuB,EACvBC,gBAAmD,EACnDC,MAA+B,CACzC;aAJUH,YAAY,GAAZA;aACAC,EAAE,GAAFA;aACAC,gBAAgB,GAAhBA;aACAC,MAAM,GAANA;IACT;IAEH,MAAM,QAAQC,MAA6B,EAAiB;QACxD,IAAIA,OAAO,OAAO,EAEd;QAGJ,MAAMC,gBAAgB,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO;QACzD,MAAMC,6BAA6BD,cAAc,gBAAgB,CAAC;QAElE,IAAIC,AAAsC,MAAtCA,2BAA2B,MAAM,EACjC;QAGJ,MAAMC,SAASD,0BAA0B,CAAC,EAAE,CAAC,MAAM;QAGnD,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC;QAEb,IAAI;YACA,MAAME,sBAAsB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,CAAsB;gBAC3E,OAAOX;YACX;YAEA,IAAIW,oBAAoB,IAAI,EAAE,OAAO,kBAAkB,SAAS,MAAM,YAClE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC;QAGrB,EAAE,OAAOC,OAAY;YACjB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uCAAuC;gBAAEA;YAAM;YACjE,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,qCAAqC,EAAEA,MAAM,OAAO,EAAE;YACvE;QACJ;QAEA,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC;QAKb,MAAMC,YAAYH,OAAO,SAAS,IAAI;YAClC,WAAW;YACX,UAAU;YACV,OAAO;YACP,UAAU;QACd;QAEA,MAAMI,YAAY;YACd,mBAAmB;gBACf;oBACI,KAAK;oBACL,MAAMD;gBACV;aACH;QACL;QAEA,MAAME,kBAAkB,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAkB;YACtE,UAAUd;YACVa;QACJ;QAEA,IAAIC,gBAAgB,IAAI,EAAE,OAAO,cAAc,OAAO;YAClD,MAAM,EAAEC,OAAO,EAAEC,IAAI,EAAE,GAAGF,gBAAgB,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK;YACzE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uBAAuB;gBAAEC;gBAASC;YAAK;YACzD,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,qBAAqB,EAAED,QAAQ,EAAE,EAAEC,KAAK,CAAC,CAAC;YACzD,MAAM,IAAIC,MAAMF;QACpB;QAEA,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC;QAChB,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC;QACb,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAEH,UAAU,KAAK,EAAE;QACzC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,EAAEA,UAAU,QAAQ,EAAE;IACnD;AACJ;AAEO,MAAMM,4BAA4BC,eAAe,oBAAoB,CAAC;IACzE,gBAAgBlB;IAChB,cAAc;QAACmB;QAAcC;QAAWC;QAAyBC;KAAc;AACnF"}
1
+ {"version":3,"file":"extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.js","sources":["../../../../src/extensions/ProjectAws/AutoInstall/AutoInstallAfterApiDeploy.ts"],"sourcesContent":["import { ApiAfterDeploy } from \"@webiny/project/abstractions/index.js\";\nimport { UiService } from \"@webiny/project/abstractions/services/UiService.js\";\nimport { LoggerService } from \"@webiny/project/abstractions/services/LoggerService.js\";\nimport { GetProjectConfigService } from \"@webiny/project/abstractions/index.js\";\nimport { ApiGqlClient } from \"~/abstractions/ApiGqlClient.js\";\n\nconst IS_INSTALLED_QUERY = `\n query IsSystemInstalled {\n system {\n isSystemInstalled {\n data\n error {\n message\n code\n }\n }\n }\n }\n`;\n\nconst INSTALL_MUTATION = `\n mutation InstallSystem($installationInput: JSON!) {\n system {\n installSystem(installationInput: $installationInput) {\n data\n error {\n message\n code\n }\n }\n }\n }\n`;\n\ninterface IsInstalledResponse {\n system: {\n isSystemInstalled: {\n data: boolean;\n error?: {\n message: string;\n code: string;\n };\n };\n };\n}\n\ninterface InstallResponse {\n system: {\n installSystem: {\n data: boolean;\n error?: {\n message: string;\n code: string;\n };\n };\n };\n}\n\nclass AutoInstallAfterApiDeployImpl implements ApiAfterDeploy.Interface {\n constructor(\n private apiGqlClient: ApiGqlClient.Interface,\n private ui: UiService.Interface,\n private getProjectConfig: GetProjectConfigService.Interface,\n private logger: LoggerService.Interface\n ) {}\n\n async execute(params: ApiAfterDeploy.Params): Promise<void> {\n if (params.preview) {\n // Skip auto-install on preview deployments\n return;\n }\n\n const projectConfig = await this.getProjectConfig.execute();\n const adminAutoInstallExtensions = projectConfig.extensionsByType(\"Project/AutoInstall\");\n\n if (adminAutoInstallExtensions.length === 0) {\n return;\n }\n\n const config = adminAutoInstallExtensions[0].params;\n\n // Check if system is already installed\n this.ui.info(\"Checking if system is already installed...\");\n\n try {\n const isInstalledResponse = await this.apiGqlClient.query<IsInstalledResponse>({\n query: IS_INSTALLED_QUERY\n });\n\n if (isInstalledResponse.data?.system.isSystemInstalled.data === true) {\n this.ui.info(\"System is already installed, skipping auto-install.\");\n return;\n }\n } catch (error: any) {\n this.logger.error(\"Failed to check installation status\", { error });\n this.ui.warning(`Could not check installation status: ${error.message}`);\n return;\n }\n\n this.ui.info(\"Auto-installing...\");\n /**\n * Type Error introduced with Zod v4. V3 had any type.\n */\n // @ts-expect-error\n const adminUser = config.adminUser || {\n firstName: \"John\",\n lastName: \"Smith\",\n email: \"admin@webiny.com\",\n password: \"12345678\"\n };\n\n const variables = {\n installationInput: [\n {\n app: \"Cognito\",\n data: adminUser\n }\n ]\n };\n\n const installResponse = await this.apiGqlClient.mutation<InstallResponse>({\n mutation: INSTALL_MUTATION,\n variables\n });\n\n if (installResponse.data?.system.installSystem.error) {\n const { message, code } = installResponse.data.system.installSystem.error;\n this.logger.error(\"Installation failed\", { message, code });\n this.ui.error(`Installation failed: ${message} (${code})`);\n throw new Error(message);\n }\n\n this.ui.success(\"System installed successfully!\");\n this.ui.info(\"Admin credentials:\");\n this.ui.info(` Email: ${adminUser.email}`);\n this.ui.info(` Password: ${adminUser.password}`);\n }\n}\n\nexport const AutoInstallAfterApiDeploy = ApiAfterDeploy.createImplementation({\n implementation: AutoInstallAfterApiDeployImpl,\n dependencies: [ApiGqlClient, UiService, GetProjectConfigService, LoggerService]\n});\n"],"names":["IS_INSTALLED_QUERY","INSTALL_MUTATION","AutoInstallAfterApiDeployImpl","apiGqlClient","ui","getProjectConfig","logger","params","projectConfig","adminAutoInstallExtensions","config","isInstalledResponse","error","adminUser","variables","installResponse","message","code","Error","AutoInstallAfterApiDeploy","ApiAfterDeploy","ApiGqlClient","UiService","GetProjectConfigService","LoggerService"],"mappings":";;;;AAMA,MAAMA,qBAAqB,CAAC;;;;;;;;;;;;AAY5B,CAAC;AAED,MAAMC,mBAAmB,CAAC;;;;;;;;;;;;AAY1B,CAAC;AA0BD,MAAMC;IACF,YACYC,YAAoC,EACpCC,EAAuB,EACvBC,gBAAmD,EACnDC,MAA+B,CACzC;aAJUH,YAAY,GAAZA;aACAC,EAAE,GAAFA;aACAC,gBAAgB,GAAhBA;aACAC,MAAM,GAANA;IACT;IAEH,MAAM,QAAQC,MAA6B,EAAiB;QACxD,IAAIA,OAAO,OAAO,EAEd;QAGJ,MAAMC,gBAAgB,MAAM,IAAI,CAAC,gBAAgB,CAAC,OAAO;QACzD,MAAMC,6BAA6BD,cAAc,gBAAgB,CAAC;QAElE,IAAIC,AAAsC,MAAtCA,2BAA2B,MAAM,EACjC;QAGJ,MAAMC,SAASD,0BAA0B,CAAC,EAAE,CAAC,MAAM;QAGnD,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC;QAEb,IAAI;YACA,MAAME,sBAAsB,MAAM,IAAI,CAAC,YAAY,CAAC,KAAK,CAAsB;gBAC3E,OAAOX;YACX;YAEA,IAAIW,oBAAoB,IAAI,EAAE,OAAO,kBAAkB,SAAS,MAAM,YAClE,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC;QAGrB,EAAE,OAAOC,OAAY;YACjB,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uCAAuC;gBAAEA;YAAM;YACjE,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC,qCAAqC,EAAEA,MAAM,OAAO,EAAE;YACvE;QACJ;QAEA,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC;QAKb,MAAMC,YAAYH,OAAO,SAAS,IAAI;YAClC,WAAW;YACX,UAAU;YACV,OAAO;YACP,UAAU;QACd;QAEA,MAAMI,YAAY;YACd,mBAAmB;gBACf;oBACI,KAAK;oBACL,MAAMD;gBACV;aACH;QACL;QAEA,MAAME,kBAAkB,MAAM,IAAI,CAAC,YAAY,CAAC,QAAQ,CAAkB;YACtE,UAAUd;YACVa;QACJ;QAEA,IAAIC,gBAAgB,IAAI,EAAE,OAAO,cAAc,OAAO;YAClD,MAAM,EAAEC,OAAO,EAAEC,IAAI,EAAE,GAAGF,gBAAgB,IAAI,CAAC,MAAM,CAAC,aAAa,CAAC,KAAK;YACzE,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC,uBAAuB;gBAAEC;gBAASC;YAAK;YACzD,IAAI,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC,qBAAqB,EAAED,QAAQ,EAAE,EAAEC,KAAK,CAAC,CAAC;YACzD,MAAM,IAAIC,MAAMF;QACpB;QAEA,IAAI,CAAC,EAAE,CAAC,OAAO,CAAC;QAChB,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC;QACb,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,QAAQ,EAAEH,UAAU,KAAK,EAAE;QACzC,IAAI,CAAC,EAAE,CAAC,IAAI,CAAC,CAAC,WAAW,EAAEA,UAAU,QAAQ,EAAE;IACnD;AACJ;AAEO,MAAMM,4BAA4BC,eAAe,oBAAoB,CAAC;IACzE,gBAAgBlB;IAChB,cAAc;QAACmB;QAAcC;QAAWC;QAAyBC;KAAc;AACnF"}
@@ -1,9 +1,10 @@
1
- import { BuildAppWorkspaceService, GetApp, LoggerService } from "@webiny/project/abstractions/index.js";
1
+ import { BuildAppWorkspaceService, GetApp, LoggerService, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
2
2
  declare class BuildAppWorkspaceImpl implements BuildAppWorkspaceService.Interface {
3
3
  private getApp;
4
4
  private logger;
5
+ private projectSdkParamsService;
5
6
  private decoratee;
6
- constructor(getApp: GetApp.Interface, logger: LoggerService.Interface, decoratee: BuildAppWorkspaceService.Interface);
7
+ constructor(getApp: GetApp.Interface, logger: LoggerService.Interface, projectSdkParamsService: ProjectSdkParamsService.Interface, decoratee: BuildAppWorkspaceService.Interface);
7
8
  execute(appName: GetApp.AppName, options?: BuildAppWorkspaceService.Options): Promise<void>;
8
9
  }
9
10
  export declare const BuildAppWorkspace: typeof BuildAppWorkspaceImpl & {
@@ -1,30 +1,56 @@
1
1
  import path from "path";
2
2
  import fs from "fs";
3
3
  import { replaceInPath } from "replace-in-path";
4
- import { BuildAppWorkspaceService, GetApp, LoggerService } from "@webiny/project/abstractions/index.js";
5
- import { getTemplatesFolderPath } from "../../utils/index.js";
4
+ import { BuildAppWorkspaceService, GetApp, LoggerService, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
5
+ import { getPulumiBaseTemplatesFolderPath, getTemplatesFolderPath } from "../../utils/index.js";
6
6
  const wait = ()=>new Promise((resolve)=>setTimeout(resolve, 10));
7
7
  class BuildAppWorkspaceImpl {
8
- constructor(getApp, logger, decoratee){
8
+ constructor(getApp, logger, projectSdkParamsService, decoratee){
9
9
  this.getApp = getApp;
10
10
  this.logger = logger;
11
+ this.projectSdkParamsService = projectSdkParamsService;
11
12
  this.decoratee = decoratee;
12
13
  }
13
14
  async execute(appName, options = {}) {
15
+ const sdkParams = this.projectSdkParamsService.get();
16
+ if (!sdkParams.env) throw new Error('Please specify environment, for example "dev".');
14
17
  await this.decoratee.execute(appName, options);
15
18
  const app = this.getApp.execute(appName);
16
- if (app.paths.workspaceFolder.existsSync()) {
17
- if (true !== options.forceRebuild) return void this.logger.debug({
18
- appName
19
- }, "App workspace already exists, skipping rebuild (project-aws).");
20
- }
19
+ const pulumiYamlExists = fs.existsSync(path.join(app.paths.workspaceFolder.toString(), "Pulumi.yaml"));
20
+ if (pulumiYamlExists && true !== options.forceRebuild) return void this.logger.debug({
21
+ appName
22
+ }, "App workspace already exists, skipping rebuild (project-aws).");
21
23
  this.logger.info({
22
24
  appName,
23
25
  options
24
26
  }, "Building app workspace (project-aws)...");
25
- const templatesFolderPath = getTemplatesFolderPath();
26
27
  const appWorkspaceFolderPath = app.paths.workspaceFolder.toString();
27
- const appTemplateFolderPath = path.join(templatesFolderPath, "appTemplates", app.name);
28
+ const pulumiBaseTemplatePath = path.join(getPulumiBaseTemplatesFolderPath(), "appTemplates", "base");
29
+ fs.cpSync(pulumiBaseTemplatePath, appWorkspaceFolderPath, {
30
+ recursive: true
31
+ });
32
+ await wait();
33
+ const { env, variant } = sdkParams;
34
+ replaceInPath(path.join(appWorkspaceFolderPath, "/**/*.{ts,js,yaml}"), [
35
+ {
36
+ find: "%{PROJECT_ID}",
37
+ replaceWith: app.name
38
+ },
39
+ {
40
+ find: "%{PROJECT_DESCRIPTION}",
41
+ replaceWith: `Webiny's ${env} app.`
42
+ },
43
+ {
44
+ find: "%{DEPLOY_ENV}",
45
+ replaceWith: env
46
+ },
47
+ {
48
+ find: "%{DEPLOY_VARIANT}",
49
+ replaceWith: variant && "undefined" !== variant ? variant : ""
50
+ }
51
+ ]);
52
+ await wait();
53
+ const appTemplateFolderPath = path.join(getTemplatesFolderPath(), "appTemplates", appName);
28
54
  fs.cpSync(appTemplateFolderPath, appWorkspaceFolderPath, {
29
55
  recursive: true
30
56
  });
@@ -53,7 +79,8 @@ const BuildAppWorkspace = BuildAppWorkspaceService.createDecorator({
53
79
  decorator: BuildAppWorkspaceImpl,
54
80
  dependencies: [
55
81
  GetApp,
56
- LoggerService
82
+ LoggerService,
83
+ ProjectSdkParamsService
57
84
  ]
58
85
  });
59
86
  export { BuildAppWorkspace };
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/ProjectAws/BuildAppWorkspace.js","sources":["../../../src/extensions/ProjectAws/BuildAppWorkspace.ts"],"sourcesContent":["import path from \"path\";\nimport fs from \"fs\";\nimport { replaceInPath } from \"replace-in-path\";\nimport {\n BuildAppWorkspaceService,\n GetApp,\n LoggerService\n} from \"@webiny/project/abstractions/index.js\";\nimport { getTemplatesFolderPath } from \"~/utils/index.js\";\n\nconst wait = () => new Promise(resolve => setTimeout(resolve, 10));\n\nclass BuildAppWorkspaceImpl implements BuildAppWorkspaceService.Interface {\n constructor(\n private getApp: GetApp.Interface,\n private logger: LoggerService.Interface,\n private decoratee: BuildAppWorkspaceService.Interface\n ) {}\n\n async execute(appName: GetApp.AppName, options: BuildAppWorkspaceService.Options = {}) {\n await this.decoratee.execute(appName, options);\n\n const app = this.getApp.execute(appName);\n\n if (app.paths.workspaceFolder.existsSync()) {\n if (options.forceRebuild !== true) {\n this.logger.debug(\n { appName },\n \"App workspace already exists, skipping rebuild (project-aws).\"\n );\n return;\n }\n }\n\n this.logger.info({ appName, options }, \"Building app workspace (project-aws)...\");\n\n const templatesFolderPath = getTemplatesFolderPath();\n const appWorkspaceFolderPath = app.paths.workspaceFolder.toString();\n const appTemplateFolderPath = path.join(templatesFolderPath, \"appTemplates\", app.name);\n\n // Create app.\n fs.cpSync(appTemplateFolderPath, appWorkspaceFolderPath, { recursive: true });\n\n // Copy `public` folder into `admin` app workspace folder.\n if (appName === \"admin\") {\n const publicFolder = path.join(process.cwd(), \"public\");\n fs.cpSync(publicFolder, path.join(appWorkspaceFolderPath, \"public\"), {\n recursive: true\n });\n\n await wait();\n\n const indexTsx = app.paths.workspaceFolder.join(\"src\", \"index.tsx\").toString();\n const globalCssPath = path.join(publicFolder, \"global.css\");\n\n let globalCss = \"\";\n\n if (fs.existsSync(globalCssPath)) {\n const relativePath = path\n .relative(path.dirname(indexTsx), globalCssPath)\n .replace(/\\\\/g, \"/\");\n globalCss = `import \"${relativePath}\";`;\n } else {\n console.log(\"globalCssPath does not exist\");\n }\n\n replaceInPath(indexTsx, {\n find: \"{GLOBAL_CSS}\",\n replaceWith: globalCss\n });\n }\n\n this.logger.info(\"App workspace built successfully (project-aws).\");\n }\n}\n\nexport const BuildAppWorkspace = BuildAppWorkspaceService.createDecorator({\n decorator: BuildAppWorkspaceImpl,\n dependencies: [GetApp, LoggerService]\n});\n"],"names":["wait","Promise","resolve","setTimeout","BuildAppWorkspaceImpl","getApp","logger","decoratee","appName","options","app","templatesFolderPath","getTemplatesFolderPath","appWorkspaceFolderPath","appTemplateFolderPath","path","fs","publicFolder","process","indexTsx","globalCssPath","globalCss","relativePath","console","replaceInPath","BuildAppWorkspace","BuildAppWorkspaceService","GetApp","LoggerService"],"mappings":";;;;;AAUA,MAAMA,OAAO,IAAM,IAAIC,QAAQC,CAAAA,UAAWC,WAAWD,SAAS;AAE9D,MAAME;IACF,YACYC,MAAwB,EACxBC,MAA+B,EAC/BC,SAA6C,CACvD;aAHUF,MAAM,GAANA;aACAC,MAAM,GAANA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,QAAQC,OAAuB,EAAEC,UAA4C,CAAC,CAAC,EAAE;QACnF,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAACD,SAASC;QAEtC,MAAMC,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAACF;QAEhC,IAAIE,IAAI,KAAK,CAAC,eAAe,CAAC,UAAU,IACpC;YAAA,IAAID,AAAyB,SAAzBA,QAAQ,YAAY,EAAW,YAC/B,IAAI,CAAC,MAAM,CAAC,KAAK,CACb;gBAAED;YAAQ,GACV;QAGR;QAGJ,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YAAEA;YAASC;QAAQ,GAAG;QAEvC,MAAME,sBAAsBC;QAC5B,MAAMC,yBAAyBH,IAAI,KAAK,CAAC,eAAe,CAAC,QAAQ;QACjE,MAAMI,wBAAwBC,KAAK,IAAI,CAACJ,qBAAqB,gBAAgBD,IAAI,IAAI;QAGrFM,GAAG,MAAM,CAACF,uBAAuBD,wBAAwB;YAAE,WAAW;QAAK;QAG3E,IAAIL,AAAY,YAAZA,SAAqB;YACrB,MAAMS,eAAeF,KAAK,IAAI,CAACG,QAAQ,GAAG,IAAI;YAC9CF,GAAG,MAAM,CAACC,cAAcF,KAAK,IAAI,CAACF,wBAAwB,WAAW;gBACjE,WAAW;YACf;YAEA,MAAMb;YAEN,MAAMmB,WAAWT,IAAI,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,aAAa,QAAQ;YAC5E,MAAMU,gBAAgBL,KAAK,IAAI,CAACE,cAAc;YAE9C,IAAII,YAAY;YAEhB,IAAIL,GAAG,UAAU,CAACI,gBAAgB;gBAC9B,MAAME,eAAeP,KAAAA,QACR,CAACA,KAAK,OAAO,CAACI,WAAWC,eACjC,OAAO,CAAC,OAAO;gBACpBC,YAAY,CAAC,QAAQ,EAAEC,aAAa,EAAE,CAAC;YAC3C,OACIC,QAAQ,GAAG,CAAC;YAGhBC,cAAcL,UAAU;gBACpB,MAAM;gBACN,aAAaE;YACjB;QACJ;QAEA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IACrB;AACJ;AAEO,MAAMI,oBAAoBC,yBAAyB,eAAe,CAAC;IACtE,WAAWtB;IACX,cAAc;QAACuB;QAAQC;KAAc;AACzC"}
1
+ {"version":3,"file":"extensions/ProjectAws/BuildAppWorkspace.js","sources":["../../../src/extensions/ProjectAws/BuildAppWorkspace.ts"],"sourcesContent":["import path from \"path\";\nimport fs from \"fs\";\nimport { replaceInPath } from \"replace-in-path\";\nimport {\n BuildAppWorkspaceService,\n GetApp,\n LoggerService,\n ProjectSdkParamsService\n} from \"@webiny/project/abstractions/index.js\";\nimport { getTemplatesFolderPath, getPulumiBaseTemplatesFolderPath } from \"~/utils/index.js\";\n\nconst wait = () => new Promise(resolve => setTimeout(resolve, 10));\n\nclass BuildAppWorkspaceImpl implements BuildAppWorkspaceService.Interface {\n constructor(\n private getApp: GetApp.Interface,\n private logger: LoggerService.Interface,\n private projectSdkParamsService: ProjectSdkParamsService.Interface,\n private decoratee: BuildAppWorkspaceService.Interface\n ) {}\n\n async execute(appName: GetApp.AppName, options: BuildAppWorkspaceService.Options = {}) {\n const sdkParams = this.projectSdkParamsService.get();\n\n if (!sdkParams.env) {\n throw new Error(`Please specify environment, for example \"dev\".`);\n }\n\n // Base service creates/clears the workspace directory.\n await this.decoratee.execute(appName, options);\n\n const app = this.getApp.execute(appName);\n\n const pulumiYamlExists = fs.existsSync(\n path.join(app.paths.workspaceFolder.toString(), \"Pulumi.yaml\")\n );\n\n if (pulumiYamlExists && options.forceRebuild !== true) {\n this.logger.debug(\n { appName },\n \"App workspace already exists, skipping rebuild (project-aws).\"\n );\n return;\n }\n\n this.logger.info({ appName, options }, \"Building app workspace (project-aws)...\");\n\n const appWorkspaceFolderPath = app.paths.workspaceFolder.toString();\n\n // Copy Pulumi scaffolding (Pulumi.yaml, pulumi/index.js).\n const pulumiBaseTemplatePath = path.join(\n getPulumiBaseTemplatesFolderPath(),\n \"appTemplates\",\n \"base\"\n );\n fs.cpSync(pulumiBaseTemplatePath, appWorkspaceFolderPath, { recursive: true });\n\n await wait();\n\n // Replace Pulumi-specific placeholders.\n const { env, variant } = sdkParams;\n replaceInPath(path.join(appWorkspaceFolderPath, \"/**/*.{ts,js,yaml}\"), [\n { find: \"%{PROJECT_ID}\", replaceWith: app.name },\n { find: \"%{PROJECT_DESCRIPTION}\", replaceWith: `Webiny's ${env} app.` },\n { find: \"%{DEPLOY_ENV}\", replaceWith: env },\n {\n find: \"%{DEPLOY_VARIANT}\",\n replaceWith: !variant || variant === \"undefined\" ? \"\" : variant\n }\n ]);\n\n await wait();\n\n // Copy app source templates (graphql/, admin src/, etc.).\n const appTemplateFolderPath = path.join(getTemplatesFolderPath(), \"appTemplates\", appName);\n fs.cpSync(appTemplateFolderPath, appWorkspaceFolderPath, { recursive: true });\n\n // Copy `public` folder into `admin` app workspace folder.\n if (appName === \"admin\") {\n const publicFolder = path.join(process.cwd(), \"public\");\n fs.cpSync(publicFolder, path.join(appWorkspaceFolderPath, \"public\"), {\n recursive: true\n });\n\n await wait();\n\n const indexTsx = app.paths.workspaceFolder.join(\"src\", \"index.tsx\").toString();\n const globalCssPath = path.join(publicFolder, \"global.css\");\n\n let globalCss = \"\";\n\n if (fs.existsSync(globalCssPath)) {\n const relativePath = path\n .relative(path.dirname(indexTsx), globalCssPath)\n .replace(/\\\\/g, \"/\");\n globalCss = `import \"${relativePath}\";`;\n } else {\n console.log(\"globalCssPath does not exist\");\n }\n\n replaceInPath(indexTsx, {\n find: \"{GLOBAL_CSS}\",\n replaceWith: globalCss\n });\n }\n\n this.logger.info(\"App workspace built successfully (project-aws).\");\n }\n}\n\nexport const BuildAppWorkspace = BuildAppWorkspaceService.createDecorator({\n decorator: BuildAppWorkspaceImpl,\n dependencies: [GetApp, LoggerService, ProjectSdkParamsService]\n});\n"],"names":["wait","Promise","resolve","setTimeout","BuildAppWorkspaceImpl","getApp","logger","projectSdkParamsService","decoratee","appName","options","sdkParams","Error","app","pulumiYamlExists","fs","path","appWorkspaceFolderPath","pulumiBaseTemplatePath","getPulumiBaseTemplatesFolderPath","env","variant","replaceInPath","appTemplateFolderPath","getTemplatesFolderPath","publicFolder","process","indexTsx","globalCssPath","globalCss","relativePath","console","BuildAppWorkspace","BuildAppWorkspaceService","GetApp","LoggerService","ProjectSdkParamsService"],"mappings":";;;;;AAWA,MAAMA,OAAO,IAAM,IAAIC,QAAQC,CAAAA,UAAWC,WAAWD,SAAS;AAE9D,MAAME;IACF,YACYC,MAAwB,EACxBC,MAA+B,EAC/BC,uBAA0D,EAC1DC,SAA6C,CACvD;aAJUH,MAAM,GAANA;aACAC,MAAM,GAANA;aACAC,uBAAuB,GAAvBA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,QAAQC,OAAuB,EAAEC,UAA4C,CAAC,CAAC,EAAE;QACnF,MAAMC,YAAY,IAAI,CAAC,uBAAuB,CAAC,GAAG;QAElD,IAAI,CAACA,UAAU,GAAG,EACd,MAAM,IAAIC,MAAM;QAIpB,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO,CAACH,SAASC;QAEtC,MAAMG,MAAM,IAAI,CAAC,MAAM,CAAC,OAAO,CAACJ;QAEhC,MAAMK,mBAAmBC,GAAG,UAAU,CAClCC,KAAK,IAAI,CAACH,IAAI,KAAK,CAAC,eAAe,CAAC,QAAQ,IAAI;QAGpD,IAAIC,oBAAoBJ,AAAyB,SAAzBA,QAAQ,YAAY,EAAW,YACnD,IAAI,CAAC,MAAM,CAAC,KAAK,CACb;YAAED;QAAQ,GACV;QAKR,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;YAAEA;YAASC;QAAQ,GAAG;QAEvC,MAAMO,yBAAyBJ,IAAI,KAAK,CAAC,eAAe,CAAC,QAAQ;QAGjE,MAAMK,yBAAyBF,KAAK,IAAI,CACpCG,oCACA,gBACA;QAEJJ,GAAG,MAAM,CAACG,wBAAwBD,wBAAwB;YAAE,WAAW;QAAK;QAE5E,MAAMjB;QAGN,MAAM,EAAEoB,GAAG,EAAEC,OAAO,EAAE,GAAGV;QACzBW,cAAcN,KAAK,IAAI,CAACC,wBAAwB,uBAAuB;YACnE;gBAAE,MAAM;gBAAiB,aAAaJ,IAAI,IAAI;YAAC;YAC/C;gBAAE,MAAM;gBAA0B,aAAa,CAAC,SAAS,EAAEO,IAAI,KAAK,CAAC;YAAC;YACtE;gBAAE,MAAM;gBAAiB,aAAaA;YAAI;YAC1C;gBACI,MAAM;gBACN,aAAa,AAACC,WAAWA,AAAY,gBAAZA,UAA+BA,UAAL;YACvD;SACH;QAED,MAAMrB;QAGN,MAAMuB,wBAAwBP,KAAK,IAAI,CAACQ,0BAA0B,gBAAgBf;QAClFM,GAAG,MAAM,CAACQ,uBAAuBN,wBAAwB;YAAE,WAAW;QAAK;QAG3E,IAAIR,AAAY,YAAZA,SAAqB;YACrB,MAAMgB,eAAeT,KAAK,IAAI,CAACU,QAAQ,GAAG,IAAI;YAC9CX,GAAG,MAAM,CAACU,cAAcT,KAAK,IAAI,CAACC,wBAAwB,WAAW;gBACjE,WAAW;YACf;YAEA,MAAMjB;YAEN,MAAM2B,WAAWd,IAAI,KAAK,CAAC,eAAe,CAAC,IAAI,CAAC,OAAO,aAAa,QAAQ;YAC5E,MAAMe,gBAAgBZ,KAAK,IAAI,CAACS,cAAc;YAE9C,IAAII,YAAY;YAEhB,IAAId,GAAG,UAAU,CAACa,gBAAgB;gBAC9B,MAAME,eAAed,KAAAA,QACR,CAACA,KAAK,OAAO,CAACW,WAAWC,eACjC,OAAO,CAAC,OAAO;gBACpBC,YAAY,CAAC,QAAQ,EAAEC,aAAa,EAAE,CAAC;YAC3C,OACIC,QAAQ,GAAG,CAAC;YAGhBT,cAAcK,UAAU;gBACpB,MAAM;gBACN,aAAaE;YACjB;QACJ;QAEA,IAAI,CAAC,MAAM,CAAC,IAAI,CAAC;IACrB;AACJ;AAEO,MAAMG,oBAAoBC,yBAAyB,eAAe,CAAC;IACtE,WAAW7B;IACX,cAAc;QAAC8B;QAAQC;QAAeC;KAAwB;AAClE"}
@@ -0,0 +1,12 @@
1
+ import { BuildProjectWorkspaceService, GetProjectService, LoggerService } from "@webiny/project/abstractions/index.js";
2
+ declare class BuildProjectWorkspaceImpl implements BuildProjectWorkspaceService.Interface {
3
+ private getProjectService;
4
+ private logger;
5
+ private decoratee;
6
+ constructor(getProjectService: GetProjectService.Interface, logger: LoggerService.Interface, decoratee: BuildProjectWorkspaceService.Interface);
7
+ execute(): Promise<void>;
8
+ }
9
+ export declare const BuildProjectWorkspace: typeof BuildProjectWorkspaceImpl & {
10
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/project/abstractions/services/BuildProjectWorkspaceService").IBuildProjectWorkspaceService>;
11
+ };
12
+ export {};
@@ -0,0 +1,30 @@
1
+ import path from "path";
2
+ import fs from "fs";
3
+ import { BuildProjectWorkspaceService, GetProjectService, LoggerService } from "@webiny/project/abstractions/index.js";
4
+ import { getPulumiBaseTemplatesFolderPath } from "../../utils/index.js";
5
+ class BuildProjectWorkspaceImpl {
6
+ constructor(getProjectService, logger, decoratee){
7
+ this.getProjectService = getProjectService;
8
+ this.logger = logger;
9
+ this.decoratee = decoratee;
10
+ }
11
+ async execute() {
12
+ await this.decoratee.execute();
13
+ this.logger.trace("Copying webiny.config.base.tsx (project-aws)...");
14
+ const templatesFolderPath = getPulumiBaseTemplatesFolderPath();
15
+ const webinyConfigBaseTemplatePath = path.join(templatesFolderPath, "webiny.config.base.tsx");
16
+ const project = this.getProjectService.execute();
17
+ const dest = project.paths.webinyConfigBaseFile.toString();
18
+ fs.cpSync(webinyConfigBaseTemplatePath, dest);
19
+ }
20
+ }
21
+ const BuildProjectWorkspace = BuildProjectWorkspaceService.createDecorator({
22
+ decorator: BuildProjectWorkspaceImpl,
23
+ dependencies: [
24
+ GetProjectService,
25
+ LoggerService
26
+ ]
27
+ });
28
+ export { BuildProjectWorkspace };
29
+
30
+ //# sourceMappingURL=BuildProjectWorkspace.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions/ProjectAws/BuildProjectWorkspace.js","sources":["../../../src/extensions/ProjectAws/BuildProjectWorkspace.ts"],"sourcesContent":["import path from \"path\";\nimport fs from \"fs\";\nimport {\n BuildProjectWorkspaceService,\n GetProjectService,\n LoggerService\n} from \"@webiny/project/abstractions/index.js\";\nimport { getPulumiBaseTemplatesFolderPath } from \"~/utils/index.js\";\n\nclass BuildProjectWorkspaceImpl implements BuildProjectWorkspaceService.Interface {\n constructor(\n private getProjectService: GetProjectService.Interface,\n private logger: LoggerService.Interface,\n private decoratee: BuildProjectWorkspaceService.Interface\n ) {}\n\n async execute() {\n await this.decoratee.execute();\n\n this.logger.trace(\"Copying webiny.config.base.tsx (project-aws)...\");\n\n const templatesFolderPath = getPulumiBaseTemplatesFolderPath();\n const webinyConfigBaseTemplatePath = path.join(\n templatesFolderPath,\n \"webiny.config.base.tsx\"\n );\n\n const project = this.getProjectService.execute();\n const dest = project.paths.webinyConfigBaseFile.toString();\n\n fs.cpSync(webinyConfigBaseTemplatePath, dest);\n }\n}\n\nexport const BuildProjectWorkspace = BuildProjectWorkspaceService.createDecorator({\n decorator: BuildProjectWorkspaceImpl,\n dependencies: [GetProjectService, LoggerService]\n});\n"],"names":["BuildProjectWorkspaceImpl","getProjectService","logger","decoratee","templatesFolderPath","getPulumiBaseTemplatesFolderPath","webinyConfigBaseTemplatePath","path","project","dest","fs","BuildProjectWorkspace","BuildProjectWorkspaceService","GetProjectService","LoggerService"],"mappings":";;;;AASA,MAAMA;IACF,YACYC,iBAA8C,EAC9CC,MAA+B,EAC/BC,SAAiD,CAC3D;aAHUF,iBAAiB,GAAjBA;aACAC,MAAM,GAANA;aACAC,SAAS,GAATA;IACT;IAEH,MAAM,UAAU;QACZ,MAAM,IAAI,CAAC,SAAS,CAAC,OAAO;QAE5B,IAAI,CAAC,MAAM,CAAC,KAAK,CAAC;QAElB,MAAMC,sBAAsBC;QAC5B,MAAMC,+BAA+BC,KAAK,IAAI,CAC1CH,qBACA;QAGJ,MAAMI,UAAU,IAAI,CAAC,iBAAiB,CAAC,OAAO;QAC9C,MAAMC,OAAOD,QAAQ,KAAK,CAAC,oBAAoB,CAAC,QAAQ;QAExDE,GAAG,MAAM,CAACJ,8BAA8BG;IAC5C;AACJ;AAEO,MAAME,wBAAwBC,6BAA6B,eAAe,CAAC;IAC9E,WAAWZ;IACX,cAAc;QAACa;QAAmBC;KAAc;AACpD"}
@@ -0,0 +1,11 @@
1
+ import { AdminBeforeBuild, GetAppStackOutput, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
2
+ declare class EnsureApiDeployedBeforeAdminBuildImpl implements AdminBeforeBuild.Interface {
3
+ private getAppStackOutput;
4
+ private projectSdkParamsService;
5
+ constructor(getAppStackOutput: GetAppStackOutput.Interface, projectSdkParamsService: ProjectSdkParamsService.Interface);
6
+ execute(params: AdminBeforeBuild.Params): Promise<void>;
7
+ }
8
+ export declare const EnsureApiDeployedBeforeAdminBuild: typeof EnsureApiDeployedBeforeAdminBuildImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/project/abstractions/features").IAdminBeforeBuild>;
10
+ };
11
+ export {};
@@ -0,0 +1,30 @@
1
+ import { AdminBeforeBuild, GetAppStackOutput, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
2
+ import { GracefulError } from "@webiny/project";
3
+ const NO_DEPLOYMENT_CHECKS_FLAG_NAME = "--no-deployment-checks";
4
+ class EnsureApiDeployedBeforeAdminBuildImpl {
5
+ constructor(getAppStackOutput, projectSdkParamsService){
6
+ this.getAppStackOutput = getAppStackOutput;
7
+ this.projectSdkParamsService = projectSdkParamsService;
8
+ }
9
+ async execute(params) {
10
+ if (false === params.deploymentChecks) return;
11
+ const output = await this.getAppStackOutput.execute("api");
12
+ const apiDeployed = output && Object.keys(output).length > 0;
13
+ if (apiDeployed) return;
14
+ const sdkParams = this.projectSdkParamsService.get();
15
+ const cmd = `yarn webiny deploy api --env ${sdkParams.env}`;
16
+ const error = new Error("Cannot build Admin before deploying API.");
17
+ const message = "Before building %s, please build %s first by running: %s. If you think this is a mistake, you can also try skipping deployment checks by appending the %s flag. Learn more: https://webiny.link/deployment-checks";
18
+ throw GracefulError.from(error, message, "Admin", "API", cmd, NO_DEPLOYMENT_CHECKS_FLAG_NAME);
19
+ }
20
+ }
21
+ const EnsureApiDeployedBeforeAdminBuild = AdminBeforeBuild.createImplementation({
22
+ implementation: EnsureApiDeployedBeforeAdminBuildImpl,
23
+ dependencies: [
24
+ GetAppStackOutput,
25
+ ProjectSdkParamsService
26
+ ]
27
+ });
28
+ export { EnsureApiDeployedBeforeAdminBuild };
29
+
30
+ //# sourceMappingURL=EnsureApiDeployedBeforeAdminBuild.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.js","sources":["../../../src/extensions/ProjectAws/EnsureApiDeployedBeforeAdminBuild.ts"],"sourcesContent":["import {\n AdminBeforeBuild,\n GetAppStackOutput,\n ProjectSdkParamsService\n} from \"@webiny/project/abstractions/index.js\";\nimport { GracefulError } from \"@webiny/project\";\n\nconst NO_DEPLOYMENT_CHECKS_FLAG_NAME = \"--no-deployment-checks\";\n\nclass EnsureApiDeployedBeforeAdminBuildImpl implements AdminBeforeBuild.Interface {\n constructor(\n private getAppStackOutput: GetAppStackOutput.Interface,\n private projectSdkParamsService: ProjectSdkParamsService.Interface\n ) {}\n\n async execute(params: AdminBeforeBuild.Params) {\n // Just in case, we want to allow users to skip the system requirements check.\n if (params.deploymentChecks === false) {\n return;\n }\n\n const output = await this.getAppStackOutput.execute(\"api\");\n const apiDeployed = output && Object.keys(output).length > 0;\n if (apiDeployed) {\n return;\n }\n\n const sdkParams = this.projectSdkParamsService.get();\n const cmd = `yarn webiny deploy api --env ${sdkParams.env}`;\n\n const error = new Error(\"Cannot build Admin before deploying API.\");\n const message = [\n `Before building %s, please build %s first by running: %s.`,\n `If you think this is a mistake, you can also try skipping`,\n `deployment checks by appending the %s flag.`,\n `Learn more: https://webiny.link/deployment-checks`\n ].join(\" \");\n\n throw GracefulError.from(\n error,\n message,\n \"Admin\",\n \"API\",\n cmd,\n NO_DEPLOYMENT_CHECKS_FLAG_NAME\n );\n }\n}\n\nexport const EnsureApiDeployedBeforeAdminBuild = AdminBeforeBuild.createImplementation({\n implementation: EnsureApiDeployedBeforeAdminBuildImpl,\n dependencies: [GetAppStackOutput, ProjectSdkParamsService]\n});\n"],"names":["NO_DEPLOYMENT_CHECKS_FLAG_NAME","EnsureApiDeployedBeforeAdminBuildImpl","getAppStackOutput","projectSdkParamsService","params","output","apiDeployed","Object","sdkParams","cmd","error","Error","message","GracefulError","EnsureApiDeployedBeforeAdminBuild","AdminBeforeBuild","GetAppStackOutput","ProjectSdkParamsService"],"mappings":";;AAOA,MAAMA,iCAAiC;AAEvC,MAAMC;IACF,YACYC,iBAA8C,EAC9CC,uBAA0D,CACpE;aAFUD,iBAAiB,GAAjBA;aACAC,uBAAuB,GAAvBA;IACT;IAEH,MAAM,QAAQC,MAA+B,EAAE;QAE3C,IAAIA,AAA4B,UAA5BA,OAAO,gBAAgB,EACvB;QAGJ,MAAMC,SAAS,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;QACpD,MAAMC,cAAcD,UAAUE,OAAO,IAAI,CAACF,QAAQ,MAAM,GAAG;QAC3D,IAAIC,aACA;QAGJ,MAAME,YAAY,IAAI,CAAC,uBAAuB,CAAC,GAAG;QAClD,MAAMC,MAAM,CAAC,6BAA6B,EAAED,UAAU,GAAG,EAAE;QAE3D,MAAME,QAAQ,IAAIC,MAAM;QACxB,MAAMC,UAAU;QAOhB,MAAMC,cAAc,IAAI,CACpBH,OACAE,SACA,SACA,OACAH,KACAT;IAER;AACJ;AAEO,MAAMc,oCAAoCC,iBAAiB,oBAAoB,CAAC;IACnF,gBAAgBd;IAChB,cAAc;QAACe;QAAmBC;KAAwB;AAC9D"}
@@ -0,0 +1,11 @@
1
+ import { AdminBeforeWatch, GetAppStackOutput, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
2
+ declare class EnsureApiDeployedBeforeAdminWatchImpl implements AdminBeforeWatch.Interface {
3
+ private getAppStackOutput;
4
+ private projectSdkParamsService;
5
+ constructor(getAppStackOutput: GetAppStackOutput.Interface, projectSdkParamsService: ProjectSdkParamsService.Interface);
6
+ execute(params: AdminBeforeWatch.Params): Promise<void>;
7
+ }
8
+ export declare const EnsureApiDeployedBeforeAdminWatch: typeof EnsureApiDeployedBeforeAdminWatchImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/project/abstractions/features").IAdminBeforeWatch>;
10
+ };
11
+ export {};
@@ -0,0 +1,30 @@
1
+ import { AdminBeforeWatch, GetAppStackOutput, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
2
+ import { GracefulError } from "@webiny/project";
3
+ const NO_DEPLOYMENT_CHECKS_FLAG_NAME = "--no-deployment-checks";
4
+ class EnsureApiDeployedBeforeAdminWatchImpl {
5
+ constructor(getAppStackOutput, projectSdkParamsService){
6
+ this.getAppStackOutput = getAppStackOutput;
7
+ this.projectSdkParamsService = projectSdkParamsService;
8
+ }
9
+ async execute(params) {
10
+ if (false === params.deploymentChecks) return;
11
+ const output = await this.getAppStackOutput.execute("api");
12
+ const apiDeployed = output && Object.keys(output).length > 0;
13
+ if (apiDeployed) return;
14
+ const sdkParams = this.projectSdkParamsService.get();
15
+ const cmd = `yarn webiny deploy api --env ${sdkParams.env}`;
16
+ const error = new Error("Cannot watch Admin before deploying API.");
17
+ const message = "Before watching %s, please build %s first by running: %s. If you think this is a mistake, you can also try skipping deployment checks by appending the %s flag. Learn more: https://webiny.link/deployment-checks";
18
+ throw GracefulError.from(error, message, "Admin", "API", cmd, NO_DEPLOYMENT_CHECKS_FLAG_NAME);
19
+ }
20
+ }
21
+ const EnsureApiDeployedBeforeAdminWatch = AdminBeforeWatch.createImplementation({
22
+ implementation: EnsureApiDeployedBeforeAdminWatchImpl,
23
+ dependencies: [
24
+ GetAppStackOutput,
25
+ ProjectSdkParamsService
26
+ ]
27
+ });
28
+ export { EnsureApiDeployedBeforeAdminWatch };
29
+
30
+ //# sourceMappingURL=EnsureApiDeployedBeforeAdminWatch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.js","sources":["../../../src/extensions/ProjectAws/EnsureApiDeployedBeforeAdminWatch.ts"],"sourcesContent":["import {\n AdminBeforeWatch,\n GetAppStackOutput,\n ProjectSdkParamsService\n} from \"@webiny/project/abstractions/index.js\";\nimport { GracefulError } from \"@webiny/project\";\n\nconst NO_DEPLOYMENT_CHECKS_FLAG_NAME = \"--no-deployment-checks\";\n\nclass EnsureApiDeployedBeforeAdminWatchImpl implements AdminBeforeWatch.Interface {\n constructor(\n private getAppStackOutput: GetAppStackOutput.Interface,\n private projectSdkParamsService: ProjectSdkParamsService.Interface\n ) {}\n\n async execute(params: AdminBeforeWatch.Params) {\n // Just in case, we want to allow users to skip the system requirements check.\n if (params.deploymentChecks === false) {\n return;\n }\n\n const output = await this.getAppStackOutput.execute(\"api\");\n const apiDeployed = output && Object.keys(output).length > 0;\n if (apiDeployed) {\n return;\n }\n\n const sdkParams = this.projectSdkParamsService.get();\n const cmd = `yarn webiny deploy api --env ${sdkParams.env}`;\n\n const error = new Error(`Cannot watch Admin before deploying API.`);\n const message = [\n `Before watching %s, please build %s first by running: %s.`,\n `If you think this is a mistake, you can also try skipping`,\n `deployment checks by appending the %s flag.`,\n `Learn more: https://webiny.link/deployment-checks`\n ].join(\" \");\n\n throw GracefulError.from(\n error,\n message,\n \"Admin\",\n \"API\",\n cmd,\n NO_DEPLOYMENT_CHECKS_FLAG_NAME\n );\n }\n}\n\nexport const EnsureApiDeployedBeforeAdminWatch = AdminBeforeWatch.createImplementation({\n implementation: EnsureApiDeployedBeforeAdminWatchImpl,\n dependencies: [GetAppStackOutput, ProjectSdkParamsService]\n});\n"],"names":["NO_DEPLOYMENT_CHECKS_FLAG_NAME","EnsureApiDeployedBeforeAdminWatchImpl","getAppStackOutput","projectSdkParamsService","params","output","apiDeployed","Object","sdkParams","cmd","error","Error","message","GracefulError","EnsureApiDeployedBeforeAdminWatch","AdminBeforeWatch","GetAppStackOutput","ProjectSdkParamsService"],"mappings":";;AAOA,MAAMA,iCAAiC;AAEvC,MAAMC;IACF,YACYC,iBAA8C,EAC9CC,uBAA0D,CACpE;aAFUD,iBAAiB,GAAjBA;aACAC,uBAAuB,GAAvBA;IACT;IAEH,MAAM,QAAQC,MAA+B,EAAE;QAE3C,IAAIA,AAA4B,UAA5BA,OAAO,gBAAgB,EACvB;QAGJ,MAAMC,SAAS,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;QACpD,MAAMC,cAAcD,UAAUE,OAAO,IAAI,CAACF,QAAQ,MAAM,GAAG;QAC3D,IAAIC,aACA;QAGJ,MAAME,YAAY,IAAI,CAAC,uBAAuB,CAAC,GAAG;QAClD,MAAMC,MAAM,CAAC,6BAA6B,EAAED,UAAU,GAAG,EAAE;QAE3D,MAAME,QAAQ,IAAIC,MAAM;QACxB,MAAMC,UAAU;QAOhB,MAAMC,cAAc,IAAI,CACpBH,OACAE,SACA,SACA,OACAH,KACAT;IAER;AACJ;AAEO,MAAMc,oCAAoCC,iBAAiB,oBAAoB,CAAC;IACnF,gBAAgBd;IAChB,cAAc;QAACe;QAAmBC;KAAwB;AAC9D"}
@@ -0,0 +1,11 @@
1
+ import { ApiBeforeWatch, GetAppStackOutput, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
2
+ declare class EnsureApiDeployedBeforeWatchImpl implements ApiBeforeWatch.Interface {
3
+ private getAppStackOutput;
4
+ private projectSdkParamsService;
5
+ constructor(getAppStackOutput: GetAppStackOutput.Interface, projectSdkParamsService: ProjectSdkParamsService.Interface);
6
+ execute(params: ApiBeforeWatch.Params): Promise<void>;
7
+ }
8
+ export declare const EnsureApiDeployedBeforeWatch: typeof EnsureApiDeployedBeforeWatchImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/project/abstractions/features").IApiBeforeWatch>;
10
+ };
11
+ export {};
@@ -0,0 +1,30 @@
1
+ import { ApiBeforeWatch, GetAppStackOutput, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
2
+ import { GracefulError } from "@webiny/project";
3
+ const NO_DEPLOYMENT_CHECKS_FLAG_NAME = "--no-deployment-checks";
4
+ class EnsureApiDeployedBeforeWatchImpl {
5
+ constructor(getAppStackOutput, projectSdkParamsService){
6
+ this.getAppStackOutput = getAppStackOutput;
7
+ this.projectSdkParamsService = projectSdkParamsService;
8
+ }
9
+ async execute(params) {
10
+ if (false === params.deploymentChecks) return;
11
+ const output = await this.getAppStackOutput.execute("api");
12
+ const apiDeployed = output && Object.keys(output).length > 0;
13
+ if (apiDeployed) return;
14
+ const error = new Error("Cannot watch API before deploying it.");
15
+ const sdkParams = this.projectSdkParamsService.get();
16
+ const cmd = `yarn webiny deploy api --env ${sdkParams.env}`;
17
+ const message = "Before watching %s, please deploy it first by running: %s. If you think this is a mistake, you can also try skipping deployment checks by appending the %s flag. Learn more: https://webiny.link/deployment-checks";
18
+ throw GracefulError.from(error, message, "API", cmd, NO_DEPLOYMENT_CHECKS_FLAG_NAME);
19
+ }
20
+ }
21
+ const EnsureApiDeployedBeforeWatch = ApiBeforeWatch.createImplementation({
22
+ implementation: EnsureApiDeployedBeforeWatchImpl,
23
+ dependencies: [
24
+ GetAppStackOutput,
25
+ ProjectSdkParamsService
26
+ ]
27
+ });
28
+ export { EnsureApiDeployedBeforeWatch };
29
+
30
+ //# sourceMappingURL=EnsureApiDeployedBeforeWatch.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions/ProjectAws/EnsureApiDeployedBeforeWatch.js","sources":["../../../src/extensions/ProjectAws/EnsureApiDeployedBeforeWatch.ts"],"sourcesContent":["import {\n ApiBeforeWatch,\n GetAppStackOutput,\n ProjectSdkParamsService\n} from \"@webiny/project/abstractions/index.js\";\nimport { GracefulError } from \"@webiny/project\";\n\nconst NO_DEPLOYMENT_CHECKS_FLAG_NAME = \"--no-deployment-checks\";\n\nclass EnsureApiDeployedBeforeWatchImpl implements ApiBeforeWatch.Interface {\n constructor(\n private getAppStackOutput: GetAppStackOutput.Interface,\n private projectSdkParamsService: ProjectSdkParamsService.Interface\n ) {}\n\n async execute(params: ApiBeforeWatch.Params) {\n // Just in case, we want to allow users to skip the system requirements check.\n if (params.deploymentChecks === false) {\n return;\n }\n\n const output = await this.getAppStackOutput.execute(\"api\");\n const apiDeployed = output && Object.keys(output).length > 0;\n if (apiDeployed) {\n return;\n }\n\n const error = new Error(`Cannot watch API before deploying it.`);\n const sdkParams = this.projectSdkParamsService.get();\n const cmd = `yarn webiny deploy api --env ${sdkParams.env}`;\n\n const message = [\n `Before watching %s, please deploy it first by running: %s.`,\n `If you think this is a mistake, you can also try skipping`,\n `deployment checks by appending the %s flag.`,\n `Learn more: https://webiny.link/deployment-checks`\n ].join(\" \");\n\n throw GracefulError.from(error, message, \"API\", cmd, NO_DEPLOYMENT_CHECKS_FLAG_NAME);\n }\n}\n\nexport const EnsureApiDeployedBeforeWatch = ApiBeforeWatch.createImplementation({\n implementation: EnsureApiDeployedBeforeWatchImpl,\n dependencies: [GetAppStackOutput, ProjectSdkParamsService]\n});\n"],"names":["NO_DEPLOYMENT_CHECKS_FLAG_NAME","EnsureApiDeployedBeforeWatchImpl","getAppStackOutput","projectSdkParamsService","params","output","apiDeployed","Object","error","Error","sdkParams","cmd","message","GracefulError","EnsureApiDeployedBeforeWatch","ApiBeforeWatch","GetAppStackOutput","ProjectSdkParamsService"],"mappings":";;AAOA,MAAMA,iCAAiC;AAEvC,MAAMC;IACF,YACYC,iBAA8C,EAC9CC,uBAA0D,CACpE;aAFUD,iBAAiB,GAAjBA;aACAC,uBAAuB,GAAvBA;IACT;IAEH,MAAM,QAAQC,MAA6B,EAAE;QAEzC,IAAIA,AAA4B,UAA5BA,OAAO,gBAAgB,EACvB;QAGJ,MAAMC,SAAS,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;QACpD,MAAMC,cAAcD,UAAUE,OAAO,IAAI,CAACF,QAAQ,MAAM,GAAG;QAC3D,IAAIC,aACA;QAGJ,MAAME,QAAQ,IAAIC,MAAM;QACxB,MAAMC,YAAY,IAAI,CAAC,uBAAuB,CAAC,GAAG;QAClD,MAAMC,MAAM,CAAC,6BAA6B,EAAED,UAAU,GAAG,EAAE;QAE3D,MAAME,UAAU;QAOhB,MAAMC,cAAc,IAAI,CAACL,OAAOI,SAAS,OAAOD,KAAKX;IACzD;AACJ;AAEO,MAAMc,+BAA+BC,eAAe,oBAAoB,CAAC;IAC5E,gBAAgBd;IAChB,cAAc;QAACe;QAAmBC;KAAwB;AAC9D"}
@@ -1,6 +1,6 @@
1
1
  import { BeforeDeploy, LoggerService } from "@webiny/project/abstractions/index.js";
2
2
  import { GracefulError } from "@webiny/project";
3
- import { STS } from "@webiny/aws-sdk/client-sts";
3
+ import { STS } from "@webiny/aws-sdk/client-sts/index.js";
4
4
  class EnsureAwsCredentialsBeforeDeployImpl {
5
5
  constructor(loggerService){
6
6
  this.loggerService = loggerService;
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js","sources":["../../../src/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.ts"],"sourcesContent":["import { BeforeDeploy, LoggerService } from \"@webiny/project/abstractions/index.js\";\nimport { GracefulError } from \"@webiny/project\";\nimport { STS } from \"@webiny/aws-sdk/client-sts\";\n\nclass EnsureAwsCredentialsBeforeDeployImpl implements BeforeDeploy.Interface {\n constructor(private loggerService: LoggerService.Interface) {}\n\n async execute() {\n process.env.AWS_SDK_LOAD_CONFIG = \"true\";\n const sts = new STS({});\n\n try {\n await sts.getCallerIdentity({});\n } catch (err) {\n this.loggerService.debug({ err }, \"AWS credentials error.\");\n throw GracefulError.from(\n new Error(\"AWS credentials are not configured correctly.\"),\n 'No valid AWS credentials were found. Run \"aws configure\" or set the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables before deploying. Learn more: https://webiny.link/aws-credentials'\n );\n }\n\n const region = await sts.config.region();\n if (!region) {\n throw GracefulError.from(\n new Error(\"AWS region is not defined.\"),\n \"No AWS region is set. Define the AWS_REGION environment variable or set a default region in your AWS profile. Learn more: https://webiny.link/aws-region\"\n );\n }\n\n process.env.AWS_REGION = region;\n\n const { accessKeyId } = await sts.config.credentials();\n const profile = process.env.AWS_PROFILE;\n\n if (profile) {\n this.loggerService.info(`Using profile \"${profile}\" in \"${region}\" region.`);\n } else {\n this.loggerService.info(`Using access key ID \"${accessKeyId}\" in \"${region}\" region.`);\n }\n }\n}\n\nexport const EnsureAwsCredentialsBeforeDeploy = BeforeDeploy.createImplementation({\n implementation: EnsureAwsCredentialsBeforeDeployImpl,\n dependencies: [LoggerService]\n});\n"],"names":["EnsureAwsCredentialsBeforeDeployImpl","loggerService","process","sts","STS","err","GracefulError","Error","region","accessKeyId","profile","EnsureAwsCredentialsBeforeDeploy","BeforeDeploy","LoggerService"],"mappings":";;;AAIA,MAAMA;IACF,YAAoBC,aAAsC,CAAE;aAAxCA,aAAa,GAAbA;IAAyC;IAE7D,MAAM,UAAU;QACZC,QAAQ,GAAG,CAAC,mBAAmB,GAAG;QAClC,MAAMC,MAAM,IAAIC,IAAI,CAAC;QAErB,IAAI;YACA,MAAMD,IAAI,iBAAiB,CAAC,CAAC;QACjC,EAAE,OAAOE,KAAK;YACV,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;gBAAEA;YAAI,GAAG;YAClC,MAAMC,cAAc,IAAI,CACpB,IAAIC,MAAM,kDACV;QAER;QAEA,MAAMC,SAAS,MAAML,IAAI,MAAM,CAAC,MAAM;QACtC,IAAI,CAACK,QACD,MAAMF,cAAc,IAAI,CACpB,IAAIC,MAAM,+BACV;QAIRL,QAAQ,GAAG,CAAC,UAAU,GAAGM;QAEzB,MAAM,EAAEC,WAAW,EAAE,GAAG,MAAMN,IAAI,MAAM,CAAC,WAAW;QACpD,MAAMO,UAAUR,QAAQ,GAAG,CAAC,WAAW;QAEvC,IAAIQ,SACA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,eAAe,EAAEA,QAAQ,MAAM,EAAEF,OAAO,SAAS,CAAC;aAE3E,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,qBAAqB,EAAEC,YAAY,MAAM,EAAED,OAAO,SAAS,CAAC;IAE7F;AACJ;AAEO,MAAMG,mCAAmCC,aAAa,oBAAoB,CAAC;IAC9E,gBAAgBZ;IAChB,cAAc;QAACa;KAAc;AACjC"}
1
+ {"version":3,"file":"extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.js","sources":["../../../src/extensions/ProjectAws/EnsureAwsCredentialsBeforeDeploy.ts"],"sourcesContent":["import { BeforeDeploy, LoggerService } from \"@webiny/project/abstractions/index.js\";\nimport { GracefulError } from \"@webiny/project\";\nimport { STS } from \"@webiny/aws-sdk/client-sts/index.js\";\n\nclass EnsureAwsCredentialsBeforeDeployImpl implements BeforeDeploy.Interface {\n constructor(private loggerService: LoggerService.Interface) {}\n\n async execute() {\n process.env.AWS_SDK_LOAD_CONFIG = \"true\";\n const sts = new STS({});\n\n try {\n await sts.getCallerIdentity({});\n } catch (err) {\n this.loggerService.debug({ err }, \"AWS credentials error.\");\n throw GracefulError.from(\n new Error(\"AWS credentials are not configured correctly.\"),\n 'No valid AWS credentials were found. Run \"aws configure\" or set the AWS_ACCESS_KEY_ID and AWS_SECRET_ACCESS_KEY environment variables before deploying. Learn more: https://webiny.link/aws-credentials'\n );\n }\n\n const region = await sts.config.region();\n if (!region) {\n throw GracefulError.from(\n new Error(\"AWS region is not defined.\"),\n \"No AWS region is set. Define the AWS_REGION environment variable or set a default region in your AWS profile. Learn more: https://webiny.link/aws-region\"\n );\n }\n\n process.env.AWS_REGION = region;\n\n const { accessKeyId } = await sts.config.credentials();\n const profile = process.env.AWS_PROFILE;\n\n if (profile) {\n this.loggerService.info(`Using profile \"${profile}\" in \"${region}\" region.`);\n } else {\n this.loggerService.info(`Using access key ID \"${accessKeyId}\" in \"${region}\" region.`);\n }\n }\n}\n\nexport const EnsureAwsCredentialsBeforeDeploy = BeforeDeploy.createImplementation({\n implementation: EnsureAwsCredentialsBeforeDeployImpl,\n dependencies: [LoggerService]\n});\n"],"names":["EnsureAwsCredentialsBeforeDeployImpl","loggerService","process","sts","STS","err","GracefulError","Error","region","accessKeyId","profile","EnsureAwsCredentialsBeforeDeploy","BeforeDeploy","LoggerService"],"mappings":";;;AAIA,MAAMA;IACF,YAAoBC,aAAsC,CAAE;aAAxCA,aAAa,GAAbA;IAAyC;IAE7D,MAAM,UAAU;QACZC,QAAQ,GAAG,CAAC,mBAAmB,GAAG;QAClC,MAAMC,MAAM,IAAIC,IAAI,CAAC;QAErB,IAAI;YACA,MAAMD,IAAI,iBAAiB,CAAC,CAAC;QACjC,EAAE,OAAOE,KAAK;YACV,IAAI,CAAC,aAAa,CAAC,KAAK,CAAC;gBAAEA;YAAI,GAAG;YAClC,MAAMC,cAAc,IAAI,CACpB,IAAIC,MAAM,kDACV;QAER;QAEA,MAAMC,SAAS,MAAML,IAAI,MAAM,CAAC,MAAM;QACtC,IAAI,CAACK,QACD,MAAMF,cAAc,IAAI,CACpB,IAAIC,MAAM,+BACV;QAIRL,QAAQ,GAAG,CAAC,UAAU,GAAGM;QAEzB,MAAM,EAAEC,WAAW,EAAE,GAAG,MAAMN,IAAI,MAAM,CAAC,WAAW;QACpD,MAAMO,UAAUR,QAAQ,GAAG,CAAC,WAAW;QAEvC,IAAIQ,SACA,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,eAAe,EAAEA,QAAQ,MAAM,EAAEF,OAAO,SAAS,CAAC;aAE3E,IAAI,CAAC,aAAa,CAAC,IAAI,CAAC,CAAC,qBAAqB,EAAEC,YAAY,MAAM,EAAED,OAAO,SAAS,CAAC;IAE7F;AACJ;AAEO,MAAMG,mCAAmCC,aAAa,oBAAoB,CAAC;IAC9E,gBAAgBZ;IAChB,cAAc;QAACa;KAAc;AACjC"}
@@ -0,0 +1,11 @@
1
+ import { ApiBeforeDeploy, GetAppStackOutput, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
2
+ declare class EnsureCoreDeployedBeforeApiDeployImpl implements ApiBeforeDeploy.Interface {
3
+ private getAppStackOutput;
4
+ private projectSdkParamsService;
5
+ constructor(getAppStackOutput: GetAppStackOutput.Interface, projectSdkParamsService: ProjectSdkParamsService.Interface);
6
+ execute(): Promise<void>;
7
+ }
8
+ export declare const EnsureCoreDeployedBeforeApiDeploy: typeof EnsureCoreDeployedBeforeApiDeployImpl & {
9
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/project/abstractions/features").IApiBeforeDeploy>;
10
+ };
11
+ export {};
@@ -0,0 +1,31 @@
1
+ import { ApiBeforeDeploy, GetAppStackOutput, ProjectSdkParamsService } from "@webiny/project/abstractions/index.js";
2
+ import { GracefulError } from "@webiny/project";
3
+ class EnsureCoreDeployedBeforeApiDeployImpl {
4
+ constructor(getAppStackOutput, projectSdkParamsService){
5
+ this.getAppStackOutput = getAppStackOutput;
6
+ this.projectSdkParamsService = projectSdkParamsService;
7
+ }
8
+ async execute() {
9
+ const output = await this.getAppStackOutput.execute("core");
10
+ const coreDeployed = output && Object.keys(output).length > 0;
11
+ if (coreDeployed) return;
12
+ const sdkParams = this.projectSdkParamsService.get();
13
+ const { variant, env } = sdkParams;
14
+ let variantCmd = "";
15
+ if (variant) variantCmd = ` --variant ${variant}`;
16
+ const error = new Error("Cannot deploy API before deploying Core.");
17
+ const message = "Before deploying %s, please deploy %s first by running: %s.";
18
+ const cmd = `yarn webiny deploy core --env ${env}${variantCmd}`;
19
+ throw GracefulError.from(error, message, "API", "Core", cmd);
20
+ }
21
+ }
22
+ const EnsureCoreDeployedBeforeApiDeploy = ApiBeforeDeploy.createImplementation({
23
+ implementation: EnsureCoreDeployedBeforeApiDeployImpl,
24
+ dependencies: [
25
+ GetAppStackOutput,
26
+ ProjectSdkParamsService
27
+ ]
28
+ });
29
+ export { EnsureCoreDeployedBeforeApiDeploy };
30
+
31
+ //# sourceMappingURL=EnsureCoreDeployedBeforeApiDeploy.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.js","sources":["../../../src/extensions/ProjectAws/EnsureCoreDeployedBeforeApiDeploy.ts"],"sourcesContent":["import {\n ApiBeforeDeploy,\n GetAppStackOutput,\n ProjectSdkParamsService\n} from \"@webiny/project/abstractions/index.js\";\nimport { GracefulError } from \"@webiny/project\";\n\nclass EnsureCoreDeployedBeforeApiDeployImpl implements ApiBeforeDeploy.Interface {\n constructor(\n private getAppStackOutput: GetAppStackOutput.Interface,\n private projectSdkParamsService: ProjectSdkParamsService.Interface\n ) {}\n\n async execute() {\n const output = await this.getAppStackOutput.execute(\"core\");\n\n const coreDeployed = output && Object.keys(output).length > 0;\n if (coreDeployed) {\n return;\n }\n\n const sdkParams = this.projectSdkParamsService.get();\n const { variant, env } = sdkParams;\n\n let variantCmd = \"\";\n if (variant) {\n variantCmd = ` --variant ${variant}`;\n }\n\n const error = new Error(`Cannot deploy API before deploying Core.`);\n\n const message = [`Before deploying %s, please`, `deploy %s first by running: %s.`].join(\n \" \"\n );\n\n const cmd = `yarn webiny deploy core --env ${env}${variantCmd}`;\n throw GracefulError.from(error, message, \"API\", \"Core\", cmd);\n }\n}\n\nexport const EnsureCoreDeployedBeforeApiDeploy = ApiBeforeDeploy.createImplementation({\n implementation: EnsureCoreDeployedBeforeApiDeployImpl,\n dependencies: [GetAppStackOutput, ProjectSdkParamsService]\n});\n"],"names":["EnsureCoreDeployedBeforeApiDeployImpl","getAppStackOutput","projectSdkParamsService","output","coreDeployed","Object","sdkParams","variant","env","variantCmd","error","Error","message","cmd","GracefulError","EnsureCoreDeployedBeforeApiDeploy","ApiBeforeDeploy","GetAppStackOutput","ProjectSdkParamsService"],"mappings":";;AAOA,MAAMA;IACF,YACYC,iBAA8C,EAC9CC,uBAA0D,CACpE;aAFUD,iBAAiB,GAAjBA;aACAC,uBAAuB,GAAvBA;IACT;IAEH,MAAM,UAAU;QACZ,MAAMC,SAAS,MAAM,IAAI,CAAC,iBAAiB,CAAC,OAAO,CAAC;QAEpD,MAAMC,eAAeD,UAAUE,OAAO,IAAI,CAACF,QAAQ,MAAM,GAAG;QAC5D,IAAIC,cACA;QAGJ,MAAME,YAAY,IAAI,CAAC,uBAAuB,CAAC,GAAG;QAClD,MAAM,EAAEC,OAAO,EAAEC,GAAG,EAAE,GAAGF;QAEzB,IAAIG,aAAa;QACjB,IAAIF,SACAE,aAAa,CAAC,WAAW,EAAEF,SAAS;QAGxC,MAAMG,QAAQ,IAAIC,MAAM;QAExB,MAAMC,UAAU;QAIhB,MAAMC,MAAM,CAAC,8BAA8B,EAAEL,MAAMC,YAAY;QAC/D,MAAMK,cAAc,IAAI,CAACJ,OAAOE,SAAS,OAAO,QAAQC;IAC5D;AACJ;AAEO,MAAME,oCAAoCC,gBAAgB,oBAAoB,CAAC;IAClF,gBAAgBhB;IAChB,cAAc;QAACiB;QAAmBC;KAAwB;AAC9D"}
@@ -0,0 +1,13 @@
1
+ import { BeforeDeploy, IsCi, IsTelemetryEnabled, IsWcpEnabled, IsWebinyJsRepo } from "@webiny/project/abstractions/index.js";
2
+ declare class EnsureTelemetryEnabledForOssImpl implements BeforeDeploy.Interface {
3
+ private isTelemetryEnabled;
4
+ private isWcpEnabled;
5
+ private isWebinyJsRepo;
6
+ private isCi;
7
+ constructor(isTelemetryEnabled: IsTelemetryEnabled.Interface, isWcpEnabled: IsWcpEnabled.Interface, isWebinyJsRepo: IsWebinyJsRepo.Interface, isCi: IsCi.Interface);
8
+ execute(): Promise<void>;
9
+ }
10
+ export declare const EnsureTelemetryEnabledForOss: typeof EnsureTelemetryEnabledForOssImpl & {
11
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/project/abstractions/features").IBeforeDeploy>;
12
+ };
13
+ export {};
@@ -0,0 +1,34 @@
1
+ import { BeforeDeploy, IsCi, IsTelemetryEnabled, IsWcpEnabled, IsWebinyJsRepo } from "@webiny/project/abstractions/index.js";
2
+ import { GracefulError } from "@webiny/project";
3
+ class EnsureTelemetryEnabledForOssImpl {
4
+ constructor(isTelemetryEnabled, isWcpEnabled, isWebinyJsRepo, isCi){
5
+ this.isTelemetryEnabled = isTelemetryEnabled;
6
+ this.isWcpEnabled = isWcpEnabled;
7
+ this.isWebinyJsRepo = isWebinyJsRepo;
8
+ this.isCi = isCi;
9
+ }
10
+ async execute() {
11
+ if (this.isCi.execute()) return;
12
+ const isDevRepo = this.isWebinyJsRepo.execute();
13
+ if (isDevRepo) return;
14
+ const telemetryEnabled = await this.isTelemetryEnabled.execute();
15
+ const wcpEnabled = await this.isWcpEnabled.execute();
16
+ if (!telemetryEnabled && !wcpEnabled) {
17
+ const message = "You are trying to deploy your project, but telemetry is currently disabled. The open-source edition of Webiny requires telemetry to be enabled. To proceed with the deployment, please re-enable telemetry or upgrade your project via https://www.webiny.com/pricing. Learn more: https://webiny.link/telemetry-oss";
18
+ const error = new Error("Cannot deploy with telemetry disabled in OSS edition.");
19
+ throw GracefulError.from(error, message);
20
+ }
21
+ }
22
+ }
23
+ const EnsureTelemetryEnabledForOss = BeforeDeploy.createImplementation({
24
+ implementation: EnsureTelemetryEnabledForOssImpl,
25
+ dependencies: [
26
+ IsTelemetryEnabled,
27
+ IsWcpEnabled,
28
+ IsWebinyJsRepo,
29
+ IsCi
30
+ ]
31
+ });
32
+ export { EnsureTelemetryEnabledForOss };
33
+
34
+ //# sourceMappingURL=EnsureTelemetryEnabledForOss.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions/ProjectAws/EnsureTelemetryEnabledForOss.js","sources":["../../../src/extensions/ProjectAws/EnsureTelemetryEnabledForOss.ts"],"sourcesContent":["import {\n BeforeDeploy,\n IsCi,\n IsTelemetryEnabled,\n IsWcpEnabled,\n IsWebinyJsRepo\n} from \"@webiny/project/abstractions/index.js\";\nimport { GracefulError } from \"@webiny/project\";\n\nclass EnsureTelemetryEnabledForOssImpl implements BeforeDeploy.Interface {\n constructor(\n private isTelemetryEnabled: IsTelemetryEnabled.Interface,\n private isWcpEnabled: IsWcpEnabled.Interface,\n private isWebinyJsRepo: IsWebinyJsRepo.Interface,\n private isCi: IsCi.Interface\n ) {}\n\n async execute() {\n // Skip telemetry checks in CI environments\n if (this.isCi.execute()) {\n return;\n }\n\n // Don't enforce telemetry validation in the webiny-js development repository\n const isDevRepo = this.isWebinyJsRepo.execute();\n if (isDevRepo) {\n return;\n }\n\n const telemetryEnabled = await this.isTelemetryEnabled.execute();\n const wcpEnabled = await this.isWcpEnabled.execute();\n\n // If telemetry is disabled and WCP is not connected, throw an error\n if (!telemetryEnabled && !wcpEnabled) {\n const message = [\n `You are trying to deploy your project, but telemetry is currently disabled.`,\n `The open-source edition of Webiny requires telemetry to be enabled.`,\n `To proceed with the deployment, please re-enable telemetry or upgrade your project via https://www.webiny.com/pricing.`,\n `Learn more: https://webiny.link/telemetry-oss`\n ].join(\" \");\n\n const error = new Error(\"Cannot deploy with telemetry disabled in OSS edition.\");\n\n throw GracefulError.from(error, message);\n }\n }\n}\n\nexport const EnsureTelemetryEnabledForOss = BeforeDeploy.createImplementation({\n implementation: EnsureTelemetryEnabledForOssImpl,\n dependencies: [IsTelemetryEnabled, IsWcpEnabled, IsWebinyJsRepo, IsCi]\n});\n"],"names":["EnsureTelemetryEnabledForOssImpl","isTelemetryEnabled","isWcpEnabled","isWebinyJsRepo","isCi","isDevRepo","telemetryEnabled","wcpEnabled","message","error","Error","GracefulError","EnsureTelemetryEnabledForOss","BeforeDeploy","IsTelemetryEnabled","IsWcpEnabled","IsWebinyJsRepo","IsCi"],"mappings":";;AASA,MAAMA;IACF,YACYC,kBAAgD,EAChDC,YAAoC,EACpCC,cAAwC,EACxCC,IAAoB,CAC9B;aAJUH,kBAAkB,GAAlBA;aACAC,YAAY,GAAZA;aACAC,cAAc,GAAdA;aACAC,IAAI,GAAJA;IACT;IAEH,MAAM,UAAU;QAEZ,IAAI,IAAI,CAAC,IAAI,CAAC,OAAO,IACjB;QAIJ,MAAMC,YAAY,IAAI,CAAC,cAAc,CAAC,OAAO;QAC7C,IAAIA,WACA;QAGJ,MAAMC,mBAAmB,MAAM,IAAI,CAAC,kBAAkB,CAAC,OAAO;QAC9D,MAAMC,aAAa,MAAM,IAAI,CAAC,YAAY,CAAC,OAAO;QAGlD,IAAI,CAACD,oBAAoB,CAACC,YAAY;YAClC,MAAMC,UAAU;YAOhB,MAAMC,QAAQ,IAAIC,MAAM;YAExB,MAAMC,cAAc,IAAI,CAACF,OAAOD;QACpC;IACJ;AACJ;AAEO,MAAMI,+BAA+BC,aAAa,oBAAoB,CAAC;IAC1E,gBAAgBb;IAChB,cAAc;QAACc;QAAoBC;QAAcC;QAAgBC;KAAK;AAC1E"}
@@ -16,8 +16,7 @@ class SetAdminEnvVars {
16
16
  const apiOutput = await apiStackOutputService.execute();
17
17
  if (apiOutput) {
18
18
  process.env.REACT_APP_USER_POOL_REGION = apiOutput.region;
19
- process.env.REACT_APP_GRAPHQL_API_URL = `${apiOutput.apiUrl}/graphql`;
20
- process.env.REACT_APP_API_URL = apiOutput.apiUrl;
19
+ process.env.WEBINY_ADMIN_API_URL = apiOutput.apiUrl;
21
20
  process.env.REACT_APP_USER_POOL_ID = apiOutput.cognitoUserPoolId;
22
21
  process.env.REACT_APP_USER_POOL_WEB_CLIENT_ID = apiOutput.cognitoAppClientId;
23
22
  process.env.REACT_APP_USER_POOL_PASSWORD_POLICY = JSON.stringify(apiOutput.cognitoUserPoolPasswordPolicy);
@@ -1 +1 @@
1
- {"version":3,"file":"extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js","sources":["../../../../src/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.ts"],"sourcesContent":["import { ProjectSdkParamsService } from \"@webiny/project/abstractions/index.js\";\nimport { CoreStackOutputService, ApiStackOutputService } from \"../../../abstractions/index.js\";\n\ninterface ISetAdminEnvVarsDi {\n projectSdkParamsService: ProjectSdkParamsService.Interface;\n coreStackOutputService: CoreStackOutputService.Interface;\n apiStackOutputService: ApiStackOutputService.Interface;\n}\n\nexport class SetAdminEnvVars {\n di: ISetAdminEnvVarsDi;\n\n constructor(di: ISetAdminEnvVarsDi) {\n this.di = di;\n }\n\n async execute() {\n const { projectSdkParamsService, coreStackOutputService, apiStackOutputService } = this.di;\n const sdkParams = projectSdkParamsService.get();\n\n // Set basic admin env vars\n process.env.PORT = process.env.PORT || \"3001\";\n process.env.WEBINY_ADMIN_ENV = sdkParams.env;\n process.env.WEBINY_ADMIN_TRASH_BIN_RETENTION_PERIOD_DAYS =\n process.env.WEBINY_TRASH_BIN_RETENTION_PERIOD_DAYS || \"\";\n\n // Load Core app stack output (automatically uses env/variant/region from ProjectSdkParamsService)\n const coreOutput = await coreStackOutputService.execute<{\n deploymentId: string;\n cognitoUserPoolDomain?: string;\n }>();\n\n if (coreOutput) {\n process.env.WEBINY_ADMIN_DEPLOYMENT_ID = coreOutput.deploymentId;\n\n // Set Cognito user pool domain if available\n if (coreOutput.cognitoUserPoolDomain) {\n process.env.REACT_APP_USER_POOL_DOMAIN = coreOutput.cognitoUserPoolDomain;\n }\n }\n\n // Load API app stack output (automatically uses env/variant/region from ProjectSdkParamsService)\n const apiOutput = await apiStackOutputService.execute<{\n region: string;\n apiUrl: string;\n cognitoUserPoolId: string;\n cognitoAppClientId: string;\n cognitoUserPoolPasswordPolicy: any;\n websocketApiUrl: string;\n }>();\n\n if (apiOutput) {\n process.env.REACT_APP_USER_POOL_REGION = apiOutput.region;\n process.env.REACT_APP_GRAPHQL_API_URL = `${apiOutput.apiUrl}/graphql`;\n process.env.REACT_APP_API_URL = apiOutput.apiUrl;\n process.env.REACT_APP_USER_POOL_ID = apiOutput.cognitoUserPoolId;\n process.env.REACT_APP_USER_POOL_WEB_CLIENT_ID = apiOutput.cognitoAppClientId;\n process.env.REACT_APP_USER_POOL_PASSWORD_POLICY = JSON.stringify(\n apiOutput.cognitoUserPoolPasswordPolicy\n );\n process.env.REACT_APP_WEBSOCKET_URL = apiOutput.websocketApiUrl;\n }\n }\n}\n"],"names":["SetAdminEnvVars","di","projectSdkParamsService","coreStackOutputService","apiStackOutputService","sdkParams","process","coreOutput","apiOutput","JSON"],"mappings":"AASO,MAAMA;IAGT,YAAYC,EAAsB,CAAE;QAChC,IAAI,CAAC,EAAE,GAAGA;IACd;IAEA,MAAM,UAAU;QACZ,MAAM,EAAEC,uBAAuB,EAAEC,sBAAsB,EAAEC,qBAAqB,EAAE,GAAG,IAAI,CAAC,EAAE;QAC1F,MAAMC,YAAYH,wBAAwB,GAAG;QAG7CI,QAAQ,GAAG,CAAC,IAAI,GAAGA,QAAQ,GAAG,CAAC,IAAI,IAAI;QACvCA,QAAQ,GAAG,CAAC,gBAAgB,GAAGD,UAAU,GAAG;QAC5CC,QAAQ,GAAG,CAAC,4CAA4C,GACpDA,QAAQ,GAAG,CAAC,sCAAsC,IAAI;QAG1D,MAAMC,aAAa,MAAMJ,uBAAuB,OAAO;QAKvD,IAAII,YAAY;YACZD,QAAQ,GAAG,CAAC,0BAA0B,GAAGC,WAAW,YAAY;YAGhE,IAAIA,WAAW,qBAAqB,EAChCD,QAAQ,GAAG,CAAC,0BAA0B,GAAGC,WAAW,qBAAqB;QAEjF;QAGA,MAAMC,YAAY,MAAMJ,sBAAsB,OAAO;QASrD,IAAII,WAAW;YACXF,QAAQ,GAAG,CAAC,0BAA0B,GAAGE,UAAU,MAAM;YACzDF,QAAQ,GAAG,CAAC,yBAAyB,GAAG,GAAGE,UAAU,MAAM,CAAC,QAAQ,CAAC;YACrEF,QAAQ,GAAG,CAAC,iBAAiB,GAAGE,UAAU,MAAM;YAChDF,QAAQ,GAAG,CAAC,sBAAsB,GAAGE,UAAU,iBAAiB;YAChEF,QAAQ,GAAG,CAAC,iCAAiC,GAAGE,UAAU,kBAAkB;YAC5EF,QAAQ,GAAG,CAAC,mCAAmC,GAAGG,KAAK,SAAS,CAC5DD,UAAU,6BAA6B;YAE3CF,QAAQ,GAAG,CAAC,uBAAuB,GAAGE,UAAU,eAAe;QACnE;IACJ;AACJ"}
1
+ {"version":3,"file":"extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.js","sources":["../../../../src/extensions/ProjectAws/SetAdminEnvVars/SetAdminEnvVars.ts"],"sourcesContent":["import { ProjectSdkParamsService } from \"@webiny/project/abstractions/index.js\";\nimport { CoreStackOutputService, ApiStackOutputService } from \"../../../abstractions/index.js\";\n\ninterface ISetAdminEnvVarsDi {\n projectSdkParamsService: ProjectSdkParamsService.Interface;\n coreStackOutputService: CoreStackOutputService.Interface;\n apiStackOutputService: ApiStackOutputService.Interface;\n}\n\nexport class SetAdminEnvVars {\n di: ISetAdminEnvVarsDi;\n\n constructor(di: ISetAdminEnvVarsDi) {\n this.di = di;\n }\n\n async execute() {\n const { projectSdkParamsService, coreStackOutputService, apiStackOutputService } = this.di;\n const sdkParams = projectSdkParamsService.get();\n\n // Set basic admin env vars\n process.env.PORT = process.env.PORT || \"3001\";\n process.env.WEBINY_ADMIN_ENV = sdkParams.env;\n process.env.WEBINY_ADMIN_TRASH_BIN_RETENTION_PERIOD_DAYS =\n process.env.WEBINY_TRASH_BIN_RETENTION_PERIOD_DAYS || \"\";\n\n // Load Core app stack output (automatically uses env/variant/region from ProjectSdkParamsService)\n const coreOutput = await coreStackOutputService.execute<{\n deploymentId: string;\n cognitoUserPoolDomain?: string;\n }>();\n\n if (coreOutput) {\n process.env.WEBINY_ADMIN_DEPLOYMENT_ID = coreOutput.deploymentId;\n\n // Set Cognito user pool domain if available\n if (coreOutput.cognitoUserPoolDomain) {\n process.env.REACT_APP_USER_POOL_DOMAIN = coreOutput.cognitoUserPoolDomain;\n }\n }\n\n // Load API app stack output (automatically uses env/variant/region from ProjectSdkParamsService)\n const apiOutput = await apiStackOutputService.execute<{\n region: string;\n apiUrl: string;\n cognitoUserPoolId: string;\n cognitoAppClientId: string;\n cognitoUserPoolPasswordPolicy: any;\n websocketApiUrl: string;\n }>();\n\n if (apiOutput) {\n process.env.REACT_APP_USER_POOL_REGION = apiOutput.region;\n // Admin API URL, read by createRootContainer / Admin.tsx / playgrounds / api-info.\n process.env.WEBINY_ADMIN_API_URL = apiOutput.apiUrl;\n process.env.REACT_APP_USER_POOL_ID = apiOutput.cognitoUserPoolId;\n process.env.REACT_APP_USER_POOL_WEB_CLIENT_ID = apiOutput.cognitoAppClientId;\n process.env.REACT_APP_USER_POOL_PASSWORD_POLICY = JSON.stringify(\n apiOutput.cognitoUserPoolPasswordPolicy\n );\n process.env.REACT_APP_WEBSOCKET_URL = apiOutput.websocketApiUrl;\n }\n }\n}\n"],"names":["SetAdminEnvVars","di","projectSdkParamsService","coreStackOutputService","apiStackOutputService","sdkParams","process","coreOutput","apiOutput","JSON"],"mappings":"AASO,MAAMA;IAGT,YAAYC,EAAsB,CAAE;QAChC,IAAI,CAAC,EAAE,GAAGA;IACd;IAEA,MAAM,UAAU;QACZ,MAAM,EAAEC,uBAAuB,EAAEC,sBAAsB,EAAEC,qBAAqB,EAAE,GAAG,IAAI,CAAC,EAAE;QAC1F,MAAMC,YAAYH,wBAAwB,GAAG;QAG7CI,QAAQ,GAAG,CAAC,IAAI,GAAGA,QAAQ,GAAG,CAAC,IAAI,IAAI;QACvCA,QAAQ,GAAG,CAAC,gBAAgB,GAAGD,UAAU,GAAG;QAC5CC,QAAQ,GAAG,CAAC,4CAA4C,GACpDA,QAAQ,GAAG,CAAC,sCAAsC,IAAI;QAG1D,MAAMC,aAAa,MAAMJ,uBAAuB,OAAO;QAKvD,IAAII,YAAY;YACZD,QAAQ,GAAG,CAAC,0BAA0B,GAAGC,WAAW,YAAY;YAGhE,IAAIA,WAAW,qBAAqB,EAChCD,QAAQ,GAAG,CAAC,0BAA0B,GAAGC,WAAW,qBAAqB;QAEjF;QAGA,MAAMC,YAAY,MAAMJ,sBAAsB,OAAO;QASrD,IAAII,WAAW;YACXF,QAAQ,GAAG,CAAC,0BAA0B,GAAGE,UAAU,MAAM;YAEzDF,QAAQ,GAAG,CAAC,oBAAoB,GAAGE,UAAU,MAAM;YACnDF,QAAQ,GAAG,CAAC,sBAAsB,GAAGE,UAAU,iBAAiB;YAChEF,QAAQ,GAAG,CAAC,iCAAiC,GAAGE,UAAU,kBAAkB;YAC5EF,QAAQ,GAAG,CAAC,mCAAmC,GAAGG,KAAK,SAAS,CAC5DD,UAAU,6BAA6B;YAE3CF,QAAQ,GAAG,CAAC,uBAAuB,GAAGE,UAAU,eAAe;QACnE;IACJ;AACJ"}
@@ -0,0 +1,8 @@
1
+ import { AdminAfterDeploy } from "@webiny/project/abstractions/index.js";
2
+ declare class TelemetryNoLongerNewUserImpl implements AdminAfterDeploy.Interface {
3
+ execute(): Promise<void>;
4
+ }
5
+ export declare const TelemetryNoLongerNewUser: typeof TelemetryNoLongerNewUserImpl & {
6
+ __abstraction: import("@webiny/di").Abstraction<import("@webiny/project/abstractions/features").IAdminAfterDeploy>;
7
+ };
8
+ export {};
@@ -0,0 +1,14 @@
1
+ import { AdminAfterDeploy } from "@webiny/project/abstractions/index.js";
2
+ import { globalConfig } from "@webiny/global-config";
3
+ class TelemetryNoLongerNewUserImpl {
4
+ async execute() {
5
+ globalConfig.set("newUser", false);
6
+ }
7
+ }
8
+ const TelemetryNoLongerNewUser = AdminAfterDeploy.createImplementation({
9
+ implementation: TelemetryNoLongerNewUserImpl,
10
+ dependencies: []
11
+ });
12
+ export { TelemetryNoLongerNewUser };
13
+
14
+ //# sourceMappingURL=TelemetryNoLongerNewUser.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"extensions/ProjectAws/TelemetryNoLongerNewUser.js","sources":["../../../src/extensions/ProjectAws/TelemetryNoLongerNewUser.ts"],"sourcesContent":["import { AdminAfterDeploy } from \"@webiny/project/abstractions/index.js\";\nimport { globalConfig } from \"@webiny/global-config\";\n\nclass TelemetryNoLongerNewUserImpl implements AdminAfterDeploy.Interface {\n async execute() {\n // Mark the user as no longer new.\n globalConfig.set(\"newUser\", false);\n }\n}\n\nexport const TelemetryNoLongerNewUser = AdminAfterDeploy.createImplementation({\n implementation: TelemetryNoLongerNewUserImpl,\n dependencies: []\n});\n"],"names":["TelemetryNoLongerNewUserImpl","globalConfig","TelemetryNoLongerNewUser","AdminAfterDeploy"],"mappings":";;AAGA,MAAMA;IACF,MAAM,UAAU;QAEZC,aAAa,GAAG,CAAC,WAAW;IAChC;AACJ;AAEO,MAAMC,2BAA2BC,iBAAiB,oBAAoB,CAAC;IAC1E,gBAAgBH;IAChB,cAAc,EAAE;AACpB"}