@emilgroup/action-sdk 1.1.1-beta.1 → 1.1.1-beta.11

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 (40) hide show
  1. package/.openapi-generator/FILES +6 -0
  2. package/README.md +2 -2
  3. package/api/actions-api.ts +184 -219
  4. package/api/executions-api.ts +471 -0
  5. package/api.ts +2 -0
  6. package/dist/api/actions-api.d.ts +140 -166
  7. package/dist/api/actions-api.js +126 -141
  8. package/dist/api/executions-api.d.ts +272 -0
  9. package/dist/api/executions-api.js +452 -0
  10. package/dist/api.d.ts +1 -0
  11. package/dist/api.js +1 -0
  12. package/dist/models/action-class.d.ts +38 -2
  13. package/dist/models/action-execution-class.d.ts +30 -0
  14. package/dist/models/create-action-request-dto.d.ts +31 -1
  15. package/dist/models/create-action-request-dto.js +6 -0
  16. package/dist/models/export-actions-as-yaml-response-class.d.ts +24 -0
  17. package/dist/models/export-actions-as-yaml-response-class.js +15 -0
  18. package/dist/models/import-actions-from-yaml-request-dto.d.ts +36 -0
  19. package/dist/models/import-actions-from-yaml-request-dto.js +15 -0
  20. package/dist/models/import-actions-from-yaml-response-class.d.ts +37 -0
  21. package/dist/models/import-actions-from-yaml-response-class.js +15 -0
  22. package/dist/models/index.d.ts +5 -0
  23. package/dist/models/index.js +5 -0
  24. package/dist/models/trigger-action-request-dto.d.ts +62 -0
  25. package/dist/models/trigger-action-request-dto.js +15 -0
  26. package/dist/models/trigger-action-response-class.d.ts +25 -0
  27. package/dist/models/trigger-action-response-class.js +15 -0
  28. package/dist/models/update-action-request-dto.d.ts +30 -0
  29. package/dist/models/update-action-request-dto.js +6 -0
  30. package/models/action-class.ts +38 -2
  31. package/models/action-execution-class.ts +30 -0
  32. package/models/create-action-request-dto.ts +34 -1
  33. package/models/export-actions-as-yaml-response-class.ts +30 -0
  34. package/models/import-actions-from-yaml-request-dto.ts +42 -0
  35. package/models/import-actions-from-yaml-response-class.ts +43 -0
  36. package/models/index.ts +5 -0
  37. package/models/trigger-action-request-dto.ts +66 -0
  38. package/models/trigger-action-response-class.ts +31 -0
  39. package/models/update-action-request-dto.ts +33 -0
  40. package/package.json +1 -1
