hereya-cli 0.84.1 → 0.85.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.
@@ -1198,8 +1198,7 @@
1198
1198
  "examples": [
1199
1199
  "<%= config.bin %> <%= command.id %> my-org/my-app -w my-workspace",
1200
1200
  "<%= config.bin %> <%= command.id %> my-org/my-app -w prod --version 1.2.0",
1201
- "<%= config.bin %> <%= command.id %> my-org/my-app -w prod -V 'app.yaml: \"key: value\"'",
1202
- "<%= config.bin %> <%= command.id %> my-org/my-app -w prod --vars-file ./hereyavars.yaml"
1201
+ "<%= config.bin %> <%= command.id %> my-org/my-app -w prod -p organizationId=org-123"
1203
1202
  ],
1204
1203
  "flags": {
1205
1204
  "parameter": {
@@ -1211,27 +1210,6 @@
1211
1210
  "multiple": true,
1212
1211
  "type": "option"
1213
1212
  },
1214
- "vars": {
1215
- "char": "V",
1216
- "description": "YAML string mapping hereyavars filename -> YAML body (mutually exclusive with --vars-file)",
1217
- "exclusive": [
1218
- "vars-file"
1219
- ],
1220
- "name": "vars",
1221
- "hasDynamicHelp": false,
1222
- "multiple": false,
1223
- "type": "option"
1224
- },
1225
- "vars-file": {
1226
- "description": "path to a YAML file mapping hereyavars filename -> YAML body (mutually exclusive with --vars)",
1227
- "exclusive": [
1228
- "vars"
1229
- ],
1230
- "name": "vars-file",
1231
- "hasDynamicHelp": false,
1232
- "multiple": false,
1233
- "type": "option"
1234
- },
1235
1213
  "version": {
1236
1214
  "description": "specific app version to deploy (defaults to latest)",
1237
1215
  "name": "version",
@@ -3197,5 +3175,5 @@
3197
3175
  ]
3198
3176
  }
3199
3177
  },
3200
- "version": "0.84.1"
3178
+ "version": "0.85.1"
3201
3179
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "hereya-cli",
3
3
  "description": "Infrastructure as Package",
4
- "version": "0.84.1",
4
+ "version": "0.85.1",
5
5
  "author": "Hereya Developers",
6
6
  "bin": {
7
7
  "hereya": "./bin/run.js"
@@ -1,10 +0,0 @@
1
- /**
2
- * Write per-deployment hereyavars overrides into <appRootDir>/hereyaconfig/hereyavars/.
3
- *
4
- * `hereyaVarsYaml` is a YAML string mapping filename -> YAML body (string).
5
- * Each filename is validated against a safe pattern (no path traversal, must
6
- * end in `.yaml`/`.yml`). Each body must be a string.
7
- */
8
- export declare function applyHereyaVars(appRootDir: string, hereyaVarsYaml: string | undefined): Promise<{
9
- filesWritten: string[];
10
- }>;
@@ -1,45 +0,0 @@
1
- import fs from 'node:fs/promises';
2
- import path from 'node:path';
3
- import * as yaml from 'yaml';
4
- const HEREYAVARS_FILENAME_PATTERN = /^[\w.-]+\.ya?ml$/;
5
- /**
6
- * Write per-deployment hereyavars overrides into <appRootDir>/hereyaconfig/hereyavars/.
7
- *
8
- * `hereyaVarsYaml` is a YAML string mapping filename -> YAML body (string).
9
- * Each filename is validated against a safe pattern (no path traversal, must
10
- * end in `.yaml`/`.yml`). Each body must be a string.
11
- */
12
- export async function applyHereyaVars(appRootDir, hereyaVarsYaml) {
13
- if (!hereyaVarsYaml || hereyaVarsYaml.trim() === '') {
14
- return { filesWritten: [] };
15
- }
16
- let parsed;
17
- try {
18
- parsed = yaml.parse(hereyaVarsYaml);
19
- }
20
- catch (error) {
21
- throw new Error(`Failed to parse hereyaVarsYaml: ${error.message}`);
22
- }
23
- if (parsed === null || parsed === undefined) {
24
- return { filesWritten: [] };
25
- }
26
- if (typeof parsed !== 'object' || Array.isArray(parsed)) {
27
- throw new TypeError('hereyaVarsYaml must be a YAML mapping of filename -> body string');
28
- }
29
- const targetDir = path.join(appRootDir, 'hereyaconfig', 'hereyavars');
30
- await fs.mkdir(targetDir, { recursive: true });
31
- const filesWritten = [];
32
- for (const [filename, body] of Object.entries(parsed)) {
33
- if (!HEREYAVARS_FILENAME_PATTERN.test(filename)) {
34
- throw new Error(`Invalid hereyavars filename '${filename}'. Expected a name matching ${HEREYAVARS_FILENAME_PATTERN.source}`);
35
- }
36
- if (typeof body !== 'string') {
37
- throw new TypeError(`hereyavars value for '${filename}' must be a string (YAML body)`);
38
- }
39
- const filePath = path.join(targetDir, filename);
40
- // eslint-disable-next-line no-await-in-loop
41
- await fs.writeFile(filePath, body, { encoding: 'utf8' });
42
- filesWritten.push(filePath);
43
- }
44
- return { filesWritten };
45
- }