@5minds/node-red-contrib-processcube 1.5.5-feature-22f94f-m3eulbpf → 1.5.6-develop-51b402-m3iul3hf
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/endevent-finished-listener.js +23 -15
- package/externaltask-input.html +1 -16
- package/externaltask-input.js +2 -9
- package/nodered/flows.json +85 -143
- package/package.json +2 -2
- package/process-event-listener.js +182 -148
- package/process-terminate.html +2 -3
- package/processcube-engine-config.js +81 -108
- package/processdefinition-query.html +0 -121
- package/processdefinition-query.js +4 -0
- package/processinstance-delete.html +9 -9
- package/processinstance-query.html +1 -115
- package/usertask-event-listener.html +0 -121
- package/usertask-event-listener.js +20 -15
- package/usertask-input.html +0 -119
- package/wait-for-usertask.html +0 -119
- package/wait-for-usertask.js +31 -23
- package/doc_generator/README.md +0 -6
- package/doc_generator/_process_instances_query.md +0 -121
- package/doc_generator/generator.js +0 -41
- package/doc_generator/generator_with_swagger.js +0 -89
- package/doc_generator/outputs/.gitkeep +0 -0
- package/doc_generator/package-lock.json +0 -176
- package/doc_generator/package.json +0 -15
- package/doc_generator/query_template.mustache +0 -20
- package/doc_generator/swagger.json +0 -4110
package/wait-for-usertask.html
CHANGED
@@ -70,125 +70,6 @@ Waiting for Usertasks of the connected ProcessCube Engine.
|
|
70
70
|
- `msg.payload` or a constant json to filter the UserTasks for Waiting for
|
71
71
|
- `Only for new` will trigger only for new UserTasks if checked and also for old ones if not checked.
|
72
72
|
|
73
|
-
### Query fields
|
74
|
-
|
75
|
-
**Summary**:
|
76
|
-
|
77
|
-
**Description**: Filter result for 'Wait for UserTask'
|
78
|
-
|
79
|
-
#### Parameters:
|
80
|
-
- Name: `offset` Required: `false`
|
81
|
-
- Type: number
|
82
|
-
- Description: The index of the first ProcessInstance to include in the result set.
|
83
|
-
- Name: `limit` Required: `false`
|
84
|
-
- Type: number
|
85
|
-
- Description: The maximum number of ProcessInstances to return.
|
86
|
-
- Name: `correlationId` Required: `false`
|
87
|
-
- Type: Array<string> | string | SearchQuery
|
88
|
-
- string: myCorrelationId
|
89
|
-
- Array<string>: myCorrelationId1,myCorrelationId2
|
90
|
-
- object:
|
91
|
-
- Description: Filter by the CorrelationId of the ProcessInstances.
|
92
|
-
- Name: `processInstanceId` Required: ``
|
93
|
-
- Type: Array<string> | string | SearchQuery
|
94
|
-
- string: myProcessInstance_12345678
|
95
|
-
- Array<string>: myProcessInstance_12345678,myProcessInstance_87654321
|
96
|
-
- object:
|
97
|
-
- Description: Filter by the ID of the ProcessInstances.
|
98
|
-
- Name: `processDefinitionId` Required: ``
|
99
|
-
- Type: Array<string> | string | SearchQuery
|
100
|
-
- string: myProcess_12345678
|
101
|
-
- Array<string>: myProcess_12345678,myProcess_87654321
|
102
|
-
- object:
|
103
|
-
- Description: Filter by the ID of the ProcessDefinition that the ProcessInstances belong to.
|
104
|
-
- Name: `processModelId` Required: ``
|
105
|
-
- Type: Array<string> | string | SearchQuery
|
106
|
-
- string: myProcessModel_12345678
|
107
|
-
- Array<string>: myProcessModel_12345678,myProcessModel_87654321
|
108
|
-
- object:
|
109
|
-
- Description: Filter by the ID of the ProcessModel that the ProcessInstances belong to.
|
110
|
-
- Name: `processModelName` Required: ``
|
111
|
-
- Type: Array<string> | string | SearchQuery
|
112
|
-
- string: My Process Model
|
113
|
-
- Array<string>: My Process Model,My Other Process Model
|
114
|
-
- object:
|
115
|
-
- Description: Filter by the name of the ProcessModel that the ProcessInstances belong to.
|
116
|
-
- Name: `processModelHash` Required: ``
|
117
|
-
- Type: Array<string> | string | SearchQuery
|
118
|
-
- string: 12345678
|
119
|
-
- Array<string>: 12345678,87654321
|
120
|
-
- object:
|
121
|
-
- Description: Filter by the hash of the ProcessModel that the ProcessInstances belong to.
|
122
|
-
- Name: `ownerId` Required: ``
|
123
|
-
- Type: Array<string> | string | SearchQuery
|
124
|
-
- string: 12345678
|
125
|
-
- Array<string>: 12345678,87654321
|
126
|
-
- object:
|
127
|
-
- Description: Filter by the ID of the User that owns the ProcessInstances.
|
128
|
-
- Name: `state` Required: ``
|
129
|
-
- Type: Array<string> | string | SearchQuery
|
130
|
-
- string: running
|
131
|
-
- Array<string>: running,finished
|
132
|
-
- object:
|
133
|
-
- Description: Filter by the state of the ProcessInstances.
|
134
|
-
- Name: `parentProcessInstanceId` Required: ``
|
135
|
-
- Type: Array<string> | string | SearchQuery
|
136
|
-
- string: myParentProcessInstance_12345678
|
137
|
-
- Array<string>: myParentProcessInstance_12345678,myParentProcessInstance_87654321
|
138
|
-
- object:
|
139
|
-
- Description: Filter by the ID of the parent ProcessInstance.
|
140
|
-
- Name: `embeddedProcessModelId` Required: ``
|
141
|
-
- Type: Array<string> | string | SearchQuery
|
142
|
-
- string: myModel1
|
143
|
-
- Array<string>: myModel1,myModel2
|
144
|
-
- object:
|
145
|
-
- Description: Filter by the ID of the embedded process model.
|
146
|
-
- Name: `terminatedByUserId` Required: ``
|
147
|
-
- Type: Array<string> | string | SearchQuery
|
148
|
-
- string: 12345678
|
149
|
-
- Array<string>: 12345678,87654321
|
150
|
-
- object:
|
151
|
-
- Description: Filter by the ID of the User that terminated the ProcessInstances.
|
152
|
-
- Name: `createdBefore` Required: ``
|
153
|
-
- Type: string
|
154
|
-
- Description: The maximum created date of the ProcessInstances to include in the results.
|
155
|
-
- Name: `createdAt` Required: ``
|
156
|
-
- Type: Array<string> | string
|
157
|
-
- string: 2021-01-01T00:00:00.000Z
|
158
|
-
- array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
|
159
|
-
- Description: The minimum created date of the ProcessInstances to include in the results.
|
160
|
-
- Name: `createdAfter` Required: ``
|
161
|
-
- Type: string
|
162
|
-
- Description: The minimum created date of the ProcessInstances to include in the results.
|
163
|
-
- Name: `updatedBefore` Required: ``
|
164
|
-
- Type: string
|
165
|
-
- Description: The maximum updated date of the ProcessInstances to include in the results.
|
166
|
-
- Name: `updatedAt` Required: ``
|
167
|
-
- Type: Array<string> | string
|
168
|
-
- string: 2021-01-01T00:00:00.000Z
|
169
|
-
- array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
|
170
|
-
- Description: The exact updated date of the ProcessInstances to include in the results.
|
171
|
-
- Name: `updatedAfter` Required: ``
|
172
|
-
- Type: string
|
173
|
-
- Description: The minimum updated date of the ProcessInstances to include in the results.
|
174
|
-
- Name: `finishedBefore` Required: ``
|
175
|
-
- Type: string
|
176
|
-
- Description: The maximum finished date of the ProcessInstances to include in the results.
|
177
|
-
- Name: `finishedAt` Required: ``
|
178
|
-
- Type: Array<string> | string
|
179
|
-
- string: 2021-01-01T00:00:00.000Z
|
180
|
-
- array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
|
181
|
-
- Description: The exact finished date of the ProcessInstances to include in the results.
|
182
|
-
- Name: `finishedAfter` Required: ``
|
183
|
-
- Type: string
|
184
|
-
- Description: The minimum finished date of the ProcessInstances to include in the results.
|
185
|
-
- Name: `triggeredByFlowNodeInstance` Required: ``
|
186
|
-
- Type: Array<string> | string | SearchQuery
|
187
|
-
- string: myFlowNodeInstance_12345678
|
188
|
-
- array: myFlowNodeInstance_12345678,myFlowNodeInstance_87654321
|
189
|
-
- object:
|
190
|
-
- Description: Filter by the ID of the FlowNodeInstance that triggered the ProcessInstance.
|
191
|
-
|
192
73
|
### References
|
193
74
|
|
194
75
|
- [The ProcessCube© Developer Network](https://processcube.io) - All documentation for the ProcessCube© platform
|
package/wait-for-usertask.js
CHANGED
@@ -27,23 +27,27 @@ module.exports = function (RED) {
|
|
27
27
|
...query
|
28
28
|
};
|
29
29
|
|
30
|
-
|
31
|
-
|
32
|
-
|
33
|
-
|
34
|
-
|
35
|
-
|
36
|
-
|
37
|
-
|
38
|
-
|
39
|
-
|
40
|
-
|
41
|
-
|
30
|
+
try {
|
31
|
+
const matchingFlowNodes = await client.userTasks.query(newQuery, { identity: currentIdentity });
|
32
|
+
|
33
|
+
if (matchingFlowNodes.userTasks && matchingFlowNodes.userTasks.length == 1) {
|
34
|
+
// remove subscription
|
35
|
+
client.userTasks.removeSubscription(subscription, currentIdentity);
|
36
|
+
|
37
|
+
const userTask = matchingFlowNodes.userTasks[0];
|
38
|
+
|
39
|
+
msg.payload = { userTask: userTask };
|
40
|
+
node.send(msg);
|
41
|
+
} else {
|
42
|
+
// nothing todo - wait for next notification
|
43
|
+
}
|
44
|
+
} catch (error) {
|
45
|
+
node.error(error);
|
42
46
|
}
|
43
47
|
|
44
48
|
}, { identity: currentIdentity });
|
45
49
|
|
46
|
-
node.log({"Handling old userTasks config.only_for_new": config.only_for_new});
|
50
|
+
node.log({ "Handling old userTasks config.only_for_new": config.only_for_new });
|
47
51
|
|
48
52
|
if (config.only_for_new === false) {
|
49
53
|
// only check suspended user tasks
|
@@ -52,18 +56,22 @@ module.exports = function (RED) {
|
|
52
56
|
...query
|
53
57
|
};
|
54
58
|
|
55
|
-
|
59
|
+
try {
|
60
|
+
const matchingFlowNodes = await client.userTasks.query(suspendedQuery, { identity: currentIdentity });
|
56
61
|
|
57
|
-
|
58
|
-
|
62
|
+
if (matchingFlowNodes.userTasks && matchingFlowNodes.userTasks.length >= 1) {
|
63
|
+
const userTask = matchingFlowNodes.userTasks[0];
|
59
64
|
|
60
|
-
|
61
|
-
|
65
|
+
msg.payload = { userTask: userTask };
|
66
|
+
node.send(msg);
|
62
67
|
|
63
|
-
|
64
|
-
|
65
|
-
|
66
|
-
|
68
|
+
// remove subscription
|
69
|
+
client.userTasks.removeSubscription(subscription, currentIdentity);
|
70
|
+
} else {
|
71
|
+
// let the *currentIdentity* be active
|
72
|
+
}
|
73
|
+
} catch (error) {
|
74
|
+
node.error(error);
|
67
75
|
}
|
68
76
|
}
|
69
77
|
};
|
@@ -84,7 +92,7 @@ module.exports = function (RED) {
|
|
84
92
|
|
85
93
|
node.on("close", async () => {
|
86
94
|
if (client != null && subscription != null) {
|
87
|
-
client.userTasks.removeSubscription(subscription, currentIdentity);
|
95
|
+
client.userTasks.removeSubscription(subscription, currentIdentity);
|
88
96
|
}
|
89
97
|
});
|
90
98
|
}
|
package/doc_generator/README.md
DELETED
@@ -1,121 +0,0 @@
|
|
1
|
-
### Query fields
|
2
|
-
|
3
|
-
**Summary**:
|
4
|
-
|
5
|
-
**Description**: Gets all ProcessInstances that match the given query.
|
6
|
-
|
7
|
-
#### Parameters:
|
8
|
-
- Name: `offset` Required: `false`
|
9
|
-
- Type: number
|
10
|
-
- Description: The index of the first ProcessInstance to include in the result set.
|
11
|
-
- Name: `limit` Required: `false`
|
12
|
-
- Type: number
|
13
|
-
- Description: The maximum number of ProcessInstances to return.
|
14
|
-
- Name: `correlationId` Required: `false`
|
15
|
-
- Type: Array<string> | string | SearchQuery
|
16
|
-
- string: myCorrelationId
|
17
|
-
- Array<string>: myCorrelationId1,myCorrelationId2
|
18
|
-
- object:
|
19
|
-
- Description: Filter by the CorrelationId of the ProcessInstances.
|
20
|
-
- Name: `processInstanceId` Required: ``
|
21
|
-
- Type: Array<string> | string | SearchQuery
|
22
|
-
- string: myProcessInstance_12345678
|
23
|
-
- Array<string>: myProcessInstance_12345678,myProcessInstance_87654321
|
24
|
-
- object:
|
25
|
-
- Description: Filter by the ID of the ProcessInstances.
|
26
|
-
- Name: `processDefinitionId` Required: ``
|
27
|
-
- Type: Array<string> | string | SearchQuery
|
28
|
-
- string: myProcess_12345678
|
29
|
-
- Array<string>: myProcess_12345678,myProcess_87654321
|
30
|
-
- object:
|
31
|
-
- Description: Filter by the ID of the ProcessDefinition that the ProcessInstances belong to.
|
32
|
-
- Name: `processModelId` Required: ``
|
33
|
-
- Type: Array<string> | string | SearchQuery
|
34
|
-
- string: myProcessModel_12345678
|
35
|
-
- Array<string>: myProcessModel_12345678,myProcessModel_87654321
|
36
|
-
- object:
|
37
|
-
- Description: Filter by the ID of the ProcessModel that the ProcessInstances belong to.
|
38
|
-
- Name: `processModelName` Required: ``
|
39
|
-
- Type: Array<string> | string | SearchQuery
|
40
|
-
- string: My Process Model
|
41
|
-
- Array<string>: My Process Model,My Other Process Model
|
42
|
-
- object:
|
43
|
-
- Description: Filter by the name of the ProcessModel that the ProcessInstances belong to.
|
44
|
-
- Name: `processModelHash` Required: ``
|
45
|
-
- Type: Array<string> | string | SearchQuery
|
46
|
-
- string: 12345678
|
47
|
-
- Array<string>: 12345678,87654321
|
48
|
-
- object:
|
49
|
-
- Description: Filter by the hash of the ProcessModel that the ProcessInstances belong to.
|
50
|
-
- Name: `ownerId` Required: ``
|
51
|
-
- Type: Array<string> | string | SearchQuery
|
52
|
-
- string: 12345678
|
53
|
-
- Array<string>: 12345678,87654321
|
54
|
-
- object:
|
55
|
-
- Description: Filter by the ID of the User that owns the ProcessInstances.
|
56
|
-
- Name: `state` Required: ``
|
57
|
-
- Type: Array<string> | string | SearchQuery
|
58
|
-
- string: running
|
59
|
-
- Array<string>: running,finished
|
60
|
-
- object:
|
61
|
-
- Description: Filter by the state of the ProcessInstances.
|
62
|
-
- Name: `parentProcessInstanceId` Required: ``
|
63
|
-
- Type: Array<string> | string | SearchQuery
|
64
|
-
- string: myParentProcessInstance_12345678
|
65
|
-
- Array<string>: myParentProcessInstance_12345678,myParentProcessInstance_87654321
|
66
|
-
- object:
|
67
|
-
- Description: Filter by the ID of the parent ProcessInstance.
|
68
|
-
- Name: `embeddedProcessModelId` Required: ``
|
69
|
-
- Type: Array<string> | string | SearchQuery
|
70
|
-
- string: myModel1
|
71
|
-
- Array<string>: myModel1,myModel2
|
72
|
-
- object:
|
73
|
-
- Description: Filter by the ID of the embedded process model.
|
74
|
-
- Name: `terminatedByUserId` Required: ``
|
75
|
-
- Type: Array<string> | string | SearchQuery
|
76
|
-
- string: 12345678
|
77
|
-
- Array<string>: 12345678,87654321
|
78
|
-
- object:
|
79
|
-
- Description: Filter by the ID of the User that terminated the ProcessInstances.
|
80
|
-
- Name: `createdBefore` Required: ``
|
81
|
-
- Type: string
|
82
|
-
- Description: The maximum created date of the ProcessInstances to include in the results.
|
83
|
-
- Name: `createdAt` Required: ``
|
84
|
-
- Type: Array<string> | string
|
85
|
-
- string: 2021-01-01T00:00:00.000Z
|
86
|
-
- array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
|
87
|
-
- Description: The minimum created date of the ProcessInstances to include in the results.
|
88
|
-
- Name: `createdAfter` Required: ``
|
89
|
-
- Type: string
|
90
|
-
- Description: The minimum created date of the ProcessInstances to include in the results.
|
91
|
-
- Name: `updatedBefore` Required: ``
|
92
|
-
- Type: string
|
93
|
-
- Description: The maximum updated date of the ProcessInstances to include in the results.
|
94
|
-
- Name: `updatedAt` Required: ``
|
95
|
-
- Type: Array<string> | string
|
96
|
-
- string: 2021-01-01T00:00:00.000Z
|
97
|
-
- array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
|
98
|
-
- Description: The exact updated date of the ProcessInstances to include in the results.
|
99
|
-
- Name: `updatedAfter` Required: ``
|
100
|
-
- Type: string
|
101
|
-
- Description: The minimum updated date of the ProcessInstances to include in the results.
|
102
|
-
- Name: `finishedBefore` Required: ``
|
103
|
-
- Type: string
|
104
|
-
- Description: The maximum finished date of the ProcessInstances to include in the results.
|
105
|
-
- Name: `finishedAt` Required: ``
|
106
|
-
- Type: Array<string> | string
|
107
|
-
- string: 2021-01-01T00:00:00.000Z
|
108
|
-
- array: 2021-01-01T00:00:00.000Z,2021-01-02T00:00:00.000Z
|
109
|
-
- Description: The exact finished date of the ProcessInstances to include in the results.
|
110
|
-
- Name: `finishedAfter` Required: ``
|
111
|
-
- Type: string
|
112
|
-
- Description: The minimum finished date of the ProcessInstances to include in the results.
|
113
|
-
- Name: `triggeredByFlowNodeInstance` Required: ``
|
114
|
-
- Type: Array<string> | string | SearchQuery
|
115
|
-
- string: myFlowNodeInstance_12345678
|
116
|
-
- array: myFlowNodeInstance_12345678,myFlowNodeInstance_87654321
|
117
|
-
- object:
|
118
|
-
- Description: Filter by the ID of the FlowNodeInstance that triggered the ProcessInstance.
|
119
|
-
|
120
|
-
#### Responses:
|
121
|
-
- **200**:
|
@@ -1,41 +0,0 @@
|
|
1
|
-
const Mustache = require('mustache');
|
2
|
-
const fs = require('fs');
|
3
|
-
|
4
|
-
const swaggerFilename = '../../ProcessCube.Engine/docs/swagger/swagger.json'; // Dateiname der Swagger-Datei
|
5
|
-
|
6
|
-
const swaggerJson = JSON.parse(fs.readFileSync(swaggerFilename, 'utf-8'));
|
7
|
-
|
8
|
-
//console.log(Object.keys(swaggerJson.paths));
|
9
|
-
//return
|
10
|
-
|
11
|
-
const apiPath = '/process_instances/query'; // Die API-Route, die du dokumentieren möchtest
|
12
|
-
const routeData = swaggerJson.paths[apiPath];
|
13
|
-
|
14
|
-
if (routeData) {
|
15
|
-
console.log(`Details for ${apiPath}:`, routeData);
|
16
|
-
} else {
|
17
|
-
console.error(`Route ${apiPath} not found in Swagger documentation.`);
|
18
|
-
}
|
19
|
-
|
20
|
-
// API-Route-Information vorbereiten
|
21
|
-
const apiRouteData = {
|
22
|
-
path: apiPath,
|
23
|
-
method: Object.keys(routeData)[0], // z.B. GET, POST, etc.
|
24
|
-
summary: routeData[Object.keys(routeData)[0]].summary,
|
25
|
-
description: routeData[Object.keys(routeData)[0]].description,
|
26
|
-
parameters: routeData[Object.keys(routeData)[0]].parameters || [],
|
27
|
-
responses: Object.entries(routeData[Object.keys(routeData)[0]].responses).map(([status, response]) => ({
|
28
|
-
status,
|
29
|
-
description: response.description
|
30
|
-
}))
|
31
|
-
};
|
32
|
-
|
33
|
-
// Mustache-Template einlesen
|
34
|
-
const template = fs.readFileSync('query_template.mustache', 'utf-8');
|
35
|
-
|
36
|
-
// Mustache-Rendering
|
37
|
-
const output = Mustache.render(template, apiRouteData);
|
38
|
-
|
39
|
-
// Ausgabe in eine Datei schreiben oder anzeigen
|
40
|
-
console.log(output);
|
41
|
-
fs.writeFileSync('output.md', output);
|
@@ -1,89 +0,0 @@
|
|
1
|
-
const Mustache = require('mustache');
|
2
|
-
const fs = require('fs');
|
3
|
-
|
4
|
-
const SwaggerParser = require('swagger-parser');
|
5
|
-
|
6
|
-
//const swaggerFilename = '../../ProcessCube.Engine/docs/swagger/swagger.json'; // Dateiname der Swagger-Datei
|
7
|
-
//const swaggerFilename = 'swagger.json'; // Dateiname der Swagger-Datei
|
8
|
-
|
9
|
-
|
10
|
-
SwaggerParser.dereference("http://localhost:56100/atlas_engine/api/v1/swagger")
|
11
|
-
//SwaggerParser.dereference(swaggerFilename)
|
12
|
-
.then(swaggerJson => {
|
13
|
-
console.log('Dereferenced API:', swaggerJson);
|
14
|
-
|
15
|
-
const apiPaths = [{
|
16
|
-
"ProcessInstance Query": {
|
17
|
-
"path": "/process_instances/query",
|
18
|
-
"method": "get"
|
19
|
-
},
|
20
|
-
"UserTasks Input": {
|
21
|
-
"path": "/process_instances/query",
|
22
|
-
"method": "get"
|
23
|
-
},
|
24
|
-
"Wait for UserTask": {
|
25
|
-
"path": "/process_instances/query",
|
26
|
-
"method": "get"
|
27
|
-
},
|
28
|
-
"UserTask Event Listener": {
|
29
|
-
"path": "/process_instances/query",
|
30
|
-
"method": "get"
|
31
|
-
}
|
32
|
-
}];
|
33
|
-
|
34
|
-
apiPaths.forEach(apiEntry => {
|
35
|
-
console.log('API Entry:', apiEntry);
|
36
|
-
console.log('API Entry Keys:', Object.keys(apiEntry));
|
37
|
-
|
38
|
-
Object.keys(apiEntry).forEach(apiName => {
|
39
|
-
console.log('API Name:', apiName);
|
40
|
-
console.log('API Data:', apiEntry[apiName]);
|
41
|
-
|
42
|
-
let apiPath = apiEntry[apiName].path; // Die API-Route, die du dokumentieren möchtest
|
43
|
-
|
44
|
-
//let apiPath = '/process_instances/query'; // Die API-Route, die du dokumentieren möchtest
|
45
|
-
const routeData = swaggerJson.paths[apiPath];
|
46
|
-
|
47
|
-
if (routeData) {
|
48
|
-
console.log(`Details for ${apiPath}:`, routeData);
|
49
|
-
} else {
|
50
|
-
console.error(`Route ${apiPath} not found in Swagger documentation.`);
|
51
|
-
}
|
52
|
-
|
53
|
-
let description = routeData[Object.keys(routeData)[0]].description;
|
54
|
-
|
55
|
-
description = `Filter result for '${apiName}'`;
|
56
|
-
|
57
|
-
// API-Route-Information vorbereiten
|
58
|
-
const apiRouteData = {
|
59
|
-
path: apiPath,
|
60
|
-
method: Object.keys(routeData)[0], // z.B. GET, POST, etc.
|
61
|
-
summary: routeData[Object.keys(routeData)[0]].summary,
|
62
|
-
description: description,
|
63
|
-
parameters: routeData[Object.keys(routeData)[0]].parameters || [],
|
64
|
-
responses: Object.entries(routeData[Object.keys(routeData)[0]].responses).map(([status, response]) => ({
|
65
|
-
status,
|
66
|
-
description: response.description
|
67
|
-
}))
|
68
|
-
};
|
69
|
-
|
70
|
-
// Mustache-Template einlesen
|
71
|
-
const template = fs.readFileSync('query_template.mustache', 'utf-8');
|
72
|
-
|
73
|
-
// Mustache-Rendering
|
74
|
-
const output = Mustache.render(template, apiRouteData);
|
75
|
-
|
76
|
-
// Ausgabe in eine Datei schreiben oder anzeigen
|
77
|
-
//console.log(output);
|
78
|
-
|
79
|
-
const outputFilename = apiName.replace(/\/ /g, '_') + '.md';
|
80
|
-
console.log(`Writing output to ${outputFilename}`);
|
81
|
-
|
82
|
-
fs.writeFileSync(`outputs/${outputFilename}`, output);
|
83
|
-
});
|
84
|
-
});
|
85
|
-
|
86
|
-
})
|
87
|
-
.catch(err => {
|
88
|
-
console.error('Dereferencing failed:', err);
|
89
|
-
});
|
File without changes
|
@@ -1,176 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "doc_generator",
|
3
|
-
"version": "1.0.0",
|
4
|
-
"lockfileVersion": 3,
|
5
|
-
"requires": true,
|
6
|
-
"packages": {
|
7
|
-
"": {
|
8
|
-
"name": "doc_generator",
|
9
|
-
"version": "1.0.0",
|
10
|
-
"license": "MIT",
|
11
|
-
"dependencies": {
|
12
|
-
"mustache": "^4.2.0",
|
13
|
-
"swagger-parser": "^10.0.3"
|
14
|
-
}
|
15
|
-
},
|
16
|
-
"node_modules/@apidevtools/json-schema-ref-parser": {
|
17
|
-
"version": "9.1.2",
|
18
|
-
"resolved": "https://registry.npmjs.org/@apidevtools/json-schema-ref-parser/-/json-schema-ref-parser-9.1.2.tgz",
|
19
|
-
"integrity": "sha512-r1w81DpR+KyRWd3f+rk6TNqMgedmAxZP5v5KWlXQWlgMUUtyEJch0DKEci1SorPMiSeM8XPl7MZ3miJ60JIpQg==",
|
20
|
-
"license": "MIT",
|
21
|
-
"dependencies": {
|
22
|
-
"@jsdevtools/ono": "^7.1.3",
|
23
|
-
"@types/json-schema": "^7.0.6",
|
24
|
-
"call-me-maybe": "^1.0.1",
|
25
|
-
"js-yaml": "^4.1.0"
|
26
|
-
}
|
27
|
-
},
|
28
|
-
"node_modules/@apidevtools/openapi-schemas": {
|
29
|
-
"version": "2.1.0",
|
30
|
-
"resolved": "https://registry.npmjs.org/@apidevtools/openapi-schemas/-/openapi-schemas-2.1.0.tgz",
|
31
|
-
"integrity": "sha512-Zc1AlqrJlX3SlpupFGpiLi2EbteyP7fXmUOGup6/DnkRgjP9bgMM/ag+n91rsv0U1Gpz0H3VILA/o3bW7Ua6BQ==",
|
32
|
-
"license": "MIT",
|
33
|
-
"engines": {
|
34
|
-
"node": ">=10"
|
35
|
-
}
|
36
|
-
},
|
37
|
-
"node_modules/@apidevtools/swagger-methods": {
|
38
|
-
"version": "3.0.2",
|
39
|
-
"resolved": "https://registry.npmjs.org/@apidevtools/swagger-methods/-/swagger-methods-3.0.2.tgz",
|
40
|
-
"integrity": "sha512-QAkD5kK2b1WfjDS/UQn/qQkbwF31uqRjPTrsCs5ZG9BQGAkjwvqGFjjPqAuzac/IYzpPtRzjCP1WrTuAIjMrXg==",
|
41
|
-
"license": "MIT"
|
42
|
-
},
|
43
|
-
"node_modules/@apidevtools/swagger-parser": {
|
44
|
-
"version": "10.0.3",
|
45
|
-
"resolved": "https://registry.npmjs.org/@apidevtools/swagger-parser/-/swagger-parser-10.0.3.tgz",
|
46
|
-
"integrity": "sha512-sNiLY51vZOmSPFZA5TF35KZ2HbgYklQnTSDnkghamzLb3EkNtcQnrBQEj5AOCxHpTtXpqMCRM1CrmV2rG6nw4g==",
|
47
|
-
"license": "MIT",
|
48
|
-
"dependencies": {
|
49
|
-
"@apidevtools/json-schema-ref-parser": "^9.0.6",
|
50
|
-
"@apidevtools/openapi-schemas": "^2.0.4",
|
51
|
-
"@apidevtools/swagger-methods": "^3.0.2",
|
52
|
-
"@jsdevtools/ono": "^7.1.3",
|
53
|
-
"call-me-maybe": "^1.0.1",
|
54
|
-
"z-schema": "^5.0.1"
|
55
|
-
},
|
56
|
-
"peerDependencies": {
|
57
|
-
"openapi-types": ">=7"
|
58
|
-
}
|
59
|
-
},
|
60
|
-
"node_modules/@jsdevtools/ono": {
|
61
|
-
"version": "7.1.3",
|
62
|
-
"resolved": "https://registry.npmjs.org/@jsdevtools/ono/-/ono-7.1.3.tgz",
|
63
|
-
"integrity": "sha512-4JQNk+3mVzK3xh2rqd6RB4J46qUR19azEHBneZyTZM+c456qOrbbM/5xcR8huNCCcbVt7+UmizG6GuUvPvKUYg==",
|
64
|
-
"license": "MIT"
|
65
|
-
},
|
66
|
-
"node_modules/@types/json-schema": {
|
67
|
-
"version": "7.0.15",
|
68
|
-
"resolved": "https://registry.npmjs.org/@types/json-schema/-/json-schema-7.0.15.tgz",
|
69
|
-
"integrity": "sha512-5+fP8P8MFNC+AyZCDxrB2pkZFPGzqQWUzpSeuuVLvm8VMcorNYavBqoFcxK8bQz4Qsbn4oUEEem4wDLfcysGHA==",
|
70
|
-
"license": "MIT"
|
71
|
-
},
|
72
|
-
"node_modules/argparse": {
|
73
|
-
"version": "2.0.1",
|
74
|
-
"resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz",
|
75
|
-
"integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==",
|
76
|
-
"license": "Python-2.0"
|
77
|
-
},
|
78
|
-
"node_modules/call-me-maybe": {
|
79
|
-
"version": "1.0.2",
|
80
|
-
"resolved": "https://registry.npmjs.org/call-me-maybe/-/call-me-maybe-1.0.2.tgz",
|
81
|
-
"integrity": "sha512-HpX65o1Hnr9HH25ojC1YGs7HCQLq0GCOibSaWER0eNpgJ/Z1MZv2mTc7+xh6WOPxbRVcmgbv4hGU+uSQ/2xFZQ==",
|
82
|
-
"license": "MIT"
|
83
|
-
},
|
84
|
-
"node_modules/commander": {
|
85
|
-
"version": "9.5.0",
|
86
|
-
"resolved": "https://registry.npmjs.org/commander/-/commander-9.5.0.tgz",
|
87
|
-
"integrity": "sha512-KRs7WVDKg86PWiuAqhDrAQnTXZKraVcCc6vFdL14qrZ/DcWwuRo7VoiYXalXO7S5GKpqYiVEwCbgFDfxNHKJBQ==",
|
88
|
-
"license": "MIT",
|
89
|
-
"optional": true,
|
90
|
-
"engines": {
|
91
|
-
"node": "^12.20.0 || >=14"
|
92
|
-
}
|
93
|
-
},
|
94
|
-
"node_modules/js-yaml": {
|
95
|
-
"version": "4.1.0",
|
96
|
-
"resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz",
|
97
|
-
"integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==",
|
98
|
-
"license": "MIT",
|
99
|
-
"dependencies": {
|
100
|
-
"argparse": "^2.0.1"
|
101
|
-
},
|
102
|
-
"bin": {
|
103
|
-
"js-yaml": "bin/js-yaml.js"
|
104
|
-
}
|
105
|
-
},
|
106
|
-
"node_modules/lodash.get": {
|
107
|
-
"version": "4.4.2",
|
108
|
-
"resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz",
|
109
|
-
"integrity": "sha512-z+Uw/vLuy6gQe8cfaFWD7p0wVv8fJl3mbzXh33RS+0oW2wvUqiRXiQ69gLWSLpgB5/6sU+r6BlQR0MBILadqTQ==",
|
110
|
-
"license": "MIT"
|
111
|
-
},
|
112
|
-
"node_modules/lodash.isequal": {
|
113
|
-
"version": "4.5.0",
|
114
|
-
"resolved": "https://registry.npmjs.org/lodash.isequal/-/lodash.isequal-4.5.0.tgz",
|
115
|
-
"integrity": "sha512-pDo3lu8Jhfjqls6GkMgpahsF9kCyayhgykjyLMNFTKWrpVdAQtYyB4muAMWozBB4ig/dtWAmsMxLEI8wuz+DYQ==",
|
116
|
-
"license": "MIT"
|
117
|
-
},
|
118
|
-
"node_modules/mustache": {
|
119
|
-
"version": "4.2.0",
|
120
|
-
"resolved": "https://registry.npmjs.org/mustache/-/mustache-4.2.0.tgz",
|
121
|
-
"integrity": "sha512-71ippSywq5Yb7/tVYyGbkBggbU8H3u5Rz56fH60jGFgr8uHwxs+aSKeqmluIVzM0m0kB7xQjKS6qPfd0b2ZoqQ==",
|
122
|
-
"license": "MIT",
|
123
|
-
"bin": {
|
124
|
-
"mustache": "bin/mustache"
|
125
|
-
}
|
126
|
-
},
|
127
|
-
"node_modules/openapi-types": {
|
128
|
-
"version": "12.1.3",
|
129
|
-
"resolved": "https://registry.npmjs.org/openapi-types/-/openapi-types-12.1.3.tgz",
|
130
|
-
"integrity": "sha512-N4YtSYJqghVu4iek2ZUvcN/0aqH1kRDuNqzcycDxhOUpg7GdvLa2F3DgS6yBNhInhv2r/6I0Flkn7CqL8+nIcw==",
|
131
|
-
"license": "MIT",
|
132
|
-
"peer": true
|
133
|
-
},
|
134
|
-
"node_modules/swagger-parser": {
|
135
|
-
"version": "10.0.3",
|
136
|
-
"resolved": "https://registry.npmjs.org/swagger-parser/-/swagger-parser-10.0.3.tgz",
|
137
|
-
"integrity": "sha512-nF7oMeL4KypldrQhac8RyHerJeGPD1p2xDh900GPvc+Nk7nWP6jX2FcC7WmkinMoAmoO774+AFXcWsW8gMWEIg==",
|
138
|
-
"license": "MIT",
|
139
|
-
"dependencies": {
|
140
|
-
"@apidevtools/swagger-parser": "10.0.3"
|
141
|
-
},
|
142
|
-
"engines": {
|
143
|
-
"node": ">=10"
|
144
|
-
}
|
145
|
-
},
|
146
|
-
"node_modules/validator": {
|
147
|
-
"version": "13.12.0",
|
148
|
-
"resolved": "https://registry.npmjs.org/validator/-/validator-13.12.0.tgz",
|
149
|
-
"integrity": "sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg==",
|
150
|
-
"license": "MIT",
|
151
|
-
"engines": {
|
152
|
-
"node": ">= 0.10"
|
153
|
-
}
|
154
|
-
},
|
155
|
-
"node_modules/z-schema": {
|
156
|
-
"version": "5.0.5",
|
157
|
-
"resolved": "https://registry.npmjs.org/z-schema/-/z-schema-5.0.5.tgz",
|
158
|
-
"integrity": "sha512-D7eujBWkLa3p2sIpJA0d1pr7es+a7m0vFAnZLlCEKq/Ij2k0MLi9Br2UPxoxdYystm5K1yeBGzub0FlYUEWj2Q==",
|
159
|
-
"license": "MIT",
|
160
|
-
"dependencies": {
|
161
|
-
"lodash.get": "^4.4.2",
|
162
|
-
"lodash.isequal": "^4.5.0",
|
163
|
-
"validator": "^13.7.0"
|
164
|
-
},
|
165
|
-
"bin": {
|
166
|
-
"z-schema": "bin/z-schema"
|
167
|
-
},
|
168
|
-
"engines": {
|
169
|
-
"node": ">=8.0.0"
|
170
|
-
},
|
171
|
-
"optionalDependencies": {
|
172
|
-
"commander": "^9.4.1"
|
173
|
-
}
|
174
|
-
}
|
175
|
-
}
|
176
|
-
}
|
@@ -1,15 +0,0 @@
|
|
1
|
-
{
|
2
|
-
"name": "doc_generator",
|
3
|
-
"version": "1.0.0",
|
4
|
-
"main": "generator.js",
|
5
|
-
"scripts": {
|
6
|
-
"test": "echo \"Error: no test specified\" && exit 1"
|
7
|
-
},
|
8
|
-
"author": "",
|
9
|
-
"license": "MIT",
|
10
|
-
"description": "",
|
11
|
-
"dependencies": {
|
12
|
-
"mustache": "^4.2.0",
|
13
|
-
"swagger-parser": "^10.0.3"
|
14
|
-
}
|
15
|
-
}
|