@@ -0,0 +1,452 @@
1
+ "use strict";
2
+ /* tslint:disable */
3
+ /* eslint-disable */
4
+ /**
5
+ * EMIL ActionService
6
+ * The EMIL ActionService API description
7
+ *
8
+ * The version of the OpenAPI document: 1.0
9
+ * Contact: kontakt@emil.de
10
+ *
11
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
12
+ * https://openapi-generator.tech
13
+ * Do not edit the class manually.
14
+ */
15
+ var __extends = (this && this.__extends) || (function () {
16
+ var extendStatics = function (d, b) {
17
+ extendStatics = Object.setPrototypeOf ||
18
+ ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
19
+ function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
20
+ return extendStatics(d, b);
21
+ };
22
+ return function (d, b) {
23
+ if (typeof b !== "function" && b !== null)
24
+ throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
25
+ extendStatics(d, b);
26
+ function __() { this.constructor = d; }
27
+ d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
28
+ };
29
+ })();
30
+ var __assign = (this && this.__assign) || function () {
31
+ __assign = Object.assign || function(t) {
32
+ for (var s, i = 1, n = arguments.length; i < n; i++) {
33
+ s = arguments[i];
34
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
35
+ t[p] = s[p];
36
+ }
37
+ return t;
38
+ };
39
+ return __assign.apply(this, arguments);
40
+ };
41
+ var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
42
+ function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
43
+ return new (P || (P = Promise))(function (resolve, reject) {
44
+ function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
45
+ function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
46
+ function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
47
+ step((generator = generator.apply(thisArg, _arguments || [])).next());
48
+ });
49
+ };
50
+ var __generator = (this && this.__generator) || function (thisArg, body) {
51
+ var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
52
+ return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
53
+ function verb(n) { return function (v) { return step([n, v]); }; }
54
+ function step(op) {
55
+ if (f) throw new TypeError("Generator is already executing.");
56
+ while (g && (g = 0, op[0] && (_ = 0)), _) try {
57
+ if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
58
+ if (y = 0, t) op = [op[0] & 2, t.value];
59
+ switch (op[0]) {
60
+ case 0: case 1: t = op; break;
61
+ case 4: _.label++; return { value: op[1], done: false };
62
+ case 5: _.label++; y = op[1]; op = [0]; continue;
63
+ case 7: op = _.ops.pop(); _.trys.pop(); continue;
64
+ default:
65
+ if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
66
+ if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
67
+ if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
68
+ if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
69
+ if (t[2]) _.ops.pop();
70
+ _.trys.pop(); continue;
71
+ }
72
+ op = body.call(thisArg, _);
73
+ } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
74
+ if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
75
+ }
76
+ };
77
+ var __importDefault = (this && this.__importDefault) || function (mod) {
78
+ return (mod && mod.__esModule) ? mod : { "default": mod };
79
+ };
80
+ Object.defineProperty(exports, "__esModule", { value: true });
81
+ exports.ExecutionsApi = exports.ExecutionsApiFactory = exports.ExecutionsApiFp = exports.ExecutionsApiAxiosParamCreator = void 0;
82
+ var axios_1 = __importDefault(require("axios"));
83
+ // Some imports not used depending on template conditions
84
+ // @ts-ignore
85
+ var common_1 = require("../common");
86
+ // @ts-ignore
87
+ var base_1 = require("../base");
88
+ /**
89
+ * ExecutionsApi - axios parameter creator
90
+ * @export
91
+ */
92
+ var ExecutionsApiAxiosParamCreator = function (configuration) {
93
+ var _this = this;
94
+ return {
95
+ /**
96
+ * Retrieves the latest action execution status by executionCode or correlationId **Required Permissions** \"action-management.actions.view\"
97
+ * @summary Retrieve the actionExecution
98
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
99
+ * @param {string} [executionCode] Action execution code
100
+ * @param {string} [correlationId] Correlation ID (e.g. webhook execution code that triggered this action execution)
101
+ * @param {*} [options] Override http request option.
102
+ * @throws {RequiredError}
103
+ */
104
+ getActionExecutionStatus: function (authorization, executionCode, correlationId, options) {
105
+ if (options === void 0) { options = {}; }
106
+ return __awaiter(_this, void 0, void 0, function () {
107
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
108
+ return __generator(this, function (_a) {
109
+ switch (_a.label) {
110
+ case 0:
111
+ localVarPath = "/actionservice/v1/actions/executions/status";
112
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
113
+ if (configuration) {
114
+ baseOptions = configuration.baseOptions;
115
+ baseAccessToken = configuration.accessToken;
116
+ }
117
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
118
+ localVarHeaderParameter = {};
119
+ localVarQueryParameter = {};
120
+ // authentication bearer required
121
+ // http bearer authentication required
122
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
123
+ case 1:
124
+ // authentication bearer required
125
+ // http bearer authentication required
126
+ _a.sent();
127
+ if (executionCode !== undefined) {
128
+ localVarQueryParameter['executionCode'] = executionCode;
129
+ }
130
+ if (correlationId !== undefined) {
131
+ localVarQueryParameter['correlationId'] = correlationId;
132
+ }
133
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
134
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
135
+ }
136
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
137
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
138
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
139
+ return [2 /*return*/, {
140
+ url: (0, common_1.toPathString)(localVarUrlObj),
141
+ options: localVarRequestOptions,
142
+ }];
143
+ }
144
+ });
145
+ });
146
+ },
147
+ /**
148
+ * Lists action executions (latest status per execution only) with optional filters **Required Permissions** \"action-management.actions.view\"
149
+ * @summary List actionExecutions
150
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
151
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
152
+ * @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
153
+ * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, executionCode, actionCode, actionSlug, actionVersion, entityCode, entityType, triggeredBySub, status, triggeredBy, triggerSource, correlationId, workflowInstanceCode, force, completedAt, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
154
+ * @param {string} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
155
+ * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, executionCode, actionCode, actionSlug, actionVersion, entityCode, entityType, triggeredBySub, status, triggeredBy, triggerSource, correlationId, workflowInstanceCode, force, completedAt, createdAt, updatedAt&lt;/i&gt;
156
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt;
157
+ * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, executionCode, actionCode, actionSlug, actionVersion, entityCode, entityType, triggeredBySub, status, triggeredBy, triggerSource, correlationId, workflowInstanceCode, force, completedAt, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
158
+ * @param {*} [options] Override http request option.
159
+ * @throws {RequiredError}
160
+ */
161
+ listActionExecutions: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
162
+ if (options === void 0) { options = {}; }
163
+ return __awaiter(_this, void 0, void 0, function () {
164
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
165
+ return __generator(this, function (_a) {
166
+ switch (_a.label) {
167
+ case 0:
168
+ localVarPath = "/actionservice/v1/actions/executions";
169
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
170
+ if (configuration) {
171
+ baseOptions = configuration.baseOptions;
172
+ baseAccessToken = configuration.accessToken;
173
+ }
174
+ localVarRequestOptions = __assign(__assign({ method: 'GET' }, baseOptions), options);
175
+ localVarHeaderParameter = {};
176
+ localVarQueryParameter = {};
177
+ // authentication bearer required
178
+ // http bearer authentication required
179
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
180
+ case 1:
181
+ // authentication bearer required
182
+ // http bearer authentication required
183
+ _a.sent();
184
+ if (pageSize !== undefined) {
185
+ localVarQueryParameter['pageSize'] = pageSize;
186
+ }
187
+ if (pageToken !== undefined) {
188
+ localVarQueryParameter['pageToken'] = pageToken;
189
+ }
190
+ if (filter !== undefined) {
191
+ localVarQueryParameter['filter'] = filter;
192
+ }
193
+ if (search !== undefined) {
194
+ localVarQueryParameter['search'] = search;
195
+ }
196
+ if (order !== undefined) {
197
+ localVarQueryParameter['order'] = order;
198
+ }
199
+ if (expand !== undefined) {
200
+ localVarQueryParameter['expand'] = expand;
201
+ }
202
+ if (filters !== undefined) {
203
+ localVarQueryParameter['filters'] = filters;
204
+ }
205
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
206
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
207
+ }
208
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
209
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
210
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
211
+ return [2 /*return*/, {
212
+ url: (0, common_1.toPathString)(localVarUrlObj),
213
+ options: localVarRequestOptions,
214
+ }];
215
+ }
216
+ });
217
+ });
218
+ },
219
+ /**
220
+ * Triggers an action execution. When the action has an input_validation_schema, the input payload is validated against it; invalid payloads return HTTP 400 with a body containing message and errors (JSON Schema validation errors). **Required Permissions** \"action-management.actions.run\"
221
+ * @summary Create the actionExecution
222
+ * @param {TriggerActionRequestDto} triggerActionRequestDto
223
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
224
+ * @param {*} [options] Override http request option.
225
+ * @throws {RequiredError}
226
+ */
227
+ triggerAction: function (triggerActionRequestDto, authorization, options) {
228
+ if (options === void 0) { options = {}; }
229
+ return __awaiter(_this, void 0, void 0, function () {
230
+ var localVarPath, localVarUrlObj, baseOptions, baseAccessToken, localVarRequestOptions, localVarHeaderParameter, localVarQueryParameter, headersFromBaseOptions;
231
+ return __generator(this, function (_a) {
232
+ switch (_a.label) {
233
+ case 0:
234
+ // verify required parameter 'triggerActionRequestDto' is not null or undefined
235
+ (0, common_1.assertParamExists)('triggerAction', 'triggerActionRequestDto', triggerActionRequestDto);
236
+ localVarPath = "/actionservice/v1/actions/trigger";
237
+ localVarUrlObj = new URL(localVarPath, common_1.DUMMY_BASE_URL);
238
+ if (configuration) {
239
+ baseOptions = configuration.baseOptions;
240
+ baseAccessToken = configuration.accessToken;
241
+ }
242
+ localVarRequestOptions = __assign(__assign({ method: 'POST' }, baseOptions), options);
243
+ localVarHeaderParameter = {};
244
+ localVarQueryParameter = {};
245
+ // authentication bearer required
246
+ // http bearer authentication required
247
+ return [4 /*yield*/, (0, common_1.setBearerAuthToObject)(localVarHeaderParameter, configuration)];
248
+ case 1:
249
+ // authentication bearer required
250
+ // http bearer authentication required
251
+ _a.sent();
252
+ if (authorization !== undefined && authorization !== null || baseAccessToken !== undefined && baseAccessToken !== null) {
253
+ localVarHeaderParameter['Authorization'] = String(authorization ? authorization : baseAccessToken);
254
+ }
255
+ localVarHeaderParameter['Content-Type'] = 'application/json';
256
+ (0, common_1.setSearchParams)(localVarUrlObj, localVarQueryParameter);
257
+ headersFromBaseOptions = baseOptions && baseOptions.headers ? baseOptions.headers : {};
258
+ localVarRequestOptions.headers = __assign(__assign(__assign({}, localVarHeaderParameter), headersFromBaseOptions), options.headers);
259
+ localVarRequestOptions.data = (0, common_1.serializeDataIfNeeded)(triggerActionRequestDto, localVarRequestOptions, configuration);
260
+ return [2 /*return*/, {
261
+ url: (0, common_1.toPathString)(localVarUrlObj),
262
+ options: localVarRequestOptions,
263
+ }];
264
+ }
265
+ });
266
+ });
267
+ },
268
+ };
269
+ };
270
+ exports.ExecutionsApiAxiosParamCreator = ExecutionsApiAxiosParamCreator;
271
+ /**
272
+ * ExecutionsApi - functional programming interface
273
+ * @export
274
+ */
275
+ var ExecutionsApiFp = function (configuration) {
276
+ var localVarAxiosParamCreator = (0, exports.ExecutionsApiAxiosParamCreator)(configuration);
277
+ return {
278
+ /**
279
+ * Retrieves the latest action execution status by executionCode or correlationId **Required Permissions** \"action-management.actions.view\"
280
+ * @summary Retrieve the actionExecution
281
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
282
+ * @param {string} [executionCode] Action execution code
283
+ * @param {string} [correlationId] Correlation ID (e.g. webhook execution code that triggered this action execution)
284
+ * @param {*} [options] Override http request option.
285
+ * @throws {RequiredError}
286
+ */
287
+ getActionExecutionStatus: function (authorization, executionCode, correlationId, options) {
288
+ return __awaiter(this, void 0, void 0, function () {
289
+ var localVarAxiosArgs;
290
+ return __generator(this, function (_a) {
291
+ switch (_a.label) {
292
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.getActionExecutionStatus(authorization, executionCode, correlationId, options)];
293
+ case 1:
294
+ localVarAxiosArgs = _a.sent();
295
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
296
+ }
297
+ });
298
+ });
299
+ },
300
+ /**
301
+ * Lists action executions (latest status per execution only) with optional filters **Required Permissions** \"action-management.actions.view\"
302
+ * @summary List actionExecutions
303
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
304
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
305
+ * @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
306
+ * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, executionCode, actionCode, actionSlug, actionVersion, entityCode, entityType, triggeredBySub, status, triggeredBy, triggerSource, correlationId, workflowInstanceCode, force, completedAt, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
307
+ * @param {string} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
308
+ * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, executionCode, actionCode, actionSlug, actionVersion, entityCode, entityType, triggeredBySub, status, triggeredBy, triggerSource, correlationId, workflowInstanceCode, force, completedAt, createdAt, updatedAt&lt;/i&gt;
309
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt;
310
+ * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, executionCode, actionCode, actionSlug, actionVersion, entityCode, entityType, triggeredBySub, status, triggeredBy, triggerSource, correlationId, workflowInstanceCode, force, completedAt, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
311
+ * @param {*} [options] Override http request option.
312
+ * @throws {RequiredError}
313
+ */
314
+ listActionExecutions: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
315
+ return __awaiter(this, void 0, void 0, function () {
316
+ var localVarAxiosArgs;
317
+ return __generator(this, function (_a) {
318
+ switch (_a.label) {
319
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.listActionExecutions(authorization, pageSize, pageToken, filter, search, order, expand, filters, options)];
320
+ case 1:
321
+ localVarAxiosArgs = _a.sent();
322
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
323
+ }
324
+ });
325
+ });
326
+ },
327
+ /**
328
+ * Triggers an action execution. When the action has an input_validation_schema, the input payload is validated against it; invalid payloads return HTTP 400 with a body containing message and errors (JSON Schema validation errors). **Required Permissions** \"action-management.actions.run\"
329
+ * @summary Create the actionExecution
330
+ * @param {TriggerActionRequestDto} triggerActionRequestDto
331
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
332
+ * @param {*} [options] Override http request option.
333
+ * @throws {RequiredError}
334
+ */
335
+ triggerAction: function (triggerActionRequestDto, authorization, options) {
336
+ return __awaiter(this, void 0, void 0, function () {
337
+ var localVarAxiosArgs;
338
+ return __generator(this, function (_a) {
339
+ switch (_a.label) {
340
+ case 0: return [4 /*yield*/, localVarAxiosParamCreator.triggerAction(triggerActionRequestDto, authorization, options)];
341
+ case 1:
342
+ localVarAxiosArgs = _a.sent();
343
+ return [2 /*return*/, (0, common_1.createRequestFunction)(localVarAxiosArgs, axios_1.default, base_1.BASE_PATH, configuration)];
344
+ }
345
+ });
346
+ });
347
+ },
348
+ };
349
+ };
350
+ exports.ExecutionsApiFp = ExecutionsApiFp;
351
+ /**
352
+ * ExecutionsApi - factory interface
353
+ * @export
354
+ */
355
+ var ExecutionsApiFactory = function (configuration, basePath, axios) {
356
+ var localVarFp = (0, exports.ExecutionsApiFp)(configuration);
357
+ return {
358
+ /**
359
+ * Retrieves the latest action execution status by executionCode or correlationId **Required Permissions** \"action-management.actions.view\"
360
+ * @summary Retrieve the actionExecution
361
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
362
+ * @param {string} [executionCode] Action execution code
363
+ * @param {string} [correlationId] Correlation ID (e.g. webhook execution code that triggered this action execution)
364
+ * @param {*} [options] Override http request option.
365
+ * @throws {RequiredError}
366
+ */
367
+ getActionExecutionStatus: function (authorization, executionCode, correlationId, options) {
368
+ return localVarFp.getActionExecutionStatus(authorization, executionCode, correlationId, options).then(function (request) { return request(axios, basePath); });
369
+ },
370
+ /**
371
+ * Lists action executions (latest status per execution only) with optional filters **Required Permissions** \"action-management.actions.view\"
372
+ * @summary List actionExecutions
373
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
374
+ * @param {number} [pageSize] A limit on the number of objects to be returned. Limit ranges between 1 and 50. Default: 10.
375
+ * @param {string} [pageToken] A cursor for use in pagination. pageToken is an ID that defines your place in the list. For instance, if you make a list request and receive 100 objects and pageToken&#x3D;1, your subsequent call can include pageToken&#x3D;2 in order to fetch the next page of the list.
376
+ * @param {string} [filter] Filter the response by one or multiple fields. In general, fetching filtered responses will conserve bandwidth and reduce response time.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, executionCode, actionCode, actionSlug, actionVersion, entityCode, entityType, triggeredBySub, status, triggeredBy, triggerSource, correlationId, workflowInstanceCode, force, completedAt, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
377
+ * @param {string} [search] To search the list by any field, pass search&#x3D;xxx to fetch the result.
378
+ * @param {string} [order] Order allows you to specify the desired order of entities retrieved from the server by ascending (ASC) or descending (DESC) order.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, executionCode, actionCode, actionSlug, actionVersion, entityCode, entityType, triggeredBySub, status, triggeredBy, triggerSource, correlationId, workflowInstanceCode, force, completedAt, createdAt, updatedAt&lt;/i&gt;
379
+ * @param {string} [expand] Expand to fetch additional information about the list items. Expanding resources can reduce the number of API calls required to accomplish a task. Use with discretion as some expanded fields can drastically increase payload size.&lt;br/&gt; &lt;br/&gt;
380
+ * @param {string} [filters] Filters the response by one or multiple fields. Advanced filter functionality allows you to perform more complex filtering operations.&lt;br/&gt; &lt;br/&gt; &lt;i&gt;Allowed values: id, executionCode, actionCode, actionSlug, actionVersion, entityCode, entityType, triggeredBySub, status, triggeredBy, triggerSource, correlationId, workflowInstanceCode, force, completedAt, createdAt, updatedAt, createdBy, updatedBy&lt;/i&gt;
381
+ * @param {*} [options] Override http request option.
382
+ * @throws {RequiredError}
383
+ */
384
+ listActionExecutions: function (authorization, pageSize, pageToken, filter, search, order, expand, filters, options) {
385
+ return localVarFp.listActionExecutions(authorization, pageSize, pageToken, filter, search, order, expand, filters, options).then(function (request) { return request(axios, basePath); });
386
+ },
387
+ /**
388
+ * Triggers an action execution. When the action has an input_validation_schema, the input payload is validated against it; invalid payloads return HTTP 400 with a body containing message and errors (JSON Schema validation errors). **Required Permissions** \"action-management.actions.run\"
389
+ * @summary Create the actionExecution
390
+ * @param {TriggerActionRequestDto} triggerActionRequestDto
391
+ * @param {string} [authorization] Bearer Token: provided by the login endpoint under the name accessToken.
392
+ * @param {*} [options] Override http request option.
393
+ * @throws {RequiredError}
394
+ */
395
+ triggerAction: function (triggerActionRequestDto, authorization, options) {
396
+ return localVarFp.triggerAction(triggerActionRequestDto, authorization, options).then(function (request) { return request(axios, basePath); });
397
+ },
398
+ };
399
+ };
400
+ exports.ExecutionsApiFactory = ExecutionsApiFactory;
401
+ /**
402
+ * ExecutionsApi - object-oriented interface
403
+ * @export
404
+ * @class ExecutionsApi
405
+ * @extends {BaseAPI}
406
+ */
407
+ var ExecutionsApi = /** @class */ (function (_super) {
408
+ __extends(ExecutionsApi, _super);
409
+ function ExecutionsApi() {
410
+ return _super !== null && _super.apply(this, arguments) || this;
411
+ }
412
+ /**
413
+ * Retrieves the latest action execution status by executionCode or correlationId **Required Permissions** \"action-management.actions.view\"
414
+ * @summary Retrieve the actionExecution
415
+ * @param {ExecutionsApiGetActionExecutionStatusRequest} requestParameters Request parameters.
416
+ * @param {*} [options] Override http request option.
417
+ * @throws {RequiredError}
418
+ * @memberof ExecutionsApi
419
+ */
420
+ ExecutionsApi.prototype.getActionExecutionStatus = function (requestParameters, options) {
421
+ var _this = this;
422
+ if (requestParameters === void 0) { requestParameters = {}; }
423
+ return (0, exports.ExecutionsApiFp)(this.configuration).getActionExecutionStatus(requestParameters.authorization, requestParameters.executionCode, requestParameters.correlationId, options).then(function (request) { return request(_this.axios, _this.basePath); });
424
+ };
425
+ /**
426
+ * Lists action executions (latest status per execution only) with optional filters **Required Permissions** \"action-management.actions.view\"
427
+ * @summary List actionExecutions
428
+ * @param {ExecutionsApiListActionExecutionsRequest} requestParameters Request parameters.
429
+ * @param {*} [options] Override http request option.
430
+ * @throws {RequiredError}
431
+ * @memberof ExecutionsApi
432
+ */
433
+ ExecutionsApi.prototype.listActionExecutions = function (requestParameters, options) {
434
+ var _this = this;
435
+ if (requestParameters === void 0) { requestParameters = {}; }
436
+ return (0, exports.ExecutionsApiFp)(this.configuration).listActionExecutions(requestParameters.authorization, requestParameters.pageSize, requestParameters.pageToken, requestParameters.filter, requestParameters.search, requestParameters.order, requestParameters.expand, requestParameters.filters, options).then(function (request) { return request(_this.axios, _this.basePath); });
437
+ };
438
+ /**
439
+ * Triggers an action execution. When the action has an input_validation_schema, the input payload is validated against it; invalid payloads return HTTP 400 with a body containing message and errors (JSON Schema validation errors). **Required Permissions** \"action-management.actions.run\"
440
+ * @summary Create the actionExecution
441
+ * @param {ExecutionsApiTriggerActionRequest} requestParameters Request parameters.
442
+ * @param {*} [options] Override http request option.
443
+ * @throws {RequiredError}
444
+ * @memberof ExecutionsApi
445
+ */
446
+ ExecutionsApi.prototype.triggerAction = function (requestParameters, options) {
447
+ var _this = this;
448
+ return (0, exports.ExecutionsApiFp)(this.configuration).triggerAction(requestParameters.triggerActionRequestDto, requestParameters.authorization, options).then(function (request) { return request(_this.axios, _this.basePath); });
449
+ };
450
+ return ExecutionsApi;
451
+ }(base_1.BaseAPI));
452
+ exports.ExecutionsApi = ExecutionsApi;
package/dist/api.d.ts CHANGED
@@ -11,3 +11,4 @@
11
11
  */
