@red-hat-developer-hub/backstage-plugin-scaffolder-backend-module-orchestrator 1.3.0 → 1.3.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/CHANGELOG.md CHANGED
@@ -1,5 +1,14 @@
1
1
  # @red-hat-developer-hub/backstage-plugin-scaffolder-backend-module-orchestrator
2
2
 
3
+ ## 1.3.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 8524940: Fix TypeScript compilation errors in orchestrator plugins
8
+ - Updated dependencies [8524940]
9
+ - Updated dependencies [d91ef65]
10
+ - @red-hat-developer-hub/backstage-plugin-orchestrator-common@3.3.1
11
+
3
12
  ## 1.3.0
4
13
 
5
14
  ### Minor Changes
@@ -1 +1 @@
1
- {"version":3,"file":"getWorkflowParams.cjs.js","sources":["../../src/actions/getWorkflowParams.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 { AuthService } from '@backstage/backend-plugin-api';\nimport { DiscoveryApi } from '@backstage/plugin-permission-common';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport { JsonObject } from '@backstage/types/index';\n\nimport { isAxiosError } from 'axios';\nimport { dump } from 'js-yaml';\n\nimport { getOrchestratorApi, getRequestConfigOption } from './utils';\n\nconst getError = (err: unknown): Error => {\n if (\n isAxiosError<{ error: { message: string; name: string } }>(err) &&\n err.response?.data?.error?.message\n ) {\n const error = new Error(err.response?.data?.error?.message);\n error.name = err.response?.data?.error?.name || 'Error';\n return error;\n }\n return err as Error;\n};\n\nconst indentString = (str: string, indent: number) =>\n indent ? str.replace(/^/gm, ' '.repeat(indent)) : str;\n\nexport function createGetWorkflowParamsAction(\n discoveryService: DiscoveryApi,\n authService: AuthService,\n) {\n return createTemplateAction({\n id: 'orchestrator:workflow:get_params',\n description: 'Collect parameters of a SonataFlow workflow.',\n supportsDryRun: false,\n schema: {\n input: {\n workflow_id: z => z.string().describe('Workflow Id'),\n indent: z => z.number().optional().describe('Number of indents'),\n },\n },\n async handler(ctx) {\n const workflowId = ctx.input?.workflow_id;\n if (!workflowId) {\n throw new Error('Missing workflow_id required input parameter.');\n }\n\n const api = await getOrchestratorApi(discoveryService);\n const reqConfigOption = await getRequestConfigOption(authService, ctx);\n\n try {\n const { data: workflow } = await api.getWorkflowOverviewById(\n workflowId,\n reqConfigOption,\n );\n if (!workflow) {\n throw new Error(`Can not find workflow ${workflowId}`);\n }\n\n const { data: inputSchemaWrapper } =\n await api.getWorkflowInputSchemaById(\n workflowId,\n undefined,\n reqConfigOption,\n );\n const inputSchema: JsonObject | undefined =\n inputSchemaWrapper.inputSchema;\n\n ctx.output('title', workflow.name || workflowId);\n ctx.output('description', workflow.description || '');\n\n if (inputSchema?.properties) {\n let parametersYaml = dump(\n [\n // scaffolder expects an array on the top-level\n inputSchema,\n ],\n { indent: 2 },\n );\n parametersYaml = indentString(parametersYaml, ctx.input?.indent || 0);\n parametersYaml = `\\n${parametersYaml}`;\n\n ctx.output('parameters', parametersYaml);\n } else {\n ctx.output('parameters', '{}');\n }\n } catch (err) {\n throw getError(err);\n }\n },\n });\n}\n"],"names":["isAxiosError","createTemplateAction","getOrchestratorApi","getRequestConfigOption","dump"],"mappings":";;;;;;;AAyBA,MAAM,QAAA,GAAW,CAAC,GAAA,KAAwB;AACxC,EAAA,IACEA,mBAA2D,GAAG,CAAA,IAC9D,IAAI,QAAA,EAAU,IAAA,EAAM,OAAO,OAAA,EAC3B;AACA,IAAA,MAAM,QAAQ,IAAI,KAAA,CAAM,IAAI,QAAA,EAAU,IAAA,EAAM,OAAO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,EAAU;AACb,UAAA,MAAM,IAAI,KAAA,CAAM,CAAA,sBAAA,EAAyB,UAAU,CAAA,CAAE,CAAA;AAAA,QACvD;AAEA,QAAA,MAAM,EAAE,IAAA,EAAM,kBAAA,EAAmB,GAC/B,MAAM,GAAA,CAAI,0BAAA;AAAA,UACR,UAAA;AAAA,UACA,KAAA,CAAA;AAAA,UACA;AAAA,SACF;AACF,QAAA,MAAM,cACJ,kBAAA,CAAmB,WAAA;AAErB,QAAA,GAAA,CAAI,MAAA,CAAO,OAAA,EAAS,QAAA,CAAS,IAAA,IAAQ,UAAU,CAAA;AAC/C,QAAA,GAAA,CAAI,MAAA,CAAO,aAAA,EAAe,QAAA,CAAS,WAAA,IAAe,EAAE,CAAA;AAEpD,QAAA,IAAI,aAAa,UAAA,EAAY;AAC3B,UAAA,IAAI,cAAA,GAAiBC,WAAA;AAAA,YACnB;AAAA;AAAA,cAEE;AAAA,aACF;AAAA,YACA,EAAE,QAAQ,CAAA;AAAE,WACd;AACA,UAAA,cAAA,GAAiB,YAAA,CAAa,cAAA,EAAgB,GAAA,CAAI,KAAA,EAAO,UAAU,CAAC,CAAA;AACpE,UAAA,cAAA,GAAiB;AAAA,EAAK,cAAc,CAAA,CAAA;AAEpC,UAAA,GAAA,CAAI,MAAA,CAAO,cAAc,cAAc,CAAA;AAAA,QACzC,CAAA,MAAO;AACL,UAAA,GAAA,CAAI,MAAA,CAAO,cAAc,IAAI,CAAA;AAAA,QAC/B;AAAA,MACF,SAAS,GAAA,EAAK;AACZ,QAAA,MAAM,SAAS,GAAG,CAAA;AAAA,MACpB;AAAA,IACF;AAAA,GACD,CAAA;AACH;;;;"}
1
+ {"version":3,"file":"getWorkflowParams.cjs.js","sources":["../../src/actions/getWorkflowParams.ts"],"sourcesContent":["/*\n * Copyright Red Hat, Inc.\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 { AuthService } from '@backstage/backend-plugin-api';\nimport { DiscoveryApi } from '@backstage/plugin-permission-common';\nimport { createTemplateAction } from '@backstage/plugin-scaffolder-node';\nimport { JsonObject } from '@backstage/types';\n\nimport { isAxiosError } from 'axios';\nimport { dump } from 'js-yaml';\n\nimport { getOrchestratorApi, getRequestConfigOption } from './utils';\n\nconst getError = (err: unknown): Error => {\n if (\n isAxiosError<{ error: { message: string; name: string } }>(err) &&\n err.response?.data?.error?.message\n ) {\n const error = new Error(err.response?.data?.error?.message);\n error.name = err.response?.data?.error?.name || 'Error';\n return error;\n }\n return err as Error;\n};\n\nconst indentString = (str: string, indent: number) =>\n indent ? str.replace(/^/gm, ' '.repeat(indent)) : str;\n\nexport function createGetWorkflowParamsAction(\n discoveryService: DiscoveryApi,\n authService: AuthService,\n) {\n return createTemplateAction({\n id: 'orchestrator:workflow:get_params',\n description: 'Collect parameters of a SonataFlow workflow.',\n supportsDryRun: false,\n schema: {\n input: {\n workflow_id: z => z.string().describe('Workflow Id'),\n indent: z => z.number().optional().describe('Number of indents'),\n },\n },\n async handler(ctx) {\n const workflowId = ctx.input?.workflow_id;\n if (!workflowId) {\n throw new Error('Missing workflow_id required input parameter.');\n }\n\n const api = await getOrchestratorApi(discoveryService);\n const reqConfigOption = await getRequestConfigOption(authService, ctx);\n\n try {\n const { data: workflow } = await api.getWorkflowOverviewById(\n workflowId,\n reqConfigOption,\n );\n if (!workflow) {\n throw new Error(`Can not find workflow ${workflowId}`);\n }\n\n const { data: inputSchemaWrapper } =\n await api.getWorkflowInputSchemaById(\n workflowId,\n undefined,\n reqConfigOption,\n );\n const inputSchema: JsonObject | undefined =\n inputSchemaWrapper.inputSchema;\n\n ctx.output('title', workflow.name || workflowId);\n ctx.output('description', workflow.description || '');\n\n if (inputSchema?.properties) {\n let parametersYaml = dump(\n [\n // scaffolder expects an array on the top-level\n inputSchema,\n ],\n { indent: 2 },\n );\n parametersYaml = indentString(parametersYaml, ctx.input?.indent || 0);\n parametersYaml = `\\n${parametersYaml}`;\n\n ctx.output('parameters', parametersYaml);\n } else {\n ctx.output('parameters', '{}');\n }\n } catch (err) {\n throw getError(err);\n }\n },\n });\n}\n"],"names":["isAxiosError","createTemplateAction","getOrchestratorApi","getRequestConfigOption","dump"],"mappings":";;;;;;;AAyBA,MAAM,QAAA,GAAW,CAAC,GAAA,KAAwB;AACxC,EAAA,IACEA,mBAA2D,GAAG,CAAA,IAC9D,IAAI,QAAA,EAAU,IAAA,EAAM,OAAO,OAAA,EAC3B;AACA,IAAA,MAAM,QAAQ,IAAI,KAAA,CAAM,IAAI,QAAA,EAAU,IAAA,EAAM,OAAO,OAAO,CAAA;AAC1D,IAAA,KAAA,CAAM,IAAA,GAAO,GAAA,CAAI,QAAA,EAAU,IAAA,EAAM,OAAO,IAAA,IAAQ,OAAA;AAChD,IAAA,OAAO,KAAA;AAAA,EACT;AACA,EAAA,OAAO,GAAA;AACT,CAAA;AAEA,MAAM,YAAA,GAAe,CAAC,GAAA,EAAa,MAAA,KACjC,MAAA,GAAS,GAAA,CAAI,OAAA,CAAQ,KAAA,EAAO,GAAA,CAAI,MAAA,CAAO,MAAM,CAAC,CAAA,GAAI,GAAA;AAE7C,SAAS,6BAAA,CACd,kBACA,WAAA,EACA;AACA,EAAA,OAAOC,yCAAA,CAAqB;AAAA,IAC1B,EAAA,EAAI,kCAAA;AAAA,IACJ,WAAA,EAAa,8CAAA;AAAA,IACb,cAAA,EAAgB,KAAA;AAAA,IAChB,MAAA,EAAQ;AAAA,MACN,KAAA,EAAO;AAAA,QACL,aAAa,CAAA,CAAA,KAAK,CAAA,CAAE,MAAA,EAAO,CAAE,SAAS,aAAa,CAAA;AAAA,QACnD,MAAA,EAAQ,OAAK,CAAA,CAAE,MAA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AAO,UAAU,CAAC,CAAA;AACpE,UAAA,cAAA,GAAiB;AAAA,EAAK,cAAc,CAAA,CAAA;AAEpC,UAAA,GAAA,CAAI,MAAA,CAAO,cAAc,cAAc,CAAA;AAAA,QACzC,CAAA,MAAO;AACL,UAAA,GAAA,CAAI,MAAA,CAAO,cAAc,IAAI,CAAA;AAAA,QAC/B;AAAA,MACF,SAAS,GAAA,EAAK;AACZ,QAAA,MAAM,SAAS,GAAG,CAAA;AAAA,MACpB;AAAA,IACF;AAAA,GACD,CAAA;AACH;;;;"}
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@red-hat-developer-hub/backstage-plugin-scaffolder-backend-module-orchestrator",
3
3
  "description": "The orchestrator module for @backstage/plugin-scaffolder-backend",
