@backstage/plugin-scaffolder-react 1.13.3-next.1 → 1.13.3-next.2

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.
Files changed (50) hide show
  1. package/CHANGELOG.md +17 -0
  2. package/alpha/package.json +1 -1
  3. package/dist/api/ref.esm.js.map +1 -1
  4. package/dist/extensions/index.esm.js.map +1 -1
  5. package/dist/extensions/keys.esm.js.map +1 -1
  6. package/dist/hooks/useCustomFieldExtensions.esm.js.map +1 -1
  7. package/dist/hooks/useCustomLayouts.esm.js.map +1 -1
  8. package/dist/hooks/useEventStream.esm.js.map +1 -1
  9. package/dist/layouts/createScaffolderLayout.esm.js.map +1 -1
  10. package/dist/layouts/keys.esm.js.map +1 -1
  11. package/dist/next/blueprints/FormFieldBlueprint.esm.js.map +1 -1
  12. package/dist/next/components/Form/DescriptionFieldTemplate.esm.js.map +1 -1
  13. package/dist/next/components/Form/FieldTemplate.esm.js.map +1 -1
  14. package/dist/next/components/Form/Form.esm.js.map +1 -1
  15. package/dist/next/components/PasswordWidget/PasswordWidget.esm.js.map +1 -1
  16. package/dist/next/components/ReviewState/ReviewState.esm.js.map +1 -1
  17. package/dist/next/components/ReviewState/util.esm.js.map +1 -1
  18. package/dist/next/components/ScaffolderField/ScaffolderField.esm.js.map +1 -1
  19. package/dist/next/components/ScaffolderPageContextMenu/ScaffolderPageContextMenu.esm.js.map +1 -1
  20. package/dist/next/components/SecretWidget/SecretWidget.esm.js.map +1 -1
  21. package/dist/next/components/Stepper/ErrorListTemplate/errorListTemplate.esm.js.map +1 -1
  22. package/dist/next/components/Stepper/Stepper.esm.js.map +1 -1
  23. package/dist/next/components/Stepper/createAsyncValidators.esm.js.map +1 -1
  24. package/dist/next/components/Stepper/utils.esm.js.map +1 -1
  25. package/dist/next/components/TaskLogStream/TaskLogStream.esm.js.map +1 -1
  26. package/dist/next/components/TaskSteps/StepIcon.esm.js.map +1 -1
  27. package/dist/next/components/TaskSteps/StepTime.esm.js.map +1 -1
  28. package/dist/next/components/TaskSteps/TaskBorder.esm.js.map +1 -1
  29. package/dist/next/components/TaskSteps/TaskSteps.esm.js.map +1 -1
  30. package/dist/next/components/TemplateCard/CardHeader.esm.js.map +1 -1
  31. package/dist/next/components/TemplateCard/CardLink.esm.js.map +1 -1
  32. package/dist/next/components/TemplateCard/TemplateCard.esm.js.map +1 -1
  33. package/dist/next/components/TemplateCategoryPicker/TemplateCategoryPicker.esm.js.map +1 -1
  34. package/dist/next/components/TemplateGroup/TemplateGroup.esm.js.map +1 -1
  35. package/dist/next/components/TemplateGroups/TemplateGroups.esm.js.map +1 -1
  36. package/dist/next/components/TemplateOutputs/DefaultTemplateOutputs.esm.js.map +1 -1
  37. package/dist/next/components/TemplateOutputs/LinkOutputs.esm.js.map +1 -1
  38. package/dist/next/components/TemplateOutputs/TextOutputs.esm.js.map +1 -1
  39. package/dist/next/components/Workflow/Workflow.esm.js.map +1 -1
  40. package/dist/next/hooks/useFilteredSchemaProperties.esm.js.map +1 -1
  41. package/dist/next/hooks/useFormDataFromQuery.esm.js.map +1 -1
  42. package/dist/next/hooks/useTemplateParameterSchema.esm.js.map +1 -1
  43. package/dist/next/hooks/useTemplateSchema.esm.js.map +1 -1
  44. package/dist/next/hooks/useTemplateTimeSaved.esm.js.map +1 -1
  45. package/dist/next/hooks/useTransformSchemaToProps.esm.js.map +1 -1
  46. package/dist/next/lib/schema.esm.js.map +1 -1
  47. package/dist/packages/opaque-internal/src/OpaqueType.esm.js.map +1 -1
  48. package/dist/secrets/SecretsContext.esm.js.map +1 -1
  49. package/dist/utils.esm.js.map +1 -1
  50. package/package.json +5 -5
