diff --git a/plugins/scaffolder-actions/scaffolder-backend-module-utils/src/actions/jsonata/yaml.ts b/plugins/scaffolder-actions/scaffolder-backend-module-utils/src/actions/jsonata/yaml.ts index 723f0b3e4..ea5941097 100644 --- a/plugins/scaffolder-actions/scaffolder-backend-module-utils/src/actions/jsonata/yaml.ts +++ b/plugins/scaffolder-actions/scaffolder-backend-module-utils/src/actions/jsonata/yaml.ts @@ -18,13 +18,13 @@ import jsonata from 'jsonata'; import { resolveSafeChildPath } from '@backstage/backend-common'; import fs from 'fs-extra'; import YAML from 'yaml'; -import { yamlOptionsSchema } from '../../types'; +import { stringifyOptions, yamlOptionsSchema } from '../../types'; export function createYamlJSONataTransformAction() { return createTemplateAction<{ path: string; expression: string; - options?: any; + options?: stringifyOptions; loadAll?: boolean; as?: 'string' | 'object'; }>({ diff --git a/plugins/scaffolder-actions/scaffolder-backend-module-utils/src/actions/merge/merge.ts b/plugins/scaffolder-actions/scaffolder-backend-module-utils/src/actions/merge/merge.ts index 7591ac596..50ab8a844 100644 --- a/plugins/scaffolder-actions/scaffolder-backend-module-utils/src/actions/merge/merge.ts +++ b/plugins/scaffolder-actions/scaffolder-backend-module-utils/src/actions/merge/merge.ts @@ -20,7 +20,7 @@ import fs from 'fs-extra'; import { extname } from 'path'; import { isArray, isNull, mergeWith } from 'lodash'; import YAML from 'yaml'; -import { yamlOptionsSchema } from '../../types'; +import { stringifyOptions, yamlOptionsSchema } from '../../types'; import detectIndent from 'detect-indent'; function mergeArrayCustomiser(objValue: string | any[], srcValue: any) { @@ -139,7 +139,7 @@ export function createMergeAction() { path: string; content: any; mergeArrays?: boolean; - options?: any; + options?: stringifyOptions; }>({ id: 'roadiehq:utils:merge', description: 'Merges data into an existing structured file.', diff --git a/plugins/scaffolder-actions/scaffolder-backend-module-utils/src/actions/serialize/yaml.ts b/plugins/scaffolder-actions/scaffolder-backend-module-utils/src/actions/serialize/yaml.ts index 6474bf25a..e30bbdbee 100644 --- a/plugins/scaffolder-actions/scaffolder-backend-module-utils/src/actions/serialize/yaml.ts +++ b/plugins/scaffolder-actions/scaffolder-backend-module-utils/src/actions/serialize/yaml.ts @@ -15,12 +15,12 @@ */ import { createTemplateAction } from '@backstage/plugin-scaffolder-node'; import YAML from 'yaml'; -import { yamlOptionsSchema } from '../../types'; +import { stringifyOptions, yamlOptionsSchema } from '../../types'; export function createSerializeYamlAction() { return createTemplateAction<{ data: any; - options?: any; + options?: stringifyOptions; }>({ id: 'roadiehq:utils:serialize:yaml', description: 'Allows performing serialization on an object', diff --git a/plugins/scaffolder-actions/scaffolder-backend-module-utils/src/types.ts b/plugins/scaffolder-actions/scaffolder-backend-module-utils/src/types.ts index 9804256e4..772e06757 100644 --- a/plugins/scaffolder-actions/scaffolder-backend-module-utils/src/types.ts +++ b/plugins/scaffolder-actions/scaffolder-backend-module-utils/src/types.ts @@ -14,6 +14,10 @@ * limitations under the License. */ +import { ToStringOptions } from 'yaml'; + +export type stringifyOptions = Omit; + export const yamlOptionsSchema = { title: 'Options', description: 'YAML stringify options',