@roadiehq/scaffolder-backend-module-utils 1.10.6 → 1.11.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/dist/index.cjs.js CHANGED
@@ -333,6 +333,12 @@ const yamlOptionsSchema = {
333
333
  }
334
334
  };
335
335
 
336
+ function mergeArrayCustomiser(objValue, srcValue) {
337
+ if (lodash.isArray(objValue) && !lodash.isNull(objValue)) {
338
+ return Array.from(new Set(objValue.concat(srcValue)));
339
+ }
340
+ return void 0;
341
+ }
336
342
  function createMergeJSONAction({ actionId }) {
337
343
  return pluginScaffolderNode.createTemplateAction({
338
344
  id: actionId || "roadiehq:utils:json:merge",
@@ -352,6 +358,12 @@ function createMergeJSONAction({ actionId }) {
352
358
  description: "This will be merged into to the file. Can be either an object or a string.",
353
359
  title: "Content",
354
360
  type: ["string", "object"]
361
+ },
362
+ mergeArrays: {
363
+ type: "boolean",
364
+ default: false,
365
+ title: "Merge Arrays?",
366
+ description: "Where a value is an array the merge function should concatenate the provided array value with the target array"
355
367
  }
356
368
  }
357
369
  },
@@ -384,7 +396,15 @@ function createMergeJSONAction({ actionId }) {
384
396
  const content = typeof ctx.input.content === "string" ? JSON.parse(ctx.input.content) : ctx.input.content;
385
397
  fs__default["default"].writeFileSync(
386
398
  sourceFilepath,
387
- JSON.stringify(lodash.merge(existingContent, content), null, 2)
399
+ JSON.stringify(
400
+ lodash.mergeWith(
401
+ existingContent,
402
+ content,
403
+ ctx.input.mergeArrays ? mergeArrayCustomiser : void 0
404
+ ),
405
+ null,
406
+ 2
407
+ )
388
408
  );
389
409
  ctx.output("path", sourceFilepath);
390
410
  }
@@ -410,6 +430,12 @@ function createMergeAction() {
410
430
  title: "Content",
411
431
  type: ["string", "object"]
412
432
  },
433
+ mergeArrays: {
434
+ type: "boolean",
435
+ default: false,
436
+ title: "Merge Arrays?",
437
+ description: "Where a value is an array the merge function should concatenate the provided array value with the target array"
438
+ },
413
439
  options: {
414
440
  ...yamlOptionsSchema,
415
441
  description: `${yamlOptionsSchema.description} (for YAML output only)`
@@ -441,7 +467,11 @@ function createMergeAction() {
441
467
  case ".json": {
442
468
  const newContent = typeof ctx.input.content === "string" ? JSON.parse(ctx.input.content) : ctx.input.content;
443
469
  mergedContent = JSON.stringify(
444
- lodash.merge(JSON.parse(originalContent), newContent),
470
+ lodash.mergeWith(
471
+ yaml__default["default"].load(originalContent),
472
+ newContent,
473
+ ctx.input.mergeArrays ? mergeArrayCustomiser : void 0
474
+ ),
445
475
  null,
446
476
  2
447
477
  );
@@ -451,7 +481,11 @@ function createMergeAction() {
451
481
  case ".yaml": {
452
482
  const newContent = typeof ctx.input.content === "string" ? yaml__default["default"].load(ctx.input.content) : ctx.input.content;
453
483
  mergedContent = yaml__default["default"].dump(
454
- lodash.merge(yaml__default["default"].load(originalContent), newContent),
484
+ lodash.mergeWith(
485
+ yaml__default["default"].load(originalContent),
486
+ newContent,
487
+ ctx.input.mergeArrays ? mergeArrayCustomiser : void 0
488
+ ),
455
489
  ctx.input.options
456
490
  );
457
491
  break;
@@ -1 +1 @@
1
- {"version":3,"file":"index.cjs.js","sources":["../src/actions/zip.ts","../src/actions/fs/writeFile.ts","../src/actions/fs/appendFile.ts","../src/actions/fs/parseFile.ts","../src/actions/fs/replaceInFile.ts","../src/types.ts","../src/actions/merge/merge.ts","../src/actions/sleep.ts","../src/actions/jsonata/jsonata.ts","../src/actions/jsonata/yaml.ts","../src/actions/jsonata/json.ts","../src/actions/serialize/json.ts","../src/actions/serialize/yaml.ts"],"sourcesContent":["/*\n * Copyright 2021 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { resolveSafeChildPath } from '@backstage/backend-common';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport { InputError } from '@backstage/errors';\nimport AdmZip from 'adm-zip';\nimport fs from 'fs-extra';\n\nexport function createZipAction() {\n return createTemplateAction<{ path: string; outputPath: string }>({\n id: 'roadiehq:utils:zip',\n description: 'Zips the content of the path',\n supportsDryRun: true,\n schema: {\n input: {\n required: ['path'],\n type: 'object',\n properties: {\n path: {\n title: 'Path',\n description: 'Relative path you would like to zip',\n type: 'string',\n },\n\n outputPath: {\n title: 'Output Path',\n description: 'The name of the result of the zip command',\n type: 'string',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n outputPath: {\n title: 'Zip Path',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const zip = new AdmZip();\n const sourceFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n const destFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.outputPath,\n );\n\n if (!fs.existsSync(sourceFilepath)) {\n throw new InputError(\n `File ${ctx.input.path} does not exist. Can't zip it.`,\n );\n }\n if (fs.lstatSync(sourceFilepath).isDirectory()) {\n zip.addLocalFolder(sourceFilepath);\n } else if (fs.lstatSync(sourceFilepath).isFile()) {\n zip.addLocalFile(sourceFilepath);\n }\n zip.writeZip(destFilepath);\n ctx.output('outputPath', ctx.input.outputPath);\n },\n });\n}\n","/*\n * Copyright 2021 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport { resolveSafeChildPath } from '@backstage/backend-common';\nimport fs from 'fs-extra';\n\nexport function createWriteFileAction() {\n return createTemplateAction<{ path: string; content: string }>({\n id: 'roadiehq:utils:fs:write',\n description: 'Creates a file with the content on the given path',\n supportsDryRun: true,\n schema: {\n input: {\n required: ['path', 'content'],\n type: 'object',\n properties: {\n path: {\n title: 'Path',\n description: 'Relative path',\n type: 'string',\n },\n content: {\n title: 'Content',\n description: 'This will be the content of the file',\n type: 'string',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n path: {\n title: 'Path',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const destFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n\n fs.outputFileSync(destFilepath, ctx.input.content);\n ctx.output('path', destFilepath);\n },\n });\n}\n","/*\n * Copyright 2021 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport { resolveSafeChildPath } from '@backstage/backend-common';\nimport fs from 'fs-extra';\n\nexport function createAppendFileAction() {\n return createTemplateAction<{ path: string; content: string }>({\n id: 'roadiehq:utils:fs:append',\n description:\n 'Append content to the end of the given file, it will create the file if it does not exist.',\n schema: {\n input: {\n type: 'object',\n required: ['content', 'path'],\n properties: {\n path: {\n title: 'Path',\n description: 'Path to existing file to append.',\n type: 'string',\n },\n content: {\n title: 'Content',\n description: 'This will be appended to the file',\n type: 'string',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n path: {\n title: 'Path',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const sourceFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n\n fs.appendFileSync(sourceFilepath, ctx.input.content);\n ctx.output('path', sourceFilepath);\n },\n });\n}\n","/*\n * Copyright 2022 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport { resolveSafeChildPath } from '@backstage/backend-common';\nimport fs from 'fs-extra';\nimport yaml from 'js-yaml';\n\nconst parsers: Record<'yaml' | 'json' | 'multiyaml', (cnt: string) => any> = {\n yaml: (cnt: string) => yaml.load(cnt),\n json: (cnt: string) => JSON.parse(cnt),\n multiyaml: (cnt: string) => yaml.loadAll(cnt),\n};\n\nexport function createParseFileAction() {\n return createTemplateAction<{\n path: string;\n parser?: 'yaml' | 'json' | 'multiyaml';\n }>({\n id: 'roadiehq:utils:fs:parse',\n description: 'Reads a file from the workspace and optionally parses it',\n supportsDryRun: true,\n schema: {\n input: {\n type: 'object',\n required: ['path'],\n properties: {\n path: {\n title: 'Path',\n description: 'Path to the file to read.',\n type: 'string',\n },\n parser: {\n title: 'Parse',\n description: 'Optionally parse the content to an object.',\n type: 'string',\n enum: ['yaml', 'json', 'multiyaml'],\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n content: {\n title: 'Content of the file',\n type: ['string', 'object'],\n },\n },\n },\n },\n async handler(ctx) {\n const sourceFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n const parserName = ctx.input.parser;\n let parser = (content: string) => content;\n\n if (parserName) {\n parser = parsers[parserName];\n }\n\n const content: string | object = parser(\n fs.readFileSync(sourceFilepath).toString(),\n );\n\n ctx.output('content', content);\n },\n });\n}\n","/*\n * Copyright 2021 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport fs from 'fs-extra';\nimport { InputError } from '@backstage/errors';\nimport { resolveSafeChildPath } from '@backstage/backend-common';\n\nexport function createReplaceInFileAction() {\n return createTemplateAction<{\n files: Array<{\n file: string;\n find: string;\n replaceWith: string;\n }>;\n }>({\n id: 'roadiehq:utils:fs:replace',\n description: 'Replaces content of a file with given values.',\n supportsDryRun: true,\n schema: {\n input: {\n required: ['files'],\n type: 'object',\n properties: {\n files: {\n title: 'Files',\n description: 'A list of files and replacements to be done',\n type: 'array',\n items: {\n type: 'object',\n required: [],\n properties: {\n file: {\n type: 'string',\n title:\n 'The source location of the file to be used to run replace against',\n },\n find: {\n type: 'string',\n title: 'A string to be replaced',\n },\n replaceWith: {\n type: 'string',\n title: 'Text to be used to replace the found lines with',\n },\n },\n },\n },\n },\n },\n },\n async handler(ctx) {\n if (!Array.isArray(ctx.input?.files)) {\n throw new InputError('files must be an Array');\n }\n\n for (const file of ctx.input.files) {\n if (!file.file) {\n throw new InputError('Path to file needs to be defined');\n }\n if (!file.find || !file.replaceWith) {\n throw new InputError(\n 'each file must have a find and replaceWith property',\n );\n }\n\n const sourceFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n file.file,\n );\n const content: string = fs.readFileSync(sourceFilepath).toString();\n\n // Not regex\n const replacedContent = content.replaceAll(file.find, file.replaceWith);\n\n fs.writeFileSync(sourceFilepath, replacedContent);\n }\n },\n });\n}\n","/*\n * Copyright 2023 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DumpOptions } from 'js-yaml';\n\nexport type supportedDumpOptions = Omit<\n DumpOptions,\n 'styles' | 'schema' | 'replacer' | 'sortKeys'\n>;\n\nexport const yamlOptionsSchema = {\n title: 'Options',\n description: 'YAML stringify options',\n type: 'object',\n properties: {\n indent: {\n description: '(default: 2) - indentation width to use (in spaces)',\n type: 'number',\n },\n noArrayIndent: {\n description:\n '(default: false) - when true, will not add an indentation level to array elements',\n type: 'boolean',\n },\n skipInvalid: {\n description:\n '(default: false) - do not throw on invalid types (like function in the safe schema) and skip pairs and single values with such types',\n type: 'boolean',\n },\n flowLevel: {\n description:\n '(default: -1) - specifies level of nesting, when to switch from block to flow style for collections. -1 means block style everwhere',\n type: 'number',\n },\n sortKeys: {\n description:\n '(default: false) - if true, sort keys when dumping YAML. If a function, use the function to sort the keys',\n type: 'boolean',\n },\n lineWidth: {\n description:\n '(default: 80) - set max line width. Set -1 for unlimited width',\n type: 'number',\n },\n noRefs: {\n description:\n \"(default: false) - if true, don't convert duplicate objects into references\",\n type: 'boolean',\n },\n noCompatMode: {\n description:\n '(default: false) - if true don\\'t try to be compatible with older yaml versions. Currently: don\\'t quote \"yes\", \"no\" and so on, as required for YAML 1.1',\n type: 'boolean',\n },\n condenseFlow: {\n description:\n \"(default: false) - if true flow sequences will be condensed, omitting the space between a, b. Eg. '[a,b]', and omitting the space between key: value and quoting the key. Eg. '{\\\"a\\\":b}' Can be useful when using yaml for pretty URL query params as spaces are %-encoded.\",\n type: 'boolean',\n },\n quotingType: {\n description:\n \"(' or \\\", default: ') - strings will be quoted using this quoting style. If you specify single quotes, double quotes will still be used for non-printable characters.\",\n type: 'string',\n },\n forceQuotes: {\n description:\n \"(default: false) - if true, all non-key strings will be quoted even if they normally don't need to.\",\n type: 'boolean',\n },\n },\n};\n","/*\n * Copyright 2021 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport { resolveSafeChildPath } from '@backstage/backend-common';\nimport fs from 'fs-extra';\nimport { extname } from 'path';\nimport { merge } from 'lodash';\nimport yaml from 'js-yaml';\nimport { supportedDumpOptions, yamlOptionsSchema } from '../../types';\n\nexport function createMergeJSONAction({ actionId }: { actionId?: string }) {\n return createTemplateAction<{ path: string; content: any }>({\n id: actionId || 'roadiehq:utils:json:merge',\n description: 'Merge new data into an existing JSON file.',\n supportsDryRun: true,\n schema: {\n input: {\n type: 'object',\n required: ['content', 'path'],\n properties: {\n path: {\n title: 'Path',\n description: 'Path to existing file to append.',\n type: 'string',\n },\n content: {\n description:\n 'This will be merged into to the file. Can be either an object or a string.',\n title: 'Content',\n type: ['string', 'object'],\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n path: {\n title: 'Path',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const sourceFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n\n let existingContent;\n\n if (fs.existsSync(sourceFilepath)) {\n existingContent = JSON.parse(\n fs.readFileSync(sourceFilepath).toString(),\n );\n } else {\n ctx.logger.info(\n `The file ${sourceFilepath} does not exist, creating it.`,\n );\n existingContent = {};\n }\n const content =\n typeof ctx.input.content === 'string'\n ? JSON.parse(ctx.input.content)\n : ctx.input.content;\n\n fs.writeFileSync(\n sourceFilepath,\n JSON.stringify(merge(existingContent, content), null, 2),\n );\n ctx.output('path', sourceFilepath);\n },\n });\n}\n\nexport function createMergeAction() {\n return createTemplateAction<{\n path: string;\n content: any;\n options?: supportedDumpOptions;\n }>({\n id: 'roadiehq:utils:merge',\n description: 'Merges data into an existing structured file.',\n supportsDryRun: true,\n schema: {\n input: {\n type: 'object',\n required: ['content', 'path'],\n properties: {\n path: {\n title: 'Path',\n description: 'Path to existing file to append.',\n type: 'string',\n },\n content: {\n description:\n 'This will be merged into to the file. Can be either an object or a string.',\n title: 'Content',\n type: ['string', 'object'],\n },\n options: {\n ...yamlOptionsSchema,\n description: `${yamlOptionsSchema.description} (for YAML output only)`,\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n path: {\n title: 'Path',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const sourceFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n\n if (!fs.existsSync(sourceFilepath)) {\n ctx.logger.error(`The file ${sourceFilepath} does not exist.`);\n throw new Error(`The file ${sourceFilepath} does not exist.`);\n }\n const originalContent = fs.readFileSync(sourceFilepath).toString();\n let mergedContent;\n\n switch (extname(sourceFilepath)) {\n case '.json': {\n const newContent =\n typeof ctx.input.content === 'string'\n ? JSON.parse(ctx.input.content)\n : ctx.input.content; // This supports the case where dynamic keys are required\n mergedContent = JSON.stringify(\n merge(JSON.parse(originalContent), newContent),\n null,\n 2,\n );\n break;\n }\n case '.yml':\n case '.yaml': {\n const newContent =\n typeof ctx.input.content === 'string'\n ? yaml.load(ctx.input.content)\n : ctx.input.content; // This supports the case where dynamic keys are required\n mergedContent = yaml.dump(\n merge(yaml.load(originalContent), newContent),\n ctx.input.options,\n );\n break;\n }\n default:\n break;\n }\n if (!mergedContent) {\n return;\n }\n fs.writeFileSync(sourceFilepath, mergedContent);\n ctx.output('path', sourceFilepath);\n },\n });\n}\n","/*\n * Copyright 2021 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport { InputError } from '@backstage/errors';\n\nexport function createSleepAction(options?: { maxSleep?: number }) {\n return createTemplateAction<{ amount: number }>({\n id: 'roadiehq:utils:sleep',\n description: 'Halts the scaffolding for the given amount of seconds',\n supportsDryRun: true,\n schema: {\n input: {\n type: 'object',\n required: ['amount'],\n properties: {\n amount: {\n title: 'Sleep Amount',\n description: 'How much seconds should this step take.',\n type: 'number',\n },\n },\n },\n },\n async handler(ctx) {\n if (isNaN(ctx.input?.amount)) {\n throw new InputError('amount must be a number');\n } else if (options?.maxSleep && ctx.input.amount > options.maxSleep) {\n throw new InputError(\n `sleep amount can not be greater than maxSleep. amount: ${ctx.input.amount}, maxSleep: ${options.maxSleep}`,\n );\n }\n ctx.logger.info(`Waiting ${ctx.input.amount} seconds`);\n\n await new Promise(resolve => {\n setTimeout(resolve, ctx.input.amount * 1000);\n });\n },\n });\n}\n","/*\n * Copyright 2022 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport jsonata from 'jsonata';\n\nexport function createJSONataAction() {\n return createTemplateAction<{\n data: any;\n expression: string;\n }>({\n id: 'roadiehq:utils:jsonata',\n description:\n 'Allows performing JSONata operations and transformations on input objects and produces the output result as a step output.',\n supportsDryRun: true,\n schema: {\n input: {\n type: 'object',\n required: ['data', 'expression'],\n properties: {\n data: {\n title: 'Data',\n description: 'Input data to be transformed',\n type: [\n 'object',\n 'array',\n 'string',\n 'number',\n 'integer',\n 'boolean',\n 'null',\n ],\n },\n expression: {\n title: 'Expression',\n description: 'JSONata expression to perform on the input',\n type: 'string',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n result: {\n title: 'Output result from JSONata',\n type: 'object',\n },\n },\n },\n },\n async handler(ctx) {\n try {\n const expression = jsonata(ctx.input.expression);\n const result = expression.evaluate(ctx.input.data);\n\n ctx.output('result', result);\n } catch (e: any) {\n const message = e.hasOwnProperty('message')\n ? e.message\n : 'unknown JSONata evaluation error';\n throw new Error(\n `JSONata failed to evaluate the expression: ${message}`,\n );\n }\n },\n });\n}\n","/*\n * Copyright 2022 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport jsonata from 'jsonata';\nimport { resolveSafeChildPath } from '@backstage/backend-common';\nimport fs from 'fs-extra';\nimport yaml from 'js-yaml';\nimport { supportedDumpOptions, yamlOptionsSchema } from '../../types';\n\nexport function createYamlJSONataTransformAction() {\n return createTemplateAction<{\n path: string;\n expression: string;\n options?: supportedDumpOptions;\n as?: 'string' | 'object';\n }>({\n id: 'roadiehq:utils:jsonata:yaml:transform',\n description:\n 'Allows performing JSONata operations and transformations on a YAML file in the workspace. The result can be read from the `result` step output.',\n supportsDryRun: true,\n schema: {\n input: {\n type: 'object',\n required: ['path', 'expression'],\n properties: {\n path: {\n title: 'Path',\n description: 'Input path to read yaml file',\n type: 'string',\n },\n expression: {\n title: 'Expression',\n description: 'JSONata expression to perform on the input',\n type: 'string',\n },\n as: {\n title: 'Desired Result Type',\n description:\n 'Permitted values are: \"string\" (default) and \"object\"',\n type: 'string',\n enum: ['string', 'object'],\n },\n options: yamlOptionsSchema,\n },\n },\n output: {\n type: 'object',\n properties: {\n result: {\n title: 'Output result from JSONata',\n type: 'object | string',\n },\n },\n },\n },\n async handler(ctx) {\n let resultHandler: (rz: any) => any;\n\n if (ctx.input.as === 'object') {\n resultHandler = rz => rz;\n } else {\n resultHandler = rz => yaml.dump(rz, ctx.input.options);\n }\n const sourceFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n\n const data = yaml.load(fs.readFileSync(sourceFilepath).toString());\n const expression = jsonata(ctx.input.expression);\n const result = expression.evaluate(data);\n\n ctx.output('result', resultHandler(result));\n },\n });\n}\n","/*\n * Copyright 2022 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport jsonata from 'jsonata';\nimport { resolveSafeChildPath } from '@backstage/backend-common';\nimport fs from 'fs-extra';\n\nexport function createJsonJSONataTransformAction() {\n return createTemplateAction<{\n path: string;\n expression: string;\n replacer?: string[];\n space?: string;\n as?: 'string' | 'object';\n }>({\n id: 'roadiehq:utils:jsonata:json:transform',\n description:\n 'Allows performing JSONata operations and transformations on a JSON file in the workspace. The result can be read from the `result` step output.',\n supportsDryRun: true,\n schema: {\n input: {\n type: 'object',\n required: ['path', 'expression'],\n properties: {\n path: {\n title: 'Path',\n description: 'Input path to read json file',\n type: 'string',\n },\n expression: {\n title: 'Expression',\n description: 'JSONata expression to perform on the input',\n type: 'string',\n },\n as: {\n title: 'Desired Result Type',\n description:\n 'Permitted values are: \"string\" (default) and \"object\"',\n type: 'string',\n enum: ['string', 'object'],\n },\n replacer: {\n title: 'Replacer',\n description: 'Replacer array',\n type: 'array',\n items: {\n type: 'string',\n },\n },\n space: {\n title: 'Space',\n description: 'Space character',\n type: 'string',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n result: {\n title: 'Output result from JSONata',\n type: 'object | string',\n },\n },\n },\n },\n async handler(ctx) {\n let resultHandler: (rz: any) => any;\n\n if (ctx.input.as === 'object') {\n resultHandler = rz => rz;\n } else {\n resultHandler = rz =>\n JSON.stringify(rz, ctx.input.replacer, ctx.input.space);\n }\n const sourceFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n\n const data = JSON.parse(fs.readFileSync(sourceFilepath).toString());\n const expression = jsonata(ctx.input.expression);\n const result = expression.evaluate(data);\n\n ctx.output('result', resultHandler(result));\n },\n });\n}\n","/*\n * Copyright 2022 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\n\nexport function createSerializeJsonAction() {\n return createTemplateAction<{\n data: any;\n replacer?: string[];\n space?: string;\n }>({\n id: 'roadiehq:utils:serialize:json',\n description: 'Allows performing serialization on an object',\n supportsDryRun: true,\n schema: {\n input: {\n type: 'object',\n required: ['data'],\n properties: {\n data: {\n title: 'Data',\n description: 'Input data to perform seriazation on.',\n type: 'object',\n },\n replacer: {\n title: 'Replacer',\n description: 'Replacer array',\n type: 'array',\n items: {\n type: 'string',\n },\n },\n space: {\n title: 'Space',\n description: 'Space character',\n type: 'string',\n },\n },\n },\n output: {\n type: 'string',\n properties: {\n serialized: {\n title: 'Output result from serialization',\n type: 'string',\n },\n },\n },\n },\n\n async handler(ctx) {\n ctx.output(\n 'serialized',\n JSON.stringify(ctx.input.data, ctx.input.replacer, ctx.input.space),\n );\n },\n });\n}\n","/*\n * Copyright 2022 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'js-yaml';\nimport { supportedDumpOptions, yamlOptionsSchema } from '../../types';\n\nexport function createSerializeYamlAction() {\n return createTemplateAction<{\n data: any;\n options?: supportedDumpOptions;\n }>({\n id: 'roadiehq:utils:serialize:yaml',\n description: 'Allows performing serialization on an object',\n supportsDryRun: true,\n schema: {\n input: {\n type: 'object',\n required: ['data'],\n properties: {\n data: {\n title: 'Data',\n description: 'Input data to perform seriazation on.',\n type: 'object',\n },\n replacer: {\n title: 'Replacer',\n description: 'Replacer array',\n type: 'array',\n items: {\n type: 'string',\n },\n },\n options: yamlOptionsSchema,\n },\n },\n output: {\n type: 'string',\n properties: {\n serialized: {\n title: 'Output result from serialization',\n type: 'string',\n },\n },\n },\n },\n\n async handler(ctx) {\n ctx.output('serialized', yaml.dump(ctx.input.data, ctx.input.options));\n },\n });\n}\n"],"names":["createTemplateAction","AdmZip","resolveSafeChildPath","fs","InputError","yaml","merge","extname","jsonata"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAKO,SAAS,eAAe,GAAG;AAClC,EAAE,OAAOA,4CAAoB,CAAC;AAC9B,IAAI,EAAE,EAAE,oBAAoB;AAC5B,IAAI,WAAW,EAAE,8BAA8B;AAC/C,IAAI,cAAc,EAAE,IAAI;AACxB,IAAI,MAAM,EAAE;AACZ,MAAM,KAAK,EAAE;AACb,QAAQ,QAAQ,EAAE,CAAC,MAAM,CAAC;AAC1B,QAAQ,IAAI,EAAE,QAAQ;AACtB,QAAQ,UAAU,EAAE;AACpB,UAAU,IAAI,EAAE;AAChB,YAAY,KAAK,EAAE,MAAM;AACzB,YAAY,WAAW,EAAE,qCAAqC;AAC9D,YAAY,IAAI,EAAE,QAAQ;AAC1B,WAAW;AACX,UAAU,UAAU,EAAE;AACtB,YAAY,KAAK,EAAE,aAAa;AAChC,YAAY,WAAW,EAAE,2CAA2C;AACpE,YAAY,IAAI,EAAE,QAAQ;AAC1B,WAAW;AACX,SAAS;AACT,OAAO;AACP,MAAM,MAAM,EAAE;AACd,QAAQ,IAAI,EAAE,QAAQ;AACtB,QAAQ,UAAU,EAAE;AACpB,UAAU,UAAU,EAAE;AACtB,YAAY,KAAK,EAAE,UAAU;AAC7B,YAAY,IAAI,EAAE,QAAQ;AAC1B,WAAW;AACX,SAAS;AACT,OAAO;AACP,KAAK;AACL,IAAI,MAAM,OAAO,CAAC,GAAG,EAAE;AACvB,MAAM,MAAM,GAAG,GAAG,IAAIC,0BAAM,EAAE,CAAC;AAC/B,MAAM,MAAM,cAAc,GAAGC,kCAAoB;AACjD,QAAQ,GAAG,CAAC,aAAa;AACzB,QAAQ,GAAG,CAAC,KAAK,CAAC,IAAI;AACtB,OAAO,CAAC;AACR,MAAM,MAAM,YAAY,GAAGA,kCAAoB;AAC/C,QAAQ,GAAG,CAAC,aAAa;AAC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EAAE,kCAAkC;AACrD,YAAY,IAAI,EAAE,QAAQ;AAC1B,WAAW;AACX,SAAS;AACT,OAAO;AACP,KAAK;AACL,IAAI,MAAM,OAAO,CAAC,GAAG,EAAE;AACvB,MAAM,GAAG,CAAC,MAAM,CAAC,YAAY,EAAEK,wBAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAC7E,KAAK;AACL,GAAG,CAAC,CAAC;AACL;;;;;;;;;;;;;;;;"}
1
+ {"version":3,"file":"index.cjs.js","sources":["../src/actions/zip.ts","../src/actions/fs/writeFile.ts","../src/actions/fs/appendFile.ts","../src/actions/fs/parseFile.ts","../src/actions/fs/replaceInFile.ts","../src/types.ts","../src/actions/merge/merge.ts","../src/actions/sleep.ts","../src/actions/jsonata/jsonata.ts","../src/actions/jsonata/yaml.ts","../src/actions/jsonata/json.ts","../src/actions/serialize/json.ts","../src/actions/serialize/yaml.ts"],"sourcesContent":["/*\n * Copyright 2021 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { resolveSafeChildPath } from '@backstage/backend-common';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport { InputError } from '@backstage/errors';\nimport AdmZip from 'adm-zip';\nimport fs from 'fs-extra';\n\nexport function createZipAction() {\n return createTemplateAction<{ path: string; outputPath: string }>({\n id: 'roadiehq:utils:zip',\n description: 'Zips the content of the path',\n supportsDryRun: true,\n schema: {\n input: {\n required: ['path'],\n type: 'object',\n properties: {\n path: {\n title: 'Path',\n description: 'Relative path you would like to zip',\n type: 'string',\n },\n\n outputPath: {\n title: 'Output Path',\n description: 'The name of the result of the zip command',\n type: 'string',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n outputPath: {\n title: 'Zip Path',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const zip = new AdmZip();\n const sourceFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n const destFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.outputPath,\n );\n\n if (!fs.existsSync(sourceFilepath)) {\n throw new InputError(\n `File ${ctx.input.path} does not exist. Can't zip it.`,\n );\n }\n if (fs.lstatSync(sourceFilepath).isDirectory()) {\n zip.addLocalFolder(sourceFilepath);\n } else if (fs.lstatSync(sourceFilepath).isFile()) {\n zip.addLocalFile(sourceFilepath);\n }\n zip.writeZip(destFilepath);\n ctx.output('outputPath', ctx.input.outputPath);\n },\n });\n}\n","/*\n * Copyright 2021 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport { resolveSafeChildPath } from '@backstage/backend-common';\nimport fs from 'fs-extra';\n\nexport function createWriteFileAction() {\n return createTemplateAction<{ path: string; content: string }>({\n id: 'roadiehq:utils:fs:write',\n description: 'Creates a file with the content on the given path',\n supportsDryRun: true,\n schema: {\n input: {\n required: ['path', 'content'],\n type: 'object',\n properties: {\n path: {\n title: 'Path',\n description: 'Relative path',\n type: 'string',\n },\n content: {\n title: 'Content',\n description: 'This will be the content of the file',\n type: 'string',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n path: {\n title: 'Path',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const destFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n\n fs.outputFileSync(destFilepath, ctx.input.content);\n ctx.output('path', destFilepath);\n },\n });\n}\n","/*\n * Copyright 2021 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport { resolveSafeChildPath } from '@backstage/backend-common';\nimport fs from 'fs-extra';\n\nexport function createAppendFileAction() {\n return createTemplateAction<{ path: string; content: string }>({\n id: 'roadiehq:utils:fs:append',\n description:\n 'Append content to the end of the given file, it will create the file if it does not exist.',\n schema: {\n input: {\n type: 'object',\n required: ['content', 'path'],\n properties: {\n path: {\n title: 'Path',\n description: 'Path to existing file to append.',\n type: 'string',\n },\n content: {\n title: 'Content',\n description: 'This will be appended to the file',\n type: 'string',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n path: {\n title: 'Path',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const sourceFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n\n fs.appendFileSync(sourceFilepath, ctx.input.content);\n ctx.output('path', sourceFilepath);\n },\n });\n}\n","/*\n * Copyright 2022 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport { resolveSafeChildPath } from '@backstage/backend-common';\nimport fs from 'fs-extra';\nimport yaml from 'js-yaml';\n\nconst parsers: Record<'yaml' | 'json' | 'multiyaml', (cnt: string) => any> = {\n yaml: (cnt: string) => yaml.load(cnt),\n json: (cnt: string) => JSON.parse(cnt),\n multiyaml: (cnt: string) => yaml.loadAll(cnt),\n};\n\nexport function createParseFileAction() {\n return createTemplateAction<{\n path: string;\n parser?: 'yaml' | 'json' | 'multiyaml';\n }>({\n id: 'roadiehq:utils:fs:parse',\n description: 'Reads a file from the workspace and optionally parses it',\n supportsDryRun: true,\n schema: {\n input: {\n type: 'object',\n required: ['path'],\n properties: {\n path: {\n title: 'Path',\n description: 'Path to the file to read.',\n type: 'string',\n },\n parser: {\n title: 'Parse',\n description: 'Optionally parse the content to an object.',\n type: 'string',\n enum: ['yaml', 'json', 'multiyaml'],\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n content: {\n title: 'Content of the file',\n type: ['string', 'object'],\n },\n },\n },\n },\n async handler(ctx) {\n const sourceFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n const parserName = ctx.input.parser;\n let parser = (content: string) => content;\n\n if (parserName) {\n parser = parsers[parserName];\n }\n\n const content: string | object = parser(\n fs.readFileSync(sourceFilepath).toString(),\n );\n\n ctx.output('content', content);\n },\n });\n}\n","/*\n * Copyright 2021 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport fs from 'fs-extra';\nimport { InputError } from '@backstage/errors';\nimport { resolveSafeChildPath } from '@backstage/backend-common';\n\nexport function createReplaceInFileAction() {\n return createTemplateAction<{\n files: Array<{\n file: string;\n find: string;\n replaceWith: string;\n }>;\n }>({\n id: 'roadiehq:utils:fs:replace',\n description: 'Replaces content of a file with given values.',\n supportsDryRun: true,\n schema: {\n input: {\n required: ['files'],\n type: 'object',\n properties: {\n files: {\n title: 'Files',\n description: 'A list of files and replacements to be done',\n type: 'array',\n items: {\n type: 'object',\n required: [],\n properties: {\n file: {\n type: 'string',\n title:\n 'The source location of the file to be used to run replace against',\n },\n find: {\n type: 'string',\n title: 'A string to be replaced',\n },\n replaceWith: {\n type: 'string',\n title: 'Text to be used to replace the found lines with',\n },\n },\n },\n },\n },\n },\n },\n async handler(ctx) {\n if (!Array.isArray(ctx.input?.files)) {\n throw new InputError('files must be an Array');\n }\n\n for (const file of ctx.input.files) {\n if (!file.file) {\n throw new InputError('Path to file needs to be defined');\n }\n if (!file.find || !file.replaceWith) {\n throw new InputError(\n 'each file must have a find and replaceWith property',\n );\n }\n\n const sourceFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n file.file,\n );\n const content: string = fs.readFileSync(sourceFilepath).toString();\n\n // Not regex\n const replacedContent = content.replaceAll(file.find, file.replaceWith);\n\n fs.writeFileSync(sourceFilepath, replacedContent);\n }\n },\n });\n}\n","/*\n * Copyright 2023 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { DumpOptions } from 'js-yaml';\n\nexport type supportedDumpOptions = Omit<\n DumpOptions,\n 'styles' | 'schema' | 'replacer' | 'sortKeys'\n>;\n\nexport const yamlOptionsSchema = {\n title: 'Options',\n description: 'YAML stringify options',\n type: 'object',\n properties: {\n indent: {\n description: '(default: 2) - indentation width to use (in spaces)',\n type: 'number',\n },\n noArrayIndent: {\n description:\n '(default: false) - when true, will not add an indentation level to array elements',\n type: 'boolean',\n },\n skipInvalid: {\n description:\n '(default: false) - do not throw on invalid types (like function in the safe schema) and skip pairs and single values with such types',\n type: 'boolean',\n },\n flowLevel: {\n description:\n '(default: -1) - specifies level of nesting, when to switch from block to flow style for collections. -1 means block style everwhere',\n type: 'number',\n },\n sortKeys: {\n description:\n '(default: false) - if true, sort keys when dumping YAML. If a function, use the function to sort the keys',\n type: 'boolean',\n },\n lineWidth: {\n description:\n '(default: 80) - set max line width. Set -1 for unlimited width',\n type: 'number',\n },\n noRefs: {\n description:\n \"(default: false) - if true, don't convert duplicate objects into references\",\n type: 'boolean',\n },\n noCompatMode: {\n description:\n '(default: false) - if true don\\'t try to be compatible with older yaml versions. Currently: don\\'t quote \"yes\", \"no\" and so on, as required for YAML 1.1',\n type: 'boolean',\n },\n condenseFlow: {\n description:\n \"(default: false) - if true flow sequences will be condensed, omitting the space between a, b. Eg. '[a,b]', and omitting the space between key: value and quoting the key. Eg. '{\\\"a\\\":b}' Can be useful when using yaml for pretty URL query params as spaces are %-encoded.\",\n type: 'boolean',\n },\n quotingType: {\n description:\n \"(' or \\\", default: ') - strings will be quoted using this quoting style. If you specify single quotes, double quotes will still be used for non-printable characters.\",\n type: 'string',\n },\n forceQuotes: {\n description:\n \"(default: false) - if true, all non-key strings will be quoted even if they normally don't need to.\",\n type: 'boolean',\n },\n },\n};\n","/*\n * Copyright 2021 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport { resolveSafeChildPath } from '@backstage/backend-common';\nimport fs from 'fs-extra';\nimport { extname } from 'path';\nimport { isArray, isNull, mergeWith } from 'lodash';\nimport yaml from 'js-yaml';\nimport { supportedDumpOptions, yamlOptionsSchema } from '../../types';\n\nfunction mergeArrayCustomiser(objValue: string | any[], srcValue: any) {\n if (isArray(objValue) && !isNull(objValue)) {\n return Array.from(new Set(objValue.concat(srcValue)));\n }\n return undefined;\n}\n\nexport function createMergeJSONAction({ actionId }: { actionId?: string }) {\n return createTemplateAction<{\n path: string;\n content: any;\n mergeArrays?: boolean;\n }>({\n id: actionId || 'roadiehq:utils:json:merge',\n description: 'Merge new data into an existing JSON file.',\n supportsDryRun: true,\n schema: {\n input: {\n type: 'object',\n required: ['content', 'path'],\n properties: {\n path: {\n title: 'Path',\n description: 'Path to existing file to append.',\n type: 'string',\n },\n content: {\n description:\n 'This will be merged into to the file. Can be either an object or a string.',\n title: 'Content',\n type: ['string', 'object'],\n },\n mergeArrays: {\n type: 'boolean',\n default: false,\n title: 'Merge Arrays?',\n description:\n 'Where a value is an array the merge function should concatenate the provided array value with the target array',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n path: {\n title: 'Path',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const sourceFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n\n let existingContent;\n\n if (fs.existsSync(sourceFilepath)) {\n existingContent = JSON.parse(\n fs.readFileSync(sourceFilepath).toString(),\n );\n } else {\n ctx.logger.info(\n `The file ${sourceFilepath} does not exist, creating it.`,\n );\n existingContent = {};\n }\n const content =\n typeof ctx.input.content === 'string'\n ? JSON.parse(ctx.input.content)\n : ctx.input.content;\n\n fs.writeFileSync(\n sourceFilepath,\n JSON.stringify(\n mergeWith(\n existingContent,\n content,\n ctx.input.mergeArrays ? mergeArrayCustomiser : undefined,\n ),\n null,\n 2,\n ),\n );\n ctx.output('path', sourceFilepath);\n },\n });\n}\n\nexport function createMergeAction() {\n return createTemplateAction<{\n path: string;\n content: any;\n mergeArrays?: boolean;\n options?: supportedDumpOptions;\n }>({\n id: 'roadiehq:utils:merge',\n description: 'Merges data into an existing structured file.',\n supportsDryRun: true,\n schema: {\n input: {\n type: 'object',\n required: ['content', 'path'],\n properties: {\n path: {\n title: 'Path',\n description: 'Path to existing file to append.',\n type: 'string',\n },\n content: {\n description:\n 'This will be merged into to the file. Can be either an object or a string.',\n title: 'Content',\n type: ['string', 'object'],\n },\n mergeArrays: {\n type: 'boolean',\n default: false,\n title: 'Merge Arrays?',\n description:\n 'Where a value is an array the merge function should concatenate the provided array value with the target array',\n },\n options: {\n ...yamlOptionsSchema,\n description: `${yamlOptionsSchema.description} (for YAML output only)`,\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n path: {\n title: 'Path',\n type: 'string',\n },\n },\n },\n },\n async handler(ctx) {\n const sourceFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n\n if (!fs.existsSync(sourceFilepath)) {\n ctx.logger.error(`The file ${sourceFilepath} does not exist.`);\n throw new Error(`The file ${sourceFilepath} does not exist.`);\n }\n const originalContent = fs.readFileSync(sourceFilepath).toString();\n let mergedContent;\n\n switch (extname(sourceFilepath)) {\n case '.json': {\n const newContent =\n typeof ctx.input.content === 'string'\n ? JSON.parse(ctx.input.content)\n : ctx.input.content; // This supports the case where dynamic keys are required\n mergedContent = JSON.stringify(\n mergeWith(\n yaml.load(originalContent),\n newContent,\n ctx.input.mergeArrays ? mergeArrayCustomiser : undefined,\n ),\n null,\n 2,\n );\n break;\n }\n case '.yml':\n case '.yaml': {\n const newContent =\n typeof ctx.input.content === 'string'\n ? yaml.load(ctx.input.content)\n : ctx.input.content; // This supports the case where dynamic keys are required\n mergedContent = yaml.dump(\n mergeWith(\n yaml.load(originalContent),\n newContent,\n ctx.input.mergeArrays ? mergeArrayCustomiser : undefined,\n ),\n ctx.input.options,\n );\n break;\n }\n default:\n break;\n }\n if (!mergedContent) {\n return;\n }\n fs.writeFileSync(sourceFilepath, mergedContent);\n ctx.output('path', sourceFilepath);\n },\n });\n}\n","/*\n * Copyright 2021 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\n\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport { InputError } from '@backstage/errors';\n\nexport function createSleepAction(options?: { maxSleep?: number }) {\n return createTemplateAction<{ amount: number }>({\n id: 'roadiehq:utils:sleep',\n description: 'Halts the scaffolding for the given amount of seconds',\n supportsDryRun: true,\n schema: {\n input: {\n type: 'object',\n required: ['amount'],\n properties: {\n amount: {\n title: 'Sleep Amount',\n description: 'How much seconds should this step take.',\n type: 'number',\n },\n },\n },\n },\n async handler(ctx) {\n if (isNaN(ctx.input?.amount)) {\n throw new InputError('amount must be a number');\n } else if (options?.maxSleep && ctx.input.amount > options.maxSleep) {\n throw new InputError(\n `sleep amount can not be greater than maxSleep. amount: ${ctx.input.amount}, maxSleep: ${options.maxSleep}`,\n );\n }\n ctx.logger.info(`Waiting ${ctx.input.amount} seconds`);\n\n await new Promise(resolve => {\n setTimeout(resolve, ctx.input.amount * 1000);\n });\n },\n });\n}\n","/*\n * Copyright 2022 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport jsonata from 'jsonata';\n\nexport function createJSONataAction() {\n return createTemplateAction<{\n data: any;\n expression: string;\n }>({\n id: 'roadiehq:utils:jsonata',\n description:\n 'Allows performing JSONata operations and transformations on input objects and produces the output result as a step output.',\n supportsDryRun: true,\n schema: {\n input: {\n type: 'object',\n required: ['data', 'expression'],\n properties: {\n data: {\n title: 'Data',\n description: 'Input data to be transformed',\n type: [\n 'object',\n 'array',\n 'string',\n 'number',\n 'integer',\n 'boolean',\n 'null',\n ],\n },\n expression: {\n title: 'Expression',\n description: 'JSONata expression to perform on the input',\n type: 'string',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n result: {\n title: 'Output result from JSONata',\n type: 'object',\n },\n },\n },\n },\n async handler(ctx) {\n try {\n const expression = jsonata(ctx.input.expression);\n const result = expression.evaluate(ctx.input.data);\n\n ctx.output('result', result);\n } catch (e: any) {\n const message = e.hasOwnProperty('message')\n ? e.message\n : 'unknown JSONata evaluation error';\n throw new Error(\n `JSONata failed to evaluate the expression: ${message}`,\n );\n }\n },\n });\n}\n","/*\n * Copyright 2022 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport jsonata from 'jsonata';\nimport { resolveSafeChildPath } from '@backstage/backend-common';\nimport fs from 'fs-extra';\nimport yaml from 'js-yaml';\nimport { supportedDumpOptions, yamlOptionsSchema } from '../../types';\n\nexport function createYamlJSONataTransformAction() {\n return createTemplateAction<{\n path: string;\n expression: string;\n options?: supportedDumpOptions;\n as?: 'string' | 'object';\n }>({\n id: 'roadiehq:utils:jsonata:yaml:transform',\n description:\n 'Allows performing JSONata operations and transformations on a YAML file in the workspace. The result can be read from the `result` step output.',\n supportsDryRun: true,\n schema: {\n input: {\n type: 'object',\n required: ['path', 'expression'],\n properties: {\n path: {\n title: 'Path',\n description: 'Input path to read yaml file',\n type: 'string',\n },\n expression: {\n title: 'Expression',\n description: 'JSONata expression to perform on the input',\n type: 'string',\n },\n as: {\n title: 'Desired Result Type',\n description:\n 'Permitted values are: \"string\" (default) and \"object\"',\n type: 'string',\n enum: ['string', 'object'],\n },\n options: yamlOptionsSchema,\n },\n },\n output: {\n type: 'object',\n properties: {\n result: {\n title: 'Output result from JSONata',\n type: 'object | string',\n },\n },\n },\n },\n async handler(ctx) {\n let resultHandler: (rz: any) => any;\n\n if (ctx.input.as === 'object') {\n resultHandler = rz => rz;\n } else {\n resultHandler = rz => yaml.dump(rz, ctx.input.options);\n }\n const sourceFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n\n const data = yaml.load(fs.readFileSync(sourceFilepath).toString());\n const expression = jsonata(ctx.input.expression);\n const result = expression.evaluate(data);\n\n ctx.output('result', resultHandler(result));\n },\n });\n}\n","/*\n * Copyright 2022 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\nimport jsonata from 'jsonata';\nimport { resolveSafeChildPath } from '@backstage/backend-common';\nimport fs from 'fs-extra';\n\nexport function createJsonJSONataTransformAction() {\n return createTemplateAction<{\n path: string;\n expression: string;\n replacer?: string[];\n space?: string;\n as?: 'string' | 'object';\n }>({\n id: 'roadiehq:utils:jsonata:json:transform',\n description:\n 'Allows performing JSONata operations and transformations on a JSON file in the workspace. The result can be read from the `result` step output.',\n supportsDryRun: true,\n schema: {\n input: {\n type: 'object',\n required: ['path', 'expression'],\n properties: {\n path: {\n title: 'Path',\n description: 'Input path to read json file',\n type: 'string',\n },\n expression: {\n title: 'Expression',\n description: 'JSONata expression to perform on the input',\n type: 'string',\n },\n as: {\n title: 'Desired Result Type',\n description:\n 'Permitted values are: \"string\" (default) and \"object\"',\n type: 'string',\n enum: ['string', 'object'],\n },\n replacer: {\n title: 'Replacer',\n description: 'Replacer array',\n type: 'array',\n items: {\n type: 'string',\n },\n },\n space: {\n title: 'Space',\n description: 'Space character',\n type: 'string',\n },\n },\n },\n output: {\n type: 'object',\n properties: {\n result: {\n title: 'Output result from JSONata',\n type: 'object | string',\n },\n },\n },\n },\n async handler(ctx) {\n let resultHandler: (rz: any) => any;\n\n if (ctx.input.as === 'object') {\n resultHandler = rz => rz;\n } else {\n resultHandler = rz =>\n JSON.stringify(rz, ctx.input.replacer, ctx.input.space);\n }\n const sourceFilepath = resolveSafeChildPath(\n ctx.workspacePath,\n ctx.input.path,\n );\n\n const data = JSON.parse(fs.readFileSync(sourceFilepath).toString());\n const expression = jsonata(ctx.input.expression);\n const result = expression.evaluate(data);\n\n ctx.output('result', resultHandler(result));\n },\n });\n}\n","/*\n * Copyright 2022 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-backend';\n\nexport function createSerializeJsonAction() {\n return createTemplateAction<{\n data: any;\n replacer?: string[];\n space?: string;\n }>({\n id: 'roadiehq:utils:serialize:json',\n description: 'Allows performing serialization on an object',\n supportsDryRun: true,\n schema: {\n input: {\n type: 'object',\n required: ['data'],\n properties: {\n data: {\n title: 'Data',\n description: 'Input data to perform seriazation on.',\n type: 'object',\n },\n replacer: {\n title: 'Replacer',\n description: 'Replacer array',\n type: 'array',\n items: {\n type: 'string',\n },\n },\n space: {\n title: 'Space',\n description: 'Space character',\n type: 'string',\n },\n },\n },\n output: {\n type: 'string',\n properties: {\n serialized: {\n title: 'Output result from serialization',\n type: 'string',\n },\n },\n },\n },\n\n async handler(ctx) {\n ctx.output(\n 'serialized',\n JSON.stringify(ctx.input.data, ctx.input.replacer, ctx.input.space),\n );\n },\n });\n}\n","/*\n * Copyright 2022 Larder Software Limited\n *\n * Licensed under the Apache License, Version 2.0 (the \"License\");\n * you may not use this file except in compliance with the License.\n * You may obtain a copy of the License at\n *\n * http://www.apache.org/licenses/LICENSE-2.0\n *\n * Unless required by applicable law or agreed to in writing, software\n * distributed under the License is distributed on an \"AS IS\" BASIS,\n * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\n * See the License for the specific language governing permissions and\n * limitations under the License.\n */\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport yaml from 'js-yaml';\nimport { supportedDumpOptions, yamlOptionsSchema } from '../../types';\n\nexport function createSerializeYamlAction() {\n return createTemplateAction<{\n data: any;\n options?: supportedDumpOptions;\n }>({\n id: 'roadiehq:utils:serialize:yaml',\n description: 'Allows performing serialization on an object',\n supportsDryRun: true,\n schema: {\n input: {\n type: 'object',\n required: ['data'],\n properties: {\n data: {\n title: 'Data',\n description: 'Input data to perform seriazation on.',\n type: 'object',\n },\n replacer: {\n title: 'Replacer',\n description: 'Replacer array',\n type: 'array',\n items: {\n type: 'string',\n },\n },\n options: yamlOptionsSchema,\n },\n },\n output: {\n type: 'string',\n properties: {\n serialized: {\n title: 'Output result from serialization',\n type: 'string',\n },\n },\n },\n },\n\n async handler(ctx) {\n ctx.output('serialized', yaml.dump(ctx.input.data, ctx.input.options));\n },\n });\n}\n"],"names":["createTemplateAction","AdmZip","resolveSafeChildPath","fs","InputError","yaml","isArray","isNull","mergeWith","extname","jsonata"],"mappings":";;;;;;;;;;;;;;;;;;;;;;AAKO,SAAS,eAAe,GAAG;AAClC,EAAE,OAAOA,4CAAoB,CAAC;AAC9B,IAAI,EAAE,EAAE,oBAAoB;AAC5B,IAAI,WAAW,EAAE,8BAA8B;AAC/C,IAAI,cAAc,EAAE,IAAI;AACxB,IAAI,MAAM,EAAE;AACZ,MAAM,KAAK,EAAE;AACb,QAAQ,QAAQ,EAAE,CAAC,MAAM,CAAC;AAC1B,QAAQ,IAAI,EAAE,QAAQ;AACtB,QAAQ,UAAU,EAAE;AACpB,UAAU,IAAI,EAAE;AAChB,YAAY,KAAK,EAAE,MAAM;AACzB,YAAY,WAAW,EAAE,qCAAqC;AAC9D,YAAY,IAAI,EAAE,QAAQ;AAC1B,WAAW;AACX,UAAU,UAAU,EAAE;AACtB,YAAY,KAAK,EAAE,aAAa;AAChC,YAAY,WAAW,EAAE,2CAA2C;AACpE,YAAY,IAAI,EAAE,QAAQ;AAC1B,WAAW;AACX,SAAS;AACT,OAAO;AACP,MAAM,MAAM,EAAE;AACd,QAAQ,IAAI,EAAE,QAAQ;AACtB,QAAQ,UAAU,EAAE;AACpB,UAAU,UAAU,EAAE;AACtB,YAAY,KAAK,EAAE,UAAU;AAC7B,YAAY,IAAI,EAAE,QAAQ;AAC1B,WAAW;AACX,SAAS;AACT,OAAO;AACP,KAAK;AACL,IAAI,MAAM,OAAO,CAAC,GAAG,EAAE;AACvB,MAAM,MAAM,GAAG,GAAG,IAAIC,0BAAM,EAAE,C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;AACP,KAAK;AACL,IAAI,MAAM,OAAO,CAAC,GAAG,EAAE;AACvB,MAAM,GAAG,CAAC,MAAM,CAAC,YAAY,EAAEK,wBAAI,CAAC,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,IAAI,EAAE,GAAG,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC;AAC7E,KAAK;AACL,GAAG,CAAC,CAAC;AACL;;;;;;;;;;;;;;;;"}
package/dist/index.d.ts CHANGED
@@ -37,10 +37,12 @@ declare function createMergeJSONAction({ actionId }: {
37
37
  }): _backstage_plugin_scaffolder_node.TemplateAction<{
38
38
  path: string;
39
39
  content: any;
40
+ mergeArrays?: boolean | undefined;
40
41
  }, _backstage_types.JsonObject>;
41
42
  declare function createMergeAction(): _backstage_plugin_scaffolder_node.TemplateAction<{
42
43
  path: string;
43
44
  content: any;
45
+ mergeArrays?: boolean | undefined;
44
46
  options?: supportedDumpOptions | undefined;
45
47
  }, _backstage_types.JsonObject>;
46
48
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@roadiehq/scaffolder-backend-module-utils",
3
- "version": "1.10.6",
3
+ "version": "1.11.0",
4
4
  "main": "dist/index.cjs.js",
5
5
  "types": "dist/index.d.ts",
6
6
  "license": "Apache-2.0",
@@ -56,5 +56,5 @@
56
56
  "files": [
57
57
  "dist"
58
58
  ],
59
- "gitHead": "a01334b290e4e1ed9094ea5ac19946e325005fef"
59
+ "gitHead": "ecdf5dbd5ddef9eb436cd2a0a4e09803ef254429"
60
60
  }