@embeddable.com/sdk-core 3.1.5 → 3.1.7
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/templates/component.tsx.template +17 -1
package/lib/index.js
CHANGED
|
@@ -4567,9 +4567,18 @@ async function dataModelsValidation(filesList) {
|
|
|
4567
4567
|
for (const [_, filePath] of filesList) {
|
|
4568
4568
|
const fileContentRaw = await fs__namespace.readFile(filePath, "utf8");
|
|
4569
4569
|
const cube = YAML__namespace.parse(fileContentRaw);
|
|
4570
|
-
|
|
4571
|
-
|
|
4572
|
-
|
|
4570
|
+
if (!(cube === null || cube === void 0 ? void 0 : cube.cubes) && !(cube === null || cube === void 0 ? void 0 : cube.views)) {
|
|
4571
|
+
return [`${filePath}: At least one cubes or views must be defined`];
|
|
4572
|
+
}
|
|
4573
|
+
const cubeModelSafeParse = cubeModelSchema.safeParse(cube);
|
|
4574
|
+
const viewModelSafeParse = viewModelSchema.safeParse(cube);
|
|
4575
|
+
if (cube.cubes && !cubeModelSafeParse.success) {
|
|
4576
|
+
errorFormatter(cubeModelSafeParse.error.issues).forEach((error) => {
|
|
4577
|
+
errors.push(`${filePath}: ${error}`);
|
|
4578
|
+
});
|
|
4579
|
+
}
|
|
4580
|
+
if (cube.views && !viewModelSafeParse.success) {
|
|
4581
|
+
errorFormatter(viewModelSafeParse.error.issues).forEach((error) => {
|
|
4573
4582
|
errors.push(`${filePath}: ${error}`);
|
|
4574
4583
|
});
|
|
4575
4584
|
}
|
|
@@ -4648,6 +4657,18 @@ const cubeModelSchema = z
|
|
|
4648
4657
|
message: "At least one measure or dimension must be defined",
|
|
4649
4658
|
path: ["cubes"],
|
|
4650
4659
|
});
|
|
4660
|
+
const viewModelSchema = z.object({
|
|
4661
|
+
views: z.object({
|
|
4662
|
+
name: z.string(),
|
|
4663
|
+
cubes: z
|
|
4664
|
+
.object({
|
|
4665
|
+
join_path: z.string(),
|
|
4666
|
+
})
|
|
4667
|
+
.array()
|
|
4668
|
+
})
|
|
4669
|
+
.array()
|
|
4670
|
+
.min(1),
|
|
4671
|
+
});
|
|
4651
4672
|
const securityContextSchema = z.array(z.object({
|
|
4652
4673
|
name: z.string(),
|
|
4653
4674
|
securityContext: z.object({}), // can be any object
|
|
@@ -20147,10 +20168,11 @@ var push = async () => {
|
|
|
20147
20168
|
return;
|
|
20148
20169
|
}
|
|
20149
20170
|
const { workspaceId, name: workspaceName } = await selectWorkspace(config, token);
|
|
20171
|
+
const workspacePreviewUrl = `${config.previewBaseUrl}/workspace/${workspaceId}`;
|
|
20150
20172
|
await buildArchive(config);
|
|
20151
|
-
spinnerPushing = ora$1(`Publishing to ${workspaceName} using ${
|
|
20173
|
+
spinnerPushing = ora$1(`Publishing to ${workspaceName} using ${workspacePreviewUrl}...`).start();
|
|
20152
20174
|
await sendBuild(config, { workspaceId, token });
|
|
20153
|
-
spinnerPushing.succeed(`Published to ${workspaceName} using ${
|
|
20175
|
+
spinnerPushing.succeed(`Published to ${workspaceName} using ${workspacePreviewUrl}`);
|
|
20154
20176
|
}
|
|
20155
20177
|
catch (error) {
|
|
20156
20178
|
spinnerPushing === null || spinnerPushing === void 0 ? void 0 : spinnerPushing.fail("Publishing failed");
|