@embeddable.com/sdk-core 3.14.2-next.0 → 3.14.2-next.1

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 CHANGED
@@ -21876,6 +21876,7 @@ var push = async () => {
21876
21876
  breadcrumbs.push("checkNodeVersion");
21877
21877
  const isBuildSuccess = await checkBuildSuccess();
21878
21878
  const config = await provideConfig();
21879
+ const cubeVersion = getArgumentByKey(["--cube-version"]);
21879
21880
  if (!isBuildSuccess && config.pushComponents) {
21880
21881
  console.error("Build failed or not completed. Please run `embeddable:build` first.");
21881
21882
  process.exit(1);
@@ -21884,7 +21885,7 @@ var push = async () => {
21884
21885
  spinnerPushing = ora("Using API key...").start();
21885
21886
  breadcrumbs.push("push by api key");
21886
21887
  try {
21887
- await pushByApiKey(config, spinnerPushing);
21888
+ await pushByApiKey(config, spinnerPushing, cubeVersion);
21888
21889
  }
21889
21890
  catch (error) {
21890
21891
  if (((_b = (_a = error.response) === null || _a === void 0 ? void 0 : _a.data) === null || _b === void 0 ? void 0 : _b.errorCode) === "BUILDER-998") {
@@ -21915,7 +21916,7 @@ Read more about deployment regions at https://docs.embeddable.com/deployment/dep
21915
21916
  await buildArchive(config);
21916
21917
  spinnerPushing.info(`Publishing to ${workspaceName} using ${workspacePreviewUrl}...`);
21917
21918
  breadcrumbs.push("send build");
21918
- await sendBuild(config, { workspaceId, token, message });
21919
+ await sendBuild(config, { workspaceId, token, message, cubeVersion });
21919
21920
  publishedSectionFeedback(config, spinnerPushing);
21920
21921
  spinnerPushing.succeed(`Published to ${workspaceName} using ${workspacePreviewUrl}`);
21921
21922
  }
@@ -21931,7 +21932,7 @@ const publishedSectionFeedback = (config, spinnerPushing) => {
21931
21932
  config.pushModels && spinnerPushing.succeed("Models published");
21932
21933
  config.pushComponents && spinnerPushing.succeed("Components published");
21933
21934
  };
21934
- async function pushByApiKey(config, spinner) {
21935
+ async function pushByApiKey(config, spinner, cubeVersion) {
21935
21936
  const apiKey = getArgumentByKey(["--api-key", "-k"]);
21936
21937
  if (!apiKey) {
21937
21938
  spinner.fail("No API key provided");
@@ -21949,6 +21950,7 @@ async function pushByApiKey(config, spinner) {
21949
21950
  apiKey,
21950
21951
  email,
21951
21952
  message,
21953
+ cubeVersion,
21952
21954
  });
21953
21955
  }
21954
21956
  async function verify(ctx) {
@@ -22036,23 +22038,25 @@ async function createFormData(filePath, metadata) {
22036
22038
  form.set("request", metadataBlob, "request.json");
22037
22039
  return form;
22038
22040
  }
22039
- async function sendBuildByApiKey(ctx, { apiKey, email, message, }) {
22041
+ async function sendBuildByApiKey(ctx, { apiKey, email, message, cubeVersion, }) {
22040
22042
  const form = await createFormData(ctx.client.archiveFile, {
22041
22043
  pushModels: ctx.pushModels,
22042
22044
  pushComponents: ctx.pushComponents,
22043
22045
  authorEmail: email,
22044
22046
  description: message,
22047
+ ...(cubeVersion ? { cubeVersion } : {}),
22045
22048
  });
22046
22049
  const response = await uploadFile(form, `${ctx.pushBaseUrl}/api/v1/bundle/upload`, apiKey);
22047
22050
  await fs.rm(ctx.client.archiveFile);
22048
- return { ...response.data, message };
22051
+ return { ...response.data, message, cubeVersion };
22049
22052
  }
22050
- async function sendBuild(ctx, { workspaceId, token, message, }) {
22053
+ async function sendBuild(ctx, { workspaceId, token, message, cubeVersion, }) {
22051
22054
  const form = await createFormData(ctx.client.archiveFile, {
22052
22055
  pushModels: ctx.pushModels,
22053
22056
  pushComponents: ctx.pushComponents,
22054
22057
  authorEmail: "",
22055
22058
  description: message,
22059
+ ...(cubeVersion ? { cubeVersion } : {}),
22056
22060
  });
22057
22061
  await uploadFile(form, `${ctx.pushBaseUrl}/bundle/${workspaceId}/upload`, token);
22058
22062
  await fs.rm(ctx.client.archiveFile);