12
12
  export * from './api/actions-api';
13
13
  export * from './api/default-api';
14
+ export * from './api/executions-api';
package/dist/api.js CHANGED
@@ -29,3 +29,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
29
29
  Object.defineProperty(exports, "__esModule", { value: true });
30
30
  __exportStar(require("./api/actions-api"), exports);
31
31
  __exportStar(require("./api/default-api"), exports);
32
+ __exportStar(require("./api/executions-api"), exports);
@@ -44,13 +44,19 @@ export interface ActionClass {
44
44
  * @type {string}
45
45
  * @memberof ActionClass
46
46
  */
47
- 'workflowCode'?: string;
47
+ 'workflowCode': string;
48
48
  /**
49
- * Whether the action is enabled and can be triggered
49
+ * true = published (and triggerable), false = draft; only one published per code/slug/name
50
50
  * @type {boolean}
51
51
  * @memberof ActionClass
52
52
  */
53
53
  'isEnabled': boolean;
54
+ /**
55
+ * Whether the action is available in the UI
56
+ * @type {boolean}
57
+ * @memberof ActionClass
58
+ */
59
+ 'isAvailableInUi'?: boolean;
54
60
  /**
55
61
  * Detailed description of what this action does
56
62
  * @type {string}
@@ -81,4 +87,34 @@ export interface ActionClass {
81
87
  * @memberof ActionClass
82
88
  */
83
89
  'updatedBy': string;
90
+ /**
91
+ * Entity type: Policy, Lead, Claim
92
+ * @type {string}
93
+ * @memberof ActionClass
94
+ */
95
+ 'entityType'?: string;
96
+ /**
97
+ * Product version ID
98
+ * @type {number}
99
+ * @memberof ActionClass
100
+ */
101
+ 'productVersionId'?: number;
102
+ /**
103
+ * Derived from product_version.product_id
104
+ * @type {string}
105
+ * @memberof ActionClass
106
+ */
107
+ 'productSlug'?: string;
108
+ /**
109
+ * Optional JSON Schema to validate input_payload when triggering the action (only populated when expand=inputValidationSchema)
110
+ * @type {object}
111
+ * @memberof ActionClass
112
+ */
113
+ 'inputValidationSchema'?: object;
114
+ /**
115
+ * Business version per action config
116
+ * @type {number}
117
+ * @memberof ActionClass
118
+ */
119
+ 'configVersion': number;
84
120
  }
