@embeddable.com/sdk-core 2.4.15 → 2.4.17
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 +14 -10
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +14 -10
- package/lib/index.js.map +1 -1
- package/lib/push.d.ts +1 -1
- package/package.json +1 -1
package/lib/index.esm.js
CHANGED
|
@@ -4495,7 +4495,7 @@ var z = /*#__PURE__*/Object.freeze({
|
|
|
4495
4495
|
ZodError: ZodError
|
|
4496
4496
|
});
|
|
4497
4497
|
|
|
4498
|
-
const CUBE_YAML_FILE_REGEX
|
|
4498
|
+
const CUBE_YAML_FILE_REGEX = /^(.*)\.cube\.ya?ml$/;
|
|
4499
4499
|
const checkNodeVersion$1 = () => {
|
|
4500
4500
|
const [major, minor] = process.versions.node.split(".").map(Number);
|
|
4501
4501
|
const engines = require("../package.json").engines.node;
|
|
@@ -4508,7 +4508,7 @@ var validate = async (ctx, exitIfInvalid = true) => {
|
|
|
4508
4508
|
checkNodeVersion$1();
|
|
4509
4509
|
const ora = (await import('ora')).default;
|
|
4510
4510
|
const spinnerValidate = ora("data model validation...").start();
|
|
4511
|
-
const filesList = await findFiles(ctx.client.srcDir, CUBE_YAML_FILE_REGEX
|
|
4511
|
+
const filesList = await findFiles(ctx.client.srcDir, CUBE_YAML_FILE_REGEX);
|
|
4512
4512
|
const dataModelErrors = await dataModelsValidation(filesList);
|
|
4513
4513
|
if (dataModelErrors.length) {
|
|
4514
4514
|
spinnerValidate.fail("One or more cube.yaml files are invalid:");
|
|
@@ -19928,7 +19928,7 @@ var build = async () => {
|
|
|
19928
19928
|
catch (error) {
|
|
19929
19929
|
await reportErrorToRollbar(error);
|
|
19930
19930
|
console.log(error);
|
|
19931
|
-
|
|
19931
|
+
process.exit(1);
|
|
19932
19932
|
}
|
|
19933
19933
|
};
|
|
19934
19934
|
|
|
@@ -19936,8 +19936,9 @@ const oraP$2 = import('ora');
|
|
|
19936
19936
|
const openP = import('open');
|
|
19937
19937
|
var login = async () => {
|
|
19938
19938
|
var _a;
|
|
19939
|
+
const ora = (await oraP$2).default;
|
|
19940
|
+
const authenticationSpinner = ora("waiting for code verification...").start();
|
|
19939
19941
|
try {
|
|
19940
|
-
const ora = (await oraP$2).default;
|
|
19941
19942
|
const open = (await openP).default;
|
|
19942
19943
|
const config = await provideConfig();
|
|
19943
19944
|
await resolveFiles();
|
|
@@ -19951,7 +19952,6 @@ var login = async () => {
|
|
|
19951
19952
|
device_code: deviceCodeResponse.data["device_code"],
|
|
19952
19953
|
client_id: config.authClientId,
|
|
19953
19954
|
};
|
|
19954
|
-
const authenticationSpinner = ora("waiting for code verification...").start();
|
|
19955
19955
|
await open(deviceCodeResponse.data["verification_uri_complete"]);
|
|
19956
19956
|
/**
|
|
19957
19957
|
* This is a recommended way to poll, since it take some time for a user to enter a `user_code` in a browser.
|
|
@@ -19974,9 +19974,10 @@ var login = async () => {
|
|
|
19974
19974
|
}
|
|
19975
19975
|
}
|
|
19976
19976
|
catch (error) {
|
|
19977
|
+
authenticationSpinner.fail("authentication failed. please try again.");
|
|
19977
19978
|
await reportErrorToRollbar(error);
|
|
19978
19979
|
console.log(error);
|
|
19979
|
-
|
|
19980
|
+
process.exit(1);
|
|
19980
19981
|
}
|
|
19981
19982
|
};
|
|
19982
19983
|
async function getToken() {
|
|
@@ -20010,7 +20011,7 @@ async function resolveFiles() {
|
|
|
20010
20011
|
|
|
20011
20012
|
const oraP$1 = import('ora');
|
|
20012
20013
|
const inquirerSelect = import('@inquirer/select');
|
|
20013
|
-
const
|
|
20014
|
+
const CUBE_YAML_OR_JS_FILE_REGEX = /^(.*)\.cube\.(ya?ml|js)$/;
|
|
20014
20015
|
let ora$1;
|
|
20015
20016
|
var push = async () => {
|
|
20016
20017
|
try {
|
|
@@ -20020,7 +20021,7 @@ var push = async () => {
|
|
|
20020
20021
|
const token = await verify(config);
|
|
20021
20022
|
const { workspaceId, name: workspaceName } = await selectWorkspace(config, token);
|
|
20022
20023
|
const spinnerArchive = ora$1("archivation...").start();
|
|
20023
|
-
const filesList = await findFiles(config.client.srcDir,
|
|
20024
|
+
const filesList = await findFiles(config.client.srcDir, CUBE_YAML_OR_JS_FILE_REGEX);
|
|
20024
20025
|
await archive(config, filesList);
|
|
20025
20026
|
spinnerArchive.succeed("archivation competed");
|
|
20026
20027
|
const spinnerPushing = ora$1(`publishing to ${workspaceName} using ${config.pushBaseUrl}...`).start();
|
|
@@ -20088,7 +20089,10 @@ async function archive(ctx, yamlFiles, includeBuild = true) {
|
|
|
20088
20089
|
_archiver.directory(ctx.client.buildDir, false);
|
|
20089
20090
|
}
|
|
20090
20091
|
for (const fileData of yamlFiles) {
|
|
20091
|
-
|
|
20092
|
+
const fileExtension = fileData[1].split(".").pop();
|
|
20093
|
+
_archiver.file(fileData[1], {
|
|
20094
|
+
name: `${fileData[0]}.cube.${fileExtension}`,
|
|
20095
|
+
});
|
|
20092
20096
|
}
|
|
20093
20097
|
await _archiver.finalize();
|
|
20094
20098
|
return new Promise((resolve, _reject) => {
|
|
@@ -20247,7 +20251,7 @@ const sendDataModels = async (ctx) => {
|
|
|
20247
20251
|
if (isValid) {
|
|
20248
20252
|
const token = await getToken();
|
|
20249
20253
|
const sending = ora("synchronising data models...").start();
|
|
20250
|
-
const filesList = await findFiles(ctx.client.srcDir,
|
|
20254
|
+
const filesList = await findFiles(ctx.client.srcDir, CUBE_YAML_OR_JS_FILE_REGEX);
|
|
20251
20255
|
await archive(ctx, filesList, false);
|
|
20252
20256
|
await sendBuild(ctx, { workspaceId: previewWorkspace, token });
|
|
20253
20257
|
sending.succeed(`data models synchronized`);
|