@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/index.js
CHANGED
|
@@ -21981,7 +21981,34 @@ const getPreviewWorkspace = async (startedOra, ctx) => {
|
|
|
21981
21981
|
}
|
|
21982
21982
|
};
|
|
21983
21983
|
|
|
21984
|
-
|
|
21984
|
+
const REGION_CONFIGS = {
|
|
21985
|
+
EU: {
|
|
21986
|
+
pushBaseUrl: "https://api.eu.embeddable.com",
|
|
21987
|
+
audienceUrl: "https://auth.eu.embeddable.com",
|
|
21988
|
+
previewBaseUrl: "https://app.eu.embeddable.com",
|
|
21989
|
+
authDomain: "auth.eu.embeddable.com",
|
|
21990
|
+
authClientId: "6OGPwIQsVmtrBKhNrwAaXh4ePb0kBGV",
|
|
21991
|
+
},
|
|
21992
|
+
US: {
|
|
21993
|
+
pushBaseUrl: "https://api.us.embeddable.com",
|
|
21994
|
+
audienceUrl: "https://auth.embeddable.com",
|
|
21995
|
+
previewBaseUrl: "https://app.us.embeddable.com",
|
|
21996
|
+
authDomain: "auth.embeddable.com",
|
|
21997
|
+
authClientId: "dygrSUmI6HmgY5ymVbEAoLDEBxIOyr1V",
|
|
21998
|
+
},
|
|
21999
|
+
"legacy-US": {
|
|
22000
|
+
pushBaseUrl: "https://api.embeddable.com",
|
|
22001
|
+
audienceUrl: "https://auth.embeddable.com",
|
|
22002
|
+
previewBaseUrl: "https://app.embeddable.com",
|
|
22003
|
+
authDomain: "auth.embeddable.com",
|
|
22004
|
+
authClientId: "dygrSUmI6HmgY5ymVbEAoLDEBxIOyr1V",
|
|
22005
|
+
},
|
|
22006
|
+
};
|
|
22007
|
+
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 = {}, }) => {
|
|
22008
|
+
if (region && !REGION_CONFIGS[region]) {
|
|
22009
|
+
throw new Error(`Unsupported region: ${region}. Supported regions are: EU, US, legacy-US`);
|
|
22010
|
+
}
|
|
22011
|
+
const regionConfig = REGION_CONFIGS[region];
|
|
21985
22012
|
const coreRoot = path__namespace.resolve(__dirname, "..");
|
|
21986
22013
|
const clientRoot = process.cwd();
|
|
21987
22014
|
if (!path__namespace.isAbsolute(componentsSrc)) {
|
|
@@ -22029,11 +22056,11 @@ var defineConfig = ({ plugins, pushBaseUrl, audienceUrl, authDomain, authClientI
|
|
|
22029
22056
|
outputOptions: {
|
|
22030
22057
|
typesEntryPointFilename: "embeddable-types-entry-point.js",
|
|
22031
22058
|
},
|
|
22032
|
-
pushBaseUrl: pushBaseUrl !== null && pushBaseUrl !== void 0 ? pushBaseUrl :
|
|
22033
|
-
audienceUrl: audienceUrl !== null && audienceUrl !== void 0 ? audienceUrl :
|
|
22034
|
-
previewBaseUrl: previewBaseUrl !== null && previewBaseUrl !== void 0 ? previewBaseUrl :
|
|
22035
|
-
authDomain: authDomain !== null && authDomain !== void 0 ? authDomain :
|
|
22036
|
-
authClientId: authClientId !== null && authClientId !== void 0 ? authClientId :
|
|
22059
|
+
pushBaseUrl: pushBaseUrl !== null && pushBaseUrl !== void 0 ? pushBaseUrl : regionConfig.pushBaseUrl,
|
|
22060
|
+
audienceUrl: audienceUrl !== null && audienceUrl !== void 0 ? audienceUrl : regionConfig.audienceUrl,
|
|
22061
|
+
previewBaseUrl: previewBaseUrl !== null && previewBaseUrl !== void 0 ? previewBaseUrl : regionConfig.previewBaseUrl,
|
|
22062
|
+
authDomain: authDomain !== null && authDomain !== void 0 ? authDomain : regionConfig.authDomain,
|
|
22063
|
+
authClientId: authClientId !== null && authClientId !== void 0 ? authClientId : regionConfig.authClientId,
|
|
22037
22064
|
applicationEnvironment: applicationEnvironment !== null && applicationEnvironment !== void 0 ? applicationEnvironment : "production",
|
|
22038
22065
|
rollbarAccessToken: rollbarAccessToken !== null && rollbarAccessToken !== void 0 ? rollbarAccessToken : "5c6028038d844bf1835a0f4db5f55d9e",
|
|
22039
22066
|
plugins,
|