@embeddable.com/sdk-core 3.1.5 → 3.1.6
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 +27 -5
- package/lib/index.esm.js.map +1 -1
- package/lib/index.js +27 -5
- package/lib/index.js.map +1 -1
- package/package.json +1 -1
- package/src/push.ts +4 -2
- package/src/validate.ts +28 -3
package/lib/index.esm.js
CHANGED
|
@@ -4540,9 +4540,18 @@ async function dataModelsValidation(filesList) {
|
|
|
4540
4540
|
for (const [_, filePath] of filesList) {
|
|
4541
4541
|
const fileContentRaw = await fs$1.readFile(filePath, "utf8");
|
|
4542
4542
|
const cube = YAML.parse(fileContentRaw);
|
|
4543
|
-
|
|
4544
|
-
|
|
4545
|
-
|
|
4543
|
+
if (!(cube === null || cube === void 0 ? void 0 : cube.cubes) && !(cube === null || cube === void 0 ? void 0 : cube.views)) {
|
|
4544
|
+
return [`${filePath}: At least one cubes or views must be defined`];
|
|
4545
|
+
}
|
|
4546
|
+
const cubeModelSafeParse = cubeModelSchema.safeParse(cube);
|
|
4547
|
+
const viewModelSafeParse = viewModelSchema.safeParse(cube);
|
|
4548
|
+
if (cube.cubes && !cubeModelSafeParse.success) {
|
|
4549
|
+
errorFormatter(cubeModelSafeParse.error.issues).forEach((error) => {
|
|
4550
|
+
errors.push(`${filePath}: ${error}`);
|
|
4551
|
+
});
|
|
4552
|
+
}
|
|
4553
|
+
if (cube.views && !viewModelSafeParse.success) {
|
|
4554
|
+
errorFormatter(viewModelSafeParse.error.issues).forEach((error) => {
|
|
4546
4555
|
errors.push(`${filePath}: ${error}`);
|
|
4547
4556
|
});
|
|
4548
4557
|
}
|
|
@@ -4621,6 +4630,18 @@ const cubeModelSchema = z
|
|
|
4621
4630
|
message: "At least one measure or dimension must be defined",
|
|
4622
4631
|
path: ["cubes"],
|
|
4623
4632
|
});
|
|
4633
|
+
const viewModelSchema = z.object({
|
|
4634
|
+
views: z.object({
|
|
4635
|
+
name: z.string(),
|
|
4636
|
+
cubes: z
|
|
4637
|
+
.object({
|
|
4638
|
+
join_path: z.string(),
|
|
4639
|
+
})
|
|
4640
|
+
.array()
|
|
4641
|
+
})
|
|
4642
|
+
.array()
|
|
4643
|
+
.min(1),
|
|
4644
|
+
});
|
|
4624
4645
|
const securityContextSchema = z.array(z.object({
|
|
4625
4646
|
name: z.string(),
|
|
4626
4647
|
securityContext: z.object({}), // can be any object
|
|
@@ -20120,10 +20141,11 @@ var push = async () => {
|
|
|
20120
20141
|
return;
|
|
20121
20142
|
}
|
|
20122
20143
|
const { workspaceId, name: workspaceName } = await selectWorkspace(config, token);
|
|
20144
|
+
const workspacePreviewUrl = `${config.previewBaseUrl}/workspace/${workspaceId}`;
|
|
20123
20145
|
await buildArchive(config);
|
|
20124
|
-
spinnerPushing = ora$1(`Publishing to ${workspaceName} using ${
|
|
20146
|
+
spinnerPushing = ora$1(`Publishing to ${workspaceName} using ${workspacePreviewUrl}...`).start();
|
|
20125
20147
|
await sendBuild(config, { workspaceId, token });
|
|
20126
|
-
spinnerPushing.succeed(`Published to ${workspaceName} using ${
|
|
20148
|
+
spinnerPushing.succeed(`Published to ${workspaceName} using ${workspacePreviewUrl}`);
|
|
20127
20149
|
}
|
|
20128
20150
|
catch (error) {
|
|
20129
20151
|
spinnerPushing === null || spinnerPushing === void 0 ? void 0 : spinnerPushing.fail("Publishing failed");
|