@red-hat-developer-hub/backstage-plugin-orchestrator-backend 8.4.0 → 8.5.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/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,25 @@
|
|
|
1
1
|
### Dependencies
|
|
2
2
|
|
|
3
|
+
## 8.5.0
|
|
4
|
+
|
|
5
|
+
### Minor Changes
|
|
6
|
+
|
|
7
|
+
- 29dfed0: Backstage version bump to v1.45.2
|
|
8
|
+
- 43376f1: Removing the deprecated moment package and replacing with luxon
|
|
9
|
+
|
|
10
|
+
### Patch Changes
|
|
11
|
+
|
|
12
|
+
- 40b80fe: Change "lifecycle" to active in catalog-info.yaml
|
|
13
|
+
- 40b80fe: Remove "support", "lifecycle" keywords and "supported-versions" in package.json. Change "lifecycle" to active in catalog.yaml
|
|
14
|
+
- Updated dependencies [a1671ab]
|
|
15
|
+
- Updated dependencies [40b80fe]
|
|
16
|
+
- Updated dependencies [782c33f]
|
|
17
|
+
- Updated dependencies [f5f4973]
|
|
18
|
+
- Updated dependencies [40b80fe]
|
|
19
|
+
- Updated dependencies [34a36cb]
|
|
20
|
+
- Updated dependencies [29dfed0]
|
|
21
|
+
- @red-hat-developer-hub/backstage-plugin-orchestrator-common@3.3.0
|
|
22
|
+
|
|
3
23
|
## 8.4.0
|
|
4
24
|
|
|
5
25
|
### Minor Changes
|
|
@@ -1,12 +1,8 @@
|
|
|
1
1
|
'use strict';
|
|
2
2
|
|
|
3
|
-
var
|
|
3
|
+
var luxon = require('luxon');
|
|
4
4
|
var backstagePluginOrchestratorCommon = require('@red-hat-developer-hub/backstage-plugin-orchestrator-common');
|
|
5
5
|
|
|
6
|
-
function _interopDefaultCompat (e) { return e && typeof e === 'object' && 'default' in e ? e : { default: e }; }
|
|
7
|
-
|
|
8
|
-
var moment__default = /*#__PURE__*/_interopDefaultCompat(moment);
|
|
9
|
-
|
|
10
6
|
function mapToWorkflowOverviewDTO(overview) {
|
|
11
7
|
return {
|
|
12
8
|
name: overview.name,
|
|
@@ -43,9 +39,13 @@ function getProcessInstancesStatusDTOFromString(state) {
|
|
|
43
39
|
return state;
|
|
44
40
|
}
|
|
45
41
|
function mapToProcessInstanceDTO(processInstance) {
|
|
46
|
-
const start =
|
|
47
|
-
|
|
48
|
-
|
|
42
|
+
const start = luxon.DateTime.fromISO(processInstance.start, {
|
|
43
|
+
setZone: true
|
|
44
|
+
});
|
|
45
|
+
const end = luxon.DateTime.fromISO(processInstance.end, {
|
|
46
|
+
setZone: true
|
|
47
|
+
});
|
|
48
|
+
const duration = processInstance.end ? luxon.Duration.fromMillis(end.diff(start).toMillis()).rescale().toHuman() : void 0;
|
|
49
49
|
let variables;
|
|
50
50
|
if (typeof processInstance?.variables === "string") {
|
|
51
51
|
variables = JSON.parse(processInstance?.variables);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"V2Mappings.cjs.js","sources":["../../../../src/service/api/mapping/V2Mappings.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 */\n\nimport
|
|
1
|
+
{"version":3,"file":"V2Mappings.cjs.js","sources":["../../../../src/service/api/mapping/V2Mappings.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 */\n\nimport { DateTime, Duration } from 'luxon';\n\nimport {\n capitalize,\n ExecuteWorkflowResponseDTO,\n extractWorkflowFormat,\n fromWorkflowSource,\n NodeInstance,\n NodeInstanceDTO,\n ProcessInstance,\n ProcessInstanceDTO,\n ProcessInstanceState,\n ProcessInstanceStatusDTO,\n WorkflowDTO,\n WorkflowExecutionResponse,\n WorkflowFormatDTO,\n WorkflowOverview,\n WorkflowOverviewDTO,\n WorkflowRunStatusDTO,\n type ProcessInstanceStatusDTO as ProcessInstanceStatusDTOType,\n} from '@red-hat-developer-hub/backstage-plugin-orchestrator-common';\n\n// Mapping functions\nexport function mapToWorkflowOverviewDTO(\n overview: WorkflowOverview,\n): WorkflowOverviewDTO {\n return {\n name: overview.name,\n format: overview.format,\n workflowId: overview.workflowId,\n description: overview.description,\n lastRunId: overview.lastRunId,\n lastRunStatus: overview.lastRunStatus\n ? getProcessInstancesStatusDTOFromString(overview.lastRunStatus)\n : undefined,\n lastTriggeredMs: overview.lastTriggeredMs,\n isAvailable: overview.isAvailable,\n };\n}\n\nexport function getWorkflowFormatDTO(source: string): WorkflowFormatDTO {\n return extractWorkflowFormat(source);\n}\n\nexport function mapToWorkflowDTO(source: string): WorkflowDTO {\n const definition = fromWorkflowSource(source);\n return {\n annotations: definition.annotations,\n description: definition.description,\n name: definition.name,\n format: getWorkflowFormatDTO(source),\n id: definition.id,\n };\n}\n\nexport function getProcessInstancesStatusDTOFromString(\n state: string,\n): ProcessInstanceStatusDTOType {\n if (\n !Object.values(ProcessInstanceStatusDTO).includes(\n state as ProcessInstanceStatusDTOType,\n )\n ) {\n throw new Error(\n `state ${state} is not one of the values of type ProcessInstanceStatusDTO`,\n );\n }\n return state as ProcessInstanceStatusDTOType;\n}\n\nexport function mapToProcessInstanceDTO(\n processInstance: ProcessInstance,\n): ProcessInstanceDTO {\n const start = DateTime.fromISO(processInstance.start as string, {\n setZone: true,\n });\n const end = DateTime.fromISO(processInstance.end as string, {\n setZone: true,\n });\n const duration = processInstance.end\n ? Duration.fromMillis(end.diff(start).toMillis()).rescale().toHuman()\n : undefined;\n\n let variables: Record<string, unknown> | undefined;\n if (typeof processInstance?.variables === 'string') {\n variables = JSON.parse(processInstance?.variables);\n } else {\n variables = processInstance?.variables;\n }\n\n return {\n id: processInstance.id,\n processId: processInstance.processId,\n processName: processInstance.processName,\n description: processInstance.description,\n serviceUrl: processInstance.serviceUrl,\n executionSummary: processInstance.executionSummary,\n endpoint: processInstance.endpoint,\n error: processInstance.error,\n start: processInstance.start,\n end: processInstance.end,\n duration: duration,\n // @ts-ignore\n workflowdata: variables?.workflowdata,\n initiatorEntity: variables?.initiatorEntity as string,\n targetEntity: variables?.targetEntity as string,\n state: processInstance.state\n ? getProcessInstancesStatusDTOFromString(processInstance.state)\n : undefined,\n nodes: processInstance.nodes.map(mapToNodeInstanceDTO),\n };\n}\n\nexport function mapToNodeInstanceDTO(\n nodeInstance: NodeInstance,\n): NodeInstanceDTO {\n return { ...nodeInstance, __typename: 'NodeInstance' };\n}\n\nexport function mapToExecuteWorkflowResponseDTO(\n workflowId: string,\n workflowExecutionResponse: WorkflowExecutionResponse,\n): ExecuteWorkflowResponseDTO {\n if (!workflowExecutionResponse?.id) {\n throw new Error(\n `Error while mapping ExecuteWorkflowResponse to ExecuteWorkflowResponseDTO for workflow with id ${workflowId}`,\n );\n }\n\n return {\n id: workflowExecutionResponse.id,\n };\n}\n\nexport function mapToWorkflowRunStatusDTO(\n status: ProcessInstanceState,\n): WorkflowRunStatusDTO {\n return {\n key: capitalize(status),\n value: status,\n };\n}\n"],"names":["extractWorkflowFormat","fromWorkflowSource","ProcessInstanceStatusDTO","DateTime","Duration","capitalize"],"mappings":";;;;;AAuCO,SAAS,yBACd,QAAA,EACqB;AACrB,EAAA,OAAO;AAAA,IACL,MAAM,QAAA,CAAS,IAAA;AAAA,IACf,QAAQ,QAAA,CAAS,MAAA;AAAA,IAC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AC4B;AAC5B,EAAA,IAAI,CAAC,2BAA2B,EAAA,EAAI;AAClC,IAAA,MAAM,IAAI,KAAA;AAAA,MACR,kGAAkG,UAAU,CAAA;AAAA,KAC9G;AAAA,EACF;AAEA,EAAA,OAAO;AAAA,IACL,IAAI,yBAAA,CAA0B;AAAA,GAChC;AACF;AAEO,SAAS,0BACd,MAAA,EACsB;AACtB,EAAA,OAAO;AAAA,IACL,GAAA,EAAKC,6CAAW,MAAM,CAAA;AAAA,IACtB,KAAA,EAAO;AAAA,GACT;AACF;;;;;;;;;;;"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@red-hat-developer-hub/backstage-plugin-orchestrator-backend",
|
|
3
|
-
"version": "8.
|
|
3
|
+
"version": "8.5.0",
|
|
4
4
|
"license": "Apache-2.0",
|
|
5
5
|
"main": "./dist/index.cjs.js",
|
|
6
6
|
"types": "./dist/index.d.ts",
|
|
@@ -9,7 +9,6 @@
|
|
|
9
9
|
},
|
|
10
10
|
"backstage": {
|
|
11
11
|
"role": "backend-plugin",
|
|
12
|
-
"supported-versions": "1.39.1",
|
|
13
12
|
"pluginId": "orchestrator",
|
|
14
13
|
"pluginPackages": [
|
|
15
14
|
"@red-hat-developer-hub/backstage-plugin-orchestrator",
|
|
@@ -44,8 +43,6 @@
|
|
|
44
43
|
},
|
|
45
44
|
"bugs": "https://github.com/redhat-developer/rhdh-plugins/issues",
|
|
46
45
|
"keywords": [
|
|
47
|
-
"support:tech-preview",
|
|
48
|
-
"lifecycle:active",
|
|
49
46
|
"backstage",
|
|
50
47
|
"plugin",
|
|
51
48
|
"orchestrator",
|
|
@@ -73,18 +70,18 @@
|
|
|
73
70
|
"export-dynamic": "janus-cli package export-dynamic-plugin"
|
|
74
71
|
},
|
|
75
72
|
"dependencies": {
|
|
76
|
-
"@backstage/backend-defaults": "^0.13.
|
|
77
|
-
"@backstage/backend-plugin-api": "^1.
|
|
78
|
-
"@backstage/catalog-client": "^1.12.
|
|
79
|
-
"@backstage/core-plugin-api": "^1.
|
|
73
|
+
"@backstage/backend-defaults": "^0.13.1",
|
|
74
|
+
"@backstage/backend-plugin-api": "^1.5.0",
|
|
75
|
+
"@backstage/catalog-client": "^1.12.1",
|
|
76
|
+
"@backstage/core-plugin-api": "^1.12.0",
|
|
80
77
|
"@backstage/errors": "^1.2.7",
|
|
81
|
-
"@backstage/integration": "^1.18.
|
|
82
|
-
"@backstage/plugin-catalog-node": "^1.
|
|
83
|
-
"@backstage/plugin-permission-common": "^0.9.
|
|
84
|
-
"@backstage/plugin-permission-node": "^0.10.
|
|
85
|
-
"@backstage/plugin-scaffolder-backend": "^3.0.
|
|
86
|
-
"@backstage/plugin-scaffolder-node": "^0.12.
|
|
87
|
-
"@red-hat-developer-hub/backstage-plugin-orchestrator-common": "^3.
|
|
78
|
+
"@backstage/integration": "^1.18.2",
|
|
79
|
+
"@backstage/plugin-catalog-node": "^1.20.0",
|
|
80
|
+
"@backstage/plugin-permission-common": "^0.9.3",
|
|
81
|
+
"@backstage/plugin-permission-node": "^0.10.6",
|
|
82
|
+
"@backstage/plugin-scaffolder-backend": "^3.0.1",
|
|
83
|
+
"@backstage/plugin-scaffolder-node": "^0.12.1",
|
|
84
|
+
"@red-hat-developer-hub/backstage-plugin-orchestrator-common": "^3.3.0",
|
|
88
85
|
"@urql/core": "^4.1.4",
|
|
89
86
|
"ajv-formats": "^2.1.1",
|
|
90
87
|
"cloudevents": "^8.0.0",
|
|
@@ -93,19 +90,20 @@
|
|
|
93
90
|
"fs-extra": "^10.1.0",
|
|
94
91
|
"isomorphic-git": "^1.23.0",
|
|
95
92
|
"lodash": "^4.17.21",
|
|
96
|
-
"
|
|
93
|
+
"luxon": "^3.7.2",
|
|
97
94
|
"openapi-backend": "^5.10.5",
|
|
98
95
|
"yn": "^5.0.0"
|
|
99
96
|
},
|
|
100
97
|
"devDependencies": {
|
|
101
98
|
"@backstage-community/plugin-rbac-common": "^1.12.1",
|
|
102
|
-
"@backstage/backend-test-utils": "^1.
|
|
103
|
-
"@backstage/cli": "^0.34.
|
|
99
|
+
"@backstage/backend-test-utils": "^1.10.0",
|
|
100
|
+
"@backstage/cli": "^0.34.5",
|
|
104
101
|
"@janus-idp/backstage-plugin-audit-log-node": "^1.7.1",
|
|
105
102
|
"@janus-idp/cli": "3.6.1",
|
|
106
103
|
"@types/express": "4.17.23",
|
|
107
104
|
"@types/fs-extra": "11.0.4",
|
|
108
105
|
"@types/json-schema": "7.0.15",
|
|
106
|
+
"@types/luxon": "^3.7.1",
|
|
109
107
|
"prettier": "3.6.2"
|
|
110
108
|
},
|
|
111
109
|
"peerDependencies": {
|