@@ -34,6 +34,12 @@ export interface ActionExecutionClass {
34
34
  * @memberof ActionExecutionClass
35
35
  */
36
36
  'actionCode': string;
37
+ /**
38
+ * Action config version (config_version) at trigger time for audit/tracing
39
+ * @type {number}
40
+ * @memberof ActionExecutionClass
41
+ */
42
+ 'actionVersion': number;
37
43
  /**
38
44
  * Execution status
39
45
  * @type {string}
@@ -104,4 +110,28 @@ export interface ActionExecutionClass {
104
110
  * @memberof ActionExecutionClass
105
111
  */
106
112
  'workflowOutputReference'?: WorkflowOutputReferenceClass;
113
+ /**
114
+ * When true, execution was triggered with force (e.g. draft/disabled action)
115
+ * @type {boolean}
116
+ * @memberof ActionExecutionClass
117
+ */
118
+ 'force'?: boolean;
119
+ /**
120
+ * For entity actions: code of the entity the action was run on (e.g. policy code, lead code)
121
+ * @type {string}
122
+ * @memberof ActionExecutionClass
123
+ */
124
+ 'entityCode'?: string;
125
+ /**
126
+ * For entity actions: entity type (POLICY, LEAD, CLAIM) for lookup
127
+ * @type {string}
128
+ * @memberof ActionExecutionClass
129
+ */
130
+ 'entityType'?: string;
131
+ /**
132
+ * JWT sub of who triggered the action (set when trigger is from API; null for webhook/system)
133
+ * @type {string}
134
+ * @memberof ActionExecutionClass
135
+ */
136
+ 'triggeredBySub'?: string;
107
137
  }
