@udondan/avanti 0.19.1 → 0.21.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.
- package/README.md +239 -27
- package/dist/commands/diff.d.ts.map +1 -1
- package/dist/commands/diff.js +51 -12
- package/dist/commands/diff.js.map +1 -1
- package/dist/commands/lock.d.ts.map +1 -1
- package/dist/commands/lock.js +19 -5
- package/dist/commands/lock.js.map +1 -1
- package/dist/commands/pull.d.ts.map +1 -1
- package/dist/commands/pull.js +135 -15
- package/dist/commands/pull.js.map +1 -1
- package/dist/commands/reset.d.ts.map +1 -1
- package/dist/commands/reset.js +1 -1
- package/dist/commands/reset.js.map +1 -1
- package/dist/commands/revert.d.ts.map +1 -1
- package/dist/commands/revert.js +1 -1
- package/dist/commands/revert.js.map +1 -1
- package/dist/condition.d.ts +4 -0
- package/dist/condition.d.ts.map +1 -0
- package/dist/condition.js +86 -0
- package/dist/condition.js.map +1 -0
- package/dist/config-writeback.d.ts.map +1 -1
- package/dist/config-writeback.js +26 -3
- package/dist/config-writeback.js.map +1 -1
- package/dist/config.d.ts.map +1 -1
- package/dist/config.js +278 -34
- package/dist/config.js.map +1 -1
- package/dist/history.d.ts +9 -0
- package/dist/history.d.ts.map +1 -1
- package/dist/history.js +59 -1
- package/dist/history.js.map +1 -1
- package/dist/processors/insert.d.ts +3 -0
- package/dist/processors/insert.d.ts.map +1 -0
- package/dist/processors/insert.js +285 -0
- package/dist/processors/insert.js.map +1 -0
- package/dist/processors/json.d.ts +1 -1
- package/dist/processors/json.d.ts.map +1 -1
- package/dist/processors/json.js +124 -3
- package/dist/processors/json.js.map +1 -1
- package/dist/sources/index.d.ts +6 -2
- package/dist/sources/index.d.ts.map +1 -1
- package/dist/sources/index.js +89 -16
- package/dist/sources/index.js.map +1 -1
- package/dist/sources/s3.d.ts +1 -1
- package/dist/sources/s3.d.ts.map +1 -1
- package/dist/sources/s3.js +49 -48
- package/dist/sources/s3.js.map +1 -1
- package/dist/sources/secrets-manager.d.ts +5 -0
- package/dist/sources/secrets-manager.d.ts.map +1 -0
- package/dist/sources/secrets-manager.js +48 -0
- package/dist/sources/secrets-manager.js.map +1 -0
- package/dist/sources/ssm.d.ts +5 -0
- package/dist/sources/ssm.d.ts.map +1 -0
- package/dist/sources/ssm.js +79 -0
- package/dist/sources/ssm.js.map +1 -0
- package/dist/types.d.ts +68 -4
- package/dist/types.d.ts.map +1 -1
- package/dist/variables-remote.d.ts +4 -0
- package/dist/variables-remote.d.ts.map +1 -0
- package/dist/variables-remote.js +52 -0
- package/dist/variables-remote.js.map +1 -0
- package/dist/variables.d.ts +2 -2
- package/dist/variables.d.ts.map +1 -1
- package/dist/variables.js.map +1 -1
- package/dist/writer.d.ts.map +1 -1
- package/dist/writer.js +1 -1
- package/dist/writer.js.map +1 -1
- package/package.json +5 -2
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config-writeback.js","sourceRoot":"","sources":["../src/config-writeback.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,
|
|
1
|
+
{"version":3,"file":"config-writeback.js","sourceRoot":"","sources":["../src/config-writeback.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAQA,4CA0LC;AAOD,4CAcC;AAvND,uCAAyB;AACzB,+BAA6D;AAC7D,qCAAuC;AAEvC;;;GAGG;AACH,SAAgB,gBAAgB,CAC9B,GAAW,EACX,OAA4B;IAE5B,IAAI,OAAO,CAAC,IAAI,KAAK,CAAC;QAAE,OAAO,IAAI,CAAC;IACpC,MAAM,GAAG,GAAG,IAAA,oBAAa,EAAC,GAAG,CAAC,CAAC;IAE/B,MAAM,SAAS,GAAG,GAAG,CAAC,GAAG,CAAC,OAAO,EAAE,IAAI,CAAC,CAAC;IACzC,IAAI,CAAC,IAAA,YAAK,EAAC,SAAS,CAAC;QAAE,OAAO,IAAI,CAAC;IAEnC,IAAI,OAAO,GAAG,KA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AIG;AACH,SAAgB,gBAAgB,CAC9B,UAAkB,EAClB,OAA4B;IAE5B,IAAI,OAAO,CAAC,IAAI,KAAK,CAAC;QAAE,OAAO,KAAK,CAAC;IACrC,MAAM,GAAG,GAAG,EAAE,CAAC,YAAY,CAAC,UAAU,EAAE,MAAM,CAAC,CAAC;IAChD,MAAM,UAAU,GAAG,gBAAgB,CAAC,GAAG,EAAE,OAAO,CAAC,CAAC;IAClD,IAAI,UAAU,KAAK,IAAI,EAAE,CAAC;QACxB,IAAA,oBAAW,EAAC;YACV,EAAE,UAAU,EAAE,UAAU,EAAE,OAAO,EAAE,MAAM,CAAC,IAAI,CAAC,UAAU,EAAE,MAAM,CAAC,EAAE;SACrE,CAAC,CAAC;QACH,OAAO,IAAI,CAAC;IACd,CAAC;IACD,OAAO,KAAK,CAAC;AACf,CAAC"}
|
package/dist/config.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,YAAY,
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAGA,OAAO,EACL,YAAY,EAyBZ,GAAG,EACJ,MAAM,SAAS,CAAC;AAOjB,eAAO,MAAM,QAAQ,UAAU,CAAC;AAShC,wBAAgB,kBAAkB,CAAC,CAAC,EAAE,MAAM,GAAG,OAAO,CAQrD;AAED,wBAAgB,kBAAkB,CAAC,IAAI,EAAE,MAAM,GAAG,MAAM,CAcvD;AAED,wBAAgB,iBAAiB,CAAC,QAAQ,CAAC,EAAE,MAAM,GAAG,MAAM,CAgB3D;AAsGD,wBAAgB,kBAAkB,CAAC,OAAO,EAAE,MAAM,GAAG,YAAY,CAwGhE;AAED,wBAAsB,UAAU,CAC9B,UAAU,EAAE,MAAM,EAClB,GAAG,CAAC,EAAE,GAAG,GAAG,GAAG,EAAE,GAChB,OAAO,CAAC,YAAY,CAAC,CAQvB;AA0FD,wBAAgB,QAAQ,CAAC,KAAK,EAAE,OAAO,EAAE,GAAG,EAAE,MAAM,GAAG,GAAG,GAAG,GAAG,EAAE,GAAG,SAAS,CAgC7E"}
|
package/dist/config.js
CHANGED
|
@@ -194,13 +194,24 @@ function parseConfigContent(content) {
|
|
|
194
194
|
throw new Error(`files["${target}"]: "src" is required`);
|
|
195
195
|
}
|
|
196
196
|
const src = Array.isArray(e['src'])
|
|
197
|
-
? e['src'].map((item, j) => parseSingleSrc(item, target
|
|
198
|
-
: parseSingleSrc(e['src'], target
|
|
197
|
+
? e['src'].map((item, j) => parseSingleSrc(item, `files["${target}"].src[${j}]`))
|
|
198
|
+
: parseSingleSrc(e['src'], `files["${target}"].src`);
|
|
199
199
|
const fileEntry = { src, target };
|
|
200
|
+
const fileConds = parseConditionField(e, `files["${target}"]`);
|
|
201
|
+
if (fileConds['if'] !== undefined)
|
|
202
|
+
fileEntry['if'] = fileConds['if'];
|
|
203
|
+
if (fileConds.ifAny !== undefined)
|
|
204
|
+
fileEntry.ifAny = fileConds.ifAny;
|
|
200
205
|
if (typeof e['mode'] === 'string')
|
|
201
206
|
fileEntry.mode = e['mode'];
|
|
202
207
|
if (typeof e['post'] === 'string')
|
|
203
208
|
fileEntry.post = e['post'];
|
|
209
|
+
if (e['strategy'] !== undefined) {
|
|
210
|
+
if (e['strategy'] !== 'replace' && e['strategy'] !== 'insert') {
|
|
211
|
+
throw new Error(`files["${target}"].strategy: must be "replace" or "insert"`);
|
|
212
|
+
}
|
|
213
|
+
fileEntry.strategy = e['strategy'];
|
|
214
|
+
}
|
|
204
215
|
if (e['replace'] !== undefined) {
|
|
205
216
|
if (!Array.isArray(e['replace'])) {
|
|
206
217
|
throw new Error(`files["${target}"]: "replace" must be an array`);
|
|
@@ -213,7 +224,7 @@ function parseConfigContent(content) {
|
|
|
213
224
|
fileEntry.json = rawJson;
|
|
214
225
|
}
|
|
215
226
|
else {
|
|
216
|
-
fileEntry.json = parseJsonMergeOptions(rawJson, target);
|
|
227
|
+
fileEntry.json = parseJsonMergeOptions(rawJson, `files["${target}"]`);
|
|
217
228
|
}
|
|
218
229
|
}
|
|
219
230
|
if (e['yaml'] !== undefined) {
|
|
@@ -222,7 +233,7 @@ function parseConfigContent(content) {
|
|
|
222
233
|
fileEntry.yaml = rawYaml;
|
|
223
234
|
}
|
|
224
235
|
else {
|
|
225
|
-
fileEntry.yaml = parseYamlMergeOptions(rawYaml, target);
|
|
236
|
+
fileEntry.yaml = parseYamlMergeOptions(rawYaml, `files["${target}"]`);
|
|
226
237
|
}
|
|
227
238
|
}
|
|
228
239
|
if (e['toml'] !== undefined) {
|
|
@@ -231,7 +242,7 @@ function parseConfigContent(content) {
|
|
|
231
242
|
fileEntry.toml = rawToml;
|
|
232
243
|
}
|
|
233
244
|
else {
|
|
234
|
-
fileEntry.toml = parseTomlMergeOptions(rawToml, target);
|
|
245
|
+
fileEntry.toml = parseTomlMergeOptions(rawToml, `files["${target}"]`);
|
|
235
246
|
}
|
|
236
247
|
}
|
|
237
248
|
files[target] = fileEntry;
|
|
@@ -250,20 +261,67 @@ async function loadConfig(configPath, via) {
|
|
|
250
261
|
}
|
|
251
262
|
function parseVariables(raw) {
|
|
252
263
|
if (raw === undefined || raw === null)
|
|
253
|
-
return
|
|
264
|
+
return Object.create(null);
|
|
254
265
|
if (typeof raw !== 'object' || Array.isArray(raw)) {
|
|
255
|
-
throw new Error('"variables" must be a map of
|
|
266
|
+
throw new Error('"variables" must be a map of variable names to string values or source objects');
|
|
256
267
|
}
|
|
257
268
|
const obj = raw;
|
|
258
|
-
const
|
|
269
|
+
const spec = Object.create(null);
|
|
259
270
|
for (const [key, val] of Object.entries(obj)) {
|
|
260
|
-
if (typeof val
|
|
261
|
-
|
|
271
|
+
if (typeof val === 'string') {
|
|
272
|
+
spec[key] = val;
|
|
273
|
+
}
|
|
274
|
+
else if (val &&
|
|
275
|
+
typeof val === 'object' &&
|
|
276
|
+
!Array.isArray(val) &&
|
|
277
|
+
'src' in val) {
|
|
278
|
+
spec[key] = parseVariableEntry(val, key);
|
|
279
|
+
}
|
|
280
|
+
else {
|
|
281
|
+
throw new Error(`variables.${key}: value must be a string or a source object with "src"`);
|
|
282
|
+
}
|
|
283
|
+
}
|
|
284
|
+
(0, variables_1.validateVariables)(spec);
|
|
285
|
+
return spec;
|
|
286
|
+
}
|
|
287
|
+
function parseVariableEntry(obj, varName) {
|
|
288
|
+
const loc = `variables.${varName}`;
|
|
289
|
+
const rawSrc = obj['src'];
|
|
290
|
+
if (rawSrc === undefined || rawSrc === null) {
|
|
291
|
+
throw new Error(`${loc}: "src" is required`);
|
|
292
|
+
}
|
|
293
|
+
const src = Array.isArray(rawSrc)
|
|
294
|
+
? rawSrc.map((item, j) => parseSingleSrc(item, `${loc}.src[${j}]`))
|
|
295
|
+
: parseSingleSrc(rawSrc, `${loc}.src`);
|
|
296
|
+
const entry = { src };
|
|
297
|
+
if (obj['json'] !== undefined) {
|
|
298
|
+
const rawJson = obj['json'];
|
|
299
|
+
if (rawJson === true || rawJson === false) {
|
|
300
|
+
entry.json = rawJson;
|
|
301
|
+
}
|
|
302
|
+
else {
|
|
303
|
+
entry.json = parseJsonMergeOptions(rawJson, loc);
|
|
304
|
+
}
|
|
305
|
+
}
|
|
306
|
+
if (obj['yaml'] !== undefined) {
|
|
307
|
+
const rawYaml = obj['yaml'];
|
|
308
|
+
if (rawYaml === true || rawYaml === false) {
|
|
309
|
+
entry.yaml = rawYaml;
|
|
310
|
+
}
|
|
311
|
+
else {
|
|
312
|
+
entry.yaml = parseYamlMergeOptions(rawYaml, loc);
|
|
313
|
+
}
|
|
314
|
+
}
|
|
315
|
+
if (obj['toml'] !== undefined) {
|
|
316
|
+
const rawToml = obj['toml'];
|
|
317
|
+
if (rawToml === true || rawToml === false) {
|
|
318
|
+
entry.toml = rawToml;
|
|
319
|
+
}
|
|
320
|
+
else {
|
|
321
|
+
entry.toml = parseTomlMergeOptions(rawToml, loc);
|
|
262
322
|
}
|
|
263
|
-
vars[key] = val;
|
|
264
323
|
}
|
|
265
|
-
|
|
266
|
-
return vars;
|
|
324
|
+
return entry;
|
|
267
325
|
}
|
|
268
326
|
function parseSha(value, loc) {
|
|
269
327
|
if (value === undefined || value === null)
|
|
@@ -309,14 +367,94 @@ function parseVia(value, loc) {
|
|
|
309
367
|
}
|
|
310
368
|
throw new Error(`${loc}.via: must be a string or array`);
|
|
311
369
|
}
|
|
312
|
-
|
|
313
|
-
|
|
370
|
+
const VALID_OS_PLATFORMS = ['linux', 'mac', 'windows'];
|
|
371
|
+
function parseCondition(raw, loc) {
|
|
372
|
+
if (!raw || typeof raw !== 'object' || Array.isArray(raw)) {
|
|
373
|
+
throw new Error(`${loc}: must be an object`);
|
|
374
|
+
}
|
|
375
|
+
const obj = raw;
|
|
376
|
+
const known = new Set(['os', 'exists', 'exec', 'target_exists', 'not']);
|
|
377
|
+
for (const key of Object.keys(obj)) {
|
|
378
|
+
if (!known.has(key)) {
|
|
379
|
+
throw new Error(`${loc}: unknown key "${key}"`);
|
|
380
|
+
}
|
|
381
|
+
}
|
|
382
|
+
const checkKeys = ['os', 'exists', 'exec', 'target_exists'];
|
|
383
|
+
if (!checkKeys.some((k) => obj[k] !== undefined)) {
|
|
384
|
+
throw new Error(`${loc}: must specify at least one of ${checkKeys.join(', ')}`);
|
|
385
|
+
}
|
|
386
|
+
const cond = {};
|
|
387
|
+
if (obj['os'] !== undefined) {
|
|
388
|
+
if (Array.isArray(obj['os']) && obj['os'].length === 0) {
|
|
389
|
+
throw new Error(`${loc}.os: must not be an empty array`);
|
|
390
|
+
}
|
|
391
|
+
const platforms = Array.isArray(obj['os']) ? obj['os'] : [obj['os']];
|
|
392
|
+
for (const p of platforms) {
|
|
393
|
+
if (!VALID_OS_PLATFORMS.includes(p)) {
|
|
394
|
+
throw new Error(`${loc}.os: must be one of ${VALID_OS_PLATFORMS.join(', ')}, got "${p}"`);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
cond.os = Array.isArray(obj['os'])
|
|
398
|
+
? obj['os']
|
|
399
|
+
: obj['os'];
|
|
400
|
+
}
|
|
401
|
+
if (obj['exists'] !== undefined) {
|
|
402
|
+
if (typeof obj['exists'] !== 'string' || !obj['exists']) {
|
|
403
|
+
throw new Error(`${loc}.exists: must be a non-empty string`);
|
|
404
|
+
}
|
|
405
|
+
cond.exists = obj['exists'];
|
|
406
|
+
}
|
|
407
|
+
if (obj['exec'] !== undefined) {
|
|
408
|
+
if (typeof obj['exec'] !== 'string' || !obj['exec']) {
|
|
409
|
+
throw new Error(`${loc}.exec: must be a non-empty string`);
|
|
410
|
+
}
|
|
411
|
+
cond.exec = obj['exec'];
|
|
412
|
+
}
|
|
413
|
+
if (obj['target_exists'] !== undefined) {
|
|
414
|
+
if (obj['target_exists'] !== true) {
|
|
415
|
+
throw new Error(`${loc}.target_exists: must be true`);
|
|
416
|
+
}
|
|
417
|
+
cond.target_exists = true;
|
|
418
|
+
}
|
|
419
|
+
if (obj['not'] !== undefined) {
|
|
420
|
+
if (typeof obj['not'] !== 'boolean') {
|
|
421
|
+
throw new Error(`${loc}.not: must be a boolean`);
|
|
422
|
+
}
|
|
423
|
+
cond.not = obj['not'];
|
|
424
|
+
}
|
|
425
|
+
return cond;
|
|
426
|
+
}
|
|
427
|
+
function parseConditionField(obj, loc) {
|
|
428
|
+
const result = {};
|
|
429
|
+
if (obj['if'] !== undefined) {
|
|
430
|
+
if (Array.isArray(obj['if'])) {
|
|
431
|
+
if (obj['if'].length === 0) {
|
|
432
|
+
throw new Error(`${loc}.if: must not be an empty array`);
|
|
433
|
+
}
|
|
434
|
+
result['if'] = obj['if'].map((c, i) => parseCondition(c, `${loc}.if[${i}]`));
|
|
435
|
+
}
|
|
436
|
+
else {
|
|
437
|
+
result['if'] = parseCondition(obj['if'], `${loc}.if`);
|
|
438
|
+
}
|
|
439
|
+
}
|
|
440
|
+
if (obj['ifAny'] !== undefined) {
|
|
441
|
+
if (!Array.isArray(obj['ifAny'])) {
|
|
442
|
+
throw new Error(`${loc}.ifAny: must be an array`);
|
|
443
|
+
}
|
|
444
|
+
if (obj['ifAny'].length === 0) {
|
|
445
|
+
throw new Error(`${loc}.ifAny: must not be an empty array`);
|
|
446
|
+
}
|
|
447
|
+
result.ifAny = obj['ifAny'].map((c, i) => parseCondition(c, `${loc}.ifAny[${i}]`));
|
|
448
|
+
}
|
|
449
|
+
return result;
|
|
450
|
+
}
|
|
451
|
+
function parseSingleSrc(raw, loc) {
|
|
314
452
|
// Plain string → http/https URL or local path
|
|
315
453
|
if (typeof raw === 'string') {
|
|
316
454
|
return raw;
|
|
317
455
|
}
|
|
318
456
|
if (!raw || typeof raw !== 'object' || Array.isArray(raw)) {
|
|
319
|
-
throw new Error(`${loc}: must be a string or a map with one of: exec, gitlab, github, bitbucket, git,
|
|
457
|
+
throw new Error(`${loc}: must be a string or a map with one of: path, url, exec, gitlab, github, bitbucket, git, aws_s3, vault, http, raw, aws_secrets_manager, aws_systems_manager_parameter`);
|
|
320
458
|
}
|
|
321
459
|
const obj = raw;
|
|
322
460
|
if ('path' in obj) {
|
|
@@ -333,6 +471,11 @@ function parseSingleSrc(raw, target, j) {
|
|
|
333
471
|
const pathSha = parseSha(obj['sha'], loc);
|
|
334
472
|
if (pathSha !== undefined)
|
|
335
473
|
result.sha = pathSha;
|
|
474
|
+
const pathConds = parseConditionField(obj, loc);
|
|
475
|
+
if (pathConds['if'] !== undefined)
|
|
476
|
+
result['if'] = pathConds['if'];
|
|
477
|
+
if (pathConds.ifAny !== undefined)
|
|
478
|
+
result.ifAny = pathConds.ifAny;
|
|
336
479
|
return result;
|
|
337
480
|
}
|
|
338
481
|
if ('url' in obj) {
|
|
@@ -350,7 +493,7 @@ function parseSingleSrc(raw, target, j) {
|
|
|
350
493
|
(0, git_1.parseGitRemoteSpec)(obj['url']);
|
|
351
494
|
}
|
|
352
495
|
catch (err) {
|
|
353
|
-
throw new Error(`${loc}.url: ${err.message}`, {
|
|
496
|
+
throw new Error(`${loc}.url: ${err instanceof Error ? err.message : String(err)}`, {
|
|
354
497
|
cause: err,
|
|
355
498
|
});
|
|
356
499
|
}
|
|
@@ -365,6 +508,11 @@ function parseSingleSrc(raw, target, j) {
|
|
|
365
508
|
const urlSha = parseSha(obj['sha'], loc);
|
|
366
509
|
if (urlSha !== undefined)
|
|
367
510
|
result.sha = urlSha;
|
|
511
|
+
const urlConds = parseConditionField(obj, loc);
|
|
512
|
+
if (urlConds['if'] !== undefined)
|
|
513
|
+
result['if'] = urlConds['if'];
|
|
514
|
+
if (urlConds.ifAny !== undefined)
|
|
515
|
+
result.ifAny = urlConds.ifAny;
|
|
368
516
|
return result;
|
|
369
517
|
}
|
|
370
518
|
if ('http' in obj) {
|
|
@@ -380,6 +528,11 @@ function parseSingleSrc(raw, target, j) {
|
|
|
380
528
|
const httpSha = parseSha(obj['sha'], loc);
|
|
381
529
|
if (httpSha !== undefined)
|
|
382
530
|
result.sha = httpSha;
|
|
531
|
+
const httpConds = parseConditionField(obj, loc);
|
|
532
|
+
if (httpConds['if'] !== undefined)
|
|
533
|
+
result['if'] = httpConds['if'];
|
|
534
|
+
if (httpConds.ifAny !== undefined)
|
|
535
|
+
result.ifAny = httpConds.ifAny;
|
|
383
536
|
return result;
|
|
384
537
|
}
|
|
385
538
|
if ('exec' in obj) {
|
|
@@ -390,6 +543,11 @@ function parseSingleSrc(raw, target, j) {
|
|
|
390
543
|
const execSha = parseSha(obj['sha'], loc);
|
|
391
544
|
if (execSha !== undefined)
|
|
392
545
|
result.sha = execSha;
|
|
546
|
+
const execConds = parseConditionField(obj, loc);
|
|
547
|
+
if (execConds['if'] !== undefined)
|
|
548
|
+
result['if'] = execConds['if'];
|
|
549
|
+
if (execConds.ifAny !== undefined)
|
|
550
|
+
result.ifAny = execConds.ifAny;
|
|
393
551
|
return result;
|
|
394
552
|
}
|
|
395
553
|
if ('gitlab' in obj) {
|
|
@@ -408,6 +566,7 @@ function parseSingleSrc(raw, target, j) {
|
|
|
408
566
|
(typeof g['host'] !== 'string' || !g['host'].trim())) {
|
|
409
567
|
throw new Error(`${loc}.gitlab.host: must be a non-empty string`);
|
|
410
568
|
}
|
|
569
|
+
const gitlabConds = parseConditionField(obj, loc);
|
|
411
570
|
return {
|
|
412
571
|
gitlab: {
|
|
413
572
|
project: g['project'],
|
|
@@ -417,13 +576,15 @@ function parseSingleSrc(raw, target, j) {
|
|
|
417
576
|
host: typeof g['host'] === 'string' ? g['host'] : undefined,
|
|
418
577
|
via: parseVia(g['via'], `${loc}.gitlab`),
|
|
419
578
|
},
|
|
579
|
+
...gitlabConds,
|
|
420
580
|
};
|
|
421
581
|
}
|
|
422
582
|
if ('raw' in obj) {
|
|
423
583
|
if (typeof obj['raw'] !== 'string') {
|
|
424
584
|
throw new Error(`${loc}.raw: must be a string`);
|
|
425
585
|
}
|
|
426
|
-
|
|
586
|
+
const rawConds = parseConditionField(obj, loc);
|
|
587
|
+
return { raw: obj['raw'], ...rawConds };
|
|
427
588
|
}
|
|
428
589
|
if ('github' in obj) {
|
|
429
590
|
const gh = obj['github'];
|
|
@@ -441,6 +602,7 @@ function parseSingleSrc(raw, target, j) {
|
|
|
441
602
|
(typeof g['host'] !== 'string' || !g['host'].trim())) {
|
|
442
603
|
throw new Error(`${loc}.github.host: must be a non-empty string`);
|
|
443
604
|
}
|
|
605
|
+
const githubConds = parseConditionField(obj, loc);
|
|
444
606
|
return {
|
|
445
607
|
github: {
|
|
446
608
|
repo: g['repo'],
|
|
@@ -450,6 +612,7 @@ function parseSingleSrc(raw, target, j) {
|
|
|
450
612
|
host: typeof g['host'] === 'string' ? g['host'] : undefined,
|
|
451
613
|
via: parseVia(g['via'], `${loc}.github`),
|
|
452
614
|
},
|
|
615
|
+
...githubConds,
|
|
453
616
|
};
|
|
454
617
|
}
|
|
455
618
|
if ('bitbucket' in obj) {
|
|
@@ -471,6 +634,7 @@ function parseSingleSrc(raw, target, j) {
|
|
|
471
634
|
(typeof b['host'] !== 'string' || !b['host'].trim())) {
|
|
472
635
|
throw new Error(`${loc}.bitbucket.host: must be a non-empty string`);
|
|
473
636
|
}
|
|
637
|
+
const bitbucketConds = parseConditionField(obj, loc);
|
|
474
638
|
return {
|
|
475
639
|
bitbucket: {
|
|
476
640
|
workspace: b['workspace'],
|
|
@@ -480,6 +644,7 @@ function parseSingleSrc(raw, target, j) {
|
|
|
480
644
|
sha: parseSha(b['sha'], `${loc}.bitbucket`),
|
|
481
645
|
host: typeof b['host'] === 'string' ? b['host'] : undefined,
|
|
482
646
|
},
|
|
647
|
+
...bitbucketConds,
|
|
483
648
|
};
|
|
484
649
|
}
|
|
485
650
|
if ('git' in obj) {
|
|
@@ -494,6 +659,7 @@ function parseSingleSrc(raw, target, j) {
|
|
|
494
659
|
if (typeof gt['file'] !== 'string' || !gt['file']) {
|
|
495
660
|
throw new Error(`${loc}.git.file: required string`);
|
|
496
661
|
}
|
|
662
|
+
const gitConds = parseConditionField(obj, loc);
|
|
497
663
|
return {
|
|
498
664
|
git: {
|
|
499
665
|
repo: gt['repo'],
|
|
@@ -501,16 +667,22 @@ function parseSingleSrc(raw, target, j) {
|
|
|
501
667
|
ref: typeof gt['ref'] === 'string' ? gt['ref'] : undefined,
|
|
502
668
|
sha: parseSha(gt['sha'], `${loc}.git`),
|
|
503
669
|
},
|
|
670
|
+
...gitConds,
|
|
504
671
|
};
|
|
505
672
|
}
|
|
506
|
-
if ('
|
|
507
|
-
if (typeof obj['
|
|
508
|
-
throw new Error(`${loc}.
|
|
673
|
+
if ('aws_s3' in obj) {
|
|
674
|
+
if (typeof obj['aws_s3'] !== 'string' || !obj['aws_s3']) {
|
|
675
|
+
throw new Error(`${loc}.aws_s3: must be a non-empty string (s3:// URI)`);
|
|
509
676
|
}
|
|
510
|
-
const result = {
|
|
677
|
+
const result = { aws_s3: obj['aws_s3'] };
|
|
511
678
|
const s3Sha = parseSha(obj['sha'], loc);
|
|
512
679
|
if (s3Sha !== undefined)
|
|
513
680
|
result.sha = s3Sha;
|
|
681
|
+
const s3Conds = parseConditionField(obj, loc);
|
|
682
|
+
if (s3Conds['if'] !== undefined)
|
|
683
|
+
result['if'] = s3Conds['if'];
|
|
684
|
+
if (s3Conds.ifAny !== undefined)
|
|
685
|
+
result.ifAny = s3Conds.ifAny;
|
|
514
686
|
return result;
|
|
515
687
|
}
|
|
516
688
|
if ('vault' in obj) {
|
|
@@ -522,50 +694,122 @@ function parseSingleSrc(raw, target, j) {
|
|
|
522
694
|
if (typeof vt['path'] !== 'string' || !vt['path']) {
|
|
523
695
|
throw new Error(`${loc}.vault.path: required string`);
|
|
524
696
|
}
|
|
697
|
+
const vaultConds = parseConditionField(obj, loc);
|
|
525
698
|
return {
|
|
526
699
|
vault: {
|
|
527
700
|
path: vt['path'],
|
|
528
701
|
field: typeof vt['field'] === 'string' ? vt['field'] : undefined,
|
|
529
702
|
sha: parseSha(vt['sha'], `${loc}.vault`),
|
|
530
703
|
},
|
|
704
|
+
...vaultConds,
|
|
705
|
+
};
|
|
706
|
+
}
|
|
707
|
+
if ('aws_secrets_manager' in obj) {
|
|
708
|
+
const sm = obj['aws_secrets_manager'];
|
|
709
|
+
if (!sm || typeof sm !== 'object' || Array.isArray(sm)) {
|
|
710
|
+
throw new Error(`${loc}.aws_secrets_manager: must be an object`);
|
|
711
|
+
}
|
|
712
|
+
const smt = sm;
|
|
713
|
+
if (typeof smt['name'] !== 'string' || !smt['name']) {
|
|
714
|
+
throw new Error(`${loc}.aws_secrets_manager.name: required string`);
|
|
715
|
+
}
|
|
716
|
+
const smConds = parseConditionField(obj, loc);
|
|
717
|
+
return {
|
|
718
|
+
aws_secrets_manager: {
|
|
719
|
+
name: smt['name'],
|
|
720
|
+
key: typeof smt['key'] === 'string' && smt['key'] ? smt['key'] : undefined,
|
|
721
|
+
region: typeof smt['region'] === 'string' && smt['region']
|
|
722
|
+
? smt['region']
|
|
723
|
+
: undefined,
|
|
724
|
+
sha: parseSha(smt['sha'], `${loc}.aws_secrets_manager`),
|
|
725
|
+
},
|
|
726
|
+
...smConds,
|
|
531
727
|
};
|
|
532
728
|
}
|
|
533
|
-
|
|
729
|
+
if ('aws_systems_manager_parameter' in obj) {
|
|
730
|
+
const ssm = obj['aws_systems_manager_parameter'];
|
|
731
|
+
if (!ssm || typeof ssm !== 'object' || Array.isArray(ssm)) {
|
|
732
|
+
throw new Error(`${loc}.aws_systems_manager_parameter: must be an object`);
|
|
733
|
+
}
|
|
734
|
+
const ssmt = ssm;
|
|
735
|
+
if (typeof ssmt['name'] !== 'string' || !ssmt['name']) {
|
|
736
|
+
throw new Error(`${loc}.aws_systems_manager_parameter.name: required string`);
|
|
737
|
+
}
|
|
738
|
+
const ssmConds = parseConditionField(obj, loc);
|
|
739
|
+
return {
|
|
740
|
+
aws_systems_manager_parameter: {
|
|
741
|
+
name: ssmt['name'],
|
|
742
|
+
region: typeof ssmt['region'] === 'string' && ssmt['region']
|
|
743
|
+
? ssmt['region']
|
|
744
|
+
: undefined,
|
|
745
|
+
sha: parseSha(ssmt['sha'], `${loc}.aws_systems_manager_parameter`),
|
|
746
|
+
},
|
|
747
|
+
...ssmConds,
|
|
748
|
+
};
|
|
749
|
+
}
|
|
750
|
+
throw new Error(`${loc}: unknown source type. Must be a string or map with exec/gitlab/github/bitbucket/git/aws_s3/vault/http/url/path/raw/aws_secrets_manager/aws_systems_manager_parameter`);
|
|
534
751
|
}
|
|
535
|
-
function parseMergeOptions(raw,
|
|
752
|
+
function parseMergeOptions(raw, loc, kind, conflictValues, arrayValues, objectValues) {
|
|
536
753
|
if (!raw || typeof raw !== 'object' || Array.isArray(raw)) {
|
|
537
|
-
throw new Error(
|
|
754
|
+
throw new Error(`${loc}: "${kind}" must be an object`);
|
|
538
755
|
}
|
|
539
756
|
const obj = raw;
|
|
540
757
|
const opts = {};
|
|
541
758
|
if (obj['conflicts'] !== undefined) {
|
|
542
759
|
if (!conflictValues.includes(obj['conflicts'])) {
|
|
543
|
-
throw new Error(
|
|
760
|
+
throw new Error(`${loc}.${kind}.conflicts: must be one of ${conflictValues.join(', ')}`);
|
|
544
761
|
}
|
|
545
762
|
opts.conflicts = obj['conflicts'];
|
|
546
763
|
}
|
|
547
764
|
if (obj['arrays'] !== undefined) {
|
|
548
765
|
if (!arrayValues.includes(obj['arrays'])) {
|
|
549
|
-
throw new Error(
|
|
766
|
+
throw new Error(`${loc}.${kind}.arrays: must be one of ${arrayValues.join(', ')}`);
|
|
550
767
|
}
|
|
551
768
|
opts.arrays = obj['arrays'];
|
|
552
769
|
}
|
|
553
770
|
if (obj['objects'] !== undefined) {
|
|
554
771
|
if (!objectValues.includes(obj['objects'])) {
|
|
555
|
-
throw new Error(
|
|
772
|
+
throw new Error(`${loc}.${kind}.objects: must be one of ${objectValues.join(', ')}`);
|
|
556
773
|
}
|
|
557
774
|
opts.objects = obj['objects'];
|
|
558
775
|
}
|
|
559
776
|
return opts;
|
|
560
777
|
}
|
|
561
|
-
function parseJsonMergeOptions(raw,
|
|
562
|
-
|
|
778
|
+
function parseJsonMergeOptions(raw, loc) {
|
|
779
|
+
const opts = parseMergeOptions(raw, loc, 'json', ['abort', 'first_wins', 'last_wins'], ['replace', 'concat'], ['replace', 'merge']);
|
|
780
|
+
const r = raw;
|
|
781
|
+
if ('indent' in r) {
|
|
782
|
+
const v = r['indent'];
|
|
783
|
+
if (v === 'tab') {
|
|
784
|
+
opts.indent = 'tab';
|
|
785
|
+
}
|
|
786
|
+
else if (typeof v === 'number' && Number.isInteger(v) && v >= 0) {
|
|
787
|
+
opts.indent = v;
|
|
788
|
+
}
|
|
789
|
+
else {
|
|
790
|
+
throw new Error(`${loc}.json.indent: must be a non-negative integer or "tab"`);
|
|
791
|
+
}
|
|
792
|
+
}
|
|
793
|
+
for (const [yamlKey, tsKey] of [
|
|
794
|
+
['trailing_commas', 'trailingCommas'],
|
|
795
|
+
['sort_keys', 'sortKeys'],
|
|
796
|
+
['minify', 'minify'],
|
|
797
|
+
['strip_comments', 'stripComments'],
|
|
798
|
+
]) {
|
|
799
|
+
if (yamlKey in r) {
|
|
800
|
+
if (typeof r[yamlKey] !== 'boolean') {
|
|
801
|
+
throw new Error(`${loc}.json.${yamlKey}: must be a boolean`);
|
|
802
|
+
}
|
|
803
|
+
opts[tsKey] = r[yamlKey];
|
|
804
|
+
}
|
|
805
|
+
}
|
|
806
|
+
return opts;
|
|
563
807
|
}
|
|
564
|
-
function parseYamlMergeOptions(raw,
|
|
565
|
-
return parseMergeOptions(raw,
|
|
808
|
+
function parseYamlMergeOptions(raw, loc) {
|
|
809
|
+
return parseMergeOptions(raw, loc, 'yaml', ['abort', 'first_wins', 'last_wins'], ['replace', 'concat'], ['replace', 'merge']);
|
|
566
810
|
}
|
|
567
|
-
function parseTomlMergeOptions(raw,
|
|
568
|
-
return parseMergeOptions(raw,
|
|
811
|
+
function parseTomlMergeOptions(raw, loc) {
|
|
812
|
+
return parseMergeOptions(raw, loc, 'toml', ['abort', 'first_wins', 'last_wins'], ['replace', 'concat'], ['replace', 'merge']);
|
|
569
813
|
}
|
|
570
814
|
function parseReplaceRule(r, target, j) {
|
|
571
815
|
if (!r || typeof r !== 'object' || Array.isArray(r)) {
|