@wix/create-new 0.0.81 → 0.0.83

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
@@ -118,7 +118,7 @@ import {
118
118
  writeJson,
119
119
  writePackageJson,
120
120
  zod_default
121
- } from "./chunk-YAK2QTA5.js";
121
+ } from "./chunk-SFOWMTOT.js";
122
122
  import {
123
123
  __commonJS,
124
124
  __dirname,
@@ -65307,6 +65307,14 @@ function getErrorComponent(code, cause) {
65307
65307
  FailedToFetchAppForVersion: () => {
65308
65308
  return () => /* @__PURE__ */ import_react84.default.createElement(SystemErrorMessage, { message: `Failed to fetch app configuration.` });
65309
65309
  },
65310
+ FailedToFetchLatestProductionVersion: () => {
65311
+ return () => /* @__PURE__ */ import_react84.default.createElement(
65312
+ SystemErrorMessage,
65313
+ {
65314
+ message: `Failed to fetch the latest production version for an app.`
65315
+ }
65316
+ );
65317
+ },
65310
65318
  FailedToGetAppSecret: () => {
65311
65319
  return () => /* @__PURE__ */ import_react84.default.createElement(
65312
65320
  SystemErrorMessage,
@@ -65799,13 +65807,13 @@ ${errorMessage2}`
65799
65807
  }
65800
65808
  );
65801
65809
  },
65802
- FailedToPullEnvironment: () => {
65810
+ FailedToGetAppEnvironmentVariablesByEnvironment: () => {
65803
65811
  return () => /* @__PURE__ */ import_react84.default.createElement(SystemErrorMessage, { message: "Failed to pull environment variables." });
65804
65812
  },
65805
- FailedToSetEnvironmentVariable: () => {
65813
+ FailedToBulkUpsertAppEnvironmentVariables: () => {
65806
65814
  return () => /* @__PURE__ */ import_react84.default.createElement(SystemErrorMessage, { message: "Failed to set/update environment variable." });
65807
65815
  },
65808
- FailedToRemoveEnvironmentVariable: () => {
65816
+ FailedToDeleteAppEnvironmentVariableByEnvironmentAndKey: () => {
65809
65817
  return () => /* @__PURE__ */ import_react84.default.createElement(SystemErrorMessage, { message: "Failed to remove environment variable." });
65810
65818
  },
65811
65819
  FailedToUploadStaticFiles: () => {
@@ -72179,9 +72187,9 @@ var VersionStatus;
72179
72187
  VersionStatus3["RELEASED"] = "RELEASED";
72180
72188
  })(VersionStatus || (VersionStatus = {}));
72181
72189
  var SortOrder;
72182
- (function(SortOrder4) {
72183
- SortOrder4["ASC"] = "ASC";
72184
- SortOrder4["DESC"] = "DESC";
72190
+ (function(SortOrder5) {
72191
+ SortOrder5["ASC"] = "ASC";
72192
+ SortOrder5["DESC"] = "DESC";
72185
72193
  })(SortOrder || (SortOrder = {}));
72186
72194
  var RequestedFields;
72187
72195
  (function(RequestedFields3) {
@@ -72218,12 +72226,12 @@ var JoinedConditionOperator;
72218
72226
  JoinedConditionOperator2["AND"] = "AND";
72219
72227
  })(JoinedConditionOperator || (JoinedConditionOperator = {}));
72220
72228
  var WebhookIdentityType;
72221
- (function(WebhookIdentityType10) {
72222
- WebhookIdentityType10["UNKNOWN"] = "UNKNOWN";
72223
- WebhookIdentityType10["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
72224
- WebhookIdentityType10["MEMBER"] = "MEMBER";
72225
- WebhookIdentityType10["WIX_USER"] = "WIX_USER";
72226
- WebhookIdentityType10["APP"] = "APP";
72229
+ (function(WebhookIdentityType11) {
72230
+ WebhookIdentityType11["UNKNOWN"] = "UNKNOWN";
72231
+ WebhookIdentityType11["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
72232
+ WebhookIdentityType11["MEMBER"] = "MEMBER";
72233
+ WebhookIdentityType11["WIX_USER"] = "WIX_USER";
72234
+ WebhookIdentityType11["APP"] = "APP";
72227
72235
  })(WebhookIdentityType || (WebhookIdentityType = {}));
72228
72236
 
72229
72237
  // ../../node_modules/@wix/ambassador-devcenter-dsm-v1-development-site/build/es/http.impl.js
@@ -73423,12 +73431,12 @@ function installApp(payload7) {
73423
73431
  // ../../node_modules/@wix/ambassador-apps-v1-app-instance/es/build/types.impl.js
73424
73432
  init_esm_shims();
73425
73433
  var WebhookIdentityType2;
73426
- (function(WebhookIdentityType10) {
73427
- WebhookIdentityType10["UNKNOWN"] = "UNKNOWN";
73428
- WebhookIdentityType10["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
73429
- WebhookIdentityType10["MEMBER"] = "MEMBER";
73430
- WebhookIdentityType10["WIX_USER"] = "WIX_USER";
73431
- WebhookIdentityType10["APP"] = "APP";
73434
+ (function(WebhookIdentityType11) {
73435
+ WebhookIdentityType11["UNKNOWN"] = "UNKNOWN";
73436
+ WebhookIdentityType11["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
73437
+ WebhookIdentityType11["MEMBER"] = "MEMBER";
73438
+ WebhookIdentityType11["WIX_USER"] = "WIX_USER";
73439
+ WebhookIdentityType11["APP"] = "APP";
73432
73440
  })(WebhookIdentityType2 || (WebhookIdentityType2 = {}));
73433
73441
  var InstallType;
73434
73442
  (function(InstallType2) {
@@ -76254,12 +76262,12 @@ var VersionType;
76254
76262
  VersionType2["DEV_VERSION"] = "DEV_VERSION";
76255
76263
  })(VersionType || (VersionType = {}));
76256
76264
  var WebhookIdentityType3;
76257
- (function(WebhookIdentityType10) {
76258
- WebhookIdentityType10["UNKNOWN"] = "UNKNOWN";
76259
- WebhookIdentityType10["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
76260
- WebhookIdentityType10["MEMBER"] = "MEMBER";
76261
- WebhookIdentityType10["WIX_USER"] = "WIX_USER";
76262
- WebhookIdentityType10["APP"] = "APP";
76265
+ (function(WebhookIdentityType11) {
76266
+ WebhookIdentityType11["UNKNOWN"] = "UNKNOWN";
76267
+ WebhookIdentityType11["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
76268
+ WebhookIdentityType11["MEMBER"] = "MEMBER";
76269
+ WebhookIdentityType11["WIX_USER"] = "WIX_USER";
76270
+ WebhookIdentityType11["APP"] = "APP";
76263
76271
  })(WebhookIdentityType3 || (WebhookIdentityType3 = {}));
76264
76272
 
76265
76273
  // ../dev-center-client/src/schemas.ts
@@ -78725,12 +78733,12 @@ var WritingModeValue2;
78725
78733
  WritingModeValue3["sidewaysLr"] = "sidewaysLr";
78726
78734
  })(WritingModeValue2 || (WritingModeValue2 = {}));
78727
78735
  var WebhookIdentityType4;
78728
- (function(WebhookIdentityType10) {
78729
- WebhookIdentityType10["UNKNOWN"] = "UNKNOWN";
78730
- WebhookIdentityType10["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
78731
- WebhookIdentityType10["MEMBER"] = "MEMBER";
78732
- WebhookIdentityType10["WIX_USER"] = "WIX_USER";
78733
- WebhookIdentityType10["APP"] = "APP";
78736
+ (function(WebhookIdentityType11) {
78737
+ WebhookIdentityType11["UNKNOWN"] = "UNKNOWN";
78738
+ WebhookIdentityType11["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
78739
+ WebhookIdentityType11["MEMBER"] = "MEMBER";
78740
+ WebhookIdentityType11["WIX_USER"] = "WIX_USER";
78741
+ WebhookIdentityType11["APP"] = "APP";
78734
78742
  })(WebhookIdentityType4 || (WebhookIdentityType4 = {}));
78735
78743
  var ValidationTargetMethod;
78736
78744
  (function(ValidationTargetMethod2) {
@@ -80909,24 +80917,25 @@ function getAppProject(payload7) {
80909
80917
  return __getAppProject;
80910
80918
  }
80911
80919
 
80912
- // ../../node_modules/@wix/ambassador-velo-backend-v1-app-environment/build/es/http.impl.js
80920
+ // ../../node_modules/@wix/ambassador-velo-backend-v2-app-environment-variable/es/build/http.impl.js
80913
80921
  init_esm_shims();
80914
- var _appEnvironment = {
80922
+ var _appEnvironmentVariable = {
80915
80923
  createdDate: "google.protobuf.Timestamp",
80916
80924
  updatedDate: "google.protobuf.Timestamp"
80917
80925
  };
80918
- var _getAppEnvironmentByNameRequest = {};
80919
- var _getAppEnvironmentByNameResponse = { appEnvironment: "_appEnvironment" };
80920
- var _removeAppEnvironmentVariablesRequest = {};
80921
- var _removeAppEnvironmentVariablesResponse = {
80922
- appEnvironment: "_appEnvironment"
80926
+ var _bulkAppEnvironmentVariableResult = { item: "_appEnvironmentVariable" };
80927
+ var _bulkUpsertAppEnvironmentVariablesRequest = {};
80928
+ var _bulkUpsertAppEnvironmentVariablesResponse = {
80929
+ results: "_bulkAppEnvironmentVariableResult",
80930
+ appEnvironmentVariables: "_appEnvironmentVariable"
80923
80931
  };
80924
- var _upsertAppEnvironmentRequest = {
80925
- fieldMask: "google.protobuf.FieldMask",
80926
- appEnvironment: "_appEnvironment"
80932
+ var _deleteAppEnvironmentVariableByEnvironmentAndKeyRequest = {};
80933
+ var _deleteAppEnvironmentVariableByEnvironmentAndKeyResponse = {};
80934
+ var _getAppEnvironmentVariablesByEnvironmentRequest = {};
80935
+ var _getAppEnvironmentVariablesByEnvironmentResponse = {
80936
+ appEnvironmentVariables: "_appEnvironmentVariable"
80927
80937
  };
80928
- var _upsertAppEnvironmentResponse = { appEnvironment: "_appEnvironment" };
80929
- function resolveWixVeloBackendV1AppEnvironmentManagementUrl(opts) {
80938
+ function resolveWixVeloBackendV2AppEnvironmentVariableServiceUrl(opts) {
80930
80939
  var domainToMappings = {
80931
80940
  "manage._base_domain_": [
80932
80941
  {
@@ -80937,23 +80946,21 @@ function resolveWixVeloBackendV1AppEnvironmentManagementUrl(opts) {
80937
80946
  };
80938
80947
  return resolveUrl(Object.assign(opts, { domainToMappings }));
80939
80948
  }
80940
- function upsertAppEnvironment(payload7) {
80941
- var _a3 = serializer(_upsertAppEnvironmentRequest, { _appEnvironment }), toReq = _a3.toJSON, fromReq = _a3.fromJSON;
80942
- var fromRes = serializer(_upsertAppEnvironmentResponse, {
80943
- _appEnvironment
80944
- }).fromJSON;
80945
- function __upsertAppEnvironment(_a4) {
80949
+ function bulkUpsertAppEnvironmentVariables(payload7) {
80950
+ var _a3 = serializer(_bulkUpsertAppEnvironmentVariablesRequest, {}), toReq = _a3.toJSON, fromReq = _a3.fromJSON;
80951
+ var fromRes = serializer(_bulkUpsertAppEnvironmentVariablesResponse, { _appEnvironmentVariable, _bulkAppEnvironmentVariableResult }).fromJSON;
80952
+ function __bulkUpsertAppEnvironmentVariables(_a4) {
80946
80953
  var host = _a4.host;
80947
80954
  var serializedData = toReq(payload7);
80948
80955
  var metadata = {
80949
- entityFqdn: "wix.velo.backend.v1.app_environment",
80956
+ entityFqdn: "wix.velo.backend.v2.app_environment_variable",
80950
80957
  method: "POST",
80951
- methodFqn: "wix.velo.backend.v1.AppEnvironmentManagement.UpsertAppEnvironment",
80958
+ methodFqn: "wix.velo.backend.v2.AppEnvironmentVariableService.BulkUpsertAppEnvironmentVariables",
80952
80959
  migrationOptions: {
80953
80960
  optInTransformResponse: true
80954
80961
  },
80955
- url: resolveWixVeloBackendV1AppEnvironmentManagementUrl({
80956
- protoPath: "/v1/app-projects/{appEnvironment.appProjectId}/app-environments/upsert/name/{appEnvironment.name}",
80962
+ url: resolveWixVeloBackendV2AppEnvironmentVariableServiceUrl({
80963
+ protoPath: "/v2/bulk/app-projects/{appProjectId}/app-environment-variables/upsert",
80957
80964
  data: serializedData,
80958
80965
  host
80959
80966
  }),
@@ -80962,27 +80969,25 @@ function upsertAppEnvironment(payload7) {
80962
80969
  };
80963
80970
  return metadata;
80964
80971
  }
80965
- __upsertAppEnvironment.fromReq = fromReq;
80966
- __upsertAppEnvironment.__isAmbassador = true;
80967
- return __upsertAppEnvironment;
80972
+ __bulkUpsertAppEnvironmentVariables.fromReq = fromReq;
80973
+ __bulkUpsertAppEnvironmentVariables.__isAmbassador = true;
80974
+ return __bulkUpsertAppEnvironmentVariables;
80968
80975
  }
80969
- function getAppEnvironmentByName(payload7) {
80970
- var _a3 = serializer(_getAppEnvironmentByNameRequest, {}), toReq = _a3.toJSON, fromReq = _a3.fromJSON;
80971
- var fromRes = serializer(_getAppEnvironmentByNameResponse, {
80972
- _appEnvironment
80973
- }).fromJSON;
80974
- function __getAppEnvironmentByName(_a4) {
80976
+ function getAppEnvironmentVariablesByEnvironment(payload7) {
80977
+ var _a3 = serializer(_getAppEnvironmentVariablesByEnvironmentRequest, {}), toReq = _a3.toJSON, fromReq = _a3.fromJSON;
80978
+ var fromRes = serializer(_getAppEnvironmentVariablesByEnvironmentResponse, { _appEnvironmentVariable }).fromJSON;
80979
+ function __getAppEnvironmentVariablesByEnvironment(_a4) {
80975
80980
  var host = _a4.host;
80976
80981
  var serializedData = toReq(payload7);
80977
80982
  var metadata = {
80978
- entityFqdn: "wix.velo.backend.v1.app_environment",
80983
+ entityFqdn: "wix.velo.backend.v2.app_environment_variable",
80979
80984
  method: "GET",
80980
- methodFqn: "wix.velo.backend.v1.AppEnvironmentManagement.GetAppEnvironmentByName",
80985
+ methodFqn: "wix.velo.backend.v2.AppEnvironmentVariableService.GetAppEnvironmentVariablesByEnvironment",
80981
80986
  migrationOptions: {
80982
80987
  optInTransformResponse: true
80983
80988
  },
80984
- url: resolveWixVeloBackendV1AppEnvironmentManagementUrl({
80985
- protoPath: "/v1/app-projects/{appProjectId}/app-environments/name/{appEnvironmentName}",
80989
+ url: resolveWixVeloBackendV2AppEnvironmentVariableServiceUrl({
80990
+ protoPath: "/v2/app-projects/{appProjectId}/app-environment-variables/environment/{environment}",
80986
80991
  data: serializedData,
80987
80992
  host
80988
80993
  }),
@@ -80991,38 +80996,66 @@ function getAppEnvironmentByName(payload7) {
80991
80996
  };
80992
80997
  return metadata;
80993
80998
  }
80994
- __getAppEnvironmentByName.fromReq = fromReq;
80995
- __getAppEnvironmentByName.__isAmbassador = true;
80996
- return __getAppEnvironmentByName;
80999
+ __getAppEnvironmentVariablesByEnvironment.fromReq = fromReq;
81000
+ __getAppEnvironmentVariablesByEnvironment.__isAmbassador = true;
81001
+ return __getAppEnvironmentVariablesByEnvironment;
80997
81002
  }
80998
- function removeAppEnvironmentVariables(payload7) {
80999
- var _a3 = serializer(_removeAppEnvironmentVariablesRequest, {}), toReq = _a3.toJSON, fromReq = _a3.fromJSON;
81000
- var fromRes = serializer(_removeAppEnvironmentVariablesResponse, { _appEnvironment }).fromJSON;
81001
- function __removeAppEnvironmentVariables(_a4) {
81003
+ function deleteAppEnvironmentVariableByEnvironmentAndKey(payload7) {
81004
+ var _a3 = serializer(_deleteAppEnvironmentVariableByEnvironmentAndKeyRequest, {}), toReq = _a3.toJSON, fromReq = _a3.fromJSON;
81005
+ var fromRes = serializer(_deleteAppEnvironmentVariableByEnvironmentAndKeyResponse, {}).fromJSON;
81006
+ function __deleteAppEnvironmentVariableByEnvironmentAndKey(_a4) {
81002
81007
  var host = _a4.host;
81003
81008
  var serializedData = toReq(payload7);
81004
81009
  var metadata = {
81005
- entityFqdn: "wix.velo.backend.v1.app_environment",
81006
- method: "POST",
81007
- methodFqn: "wix.velo.backend.v1.AppEnvironmentManagement.RemoveAppEnvironmentVariables",
81010
+ entityFqdn: "wix.velo.backend.v2.app_environment_variable",
81011
+ method: "DELETE",
81012
+ methodFqn: "wix.velo.backend.v2.AppEnvironmentVariableService.DeleteAppEnvironmentVariableByEnvironmentAndKey",
81008
81013
  migrationOptions: {
81009
81014
  optInTransformResponse: true
81010
81015
  },
81011
- url: resolveWixVeloBackendV1AppEnvironmentManagementUrl({
81012
- protoPath: "/v1/app-projects/{appProjectId}/app-environments/{appEnvironmentId}/remove",
81016
+ url: resolveWixVeloBackendV2AppEnvironmentVariableServiceUrl({
81017
+ protoPath: "/v2/app-projects/{appProjectId}/app-environment-variables/environment/{environment}/key/{key}",
81013
81018
  data: serializedData,
81014
81019
  host
81015
81020
  }),
81016
- data: serializedData,
81021
+ params: toURLSearchParams(serializedData),
81017
81022
  transformResponse: fromRes
81018
81023
  };
81019
81024
  return metadata;
81020
81025
  }
81021
- __removeAppEnvironmentVariables.fromReq = fromReq;
81022
- __removeAppEnvironmentVariables.__isAmbassador = true;
81023
- return __removeAppEnvironmentVariables;
81026
+ __deleteAppEnvironmentVariableByEnvironmentAndKey.fromReq = fromReq;
81027
+ __deleteAppEnvironmentVariableByEnvironmentAndKey.__isAmbassador = true;
81028
+ return __deleteAppEnvironmentVariableByEnvironmentAndKey;
81024
81029
  }
81025
81030
 
81031
+ // ../../node_modules/@wix/ambassador-velo-backend-v2-app-environment-variable/es/build/types.impl.js
81032
+ init_esm_shims();
81033
+ var WebhookIdentityType5;
81034
+ (function(WebhookIdentityType11) {
81035
+ WebhookIdentityType11["UNKNOWN"] = "UNKNOWN";
81036
+ WebhookIdentityType11["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
81037
+ WebhookIdentityType11["MEMBER"] = "MEMBER";
81038
+ WebhookIdentityType11["WIX_USER"] = "WIX_USER";
81039
+ WebhookIdentityType11["APP"] = "APP";
81040
+ })(WebhookIdentityType5 || (WebhookIdentityType5 = {}));
81041
+ var SortOrder2;
81042
+ (function(SortOrder5) {
81043
+ SortOrder5["ASC"] = "ASC";
81044
+ SortOrder5["DESC"] = "DESC";
81045
+ })(SortOrder2 || (SortOrder2 = {}));
81046
+ var Mutability;
81047
+ (function(Mutability2) {
81048
+ Mutability2["UNKNOWN_MUTABILITY"] = "UNKNOWN_MUTABILITY";
81049
+ Mutability2["STATIC"] = "STATIC";
81050
+ Mutability2["DYNAMIC"] = "DYNAMIC";
81051
+ })(Mutability || (Mutability = {}));
81052
+ var Sensitivity;
81053
+ (function(Sensitivity2) {
81054
+ Sensitivity2["UNKNOWN_SENSITIVITY"] = "UNKNOWN_SENSITIVITY";
81055
+ Sensitivity2["PUBLIC"] = "PUBLIC";
81056
+ Sensitivity2["SECRET"] = "SECRET";
81057
+ })(Sensitivity || (Sensitivity = {}));
81058
+
81026
81059
  // ../backend-as-a-service-client/src/schemas.ts
81027
81060
  init_esm_shims();
81028
81061
 
@@ -81041,19 +81074,19 @@ var DeploymentState;
81041
81074
  DeploymentState2["DEPLOY_SUCCESS"] = "DEPLOY_SUCCESS";
81042
81075
  DeploymentState2["DEPLOY_FAILED"] = "DEPLOY_FAILED";
81043
81076
  })(DeploymentState || (DeploymentState = {}));
81044
- var SortOrder2;
81045
- (function(SortOrder4) {
81046
- SortOrder4["ASC"] = "ASC";
81047
- SortOrder4["DESC"] = "DESC";
81048
- })(SortOrder2 || (SortOrder2 = {}));
81049
- var WebhookIdentityType5;
81050
- (function(WebhookIdentityType10) {
81051
- WebhookIdentityType10["UNKNOWN"] = "UNKNOWN";
81052
- WebhookIdentityType10["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
81053
- WebhookIdentityType10["MEMBER"] = "MEMBER";
81054
- WebhookIdentityType10["WIX_USER"] = "WIX_USER";
81055
- WebhookIdentityType10["APP"] = "APP";
81056
- })(WebhookIdentityType5 || (WebhookIdentityType5 = {}));
81077
+ var SortOrder3;
81078
+ (function(SortOrder5) {
81079
+ SortOrder5["ASC"] = "ASC";
81080
+ SortOrder5["DESC"] = "DESC";
81081
+ })(SortOrder3 || (SortOrder3 = {}));
81082
+ var WebhookIdentityType6;
81083
+ (function(WebhookIdentityType11) {
81084
+ WebhookIdentityType11["UNKNOWN"] = "UNKNOWN";
81085
+ WebhookIdentityType11["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
81086
+ WebhookIdentityType11["MEMBER"] = "MEMBER";
81087
+ WebhookIdentityType11["WIX_USER"] = "WIX_USER";
81088
+ WebhookIdentityType11["APP"] = "APP";
81089
+ })(WebhookIdentityType6 || (WebhookIdentityType6 = {}));
81057
81090
 
81058
81091
  // ../backend-as-a-service-client/src/schemas.ts
81059
81092
  var staticFileMetadata = external_exports.object({
@@ -81074,13 +81107,6 @@ var AppDeploymentSchema = external_exports.object({
81074
81107
  var CompleteAppDeploymentSchema = external_exports.object({
81075
81108
  appDeployment: AppDeploymentSchema
81076
81109
  });
81077
- var AppEnvironmentSchema = external_exports.object({
81078
- appEnvironment: external_exports.object({
81079
- id: external_exports.string(),
81080
- variables: external_exports.record(external_exports.string()),
81081
- secrets: external_exports.record(external_exports.string())
81082
- }).passthrough()
81083
- });
81084
81110
  var AppProjectSchema = external_exports.object({
81085
81111
  appProject: external_exports.object({
81086
81112
  id: external_exports.string().uuid(),
@@ -81115,6 +81141,28 @@ var StaticFileUploadSchema = external_exports.object({
81115
81141
  jwt: external_exports.string().optional()
81116
81142
  }).optional()
81117
81143
  }).passthrough();
81144
+ var AppEnvironmentVariableSchema = external_exports.object({
81145
+ key: external_exports.string(),
81146
+ value: external_exports.string()
81147
+ });
81148
+ var AppEnvironmentVariablesSchema = external_exports.array(AppEnvironmentVariableSchema).optional().transform((variables) => {
81149
+ return (variables ?? []).reduce((acc, curr) => {
81150
+ acc[curr.key] = curr.value;
81151
+ return acc;
81152
+ }, {});
81153
+ });
81154
+ var GetAppEnvironmentVariablesSchema = external_exports.object({
81155
+ appEnvironmentVariables: AppEnvironmentVariablesSchema
81156
+ });
81157
+ var UpsertAppEnvironmentVariablesSchema = external_exports.object({
81158
+ appEnvironmentVariables: AppEnvironmentVariablesSchema,
81159
+ results: external_exports.array(external_exports.unknown()).optional(),
81160
+ bulkActionMetadata: external_exports.object({
81161
+ totalSuccesses: external_exports.number().optional(),
81162
+ totalFailures: external_exports.number().optional(),
81163
+ undetailedFailures: external_exports.number().optional()
81164
+ }).optional()
81165
+ });
81118
81166
 
81119
81167
  // ../backend-as-a-service-client/src/backend-as-a-service-client.ts
81120
81168
  var { minRetryTimeout } = getTestOverrides();
@@ -81266,64 +81314,74 @@ var BackendAsAServiceClient = class {
81266
81314
  }
81267
81315
  };
81268
81316
  // Env management
81269
- getAppEnvironmentByName = async (appId, environment) => {
81317
+ getAppEnvironmentVariables = async (appId, environment) => {
81270
81318
  try {
81271
81319
  const { data } = await pRetry(
81272
81320
  () => this.httpClient.request(
81273
- getAppEnvironmentByName({
81321
+ getAppEnvironmentVariablesByEnvironment({
81274
81322
  appProjectId: appId,
81275
- appEnvironmentName: environment
81323
+ environment
81276
81324
  })
81277
81325
  ),
81278
81326
  this.retryOptions
81279
81327
  );
81280
- return AppEnvironmentSchema.parse(data).appEnvironment;
81328
+ const { appEnvironmentVariables } = GetAppEnvironmentVariablesSchema.parse(data);
81329
+ return appEnvironmentVariables;
81281
81330
  } catch (e2) {
81282
81331
  throw new CliError({
81283
- code: CliErrorCode.FailedToPullEnvironment(),
81332
+ code: CliErrorCode.FailedToGetAppEnvironmentVariablesByEnvironment(),
81284
81333
  cause: e2
81285
81334
  });
81286
81335
  }
81287
81336
  };
81288
- upsertAppEnvironment = async (appId, environment, variables) => {
81337
+ upsertAppEnvironmentVariables = async (appId, environment, variables) => {
81338
+ let result;
81289
81339
  try {
81290
81340
  const { data } = await this.httpClient.request(
81291
- upsertAppEnvironment({
81292
- appEnvironment: {
81293
- appProjectId: appId,
81294
- name: environment,
81295
- variables
81296
- }
81341
+ bulkUpsertAppEnvironmentVariables({
81342
+ appProjectId: appId,
81343
+ environment,
81344
+ variables,
81345
+ mutability: Mutability.STATIC,
81346
+ returnEntity: true,
81347
+ returnAllEnvironment: true
81297
81348
  })
81298
81349
  );
81299
- return AppEnvironmentSchema.parse(data).appEnvironment;
81350
+ result = UpsertAppEnvironmentVariablesSchema.parse(data);
81300
81351
  } catch (e2) {
81301
81352
  throw new CliError({
81302
- code: CliErrorCode.FailedToSetEnvironmentVariable(),
81353
+ code: CliErrorCode.FailedToBulkUpsertAppEnvironmentVariables(),
81303
81354
  cause: e2
81304
81355
  });
81305
81356
  }
81357
+ const { bulkActionMetadata, appEnvironmentVariables } = result;
81358
+ if (bulkActionMetadata?.totalFailures || bulkActionMetadata?.undetailedFailures) {
81359
+ throw new CliError({
81360
+ code: CliErrorCode.FailedToBulkUpsertAppEnvironmentVariables(),
81361
+ cause: void 0,
81362
+ info: { ...result }
81363
+ });
81364
+ }
81365
+ return appEnvironmentVariables;
81306
81366
  };
81307
- removeAppEnvironmentVariable = async (appId, environment, variable) => {
81367
+ deleteAppEnvironmentVariable = async (appId, environment, variable) => {
81308
81368
  try {
81309
- const appEnvironment = await this.getAppEnvironmentByName(
81310
- appId,
81311
- environment
81312
- );
81313
- const { data } = await pRetry(
81314
- () => this.httpClient.request(
81315
- removeAppEnvironmentVariables({
81316
- appEnvironmentId: appEnvironment.id,
81317
- appProjectId: appId,
81318
- variables: [variable]
81319
- })
81320
- ),
81321
- this.retryOptions
81369
+ await this.httpClient.request(
81370
+ deleteAppEnvironmentVariableByEnvironmentAndKey({
81371
+ appProjectId: appId,
81372
+ environment,
81373
+ key: variable
81374
+ })
81322
81375
  );
81323
- return AppEnvironmentSchema.parse(data).appEnvironment;
81324
81376
  } catch (e2) {
81377
+ if (isHttpError(e2) && isHttpApplicationError(e2)) {
81378
+ const applicationError = e2.response?.data.details.applicationError;
81379
+ if (applicationError?.code === "APP_ENVIRONMENT_VARIABLE_NOT_FOUND") {
81380
+ return;
81381
+ }
81382
+ }
81325
81383
  throw new CliError({
81326
- code: CliErrorCode.FailedToRemoveEnvironmentVariable(),
81384
+ code: CliErrorCode.FailedToDeleteAppEnvironmentVariableByEnvironmentAndKey(),
81327
81385
  cause: e2
81328
81386
  });
81329
81387
  }
@@ -81351,7 +81409,6 @@ var createAppProjectAndEnvironment = async ({
81351
81409
  backendAsAServiceClient
81352
81410
  }) => {
81353
81411
  let appProject = await backendAsAServiceClient.getAppProject(appId);
81354
- let appEnvironment;
81355
81412
  if (!appProject) {
81356
81413
  const publicKeyAndSecret = await devCenterClient.getAppSecret({ appId });
81357
81414
  appProject = await backendAsAServiceClient.createAppProject({
@@ -81361,7 +81418,7 @@ var createAppProjectAndEnvironment = async ({
81361
81418
  cloudProvider: CloudProvider.CLOUD_FLARE,
81362
81419
  projectType: "APP"
81363
81420
  });
81364
- appEnvironment = await backendAsAServiceClient.upsertAppEnvironment(
81421
+ return await backendAsAServiceClient.upsertAppEnvironmentVariables(
81365
81422
  appProject.id,
81366
81423
  DEFAULT_ENVIRONMENT_NAME,
81367
81424
  {
@@ -81372,13 +81429,10 @@ var createAppProjectAndEnvironment = async ({
81372
81429
  }
81373
81430
  );
81374
81431
  }
81375
- if (!appEnvironment) {
81376
- appEnvironment = await backendAsAServiceClient.getAppEnvironmentByName(
81377
- appProject.id,
81378
- DEFAULT_ENVIRONMENT_NAME
81379
- );
81380
- }
81381
- return { variables: appEnvironment.variables };
81432
+ return await backendAsAServiceClient.getAppEnvironmentVariables(
81433
+ appProject.id,
81434
+ DEFAULT_ENVIRONMENT_NAME
81435
+ );
81382
81436
  };
81383
81437
  function generateRandomSlug() {
81384
81438
  return randomBytes(8).toString("hex");
@@ -81409,7 +81463,7 @@ var useAppCreation = ({ extendAppId }) => {
81409
81463
  }
81410
81464
  })
81411
81465
  );
81412
- const { variables: environmentVariables } = await createAppProjectAndEnvironment({
81466
+ const environmentVariables = await createAppProjectAndEnvironment({
81413
81467
  appId,
81414
81468
  appName,
81415
81469
  devCenterClient,
@@ -81646,7 +81700,7 @@ var ExistingAppFlow = ({
81646
81700
  );
81647
81701
  const registerAppCallback = useAsyncCallback3(
81648
81702
  async (_2, { appData, packageName }) => {
81649
- const { variables } = await createAppProjectAndEnvironment({
81703
+ const environmentVariables = await createAppProjectAndEnvironment({
81650
81704
  appId: appData.appId,
81651
81705
  appName: appData.appName,
81652
81706
  devCenterClient,
@@ -81657,7 +81711,7 @@ var ExistingAppFlow = ({
81657
81711
  packageName,
81658
81712
  template: TemplateSource.Default(),
81659
81713
  mcpConfigResult: McpConfigResult.Canceled(),
81660
- environmentVariables: variables
81714
+ environmentVariables
81661
81715
  });
81662
81716
  }
81663
81717
  );
@@ -81928,7 +81982,7 @@ function getTasks({
81928
81982
  cause: e2
81929
81983
  });
81930
81984
  }
81931
- const { generateApp } = await import("./generator-PWWNQSLZ.js");
81985
+ const { generateApp } = await import("./generator-MC3RF2NR.js");
81932
81986
  await generateApp({
81933
81987
  packageName,
81934
81988
  packageFolder,
@@ -82713,7 +82767,7 @@ var useCreateProject = (businessId) => {
82713
82767
  } = useDevCenterClient({
82714
82768
  siteId: businessId
82715
82769
  });
82716
- const { createAppProject: createAppProject2, upsertAppEnvironment: upsertAppEnvironment2 } = useBackendAsAServiceClient();
82770
+ const { createAppProject: createAppProject2, upsertAppEnvironmentVariables } = useBackendAsAServiceClient();
82717
82771
  return useAsyncCallback3(
82718
82772
  async (_2, {
82719
82773
  businessName,
@@ -82754,7 +82808,7 @@ var useCreateProject = (businessId) => {
82754
82808
  ],
82755
82809
  redirectUrlWixPages: prodBaseDomain
82756
82810
  });
82757
- const appEnvironment = await upsertAppEnvironment2(
82811
+ const environmentVariables = await upsertAppEnvironmentVariables(
82758
82812
  appProject.id,
82759
82813
  DEFAULT_ENVIRONMENT_NAME2,
82760
82814
  {
@@ -82770,7 +82824,7 @@ var useCreateProject = (businessId) => {
82770
82824
  instanceId: appInstall.appInstance.id,
82771
82825
  appSecret: publicKeyAndSecret.appSecret,
82772
82826
  webhookPublicKey: publicKeyAndSecret.webhookPublicKey,
82773
- environmentVariables: appEnvironment.variables,
82827
+ environmentVariables,
82774
82828
  baseUrl: appProject.baseUrl
82775
82829
  };
82776
82830
  return projectData;
@@ -92805,14 +92859,14 @@ var Action;
92805
92859
  Action2["OVERWRITE"] = "OVERWRITE";
92806
92860
  Action2["COPY"] = "COPY";
92807
92861
  })(Action || (Action = {}));
92808
- var WebhookIdentityType6;
92809
- (function(WebhookIdentityType10) {
92810
- WebhookIdentityType10["UNKNOWN"] = "UNKNOWN";
92811
- WebhookIdentityType10["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
92812
- WebhookIdentityType10["MEMBER"] = "MEMBER";
92813
- WebhookIdentityType10["WIX_USER"] = "WIX_USER";
92814
- WebhookIdentityType10["APP"] = "APP";
92815
- })(WebhookIdentityType6 || (WebhookIdentityType6 = {}));
92862
+ var WebhookIdentityType7;
92863
+ (function(WebhookIdentityType11) {
92864
+ WebhookIdentityType11["UNKNOWN"] = "UNKNOWN";
92865
+ WebhookIdentityType11["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
92866
+ WebhookIdentityType11["MEMBER"] = "MEMBER";
92867
+ WebhookIdentityType11["WIX_USER"] = "WIX_USER";
92868
+ WebhookIdentityType11["APP"] = "APP";
92869
+ })(WebhookIdentityType7 || (WebhookIdentityType7 = {}));
92816
92870
 
92817
92871
  // ../../node_modules/@wix/ambassador-velo-github-v1-github-onboarding-status/build/es/types.impl.js
92818
92872
  init_esm_shims();
@@ -92894,14 +92948,14 @@ var DeleteStatus;
92894
92948
  DeleteStatus2["PENDING_PURGE"] = "PENDING_PURGE";
92895
92949
  DeleteStatus2["PURGED_EXTERNALLY"] = "PURGED_EXTERNALLY";
92896
92950
  })(DeleteStatus || (DeleteStatus = {}));
92897
- var WebhookIdentityType7;
92898
- (function(WebhookIdentityType10) {
92899
- WebhookIdentityType10["UNKNOWN"] = "UNKNOWN";
92900
- WebhookIdentityType10["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
92901
- WebhookIdentityType10["MEMBER"] = "MEMBER";
92902
- WebhookIdentityType10["WIX_USER"] = "WIX_USER";
92903
- WebhookIdentityType10["APP"] = "APP";
92904
- })(WebhookIdentityType7 || (WebhookIdentityType7 = {}));
92951
+ var WebhookIdentityType8;
92952
+ (function(WebhookIdentityType11) {
92953
+ WebhookIdentityType11["UNKNOWN"] = "UNKNOWN";
92954
+ WebhookIdentityType11["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
92955
+ WebhookIdentityType11["MEMBER"] = "MEMBER";
92956
+ WebhookIdentityType11["WIX_USER"] = "WIX_USER";
92957
+ WebhookIdentityType11["APP"] = "APP";
92958
+ })(WebhookIdentityType8 || (WebhookIdentityType8 = {}));
92905
92959
 
92906
92960
  // ../velo-client/src/velo-client.ts
92907
92961
  init_esm_shims();
@@ -92932,14 +92986,14 @@ var RcLabel;
92932
92986
  RcLabel2["UNKNOWN"] = "UNKNOWN";
92933
92987
  RcLabel2["WIX_CLI"] = "WIX_CLI";
92934
92988
  })(RcLabel || (RcLabel = {}));
92935
- var WebhookIdentityType8;
92936
- (function(WebhookIdentityType10) {
92937
- WebhookIdentityType10["UNKNOWN"] = "UNKNOWN";
92938
- WebhookIdentityType10["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
92939
- WebhookIdentityType10["MEMBER"] = "MEMBER";
92940
- WebhookIdentityType10["WIX_USER"] = "WIX_USER";
92941
- WebhookIdentityType10["APP"] = "APP";
92942
- })(WebhookIdentityType8 || (WebhookIdentityType8 = {}));
92989
+ var WebhookIdentityType9;
92990
+ (function(WebhookIdentityType11) {
92991
+ WebhookIdentityType11["UNKNOWN"] = "UNKNOWN";
92992
+ WebhookIdentityType11["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
92993
+ WebhookIdentityType11["MEMBER"] = "MEMBER";
92994
+ WebhookIdentityType11["WIX_USER"] = "WIX_USER";
92995
+ WebhookIdentityType11["APP"] = "APP";
92996
+ })(WebhookIdentityType9 || (WebhookIdentityType9 = {}));
92943
92997
 
92944
92998
  // ../../node_modules/@wix/ambassador-velo-apps-v1-app/build/es/http.impl.js
92945
92999
  init_esm_shims();
@@ -93607,19 +93661,19 @@ var GitRemoteType;
93607
93661
  GitRemoteType2["S3"] = "S3";
93608
93662
  GitRemoteType2["GITHUB"] = "GITHUB";
93609
93663
  })(GitRemoteType || (GitRemoteType = {}));
93610
- var WebhookIdentityType9;
93611
- (function(WebhookIdentityType10) {
93612
- WebhookIdentityType10["UNKNOWN"] = "UNKNOWN";
93613
- WebhookIdentityType10["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
93614
- WebhookIdentityType10["MEMBER"] = "MEMBER";
93615
- WebhookIdentityType10["WIX_USER"] = "WIX_USER";
93616
- WebhookIdentityType10["APP"] = "APP";
93617
- })(WebhookIdentityType9 || (WebhookIdentityType9 = {}));
93618
- var SortOrder3;
93619
- (function(SortOrder4) {
93620
- SortOrder4["ASC"] = "ASC";
93621
- SortOrder4["DESC"] = "DESC";
93622
- })(SortOrder3 || (SortOrder3 = {}));
93664
+ var WebhookIdentityType10;
93665
+ (function(WebhookIdentityType11) {
93666
+ WebhookIdentityType11["UNKNOWN"] = "UNKNOWN";
93667
+ WebhookIdentityType11["ANONYMOUS_VISITOR"] = "ANONYMOUS_VISITOR";
93668
+ WebhookIdentityType11["MEMBER"] = "MEMBER";
93669
+ WebhookIdentityType11["WIX_USER"] = "WIX_USER";
93670
+ WebhookIdentityType11["APP"] = "APP";
93671
+ })(WebhookIdentityType10 || (WebhookIdentityType10 = {}));
93672
+ var SortOrder4;
93673
+ (function(SortOrder5) {
93674
+ SortOrder5["ASC"] = "ASC";
93675
+ SortOrder5["DESC"] = "DESC";
93676
+ })(SortOrder4 || (SortOrder4 = {}));
93623
93677
 
93624
93678
  // ../codestore-client/src/schemas.ts
93625
93679
  init_esm_shims();
@@ -94318,7 +94372,7 @@ import { randomUUID as randomUUID3 } from "node:crypto";
94318
94372
  var package_default = {
94319
94373
  name: "@wix/create-new",
94320
94374
  description: "General entry point for creating Wix projects",
94321
- version: "0.0.81",
94375
+ version: "0.0.83",
94322
94376
  bin: "bin/index.cjs",
94323
94377
  devDependencies: {
94324
94378
  "@commander-js/extra-typings": "^13.0.0",