@embeddable.com/sdk-core 3.14.0-next.7 → 3.14.1-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.
- package/lib/index.esm.js +22 -6
- package/lib/index.esm.js.map +1 -1
- package/package.json +2 -2
- package/src/push.test.ts +3 -3
- package/src/push.ts +29 -8
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
|
-
|
|
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(((
|
|
21925
|
+
console.log(((_g = error.response) === null || _g === void 0 ? void 0 : _g.data) || error);
|
|
21913
21926
|
process.exit(1);
|
|
21914
21927
|
}
|
|
21915
21928
|
};
|
|
@@ -21964,15 +21977,18 @@ async function buildArchive(config) {
|
|
|
21964
21977
|
const filesList = [];
|
|
21965
21978
|
if (config.pushModels) {
|
|
21966
21979
|
const cubeFilesList = await findFiles(config.client.modelsSrc || config.client.srcDir, CUBE_FILES);
|
|
21967
|
-
const clientContextFilesList = await findFiles(config.client.presetsSrc || config.client.srcDir, CLIENT_CONTEXT_FILES);
|
|
21968
21980
|
const securityContextFilesList = await findFiles(config.client.presetsSrc || config.client.srcDir, SECURITY_CONTEXT_FILES);
|
|
21969
21981
|
filesList.push(...cubeFilesList.map((entry) => [
|
|
21970
21982
|
path.basename(entry[1]),
|
|
21971
21983
|
entry[1],
|
|
21972
|
-
]), ...
|
|
21984
|
+
]), ...securityContextFilesList.map((entry) => [
|
|
21973
21985
|
path.basename(entry[1]),
|
|
21974
21986
|
entry[1],
|
|
21975
|
-
])
|
|
21987
|
+
]));
|
|
21988
|
+
}
|
|
21989
|
+
if (config.pushComponents) {
|
|
21990
|
+
const clientContextFilesList = await findFiles(config.client.presetsSrc || config.client.srcDir, CLIENT_CONTEXT_FILES);
|
|
21991
|
+
filesList.push(...clientContextFilesList.map((entry) => [
|
|
21976
21992
|
path.basename(entry[1]),
|
|
21977
21993
|
entry[1],
|
|
21978
21994
|
]));
|