@embeddable.com/sdk-core 3.12.2 → 3.12.3
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/defineConfig.d.ts +3 -1
- package/lib/index.esm.js +33 -6
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +33 -6
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/defineConfig.test.ts +56 -0
- package/src/defineConfig.ts +41 -5
package/lib/defineConfig.d.ts
CHANGED
|
@@ -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
|
@@ -21952,7 +21952,34 @@ const getPreviewWorkspace = async (startedOra, ctx) => {
|
|
|
21952
21952
|
}
|
|
21953
21953
|
};
|
|
21954
21954
|
|
|
21955
|
-
|
|
21955
|
+
const REGION_CONFIGS = {
|
|
21956
|
+
EU: {
|
|
21957
|
+
pushBaseUrl: "https://api.eu.embeddable.com",
|
|
21958
|
+
audienceUrl: "https://auth.eu.embeddable.com",
|
|
21959
|
+
previewBaseUrl: "https://app.eu.embeddable.com",
|
|
21960
|
+
authDomain: "auth.eu.embeddable.com",
|
|
21961
|
+
authClientId: "6OGPwIQsVmtrBKhNrwAaXh4ePb0kBGV",
|
|
21962
|
+
},
|
|
21963
|
+
US: {
|
|
21964
|
+
pushBaseUrl: "https://api.us.embeddable.com",
|
|
21965
|
+
audienceUrl: "https://auth.embeddable.com",
|
|
21966
|
+
previewBaseUrl: "https://app.us.embeddable.com",
|
|
21967
|
+
authDomain: "auth.embeddable.com",
|
|
21968
|
+
authClientId: "dygrSUmI6HmgY5ymVbEAoLDEBxIOyr1V",
|
|
21969
|
+
},
|
|
21970
|
+
"legacy-US": {
|
|
21971
|
+
pushBaseUrl: "https://api.embeddable.com",
|
|
21972
|
+
audienceUrl: "https://auth.embeddable.com",
|
|
21973
|
+
previewBaseUrl: "https://app.embeddable.com",
|
|
21974
|
+
authDomain: "auth.embeddable.com",
|
|
21975
|
+
authClientId: "dygrSUmI6HmgY5ymVbEAoLDEBxIOyr1V",
|
|
21976
|
+
},
|
|
21977
|
+
};
|
|
21978
|
+
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 = {}, }) => {
|
|
21979
|
+
if (region && !REGION_CONFIGS[region]) {
|
|
21980
|
+
throw new Error(`Unsupported region: ${region}. Supported regions are: EU, US, legacy-US`);
|
|
21981
|
+
}
|
|
21982
|
+
const regionConfig = REGION_CONFIGS[region];
|
|
21956
21983
|
const coreRoot = path.resolve(__dirname, "..");
|
|
21957
21984
|
const clientRoot = process.cwd();
|
|
21958
21985
|
if (!path.isAbsolute(componentsSrc)) {
|
|
@@ -22000,11 +22027,11 @@ var defineConfig = ({ plugins, pushBaseUrl, audienceUrl, authDomain, authClientI
|
|
|
22000
22027
|
outputOptions: {
|
|
22001
22028
|
typesEntryPointFilename: "embeddable-types-entry-point.js",
|
|
22002
22029
|
},
|
|
22003
|
-
pushBaseUrl: pushBaseUrl !== null && pushBaseUrl !== void 0 ? pushBaseUrl :
|
|
22004
|
-
audienceUrl: audienceUrl !== null && audienceUrl !== void 0 ? audienceUrl :
|
|
22005
|
-
previewBaseUrl: previewBaseUrl !== null && previewBaseUrl !== void 0 ? previewBaseUrl :
|
|
22006
|
-
authDomain: authDomain !== null && authDomain !== void 0 ? authDomain :
|
|
22007
|
-
authClientId: authClientId !== null && authClientId !== void 0 ? authClientId :
|
|
22030
|
+
pushBaseUrl: pushBaseUrl !== null && pushBaseUrl !== void 0 ? pushBaseUrl : regionConfig.pushBaseUrl,
|
|
22031
|
+
audienceUrl: audienceUrl !== null && audienceUrl !== void 0 ? audienceUrl : regionConfig.audienceUrl,
|
|
22032
|
+
previewBaseUrl: previewBaseUrl !== null && previewBaseUrl !== void 0 ? previewBaseUrl : regionConfig.previewBaseUrl,
|
|
22033
|
+
authDomain: authDomain !== null && authDomain !== void 0 ? authDomain : regionConfig.authDomain,
|
|
22034
|
+
authClientId: authClientId !== null && authClientId !== void 0 ? authClientId : regionConfig.authClientId,
|
|
22008
22035
|
applicationEnvironment: applicationEnvironment !== null && applicationEnvironment !== void 0 ? applicationEnvironment : "production",
|
|
22009
22036
|
rollbarAccessToken: rollbarAccessToken !== null && rollbarAccessToken !== void 0 ? rollbarAccessToken : "5c6028038d844bf1835a0f4db5f55d9e",
|
|
22010
22037
|
plugins,
|