@@ -34,15 +34,45 @@ export interface CreateActionRequestDto {
34
34
  */
35
35
  'workflowCode': string;
36
36
  /**
37
- * Whether the action is enabled and can be triggered
37
+ * true = published (triggerable), false = draft. Default true.
38
38
  * @type {boolean}
39
39
  * @memberof CreateActionRequestDto
40
40
  */
41
41
  'isEnabled'?: boolean;
42
+ /**
43
+ * Whether the action is available in the UI
44
+ * @type {boolean}
45
+ * @memberof CreateActionRequestDto
46
+ */
47
+ 'isAvailableInUi'?: boolean;
42
48
  /**
43
49
  * Detailed description of what this action does
44
50
  * @type {string}
45
51
  * @memberof CreateActionRequestDto
46
52
  */
47
53
  'description'?: string;
54
+ /**
55
+ * Entity type. When provided, productVersionId is required (and vice versa).
56
+ * @type {string}
57
+ * @memberof CreateActionRequestDto
58
+ */
59
+ 'entityType'?: CreateActionRequestDtoEntityTypeEnum;
60
+ /**
61
+ * Product version ID. When provided, entityType is required (and vice versa).
62
+ * @type {number}
63
+ * @memberof CreateActionRequestDto
64
+ */
65
+ 'productVersionId'?: number;
66
+ /**
67
+ * Optional JSON Schema to validate input_payload when triggering the action
68
+ * @type {object}
69
+ * @memberof CreateActionRequestDto
70
+ */
71
+ 'inputValidationSchema'?: object;
48
72
  }
