@solidactions/cli 3.28.0 → 3.29.0

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.
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "schema_version": 1,
3
3
  "cli_name": "solidactions",
4
- "cli_version": "3.28.0",
4
+ "cli_version": "3.29.0",
5
5
  "global_options": [
6
6
  {
7
7
  "flags": "-V, --version",
@@ -266,6 +266,12 @@ function formatSyncYamlWarnings(warnings) {
266
266
  return `${envName} → no workspace database named "${target}"`;
267
267
  }
268
268
  }
269
+ // Docs warnings carry their own full sentence; print it as is.
270
+ if ((warning?.reason === 'docs_path_not_found' || warning?.reason === 'docs_not_granted')
271
+ && typeof warning.message === 'string'
272
+ && warning.message !== '') {
273
+ return warning.message;
274
+ }
269
275
  return `${envName} → unresolved (${warning?.reason ?? 'unknown reason'})`;
270
276
  });
271
277
  }
@@ -289,6 +295,7 @@ async function pushYamlDeclarations(config, projectSlug, yamlConfig) {
289
295
  yaml_default_global_key: v.mappedTo,
290
296
  yaml_default_oauth_name: v.oauthName,
291
297
  yaml_default_database_name: v.databaseName,
298
+ yaml_default_docs_path: v.docsPath,
292
299
  source: 'yaml',
293
300
  }));
294
301
  const response = await axios_1.default.post(`${config.host}/api/v1/projects/${projectSlug}/variable-mappings/sync-yaml`, { declarations }, {
@@ -311,7 +318,11 @@ async function pushYamlDeclarations(config, projectSlug, yamlConfig) {
311
318
  for (const warning of warnings) {
312
319
  console.log(chalk_1.default.yellow(` ⚠ ${warning}`));
313
320
  }
314
- if (warnings.length > 0) {
321
+ // A docs warning does not hold the variable back (it still arrives, with
322
+ // level "none"), so the footer is only true when some warning is not a docs one.
323
+ const hasNonDocsWarning = Array.isArray(rawWarnings)
324
+ && rawWarnings.some((w) => w?.reason !== 'docs_path_not_found' && w?.reason !== 'docs_not_granted');
325
+ if (hasNonDocsWarning) {
315
326
  console.log(chalk_1.default.yellow(" These variables won't get a value from this declaration until the named resource exists (a value set in the dashboard still applies)."));
316
327
  }
317
328
  }
@@ -516,6 +516,12 @@ async function runDev(opts) {
516
516
  // mapping as "had no value in this env and was skipped" (#140).
517
517
  databaseMappings.push(pv);
518
518
  }
519
+ else if (pv.source_type === 'docs_node' && pv.resolved_value != null) {
520
+ // A docs binding arrives as the run-env JSON ({path, kind, id, level}),
521
+ // the same string a deployed run reads; pass it through, never count
522
+ // it as dropped.
523
+ vars[pv.env_name] = pv.resolved_value;
524
+ }
519
525
  else if (pv.resolved_value != null) {
520
526
  vars[pv.env_name] = pv.resolved_value;
521
527
  }
@@ -76,6 +76,11 @@ async function envList(projectName, options = {}) {
76
76
  || 'Database';
77
77
  }
78
78
  }
79
+ else if (mapping.source_type === 'docs_node') {
80
+ value = '-';
81
+ type = 'docs';
82
+ source = mapping.yaml_default_docs_path || 'Docs';
83
+ }
79
84
  else if (mapping.global_variable_key) {
80
85
  type = 'global';
81
86
  source = mapping.global_variable_key;
package/dist/utils/env.js CHANGED
@@ -52,6 +52,7 @@ function parseEnvFile(filePath) {
52
52
  * - VAR_NAME: GLOBAL -> { key: "VAR_NAME", mappedTo: "GLOBAL" }
53
53
  * - VAR_NAME:\n oauth: "Name" -> { key: "VAR_NAME", oauthName: "Name" }
54
54
  * - VAR_NAME:\n database: "Name" -> { key: "VAR_NAME", databaseName: "Name" }
55
+ * - VAR_NAME:\n docs: "Folder/Path" -> { key: "VAR_NAME", docsPath: "Folder/Path" }
55
56
  */
56
57
  function parseYamlEnvVars(config) {
57
58
  const parsedVars = [];
@@ -61,11 +62,11 @@ function parseYamlEnvVars(config) {
61
62
  for (const item of config.env) {
62
63
  if (typeof item === 'string') {
63
64
  // Simple string: - VAR_NAME (declared only, needs configuration)
64
- parsedVars.push({ key: item, mappedTo: null, oauthName: null, databaseName: null });
65
+ parsedVars.push({ key: item, mappedTo: null, oauthName: null, databaseName: null, docsPath: null });
65
66
  }
66
67
  else if (typeof item === 'object' && item !== null) {
67
68
  // Object: - VAR_NAME: GLOBAL_NAME, - VAR_NAME: { oauth: connection-name },
68
- // or - VAR_NAME: { database: database-name }
69
+ // - VAR_NAME: { database: database-name }, or - VAR_NAME: { docs: folder/or/doc/path }
69
70
  const keys = Object.keys(item);
70
71
  if (keys.length === 1) {
71
72
  const key = keys[0];
@@ -74,16 +75,22 @@ function parseYamlEnvVars(config) {
74
75
  if (typeof value.oauth !== 'string' || !value.oauth) {
75
76
  throw new Error(`Invalid env config for ${key}: 'oauth' must be a non-empty string`);
76
77
  }
77
- parsedVars.push({ key, mappedTo: null, oauthName: value.oauth, databaseName: null });
78
+ parsedVars.push({ key, mappedTo: null, oauthName: value.oauth, databaseName: null, docsPath: null });
78
79
  }
79
80
  else if (typeof value === 'object' && value !== null && 'database' in value) {
80
81
  if (typeof value.database !== 'string' || !value.database) {
81
82
  throw new Error(`Invalid env config for ${key}: 'database' must be a non-empty string`);
82
83
  }
83
- parsedVars.push({ key, mappedTo: null, oauthName: null, databaseName: value.database });
84
+ parsedVars.push({ key, mappedTo: null, oauthName: null, databaseName: value.database, docsPath: null });
85
+ }
86
+ else if (typeof value === 'object' && value !== null && 'docs' in value) {
87
+ if (typeof value.docs !== 'string' || !value.docs.trim()) {
88
+ throw new Error(`Invalid env config for ${key}: 'docs' must be a non-empty string`);
89
+ }
90
+ parsedVars.push({ key, mappedTo: null, oauthName: null, databaseName: null, docsPath: value.docs });
84
91
  }
85
92
  else {
86
- parsedVars.push({ key, mappedTo: value || null, oauthName: null, databaseName: null });
93
+ parsedVars.push({ key, mappedTo: value || null, oauthName: null, databaseName: null, docsPath: null });
87
94
  }
88
95
  }
89
96
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@solidactions/cli",
3
- "version": "3.28.0",
3
+ "version": "3.29.0",
4
4
  "description": "SolidActions CLI - Deploy and manage workflow automation",
5
5
  "main": "dist/index.js",
6
6
  "bin": {
@@ -54,7 +54,7 @@
54
54
  "tar": "^7.5.22"
55
55
  },
56
56
  "devDependencies": {
57
- "@solidactions/sdk": "^0.8.0",
57
+ "@solidactions/sdk": "^0.10.0",
58
58
  "@types/archiver": "^8.0.0",
59
59
  "@types/fs-extra": "^11.0.0",
60
60
  "@types/js-yaml": "^4.0.9",