@@ -1 +1 @@
1
- {"version":3,"file":"OpaqueType.esm.js","sources":["../../../../../../packages/opaque-internal/src/OpaqueType.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\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\n// TODO(Rugvip): This lives here temporarily, but should be moved to a more\n// central location. It's useful for backend packages too so we'll need to have\n// it in a common package, but it might also be that we want to make it\n// available publicly too in which case it would make sense to have this be part\n// of @backstage/version-bridge. The problem with exporting it from there is\n// that it would need to be very stable at that point, so it might be a bit\n// early to put it there already.\n\n/**\n * A helper for working with opaque types.\n */\nexport class OpaqueType<\n T extends {\n public: { $$type: string };\n versions: { version: string | undefined };\n },\n> {\n /**\n * Creates a new opaque type.\n *\n * @param options.type The type identifier of the opaque type\n * @param options.versions The available versions of the opaque type\n * @returns A new opaque type helper\n */\n static create<\n T extends {\n public: { $$type: string };\n versions: { version: string | undefined };\n },\n >(options: {\n type: T['public']['$$type'];\n versions: Array<T['versions']['version']>;\n }) {\n return new OpaqueType<T>(options.type, new Set(options.versions));\n }\n\n #type: string;\n #versions: Set<string | undefined>;\n\n private constructor(type: string, versions: Set<string | undefined>) {\n this.#type = type;\n this.#versions = versions;\n }\n\n /**\n * The internal version of the opaque type, used like this: `typeof MyOpaqueType.TPublic`\n *\n * @remarks\n *\n * This property is only useful for type checking, its runtime value is `undefined`.\n */\n TPublic: T['public'] = undefined as any;\n\n /**\n * The internal version of the opaque type, used like this: `typeof MyOpaqueType.TInternal`\n *\n * @remarks\n *\n * This property is only useful for type checking, its runtime value is `undefined`.\n */\n TInternal: T['public'] & T['versions'] = undefined as any;\n\n /**\n * @param value Input value expected to be an instance of this opaque type\n * @returns True if the value matches this opaque type\n */\n isType = (value: unknown): value is T['public'] => {\n return this.#isThisInternalType(value);\n };\n\n /**\n * @param value Input value expected to be an instance of this opaque type\n * @throws If the value is not an instance of this opaque type or is of an unsupported version\n * @returns The internal version of the opaque type\n */\n toInternal = (value: unknown): T['public'] & T['versions'] => {\n if (!this.#isThisInternalType(value)) {\n throw new TypeError(\n `Invalid opaque type, expected '${\n this.#type\n }', but got '${this.#stringifyUnknown(value)}'`,\n );\n }\n\n if (!this.#versions.has(value.version)) {\n const versions = Array.from(this.#versions).map(this.#stringifyVersion);\n if (versions.length > 1) {\n versions[versions.length - 1] = `or ${versions[versions.length - 1]}`;\n }\n const expected =\n versions.length > 2 ? versions.join(', ') : versions.join(' ');\n throw new TypeError(\n `Invalid opaque type instance, got version ${this.#stringifyVersion(\n value.version,\n )}, expected ${expected}`,\n );\n }\n\n return value;\n };\n\n /**\n * Creates an instance of the opaque type, returning the public type.\n *\n * @param version The version of the instance to create\n * @param value The remaining public and internal properties of the instance\n * @returns An instance of the opaque type\n */\n createInstance<\n TVersion extends T['versions']['version'],\n TPublic extends T['public'],\n >(\n version: TVersion,\n props: Omit<T['public'], '$$type'> &\n (T['versions'] extends infer UVersion\n ? UVersion extends { version: TVersion }\n ? Omit<UVersion, 'version'>\n : never\n : never) &\n Object, // & Object to allow for object properties too, e.g. toString()\n ): TPublic {\n return Object.assign(props as object, {\n $$type: this.#type,\n ...(version && { version }),\n }) as unknown as TPublic;\n }\n\n #isThisInternalType(value: unknown): value is T['public'] & T['versions'] {\n if (value === null || typeof value !== 'object') {\n return false;\n }\n return (value as T['public']).$$type === this.#type;\n }\n\n #stringifyUnknown(value: unknown) {\n if (typeof value !== 'object') {\n return `<${typeof value}>`;\n }\n if (value === null) {\n return '<null>';\n }\n if ('$$type' in value) {\n return String(value.$$type);\n }\n return String(value);\n }\n\n #stringifyVersion = (version: string | undefined) => {\n return version ? `'${version}'` : 'undefined';\n };\n}\n"],"names":[],"mappings":"AA2BO,MAAM,UAKX,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,OAAO,OAKL,OAGC,EAAA;AACD,IAAO,OAAA,IAAI,WAAc,OAAQ,CAAA,IAAA,EAAM,IAAI,GAAI,CAAA,OAAA,CAA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AA,GACrB;AAAA,EAEA,iBAAA,GAAoB,CAAC,OAAgC,KAAA;AACnD,IAAO,OAAA,OAAA,GAAU,CAAI,CAAA,EAAA,OAAO,CAAM,CAAA,CAAA,GAAA,WAAA,CAAA;AAAA,GACpC,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"OpaqueType.esm.js","sources":["../../../../../../packages/opaque-internal/src/OpaqueType.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\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\n// TODO(Rugvip): This lives here temporarily, but should be moved to a more\n// central location. It's useful for backend packages too so we'll need to have\n// it in a common package, but it might also be that we want to make it\n// available publicly too in which case it would make sense to have this be part\n// of @backstage/version-bridge. The problem with exporting it from there is\n// that it would need to be very stable at that point, so it might be a bit\n// early to put it there already.\n\n/**\n * A helper for working with opaque types.\n */\nexport class OpaqueType<\n T extends {\n public: { $$type: string };\n versions: { version: string | undefined };\n },\n> {\n /**\n * Creates a new opaque type.\n *\n * @param options.type The type identifier of the opaque type\n * @param options.versions The available versions of the opaque type\n * @returns A new opaque type helper\n */\n static create<\n T extends {\n public: { $$type: string };\n versions: { version: string | undefined };\n },\n >(options: {\n type: T['public']['$$type'];\n versions: Array<T['versions']['version']>;\n }) {\n return new OpaqueType<T>(options.type, new Set(options.versions));\n }\n\n #type: string;\n #versions: Set<string | undefined>;\n\n private constructor(type: string, versions: Set<string | undefined>) {\n this.#type = type;\n this.#versions = versions;\n }\n\n /**\n * The internal version of the opaque type, used like this: `typeof MyOpaqueType.TPublic`\n *\n * @remarks\n *\n * This property is only useful for type checking, its runtime value is `undefined`.\n */\n TPublic: T['public'] = undefined as any;\n\n /**\n * The internal version of the opaque type, used like this: `typeof MyOpaqueType.TInternal`\n *\n * @remarks\n *\n * This property is only useful for type checking, its runtime value is `undefined`.\n */\n TInternal: T['public'] & T['versions'] = undefined as any;\n\n /**\n * @param value Input value expected to be an instance of this opaque type\n * @returns True if the value matches this opaque type\n */\n isType = (value: unknown): value is T['public'] => {\n return this.#isThisInternalType(value);\n };\n\n /**\n * @param value Input value expected to be an instance of this opaque type\n * @throws If the value is not an instance of this opaque type or is of an unsupported version\n * @returns The internal version of the opaque type\n */\n toInternal = (value: unknown): T['public'] & T['versions'] => {\n if (!this.#isThisInternalType(value)) {\n throw new TypeError(\n `Invalid opaque type, expected '${\n this.#type\n }', but got '${this.#stringifyUnknown(value)}'`,\n );\n }\n\n if (!this.#versions.has(value.version)) {\n const versions = Array.from(this.#versions).map(this.#stringifyVersion);\n if (versions.length > 1) {\n versions[versions.length - 1] = `or ${versions[versions.length - 1]}`;\n }\n const expected =\n versions.length > 2 ? versions.join(', ') : versions.join(' ');\n throw new TypeError(\n `Invalid opaque type instance, got version ${this.#stringifyVersion(\n value.version,\n )}, expected ${expected}`,\n );\n }\n\n return value;\n };\n\n /**\n * Creates an instance of the opaque type, returning the public type.\n *\n * @param version The version of the instance to create\n * @param value The remaining public and internal properties of the instance\n * @returns An instance of the opaque type\n */\n createInstance<\n TVersion extends T['versions']['version'],\n TPublic extends T['public'],\n >(\n version: TVersion,\n props: Omit<T['public'], '$$type'> &\n (T['versions'] extends infer UVersion\n ? UVersion extends { version: TVersion }\n ? Omit<UVersion, 'version'>\n : never\n : never) &\n Object, // & Object to allow for object properties too, e.g. toString()\n ): TPublic {\n return Object.assign(props as object, {\n $$type: this.#type,\n ...(version && { version }),\n }) as unknown as TPublic;\n }\n\n #isThisInternalType(value: unknown): value is T['public'] & T['versions'] {\n if (value === null || typeof value !== 'object') {\n return false;\n }\n return (value as T['public']).$$type === this.#type;\n }\n\n #stringifyUnknown(value: unknown) {\n if (typeof value !== 'object') {\n return `<${typeof value}>`;\n }\n if (value === null) {\n return '<null>';\n }\n if ('$$type' in value) {\n return String(value.$$type);\n }\n return String(value);\n }\n\n #stringifyVersion = (version: string | undefined) => {\n return version ? `'${version}'` : 'undefined';\n };\n}\n"],"names":[],"mappings":"AA2BO,MAAM,UAKX,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAQA,OAAO,OAKL,OAGC,EAAA;AACD,IAAO,OAAA,IAAI,WAAc,OAAQ,CAAA,IAAA,EAAM,IAAI,GAAI,CAAA,OAAA,CAAQ,QAAQ,CAAC,CAAA;AAAA;AAClE,EAEA,KAAA;AAAA,EACA,SAAA;AAAA,EAEQ,WAAA,CAAY,MAAc,QAAmC,EAAA;AACnE,IAAA,IAAA,CAAK,KAAQ,GAAA,IAAA;AACb,IAAA,IAAA,CAAK,SAAY,GAAA,QAAA;AAAA;AACnB;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASA,OAAuB,GAAA,KAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EASvB,SAAyC,GAAA,KAAA,CAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAMzC,MAAA,GAAS,CAAC,KAAyC,KAAA;AACjD,IAAO,OAAA,IAAA,CAAK,oBAAoB,KAAK,CAAA;AAAA,GACvC;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,EAOA,UAAA,GAAa,CAAC,KAAgD,KAAA;AAC5D,IAAA,IAAI,CAAC,IAAA,CAAK,mBAAoB,CAAA,KAAK,CAAG,EAAA;AACpC,MAAA,MAAM,IAAI,SAAA;AAAA,QACR,kCACE,IAAK,CAAA,KACP,eAAe,IAAK,CAAA,iBAAA,CAAkB,KAAK,CAAC,CAAA,CAAA;AAAA,OAC9C;AAAA;AAGF,IAAA,IAAI,CAAC,IAAK,CAAA,SAAA,CAAU,GAAI,CAAA,KAAA,CAAM,OAAO,CAAG,EAAA;AAC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AO,OAAA,QAAA;AAAA;AAET,IAAA,IAAI,YAAY,KAAO,EAAA;AACrB,MAAO,OAAA,MAAA,CAAO,MAAM,MAAM,CAAA;AAAA;AAE5B,IAAA,OAAO,OAAO,KAAK,CAAA;AAAA;AACrB,EAEA,iBAAA,GAAoB,CAAC,OAAgC,KAAA;AACnD,IAAO,OAAA,OAAA,GAAU,CAAI,CAAA,EAAA,OAAO,CAAM,CAAA,CAAA,GAAA,WAAA;AAAA,GACpC;AACF;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"SecretsContext.esm.js","sources":["../../src/secrets/SecretsContext.tsx"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\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 {\n createVersionedContext,\n createVersionedValueMap,\n} from '@backstage/version-bridge';\nimport React, {\n useState,\n useCallback,\n useContext,\n PropsWithChildren,\n} from 'react';\n\n/**\n * The contents of the `SecretsContext`\n */\ntype SecretsContextContents = {\n secrets: Record<string, string>;\n setSecrets: React.Dispatch<React.SetStateAction<Record<string, string>>>;\n};\n\n/**\n * The context to hold the Secrets.\n */\nconst SecretsContext = createVersionedContext<{\n 1: SecretsContextContents;\n}>('secrets-context');\n\n/**\n * The Context Provider that holds the state for the secrets.\n * @public\n */\nexport const SecretsContextProvider = (\n props: PropsWithChildren<{ initialSecrets?: Record<string, string> }>,\n) => {\n const { initialSecrets = {} } = props;\n const [secrets, setSecrets] = useState<Record<string, string>>({\n ...initialSecrets,\n });\n\n return (\n <SecretsContext.Provider\n value={createVersionedValueMap({ 1: { secrets, setSecrets } })}\n >\n {props.children}\n </SecretsContext.Provider>\n );\n};\n\n/**\n * The return type from the useTemplateSecrets hook.\n * @public\n */\nexport interface ScaffolderUseTemplateSecrets {\n setSecrets: (input: Record<string, string>) => void;\n secrets: Record<string, string>;\n}\n\n/**\n * Hook to access the secrets context to be able to set secrets that are\n * passed to the Scaffolder backend.\n * @public\n */\nexport const useTemplateSecrets = (): ScaffolderUseTemplateSecrets => {\n const value = useContext(SecretsContext)?.atVersion(1);\n\n if (!value) {\n throw new Error(\n 'useTemplateSecrets must be used within a SecretsContextProvider',\n );\n }\n\n const { setSecrets: updateSecrets, secrets = {} } = value;\n\n const setSecrets = useCallback(\n (input: Record<string, string>) => {\n updateSecrets(currentSecrets => ({ ...currentSecrets, ...input }));\n },\n [updateSecrets],\n );\n\n return { setSecrets, secrets };\n};\n"],"names":[],"mappings":";;;AAqCA,MAAM,cAAA,GAAiB,uBAEpB,iBAAiB,CAAA,CAAA;AAMP,MAAA,sBAAA,GAAyB,CACpC,KACG,KAAA;AACH,EAAA,MAAM,EAAE,cAAA,GAAiB,EAAC,EAAM,GAAA,KAAA,CAAA;AAChC,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,QAAiC,CAAA;AAAA,IAC7D,GAAG,cAAA;AAAA,GACJ,CAAA,CAAA;AAED,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,cAAe,CAAA,QAAA;AAAA,IAAf;AAAA,MACC,KAAA,EAAO,wBAAwB,EAAE,CAAA,EAAG,EAAE,OAAS,EAAA,UAAA,IAAc,CAAA;AAAA,KAAA;AAAA,IAE5D,KAAM,CAAA,QAAA;AAAA,GACT,CAAA;AAEJ,EAAA;AAgBO,MAAM,qBAAqB,MAAoC;AACpE,EAAA,MAAM,KAAQ,GAAA,UAAA,CAAW,cAAc,CAAA,EAAG,UAAU,CAAC,CAAA,CAAA;AAErD,EAAA,IAAI,CAAC,KAAO,EAAA;AACV,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,iEAAA;AAAA,KACF,CAAA;AAAA,GACF;AAEA,EAAA,MAAM,EAAE,UAAY,EAAA,aAAA,EAAe,OAAU,GAAA,IAAO,GAAA,KAAA,CAAA;AAEpD,EAAA,MAAM,UAAa,GAAA,WAAA;AAAA,IACjB,CAAC,KAAkC,KAAA;AACjC,MAAA,aAAA,CAAc,qBAAmB,EAAE,GAAG,cAAgB,EAAA,GAAG,OAAQ,CAAA,CAAA,CAAA;AAAA,KACnE;AAAA,IACA,CAAC,aAAa,CAAA;AAAA,GAChB,CAAA;AAEA,EAAO,OAAA,EAAE,YAAY,OAAQ,EAAA,CAAA;AAC/B;;;;"}
1
+ {"version":3,"file":"SecretsContext.esm.js","sources":["../../src/secrets/SecretsContext.tsx"],"sourcesContent":["/*\n * Copyright 2022 The Backstage Authors\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 {\n createVersionedContext,\n createVersionedValueMap,\n} from '@backstage/version-bridge';\nimport React, {\n useState,\n useCallback,\n useContext,\n PropsWithChildren,\n} from 'react';\n\n/**\n * The contents of the `SecretsContext`\n */\ntype SecretsContextContents = {\n secrets: Record<string, string>;\n setSecrets: React.Dispatch<React.SetStateAction<Record<string, string>>>;\n};\n\n/**\n * The context to hold the Secrets.\n */\nconst SecretsContext = createVersionedContext<{\n 1: SecretsContextContents;\n}>('secrets-context');\n\n/**\n * The Context Provider that holds the state for the secrets.\n * @public\n */\nexport const SecretsContextProvider = (\n props: PropsWithChildren<{ initialSecrets?: Record<string, string> }>,\n) => {\n const { initialSecrets = {} } = props;\n const [secrets, setSecrets] = useState<Record<string, string>>({\n ...initialSecrets,\n });\n\n return (\n <SecretsContext.Provider\n value={createVersionedValueMap({ 1: { secrets, setSecrets } })}\n >\n {props.children}\n </SecretsContext.Provider>\n );\n};\n\n/**\n * The return type from the useTemplateSecrets hook.\n * @public\n */\nexport interface ScaffolderUseTemplateSecrets {\n setSecrets: (input: Record<string, string>) => void;\n secrets: Record<string, string>;\n}\n\n/**\n * Hook to access the secrets context to be able to set secrets that are\n * passed to the Scaffolder backend.\n * @public\n */\nexport const useTemplateSecrets = (): ScaffolderUseTemplateSecrets => {\n const value = useContext(SecretsContext)?.atVersion(1);\n\n if (!value) {\n throw new Error(\n 'useTemplateSecrets must be used within a SecretsContextProvider',\n );\n }\n\n const { setSecrets: updateSecrets, secrets = {} } = value;\n\n const setSecrets = useCallback(\n (input: Record<string, string>) => {\n updateSecrets(currentSecrets => ({ ...currentSecrets, ...input }));\n },\n [updateSecrets],\n );\n\n return { setSecrets, secrets };\n};\n"],"names":[],"mappings":";;;AAqCA,MAAM,cAAA,GAAiB,uBAEpB,iBAAiB,CAAA;AAMP,MAAA,sBAAA,GAAyB,CACpC,KACG,KAAA;AACH,EAAA,MAAM,EAAE,cAAA,GAAiB,EAAC,EAAM,GAAA,KAAA;AAChC,EAAA,MAAM,CAAC,OAAA,EAAS,UAAU,CAAA,GAAI,QAAiC,CAAA;AAAA,IAC7D,GAAG;AAAA,GACJ,CAAA;AAED,EACE,uBAAA,KAAA,CAAA,aAAA;AAAA,IAAC,cAAe,CAAA,QAAA;AAAA,IAAf;AAAA,MACC,KAAA,EAAO,wBAAwB,EAAE,CAAA,EAAG,EAAE,OAAS,EAAA,UAAA,IAAc;AAAA,KAAA;AAAA,IAE5D,KAAM,CAAA;AAAA,GACT;AAEJ;AAgBO,MAAM,qBAAqB,MAAoC;AACpE,EAAA,MAAM,KAAQ,GAAA,UAAA,CAAW,cAAc,CAAA,EAAG,UAAU,CAAC,CAAA;AAErD,EAAA,IAAI,CAAC,KAAO,EAAA;AACV,IAAA,MAAM,IAAI,KAAA;AAAA,MACR;AAAA,KACF;AAAA;AAGF,EAAA,MAAM,EAAE,UAAY,EAAA,aAAA,EAAe,OAAU,GAAA,IAAO,GAAA,KAAA;AAEpD,EAAA,MAAM,UAAa,GAAA,WAAA;AAAA,IACjB,CAAC,KAAkC,KAAA;AACjC,MAAA,aAAA,CAAc,qBAAmB,EAAE,GAAG,cAAgB,EAAA,GAAG,OAAQ,CAAA,CAAA;AAAA,KACnE;AAAA,IACA,CAAC,aAAa;AAAA,GAChB;AAEA,EAAO,OAAA,EAAE,YAAY,OAAQ,EAAA;AAC/B;;;;"}
@@ -1 +1 @@
1
- {"version":3,"file":"utils.esm.js","sources":["../src/utils.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\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 zodToJsonSchema from 'zod-to-json-schema';\nimport { JSONSchema7 } from 'json-schema';\nimport { z } from 'zod';\nimport {\n CustomFieldExtensionSchema,\n FieldExtensionComponentProps,\n} from './extensions';\n\n/** @public */\nexport function makeFieldSchema<\n TReturnType extends z.ZodType,\n TUiOptions extends z.ZodType,\n>(options: {\n output: (zImpl: typeof z) => TReturnType;\n uiOptions?: (zImpl: typeof z) => TUiOptions;\n}): FieldSchema<z.output<TReturnType>, z.output<TUiOptions>> {\n const { output, uiOptions } = options;\n return {\n TProps: undefined as any,\n schema: {\n returnValue: zodToJsonSchema(output(z)) as JSONSchema7,\n uiOptions: uiOptions && (zodToJsonSchema(uiOptions(z)) as JSONSchema7),\n },\n\n // These will be removed - just here for backwards compat whilst we're moving across\n type: undefined as any,\n uiOptionsType: undefined as any,\n };\n}\n\n/**\n * @public\n * FieldSchema encapsulates a JSONSchema7 along with the\n * matching FieldExtensionComponentProps type for a field extension.\n */\nexport interface FieldSchema<TReturn, TUiOptions> {\n /** @deprecated use TProps instead */\n readonly type: FieldExtensionComponentProps<TReturn, TUiOptions>;\n /** @deprecated will be removed */\n readonly uiOptionsType: TUiOptions;\n\n readonly schema: CustomFieldExtensionSchema;\n readonly TProps: FieldExtensionComponentProps<TReturn, TUiOptions>;\n}\n"],"names":[],"mappings":";;;AAyBO,SAAS,gBAGd,OAG2D,EAAA;AAC3D,EAAM,MAAA,EAAE,MAAQ,EAAA,SAAA,EAAc,GAAA,OAAA,CAAA;AAC9B,EAAO,OAAA;AAAA,IACL,MAAQ,EAAA,KAAA,CAAA;AAAA,IACR,MAAQ,EAAA;AAAA,MACN,WAAa,EAAA,eAAA,CAAgB,MAAO,CAAA,CAAC,CAAC,CAAA;AAAA,MACtC,SAAW,EAAA,SAAA,IAAc,eAAgB,CAAA,SAAA,CAAU,CAAC,CAAC,CAAA;AAAA,KACvD;AAAA;AAAA,IAGA,IAAM,EAAA,KAAA,CAAA;AAAA,IACN,aAAe,EAAA,KAAA,CAAA;AAAA,GACjB,CAAA;AACF;;;;"}
1
+ {"version":3,"file":"utils.esm.js","sources":["../src/utils.ts"],"sourcesContent":["/*\n * Copyright 2024 The Backstage Authors\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 zodToJsonSchema from 'zod-to-json-schema';\nimport { JSONSchema7 } from 'json-schema';\nimport { z } from 'zod';\nimport {\n CustomFieldExtensionSchema,\n FieldExtensionComponentProps,\n} from './extensions';\n\n/** @public */\nexport function makeFieldSchema<\n TReturnType extends z.ZodType,\n TUiOptions extends z.ZodType,\n>(options: {\n output: (zImpl: typeof z) => TReturnType;\n uiOptions?: (zImpl: typeof z) => TUiOptions;\n}): FieldSchema<z.output<TReturnType>, z.output<TUiOptions>> {\n const { output, uiOptions } = options;\n return {\n TProps: undefined as any,\n schema: {\n returnValue: zodToJsonSchema(output(z)) as JSONSchema7,\n uiOptions: uiOptions && (zodToJsonSchema(uiOptions(z)) as JSONSchema7),\n },\n\n // These will be removed - just here for backwards compat whilst we're moving across\n type: undefined as any,\n uiOptionsType: undefined as any,\n };\n}\n\n/**\n * @public\n * FieldSchema encapsulates a JSONSchema7 along with the\n * matching FieldExtensionComponentProps type for a field extension.\n */\nexport interface FieldSchema<TReturn, TUiOptions> {\n /** @deprecated use TProps instead */\n readonly type: FieldExtensionComponentProps<TReturn, TUiOptions>;\n /** @deprecated will be removed */\n readonly uiOptionsType: TUiOptions;\n\n readonly schema: CustomFieldExtensionSchema;\n readonly TProps: FieldExtensionComponentProps<TReturn, TUiOptions>;\n}\n"],"names":[],"mappings":";;;AAyBO,SAAS,gBAGd,OAG2D,EAAA;AAC3D,EAAM,MAAA,EAAE,MAAQ,EAAA,SAAA,EAAc,GAAA,OAAA;AAC9B,EAAO,OAAA;AAAA,IACL,MAAQ,EAAA,KAAA,CAAA;AAAA,IACR,MAAQ,EAAA;AAAA,MACN,WAAa,EAAA,eAAA,CAAgB,MAAO,CAAA,CAAC,CAAC,CAAA;AAAA,MACtC,SAAW,EAAA,SAAA,IAAc,eAAgB,CAAA,SAAA,CAAU,CAAC,CAAC;AAAA,KACvD;AAAA;AAAA,IAGA,IAAM,EAAA,KAAA,CAAA;AAAA,IACN,aAAe,EAAA,KAAA;AAAA,GACjB;AACF;;;;"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@backstage/plugin-scaffolder-react",
3
- "version": "1.13.3-next.1",
3
+ "version": "1.13.3-next.2",
4
4
  "description": "A frontend library that helps other Backstage plugins interact with the Scaffolder",
5
5
  "backstage": {
6
6
  "role": "web-library",
@@ -57,12 +57,12 @@
57
57
  "test": "backstage-cli package test"
58
58
  },
59
59
  "dependencies": {
60
- "@backstage/catalog-client": "1.8.0-next.0",
60
+ "@backstage/catalog-client": "1.8.0-next.1",
61
61
  "@backstage/catalog-model": "1.7.0",
62
62
  "@backstage/core-components": "0.16.0-next.1",
63
63
  "@backstage/core-plugin-api": "1.10.0",
64
64
  "@backstage/frontend-plugin-api": "0.9.1-next.1",
65
- "@backstage/plugin-catalog-react": "1.14.1-next.1",
65
+ "@backstage/plugin-catalog-react": "1.14.1-next.2",
66
66
  "@backstage/plugin-permission-react": "0.4.27",
67
67
  "@backstage/plugin-scaffolder-common": "1.5.6",
68
68
  "@backstage/theme": "0.6.1-next.0",
@@ -93,9 +93,9 @@
93
93
  "zod-to-json-schema": "^3.20.4"
94
94
  },
95
95
  "devDependencies": {
96
- "@backstage/cli": "0.29.0-next.1",
96
+ "@backstage/cli": "0.29.0-next.2",
97
97
  "@backstage/core-app-api": "1.15.1",
98
- "@backstage/plugin-catalog": "1.24.1-next.1",
98
+ "@backstage/plugin-catalog": "1.24.1-next.2",
99
99
  "@backstage/plugin-catalog-common": "1.1.0",
100
100
  "@backstage/plugin-permission-common": "0.8.1",
101
101
  "@backstage/test-utils": "1.7.1-next.0",