@dashai/cli 0.31.0 → 0.31.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/dist/bin.js CHANGED
@@ -18910,7 +18910,13 @@ async function moduleGenerateCommand(options) {
18910
18910
  {
18911
18911
  manifest,
18912
18912
  generation: options.generation ?? 0
18913
- }
18913
+ },
18914
+ // The installed @dashai/sdk decides the client's bootstrap (backend
18915
+ // generator 3.3.0): from 2.13.0 it reads DASHWISE_API_KEY_FILE (a
18916
+ // Workbench's key); older or none, the client every 2.x SDK links. A
18917
+ // header, not a body field: an older backend refuses unknown body
18918
+ // fields (forbidNonWhitelisted) but ignores an unknown header.
18919
+ { headers: sdkVersionHeader(projectRoot) }
18914
18920
  );
18915
18921
  } catch (err) {
18916
18922
  if (err instanceof ApiError && err.status === 401) {
@@ -18964,6 +18970,12 @@ async function moduleGenerateCommand(options) {
18964
18970
  );
18965
18971
  return 0;
18966
18972
  }
18973
+ var SDK_VERSION_HEADER = "Dashwise-Sdk-Version";
18974
+ var SDK_VERSION_PATTERN = /^v?\d+\.\d+\.\d+(-[0-9A-Za-z.-]+)?(\+[0-9A-Za-z.-]+)?$/;
18975
+ function sdkVersionHeader(projectRoot) {
18976
+ const version = readInstalledSdk(projectRoot)?.version;
18977
+ return version !== void 0 && version.length <= 64 && SDK_VERSION_PATTERN.test(version) ? { [SDK_VERSION_HEADER]: version } : {};
18978
+ }
18967
18979
  function declaresUses(manifest) {
18968
18980
  const uses = manifest?.uses;
18969
18981
  return Array.isArray(uses?.tables) && uses.tables.length > 0;
@@ -27817,7 +27829,7 @@ fieldCmd.command("set-type <table-slug> <field-slug> <new-type>").description(
27817
27829
  }
27818
27830
  );
27819
27831
  function getVersion() {
27820
- return "0.31.0";
27832
+ return "0.31.1";
27821
27833
  }
27822
27834
  function parsePositiveIdOption(value) {
27823
27835
  if (!/^[1-9][0-9]*$/.test(value.trim())) {