4
- "version": "1.3.0",
4
+ "version": "1.3.1",
5
5
  "main": "./dist/index.cjs.js",
6
6
  "types": "./dist/index.d.ts",
7
7
  "license": "Apache-2.0",
@@ -68,7 +68,7 @@
68
68
  "@backstage/plugin-permission-common": "^0.9.3",
69
69
  "@backstage/plugin-scaffolder-node": "^0.12.1",
70
70
  "@backstage/types": "^1.2.2",
71
- "@red-hat-developer-hub/backstage-plugin-orchestrator-common": "^3.3.0",
71
+ "@red-hat-developer-hub/backstage-plugin-orchestrator-common": "^3.3.1",
72
72
  "axios": "^1.11.0",
73
73
  "js-yaml": "^4.1.0"
74
74
  },
@@ -76,7 +76,8 @@
76
76
  "@backstage/cli": "^0.34.5",
77
77
  "@backstage/plugin-scaffolder-node-test-utils": "^0.3.5",
78
78
  "@janus-idp/cli": "3.6.1",
79
- "@spotify/prettier-config": "^15.0.0"
79
+ "@spotify/prettier-config": "^15.0.0",
80
+ "@types/js-yaml": "^4.0.0"
80
81
  },
81
82
  "files": [
82
83
  "app-config.yaml",