@embeddable.com/sdk-core 3.14.0-next.7 → 3.14.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/lib/index.esm.js CHANGED
@@ -21867,7 +21867,7 @@ const CUBE_FILES = /^(.*)\.cube\.(ya?ml|js)$/;
21867
21867
  const CLIENT_CONTEXT_FILES = /^(.*)\.cc\.ya?ml$/;
21868
21868
  const SECURITY_CONTEXT_FILES = /^(.*)\.sc\.ya?ml$/;
21869
21869
  var push = async () => {
21870
- var _a;
21870
+ var _a, _b, _c, _d, _f, _g;
21871
21871
  await initLogger("push");
21872
21872
  const breadcrumbs = [];
21873
21873
  let spinnerPushing;
@@ -21883,7 +21883,20 @@ var push = async () => {
21883
21883
  if (process.argv.includes("--api-key") || process.argv.includes("-k")) {
21884
21884
  spinnerPushing = ora("Using API key...").start();
21885
21885
  breadcrumbs.push("push by api key");
21886
- await pushByApiKey(config, spinnerPushing);
21886
+ try {
21887
+ await pushByApiKey(config, spinnerPushing);
21888
+ }
21889
+ catch (error) {
21890
+ if (((_b = (_a = error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.errorCode) === "BUILDER-998") {
21891
+ spinnerPushing.fail(`Authentication failure. Server responded with: "${(_d = (_c = error.response) === null || _c === void 0 ? void 0 : _c.data) === null || _d === void 0 ? void 0 : _d.errorMessage}". Ensure that your API key is valid for the region specified in the embeddable.config.ts|js file.
21892
+ You are trying to push to the following app url: ${config.previewBaseUrl}
21893
+ Read more about deployment regions at https://docs.embeddable.com/deployment/deployment-regions`);
21894
+ process.exit(1);
21895
+ }
21896
+ spinnerPushing.fail("Publishing failed");
21897
+ console.log(((_f = error.response) === null || _f === void 0 ? void 0 : _f.data) || error);
21898
+ process.exit(1);
21899
+ }
21887
21900
  publishedSectionFeedback(config, spinnerPushing);
21888
21901
  spinnerPushing.succeed("Published using API key");
21889
21902
  return;
@@ -21909,7 +21922,7 @@ var push = async () => {
21909
21922
  spinnerPushing === null || spinnerPushing === void 0 ? void 0 : spinnerPushing.fail("Publishing failed");
21910
21923
  await logError({ command: "push", breadcrumbs, error });
21911
21924
  await reportErrorToRollbar(error);
21912
- console.log(((_a = error.response) === null || _a === void 0 ? void 0 : _a.data) || error);
21925
+ console.log(((_g = error.response) === null || _g === void 0 ? void 0 : _g.data) || error);
21913
21926
  process.exit(1);
21914
21927
  }
21915
21928
  };