@embeddable.com/sdk-core 3.12.2 → 3.12.4-next.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.
@@ -1,4 +1,5 @@
1
1
  import { RollupOptions } from "rollup";
2
+ export type Region = "EU" | "US" | "legacy-US";
2
3
  export type EmbeddableConfig = {
3
4
  plugins: (() => {
4
5
  pluginName: string;
@@ -24,8 +25,9 @@ export type EmbeddableConfig = {
24
25
  };
25
26
  };
26
27
  rollupOptions?: RollupOptions;
28
+ region?: Region;
27
29
  };
28
- declare const _default: ({ plugins, pushBaseUrl, audienceUrl, authDomain, authClientId, errorFallbackComponent, applicationEnvironment, rollbarAccessToken, previewBaseUrl, modelsSrc, presetsSrc, componentsSrc, globalCss, viteConfig, rollupOptions, }: EmbeddableConfig) => {
30
+ declare const _default: ({ plugins, region, pushBaseUrl, audienceUrl, authDomain, authClientId, errorFallbackComponent, applicationEnvironment, rollbarAccessToken, previewBaseUrl, modelsSrc, presetsSrc, componentsSrc, globalCss, viteConfig, rollupOptions, }: EmbeddableConfig) => {
29
31
  core: {
30
32
  rootDir: string;
31
33
  templatesDir: string;
package/lib/index.esm.js CHANGED
@@ -21523,6 +21523,7 @@ const CUBE_FILES = /^(.*)\.cube\.(ya?ml|js)$/;
21523
21523
  const PRESET_FILES = /^(.*)\.(sc|cc)\.ya?ml$/;
21524
21524
  let ora$1;
21525
21525
  var push = async () => {
21526
+ var _a;
21526
21527
  await initLogger("push");
21527
21528
  const breadcrumbs = [];
21528
21529
  let spinnerPushing;
@@ -21562,7 +21563,7 @@ var push = async () => {
21562
21563
  spinnerPushing === null || spinnerPushing === void 0 ? void 0 : spinnerPushing.fail("Publishing failed");
21563
21564
  await logError({ command: "push", breadcrumbs, error });
21564
21565
  await reportErrorToRollbar(error);
21565
- console.log(error);
21566
+ console.log(((_a = error.response) === null || _a === void 0 ? void 0 : _a.data) || error);
21566
21567
  process.exit(1);
21567
21568
  }
21568
21569
  };
@@ -21952,7 +21953,34 @@ const getPreviewWorkspace = async (startedOra, ctx) => {
21952
21953
  }
21953
21954
  };
21954
21955
 
21955
- var defineConfig = ({ plugins, pushBaseUrl, audienceUrl, authDomain, authClientId, errorFallbackComponent, applicationEnvironment, rollbarAccessToken, previewBaseUrl, modelsSrc = "src", presetsSrc = "src", componentsSrc = "src", globalCss = "src/global.css", viteConfig = {}, rollupOptions = {}, }) => {
21956
+ const REGION_CONFIGS = {
21957
+ EU: {
21958
+ pushBaseUrl: "https://api.eu.embeddable.com",
21959
+ audienceUrl: "https://auth.eu.embeddable.com",
21960
+ previewBaseUrl: "https://app.eu.embeddable.com",
21961
+ authDomain: "auth.eu.embeddable.com",
21962
+ authClientId: "6OGPwIQsVmtrBKhNrwAaXhz4ePb0kBGV",
21963
+ },
21964
+ US: {
21965
+ pushBaseUrl: "https://api.us.embeddable.com",
21966
+ audienceUrl: "https://auth.embeddable.com",
21967
+ previewBaseUrl: "https://app.us.embeddable.com",
21968
+ authDomain: "auth.embeddable.com",
21969
+ authClientId: "dygrSUmI6HmgY5ymVbEAoLDEBxIOyr1V",
21970
+ },
21971
+ "legacy-US": {
21972
+ pushBaseUrl: "https://api.embeddable.com",
21973
+ audienceUrl: "https://auth.embeddable.com",
21974
+ previewBaseUrl: "https://app.embeddable.com",
21975
+ authDomain: "auth.embeddable.com",
21976
+ authClientId: "dygrSUmI6HmgY5ymVbEAoLDEBxIOyr1V",
21977
+ },
21978
+ };
21979
+ var defineConfig = ({ plugins, region = "legacy-US", pushBaseUrl, audienceUrl, authDomain, authClientId, errorFallbackComponent, applicationEnvironment, rollbarAccessToken, previewBaseUrl, modelsSrc = "src", presetsSrc = "src", componentsSrc = "src", globalCss = "src/global.css", viteConfig = {}, rollupOptions = {}, }) => {
21980
+ if (region && !REGION_CONFIGS[region]) {
21981
+ throw new Error(`Unsupported region: ${region}. Supported regions are: ${Object.keys(REGION_CONFIGS).join(", ")}`);
21982
+ }
21983
+ const regionConfig = REGION_CONFIGS[region];
21956
21984
  const coreRoot = path.resolve(__dirname, "..");
21957
21985
  const clientRoot = process.cwd();
21958
21986
  if (!path.isAbsolute(componentsSrc)) {
@@ -22000,11 +22028,11 @@ var defineConfig = ({ plugins, pushBaseUrl, audienceUrl, authDomain, authClientI
22000
22028
  outputOptions: {
22001
22029
  typesEntryPointFilename: "embeddable-types-entry-point.js",
22002
22030
  },
22003
- pushBaseUrl: pushBaseUrl !== null && pushBaseUrl !== void 0 ? pushBaseUrl : "https://api.embeddable.com",
22004
- audienceUrl: audienceUrl !== null && audienceUrl !== void 0 ? audienceUrl : "https://auth.embeddable.com",
22005
- previewBaseUrl: previewBaseUrl !== null && previewBaseUrl !== void 0 ? previewBaseUrl : "https://app.embeddable.com",
22006
- authDomain: authDomain !== null && authDomain !== void 0 ? authDomain : "auth.embeddable.com",
22007
- authClientId: authClientId !== null && authClientId !== void 0 ? authClientId : "dygrSUmI6HmgY5ymVbEAoLDEBxIOyr1V",
22031
+ pushBaseUrl: pushBaseUrl !== null && pushBaseUrl !== void 0 ? pushBaseUrl : regionConfig.pushBaseUrl,
22032
+ audienceUrl: audienceUrl !== null && audienceUrl !== void 0 ? audienceUrl : regionConfig.audienceUrl,
22033
+ previewBaseUrl: previewBaseUrl !== null && previewBaseUrl !== void 0 ? previewBaseUrl : regionConfig.previewBaseUrl,
22034
+ authDomain: authDomain !== null && authDomain !== void 0 ? authDomain : regionConfig.authDomain,
22035
+ authClientId: authClientId !== null && authClientId !== void 0 ? authClientId : regionConfig.authClientId,
22008
22036
  applicationEnvironment: applicationEnvironment !== null && applicationEnvironment !== void 0 ? applicationEnvironment : "production",
22009
22037
  rollbarAccessToken: rollbarAccessToken !== null && rollbarAccessToken !== void 0 ? rollbarAccessToken : "5c6028038d844bf1835a0f4db5f55d9e",
22010
22038
  plugins,
@@ -22012,7 +22040,7 @@ var defineConfig = ({ plugins, pushBaseUrl, audienceUrl, authDomain, authClientI
22012
22040
  };
22013
22041
 
22014
22042
  var name = "@embeddable.com/sdk-core";
22015
- var version = "3.12.2";
22043
+ var version = "3.12.4-next.0";
22016
22044
  var description = "Core Embeddable SDK module responsible for web-components bundling and publishing.";
22017
22045
  var keywords = [
22018
22046
  "embeddable",