@wix/create-headless-site 0.0.16 → 0.0.18

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/build/index.js CHANGED
@@ -15389,13 +15389,13 @@ var require_http_client = __commonJS({
15389
15389
  static isHttpError(payload5) {
15390
15390
  return !!(payload5 === null || payload5 === void 0 ? void 0 : payload5.isWixHttpError);
15391
15391
  }
15392
- async request(requestOptionsOrFactory, overrides) {
15392
+ async request(requestOptionsOrFactory, overrides2) {
15393
15393
  var _a3, _b;
15394
15394
  const host = (0, utils_1.resolveHost)(this.opts);
15395
15395
  const protocol = (0, utils_1.resolveProtocol)(this.opts);
15396
15396
  const urlObject = { protocol, host };
15397
15397
  const requestOptions = typeof requestOptionsOrFactory === "function" ? requestOptionsOrFactory({ isSSR: this.opts.isSSR, host }) : requestOptionsOrFactory;
15398
- const signedInstance = (overrides === null || overrides === void 0 ? void 0 : overrides.signedInstance) || await ((_b = (_a3 = this.opts).getAppToken) === null || _b === void 0 ? void 0 : _b.call(_a3)) || "";
15398
+ const signedInstance = (overrides2 === null || overrides2 === void 0 ? void 0 : overrides2.signedInstance) || await ((_b = (_a3 = this.opts).getAppToken) === null || _b === void 0 ? void 0 : _b.call(_a3)) || "";
15399
15399
  const headers = this.getHeaders(requestOptions, signedInstance, urlObject);
15400
15400
  const options = (0, options_1.buildOptions)({
15401
15401
  requestOptions,
@@ -48305,14 +48305,14 @@ var require_lib2 = __commonJS({
48305
48305
  if (hasMissingPlugin) {
48306
48306
  error.missingPlugin = details.missingPlugin;
48307
48307
  }
48308
- defineHidden(error, "clone", function clone(overrides = {}) {
48308
+ defineHidden(error, "clone", function clone(overrides2 = {}) {
48309
48309
  var _overrides$loc;
48310
48310
  const {
48311
48311
  line,
48312
48312
  column,
48313
48313
  index
48314
- } = (_overrides$loc = overrides.loc) != null ? _overrides$loc : loc;
48315
- return constructor(new Position(line, column, index), Object.assign({}, details, overrides.details));
48314
+ } = (_overrides$loc = overrides2.loc) != null ? _overrides$loc : loc;
48315
+ return constructor(new Position(line, column, index), Object.assign({}, details, overrides2.details));
48316
48316
  });
48317
48317
  defineHidden(error, "details", details);
48318
48318
  Object.defineProperty(error, "message", {
@@ -79572,7 +79572,8 @@ var CliUserErrorCode = (0, import_variant11.variant)({
79572
79572
  ProjectIsNotLinkable: {},
79573
79573
  MissingPresetCssForSiteComponent: (0, import_variant11.fields)(),
79574
79574
  AppInstallerSiteNotFound: (0, import_variant11.fields)(),
79575
- EAccessPermissionDenied: {}
79575
+ EAccessPermissionDenied: {},
79576
+ InvalidSiteComponentElementItem: (0, import_variant11.fields)()
79576
79577
  });
79577
79578
  var CliErrorCode = (0, import_variant11.variant)({
79578
79579
  ...CliSystemErrorCode,
@@ -90430,11 +90431,15 @@ ${errorMessage}`
90430
90431
  ProjectIsNotLinkable: () => {
90431
90432
  return () => /* @__PURE__ */ import_react78.default.createElement(ErrorMessage, { message: "Only Astro projects can be linked to Wix. The current project is missing an Astro configuration file." });
90432
90433
  },
90433
- MissingPresetCssForSiteComponent: ({ componentId, presetName }) => {
90434
+ MissingPresetCssForSiteComponent: ({
90435
+ componentId,
90436
+ presetName,
90437
+ elementBasePath
90438
+ }) => {
90434
90439
  return () => /* @__PURE__ */ import_react78.default.createElement(
90435
90440
  ErrorMessage,
90436
90441
  {
90437
- message: `Site component "${componentId}" is missing preset CSS file for the preset key "${presetName}".`
90442
+ message: `Site component "${componentId}" is missing preset CSS file for the preset key "${presetName}"${elementBasePath ? ` in the element base path "${elementBasePath}".` : "."}`
90438
90443
  }
90439
90444
  );
90440
90445
  },
@@ -90469,6 +90474,15 @@ ${errorMessage}`
90469
90474
  message: `The version "${version}" produced by the system does not conform to the expected semantic versioning format and could not be parsed.`
90470
90475
  }
90471
90476
  );
90477
+ },
90478
+ InvalidSiteComponentElementItem: ({ elementPath }) => {
90479
+ return () => /* @__PURE__ */ import_react78.default.createElement(
90480
+ ErrorMessage,
90481
+ {
90482
+ cause,
90483
+ message: `Site component element config is invalid at ${elementPath}`
90484
+ }
90485
+ );
90472
90486
  }
90473
90487
  });
90474
90488
  }
@@ -94788,10 +94802,15 @@ async function readUserConfig() {
94788
94802
 
94789
94803
  // ../cli-panorama/src/createPanorama.ts
94790
94804
  var globalConfig = createGlobalConfig();
94805
+ var overrides = getTestOverrides();
94806
+ if (overrides.panoramaReporterUrl) {
94807
+ globalConfig.setReporter(
94808
+ nodeReporter(overrides.panoramaReporterUrl, { silent: true })
94809
+ );
94810
+ }
94791
94811
  async function createPanorama(options) {
94792
94812
  const { version, artifact, userId } = options;
94793
94813
  const userConfig = await readUserConfig();
94794
- const overrides = getTestOverrides();
94795
94814
  const factory = panoramaClientFactory({
94796
94815
  baseParams: {
94797
94816
  platform: Platform.Standalone,
@@ -94805,29 +94824,8 @@ async function createPanorama(options) {
94805
94824
  silent: true
94806
94825
  }
94807
94826
  }).withGlobalConfig(globalConfig).setMuted(!userConfig.telemetry);
94808
- if (overrides.panoramaReporterUrl) {
94809
- return factory.withReporter(nodeReporter2(overrides.panoramaReporterUrl));
94810
- }
94811
94827
  return factory;
94812
94828
  }
94813
- function nodeReporter2(url2) {
94814
- let queue = Promise.resolve();
94815
- const noop8 = () => {
94816
- };
94817
- return (logMessage) => {
94818
- const body = JSON.stringify({ logMessage });
94819
- queue = queue.then(() => {
94820
- return fetch(url2, {
94821
- method: "POST",
94822
- body,
94823
- headers: {
94824
- "Content-Type": "application/json"
94825
- }
94826
- }).then(noop8).catch(noop8);
94827
- });
94828
- return true;
94829
- };
94830
- }
94831
94829
 
94832
94830
  // src/bi/index.ts
94833
94831
  init_esm_shims();
@@ -95047,7 +95045,7 @@ function wixCliCliError(params) {
95047
95045
  var package_default = {
95048
95046
  name: "@wix/create-headless-site",
95049
95047
  description: "Headless site creation wizard",
95050
- version: "0.0.16",
95048
+ version: "0.0.18",
95051
95049
  bin: "bin/index.cjs",
95052
95050
  devDependencies: {
95053
95051
  "@commander-js/extra-typings": "^13.0.0",
@@ -99115,6 +99113,12 @@ function resolveComWixpressDevcenterAppmarketlistingMarketListingServiceUrl(opts
99115
99113
  srcPath: "/v1/marketListings",
99116
99114
  destPath: "/v1/marketListings"
99117
99115
  }
99116
+ ],
99117
+ "vibe._base_domain_": [
99118
+ {
99119
+ srcPath: "/_api/app-market-listing",
99120
+ destPath: ""
99121
+ }
99118
99122
  ]
99119
99123
  };
99120
99124
  return resolveUrl(Object.assign(opts, { domainToMappings }));
@@ -100086,6 +100090,7 @@ var ComponentType;
100086
100090
  ComponentType3["TAX_EXEMPT_GROUPS_PROVIDER"] = "TAX_EXEMPT_GROUPS_PROVIDER";
100087
100091
  ComponentType3["BOOKING_AUTOMATIONS_CONFIGURATION"] = "BOOKING_AUTOMATIONS_CONFIGURATION";
100088
100092
  ComponentType3["WIX_VIBE_COMPONENT"] = "WIX_VIBE_COMPONENT";
100093
+ ComponentType3["WIXEL"] = "WIXEL";
100089
100094
  })(ComponentType || (ComponentType = {}));
100090
100095
  var WidgetVertical;
100091
100096
  (function(WidgetVertical3) {
@@ -100903,11 +100908,11 @@ var PlanFormPricingOption;
100903
100908
  PlanFormPricingOption3["RECURRING"] = "RECURRING";
100904
100909
  })(PlanFormPricingOption || (PlanFormPricingOption = {}));
100905
100910
  var PlanFormPricingType;
100906
- (function(PlanFormPricingType2) {
100907
- PlanFormPricingType2["UNKNOWN_OPTION"] = "UNKNOWN_OPTION";
100908
- PlanFormPricingType2["FREE"] = "FREE";
100909
- PlanFormPricingType2["ONE_TIME"] = "ONE_TIME";
100910
- PlanFormPricingType2["RECURRING"] = "RECURRING";
100911
+ (function(PlanFormPricingType3) {
100912
+ PlanFormPricingType3["UNKNOWN_OPTION"] = "UNKNOWN_OPTION";
100913
+ PlanFormPricingType3["FREE"] = "FREE";
100914
+ PlanFormPricingType3["ONE_TIME"] = "ONE_TIME";
100915
+ PlanFormPricingType3["RECURRING"] = "RECURRING";
100911
100916
  })(PlanFormPricingType || (PlanFormPricingType = {}));
100912
100917
  var PlanFormDefaultSection;
100913
100918
  (function(PlanFormDefaultSection3) {
@@ -102025,6 +102030,7 @@ var Archetype;
102025
102030
  Archetype3["Cart"] = "Cart";
102026
102031
  Archetype3["ContactForm"] = "ContactForm";
102027
102032
  Archetype3["Frame"] = "Frame";
102033
+ Archetype3["Divider"] = "Divider";
102028
102034
  })(Archetype || (Archetype = {}));
102029
102035
  var NativeStateType;
102030
102036
  (function(NativeStateType3) {
@@ -102285,6 +102291,22 @@ var RegionScopeScope;
102285
102291
  RegionScopeScope3["SPECIFIC_REGIONS"] = "SPECIFIC_REGIONS";
102286
102292
  RegionScopeScope3["WORLDWIDE"] = "WORLDWIDE";
102287
102293
  })(RegionScopeScope || (RegionScopeScope = {}));
102294
+ var VibeActionType;
102295
+ (function(VibeActionType3) {
102296
+ VibeActionType3["UNKNOWN_ActionType"] = "UNKNOWN_ActionType";
102297
+ VibeActionType3["OPEN_DASHBOARD"] = "OPEN_DASHBOARD";
102298
+ VibeActionType3["OPEN_CUSTOM_PANEL"] = "OPEN_CUSTOM_PANEL";
102299
+ })(VibeActionType || (VibeActionType = {}));
102300
+ var AssetType;
102301
+ (function(AssetType3) {
102302
+ AssetType3["UNKNOWN"] = "UNKNOWN";
102303
+ AssetType3["IMAGE"] = "IMAGE";
102304
+ AssetType3["VIDEO"] = "VIDEO";
102305
+ AssetType3["LOGO"] = "LOGO";
102306
+ AssetType3["EVENT"] = "EVENT";
102307
+ AssetType3["FORM"] = "FORM";
102308
+ AssetType3["PDF"] = "PDF";
102309
+ })(AssetType || (AssetType = {}));
102288
102310
  var SaleType;
102289
102311
  (function(SaleType2) {
102290
102312
  SaleType2["UNKNOWN_SALE_TYPE"] = "UNKNOWN_SALE_TYPE";
@@ -102476,12 +102498,12 @@ var VersionType;
102476
102498
  VersionType2["DEV_VERSION"] = "DEV_VERSION";
102477
102499
  })(VersionType || (VersionType = {}));
102478
102500
  var WebhookIdentityType;
102479
- (function(WebhookIdentityType3) {
102480
- WebhookIdentityType3["UNKNOWN"] = "UNKNOWN";
102481
- WebhookIdentityType3["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
102482
- WebhookIdentityType3["MEMBER"] = "MEMBER";
102483
- WebhookIdentityType3["WIX_USER"] = "WIX_USER";
102484
- WebhookIdentityType3["APP"] = "APP";
102501
+ (function(WebhookIdentityType4) {
102502
+ WebhookIdentityType4["UNKNOWN"] = "UNKNOWN";
102503
+ WebhookIdentityType4["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
102504
+ WebhookIdentityType4["MEMBER"] = "MEMBER";
102505
+ WebhookIdentityType4["WIX_USER"] = "WIX_USER";
102506
+ WebhookIdentityType4["APP"] = "APP";
102485
102507
  })(WebhookIdentityType || (WebhookIdentityType = {}));
102486
102508
 
102487
102509
  // ../dev-center-client/src/schemas.ts
@@ -102711,6 +102733,7 @@ var ComponentType2;
102711
102733
  ComponentType3["TAX_EXEMPT_GROUPS_PROVIDER"] = "TAX_EXEMPT_GROUPS_PROVIDER";
102712
102734
  ComponentType3["BOOKING_AUTOMATIONS_CONFIGURATION"] = "BOOKING_AUTOMATIONS_CONFIGURATION";
102713
102735
  ComponentType3["WIX_VIBE_COMPONENT"] = "WIX_VIBE_COMPONENT";
102736
+ ComponentType3["WIXEL"] = "WIXEL";
102714
102737
  })(ComponentType2 || (ComponentType2 = {}));
102715
102738
  var WidgetVertical2;
102716
102739
  (function(WidgetVertical3) {
@@ -103527,6 +103550,13 @@ var PlanFormPricingOption2;
103527
103550
  PlanFormPricingOption3["ONE_TIME"] = "ONE_TIME";
103528
103551
  PlanFormPricingOption3["RECURRING"] = "RECURRING";
103529
103552
  })(PlanFormPricingOption2 || (PlanFormPricingOption2 = {}));
103553
+ var PlanFormPricingType2;
103554
+ (function(PlanFormPricingType3) {
103555
+ PlanFormPricingType3["UNKNOWN_OPTION"] = "UNKNOWN_OPTION";
103556
+ PlanFormPricingType3["FREE"] = "FREE";
103557
+ PlanFormPricingType3["ONE_TIME"] = "ONE_TIME";
103558
+ PlanFormPricingType3["RECURRING"] = "RECURRING";
103559
+ })(PlanFormPricingType2 || (PlanFormPricingType2 = {}));
103530
103560
  var PlanFormDefaultSection2;
103531
103561
  (function(PlanFormDefaultSection3) {
103532
103562
  PlanFormDefaultSection3["UNKNWON_PLAN_FORM_SECTION"] = "UNKNWON_PLAN_FORM_SECTION";
@@ -103535,6 +103565,8 @@ var PlanFormDefaultSection2;
103535
103565
  PlanFormDefaultSection3["PAGE_PERMISSIONS"] = "PAGE_PERMISSIONS";
103536
103566
  PlanFormDefaultSection3["PRICING_AND_DURATION"] = "PRICING_AND_DURATION";
103537
103567
  PlanFormDefaultSection3["ADVANCED_SETTINGS"] = "ADVANCED_SETTINGS";
103568
+ PlanFormDefaultSection3["PRICING"] = "PRICING";
103569
+ PlanFormDefaultSection3["DURATION"] = "DURATION";
103538
103570
  })(PlanFormDefaultSection2 || (PlanFormDefaultSection2 = {}));
103539
103571
  var PlanPeriodUnit2;
103540
103572
  (function(PlanPeriodUnit3) {
@@ -104641,6 +104673,7 @@ var Archetype2;
104641
104673
  Archetype3["Cart"] = "Cart";
104642
104674
  Archetype3["ContactForm"] = "ContactForm";
104643
104675
  Archetype3["Frame"] = "Frame";
104676
+ Archetype3["Divider"] = "Divider";
104644
104677
  })(Archetype2 || (Archetype2 = {}));
104645
104678
  var NativeStateType2;
104646
104679
  (function(NativeStateType3) {
@@ -104901,6 +104934,22 @@ var RegionScopeScope2;
104901
104934
  RegionScopeScope3["SPECIFIC_REGIONS"] = "SPECIFIC_REGIONS";
104902
104935
  RegionScopeScope3["WORLDWIDE"] = "WORLDWIDE";
104903
104936
  })(RegionScopeScope2 || (RegionScopeScope2 = {}));
104937
+ var VibeActionType2;
104938
+ (function(VibeActionType3) {
104939
+ VibeActionType3["UNKNOWN_ActionType"] = "UNKNOWN_ActionType";
104940
+ VibeActionType3["OPEN_DASHBOARD"] = "OPEN_DASHBOARD";
104941
+ VibeActionType3["OPEN_CUSTOM_PANEL"] = "OPEN_CUSTOM_PANEL";
104942
+ })(VibeActionType2 || (VibeActionType2 = {}));
104943
+ var AssetType2;
104944
+ (function(AssetType3) {
104945
+ AssetType3["UNKNOWN"] = "UNKNOWN";
104946
+ AssetType3["IMAGE"] = "IMAGE";
104947
+ AssetType3["VIDEO"] = "VIDEO";
104948
+ AssetType3["LOGO"] = "LOGO";
104949
+ AssetType3["EVENT"] = "EVENT";
104950
+ AssetType3["FORM"] = "FORM";
104951
+ AssetType3["PDF"] = "PDF";
104952
+ })(AssetType2 || (AssetType2 = {}));
104904
104953
  var OpenConsentIn2;
104905
104954
  (function(OpenConsentIn3) {
104906
104955
  OpenConsentIn3["NONE_VALUE"] = "NONE_VALUE";
@@ -104947,12 +104996,12 @@ var TranslationType;
104947
104996
  TranslationType2["COMPONENT"] = "COMPONENT";
104948
104997
  })(TranslationType || (TranslationType = {}));
104949
104998
  var WebhookIdentityType2;
104950
- (function(WebhookIdentityType3) {
104951
- WebhookIdentityType3["UNKNOWN"] = "UNKNOWN";
104952
- WebhookIdentityType3["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
104953
- WebhookIdentityType3["MEMBER"] = "MEMBER";
104954
- WebhookIdentityType3["WIX_USER"] = "WIX_USER";
104955
- WebhookIdentityType3["APP"] = "APP";
104999
+ (function(WebhookIdentityType4) {
105000
+ WebhookIdentityType4["UNKNOWN"] = "UNKNOWN";
105001
+ WebhookIdentityType4["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
105002
+ WebhookIdentityType4["MEMBER"] = "MEMBER";
105003
+ WebhookIdentityType4["WIX_USER"] = "WIX_USER";
105004
+ WebhookIdentityType4["APP"] = "APP";
104956
105005
  })(WebhookIdentityType2 || (WebhookIdentityType2 = {}));
104957
105006
 
104958
105007
  // ../../node_modules/@wix/ambassador-devcenter-apps-v1-app-template/build/es/types.impl.js
@@ -106020,11 +106069,42 @@ function removeAppEnvironmentVariables(payload5) {
106020
106069
 
106021
106070
  // ../backend-as-a-service-client/src/schemas.ts
106022
106071
  init_esm_shims();
106072
+
106073
+ // ../../node_modules/@wix/ambassador-velo-backend-v1-app-deployment/build/es/types.impl.js
106074
+ init_esm_shims();
106075
+ var CloudProvider;
106076
+ (function(CloudProvider2) {
106077
+ CloudProvider2["UNKNOWN_CLOUD_PROVIDER"] = "UNKNOWN_CLOUD_PROVIDER";
106078
+ CloudProvider2["CLOUD_FLARE"] = "CLOUD_FLARE";
106079
+ CloudProvider2["KUBERNETES"] = "KUBERNETES";
106080
+ })(CloudProvider || (CloudProvider = {}));
106081
+ var DeploymentState;
106082
+ (function(DeploymentState2) {
106083
+ DeploymentState2["UNKNOWN_DEPLOYMENT_STATE"] = "UNKNOWN_DEPLOYMENT_STATE";
106084
+ DeploymentState2["STATICS_UPLOAD_PENDING"] = "STATICS_UPLOAD_PENDING";
106085
+ DeploymentState2["DEPLOY_SUCCESS"] = "DEPLOY_SUCCESS";
106086
+ DeploymentState2["DEPLOY_FAILED"] = "DEPLOY_FAILED";
106087
+ })(DeploymentState || (DeploymentState = {}));
106088
+ var SortOrder;
106089
+ (function(SortOrder2) {
106090
+ SortOrder2["ASC"] = "ASC";
106091
+ SortOrder2["DESC"] = "DESC";
106092
+ })(SortOrder || (SortOrder = {}));
106093
+ var WebhookIdentityType3;
106094
+ (function(WebhookIdentityType4) {
106095
+ WebhookIdentityType4["UNKNOWN"] = "UNKNOWN";
106096
+ WebhookIdentityType4["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
106097
+ WebhookIdentityType4["MEMBER"] = "MEMBER";
106098
+ WebhookIdentityType4["WIX_USER"] = "WIX_USER";
106099
+ WebhookIdentityType4["APP"] = "APP";
106100
+ })(WebhookIdentityType3 || (WebhookIdentityType3 = {}));
106101
+
106102
+ // ../backend-as-a-service-client/src/schemas.ts
106023
106103
  var staticFileMetadata = z.object({
106024
106104
  path: z.string(),
106025
106105
  hash: z.string(),
106026
106106
  size: z.number().optional(),
106027
- contentType: z.string().optional().nullable()
106107
+ contentType: z.string()
106028
106108
  });
106029
106109
  var StaticFileUploadUrlSchema = z.object({
106030
106110
  uploadUrl: z.string().url(),
@@ -106032,7 +106112,8 @@ var StaticFileUploadUrlSchema = z.object({
106032
106112
  });
106033
106113
  var AppDeploymentSchema = z.object({
106034
106114
  id: z.string().uuid(),
106035
- deploymentBaseUrl: z.string()
106115
+ deploymentBaseUrl: z.string(),
106116
+ cloudProviderOverride: z.nativeEnum(CloudProvider)
106036
106117
  }).passthrough();
106037
106118
  var CompleteAppDeploymentSchema = z.object({
106038
106119
  appDeployment: AppDeploymentSchema
@@ -106052,7 +106133,7 @@ var CreateAppProjectSchema = z.object({
106052
106133
  });
106053
106134
  var CreateAppDeploymentSchema = z.object({
106054
106135
  staticFilesUploadUrls: z.array(StaticFileUploadUrlSchema).optional(),
106055
- uploadAuthToken: z.string(),
106136
+ uploadAuthToken: z.string().optional(),
106056
106137
  appDeployment: AppDeploymentSchema.optional()
106057
106138
  });
106058
106139
  var StaticFileUploadSchema = z.object({
@@ -106075,7 +106156,7 @@ var BackendAsAServiceClient = class {
106075
106156
  };
106076
106157
  }
106077
106158
  retryOptions;
106078
- createAppProject = async (appId, projectName) => {
106159
+ createAppProject = async (appId, projectName, cloudProvider) => {
106079
106160
  try {
106080
106161
  const { data } = await this.httpClient.request(
106081
106162
  createAppProject({
@@ -106083,7 +106164,8 @@ var BackendAsAServiceClient = class {
106083
106164
  id: appId,
106084
106165
  displayName: projectName,
106085
106166
  slug: (0, import_lodash3.kebabCase)(projectName),
106086
- appProjectTypeId: APP_PROJECT_TYPE_ID
106167
+ appProjectTypeId: APP_PROJECT_TYPE_ID,
106168
+ cloudProviderOverride: cloudProvider
106087
106169
  }
106088
106170
  })
106089
106171
  );
@@ -106161,6 +106243,30 @@ var BackendAsAServiceClient = class {
106161
106243
  });
106162
106244
  }
106163
106245
  };
106246
+ putBinaryFile = async (endpointUrl, fileContent, contentType) => {
106247
+ try {
106248
+ await pRetry(
106249
+ async () => {
106250
+ const response = await fetch(endpointUrl, {
106251
+ method: "PUT",
106252
+ headers: {
106253
+ "Content-Type": contentType
106254
+ },
106255
+ body: fileContent
106256
+ });
106257
+ if (!response.ok) {
106258
+ throw new Error(response.statusText);
106259
+ }
106260
+ },
106261
+ { retries: 3 }
106262
+ );
106263
+ } catch (e2) {
106264
+ throw new CliError({
106265
+ code: CliErrorCode.FailedToUploadStaticFiles(),
106266
+ cause: e2
106267
+ });
106268
+ }
106269
+ };
106164
106270
  // Env management
106165
106271
  getAppEnvironmentByName = async (appId, environment) => {
106166
106272
  try {
@@ -106243,7 +106349,10 @@ var useCreateProject = (businessId) => {
106243
106349
  const { getInstalledAppInstanceId } = useMetasiteManagerClient();
106244
106350
  const { createAppProject: createAppProject2, upsertAppEnvironment: upsertAppEnvironment2 } = useBackendAsAServiceClient();
106245
106351
  return useAsyncCallback3(
106246
- async (_2, { projectName }) => {
106352
+ async (_2, {
106353
+ projectName,
106354
+ cloudProvider
106355
+ }) => {
106247
106356
  const { id: projectId } = await createOAuthApp2({
106248
106357
  name: `Private App for: ${projectName}`
106249
106358
  });
@@ -106251,7 +106360,11 @@ var useCreateProject = (businessId) => {
106251
106360
  getAppSecret({ appId: projectId }),
106252
106361
  getInstalledAppInstanceId({ metaSiteId: businessId, appId: projectId })
106253
106362
  ]);
106254
- const { appProject } = await createAppProject2(projectId, projectName);
106363
+ const { appProject } = await createAppProject2(
106364
+ projectId,
106365
+ projectName,
106366
+ cloudProvider
106367
+ );
106255
106368
  const loginRoute = `api/auth/callback`;
106256
106369
  const logoutRoute = `api/auth/logout-callback`;
106257
106370
  const projectBaseURL = new URL(appProject.baseUrl);
@@ -106296,7 +106409,12 @@ var useCreateProject = (businessId) => {
106296
106409
  };
106297
106410
 
106298
106411
  // src/components/CreateProject.tsx
106299
- var CreateProject = ({ onSubmit, projectName: providedProjectName, businessId }) => {
106412
+ var CreateProject = ({
106413
+ onSubmit,
106414
+ projectName: providedProjectName,
106415
+ businessId,
106416
+ cloudProvider
106417
+ }) => {
106300
106418
  const { status, execute } = useCreateProject(businessId);
106301
106419
  (0, import_react104.useEffect)(() => {
106302
106420
  if ((0, import_variant31.isType)(status, "Success")) {
@@ -106305,9 +106423,9 @@ var CreateProject = ({ onSubmit, projectName: providedProjectName, businessId })
106305
106423
  }, [status, onSubmit]);
106306
106424
  (0, import_react104.useEffect)(() => {
106307
106425
  if (providedProjectName) {
106308
- void execute({ projectName: providedProjectName });
106426
+ void execute({ projectName: providedProjectName, cloudProvider });
106309
106427
  }
106310
- }, [providedProjectName, execute]);
106428
+ }, [providedProjectName, cloudProvider, execute]);
106311
106429
  const validate3 = (0, import_react104.useCallback)(async (projectName) => {
106312
106430
  try {
106313
106431
  validateProjectName(projectName);
@@ -106320,7 +106438,7 @@ var CreateProject = ({ onSubmit, projectName: providedProjectName, businessId })
106320
106438
  TextInput2,
106321
106439
  {
106322
106440
  label: "What's the name of your Custom Frontend project?",
106323
- onSubmit: (projectName) => execute({ projectName }),
106441
+ onSubmit: (projectName) => execute({ projectName, cloudProvider }),
106324
106442
  validate: validate3,
106325
106443
  inCreateFlow: true
106326
106444
  }
@@ -111847,8 +111965,8 @@ var Printer = function Printer2(config) {
111847
111965
  const explicitTabWidth = config && config.tabWidth;
111848
111966
  config = normalize3(config);
111849
111967
  config.sourceFileName = null;
111850
- function makePrintFunctionWith(options, overrides) {
111851
- options = Object.assign({}, options, overrides);
111968
+ function makePrintFunctionWith(options, overrides2) {
111969
+ options = Object.assign({}, options, overrides2);
111852
111970
  return (path8) => print2(path8, options);
111853
111971
  }
111854
111972
  function print2(path8, options) {
@@ -116023,6 +116141,19 @@ function validateGitUrl(value2) {
116023
116141
  throw new InvalidArgumentError("Value must be a valid Git URL");
116024
116142
  }
116025
116143
 
116144
+ // src/validations/validate-cloud-provider.ts
116145
+ init_esm_shims();
116146
+ var validateCloudProvider = (value2) => {
116147
+ const allowedValues = ["cloudflare", "kubernetes"];
116148
+ const normalizedValue = value2.toLowerCase();
116149
+ if (!allowedValues.includes(normalizedValue)) {
116150
+ throw new Error(
116151
+ `Invalid cloud provider: ${value2}. Allowed values are: ${allowedValues.join(", ")}`
116152
+ );
116153
+ }
116154
+ return normalizedValue;
116155
+ };
116156
+
116026
116157
  // src/validations/validate-template-params.ts
116027
116158
  init_esm_shims();
116028
116159
  var schema2 = z.string().transform((value2) => JSON.parse(value2)).pipe(z.record(z.unknown()));
@@ -116743,6 +116874,24 @@ var TemplateSource = (0, import_variant37.variant)({
116743
116874
  GitRepo: (0, import_variant37.fields)(),
116744
116875
  Local: (0, import_variant37.fields)()
116745
116876
  });
116877
+ function parseCloudProvider(cloudProvider) {
116878
+ if (!cloudProvider) {
116879
+ return CloudProvider.CLOUD_FLARE;
116880
+ }
116881
+ switch (cloudProvider.trim().toLowerCase()) {
116882
+ case "cloudflare":
116883
+ return CloudProvider.CLOUD_FLARE;
116884
+ case "kubernetes":
116885
+ return CloudProvider.KUBERNETES;
116886
+ default:
116887
+ throw new CliError({
116888
+ code: CliErrorCode.ProjectNameArgumentIsInvalid({
116889
+ errorMessage: `Invalid cloud provider: "${cloudProvider}".`
116890
+ }),
116891
+ cause: null
116892
+ });
116893
+ }
116894
+ }
116746
116895
  async function parseTemplateOptions(options) {
116747
116896
  if (options.siteTemplateId) {
116748
116897
  if (options.templateRepo && options.templateRepoPath) {
@@ -116821,6 +116970,7 @@ async function parseCommandOptions(targetParentFolder2, options) {
116821
116970
  targetParentFolder2,
116822
116971
  options
116823
116972
  );
116973
+ const cloudProvider = parseCloudProvider(options.cloudProvider);
116824
116974
  const publish = processPublish({
116825
116975
  template,
116826
116976
  projectName,
@@ -116839,6 +116989,7 @@ async function parseCommandOptions(targetParentFolder2, options) {
116839
116989
  template,
116840
116990
  projectName,
116841
116991
  businessName: options.businessName,
116992
+ cloudProvider,
116842
116993
  publish
116843
116994
  };
116844
116995
  }
@@ -117246,7 +117397,8 @@ var CreateHeadlessSiteCommand = ({
117246
117397
  template: defaultTemplate,
117247
117398
  publish,
117248
117399
  projectName: defaultProjectName,
117249
- businessName: defaultBusinessName
117400
+ businessName: defaultBusinessName,
117401
+ cloudProvider
117250
117402
  }) => {
117251
117403
  const [businessName, setBusinessName] = (0, import_react115.useState)(
117252
117404
  defaultBusinessName
@@ -117307,6 +117459,7 @@ var CreateHeadlessSiteCommand = ({
117307
117459
  {
117308
117460
  businessId,
117309
117461
  projectName: defaultProjectName,
117462
+ cloudProvider,
117310
117463
  onSubmit: (data) => setProjectData(data)
117311
117464
  }
117312
117465
  )),
@@ -117373,7 +117526,9 @@ var ProcessCommand = ({ targetParentFolder: targetParentFolder2, commandOptions
117373
117526
  return (0, import_variant43.match)(status, {
117374
117527
  Error: () => null,
117375
117528
  Loading: () => /* @__PURE__ */ import_react116.default.createElement(Spinner2, { text: "Loading..." }),
117376
- Success: ({ result: { template, projectName, businessName, publish } }) => {
117529
+ Success: ({
117530
+ result: { template, projectName, businessName, cloudProvider, publish }
117531
+ }) => {
117377
117532
  return /* @__PURE__ */ import_react116.default.createElement(
117378
117533
  CreateHeadlessSiteCommand,
117379
117534
  {
@@ -117382,6 +117537,7 @@ var ProcessCommand = ({ targetParentFolder: targetParentFolder2, commandOptions
117382
117537
  template,
117383
117538
  projectName,
117384
117539
  businessName,
117540
+ cloudProvider,
117385
117541
  publish
117386
117542
  }
117387
117543
  );
@@ -117491,6 +117647,11 @@ program2.command("init", { isDefault: true }).description("Create headless site"
117491
117647
  "--project-name <project-name>",
117492
117648
  "The name of your Custom Frontend project"
117493
117649
  ).argParser(validateProjectName).hideHelp()
117650
+ ).addOption(
117651
+ new Option(
117652
+ "--cloud-provider <cloud-provider>",
117653
+ "Cloud provider for deployment"
117654
+ ).argParser(validateCloudProvider).hideHelp()
117494
117655
  ).addOption(
117495
117656
  new Option(
117496
117657
  "--publish",