73
+ export declare const CreateActionRequestDtoEntityTypeEnum: {
74
+ readonly Policy: "POLICY";
75
+ readonly Lead: "LEAD";
76
+ readonly Claim: "CLAIM";
77
+ };
78
+ export type CreateActionRequestDtoEntityTypeEnum = typeof CreateActionRequestDtoEntityTypeEnum[keyof typeof CreateActionRequestDtoEntityTypeEnum];
@@ -13,3 +13,9 @@
13
13
  * Do not edit the class manually.
14
14
  */
15
15
  Object.defineProperty(exports, "__esModule", { value: true });
16
+ exports.CreateActionRequestDtoEntityTypeEnum = void 0;
17
+ exports.CreateActionRequestDtoEntityTypeEnum = {
18
+ Policy: 'POLICY',
19
+ Lead: 'LEAD',
20
+ Claim: 'CLAIM'
21
+ };
@@ -0,0 +1,24 @@
1
+ /**
2
+ * EMIL ActionService
3
+ * The EMIL ActionService API description
4
+ *
5
+ * The version of the OpenAPI document: 1.0
6
+ * Contact: kontakt@emil.de
7
+ *
8
+ * NOTE: This class is auto generated by OpenAPI Generator (https://openapi-generator.tech).
9
+ * https://openapi-generator.tech
10
+ * Do not edit the class manually.
11
+ */
12
+ /**
13
+ *
14
+ * @export
15
+ * @interface ExportActionsAsYamlResponseClass
16
+ */
17
+ export interface ExportActionsAsYamlResponseClass {
18
+ /**
19
+ * Serialized YAML for the product version (all entity types)
20
+ * @type {string}
21
+ * @memberof ExportActionsAsYamlResponseClass
22
+ */
23
+ 'yamlContent': string;
24
+ }