@5minds/processcube_engine_sdk 4.0.0-alpha.2 → 4.0.0-alpha.3

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.
@@ -1,80 +1,4 @@
1
1
  import { SearchQuery } from '../ProcessInstance/ProcessInstanceQuery';
2
- /**
3
- * @swagger
4
- * components:
5
- * schemas:
6
- * ActiveCronjob:
7
- * description: Describes an active cronjob.
8
- * type: object
9
- * required:
10
- * - processDefinitionId
11
- * - processModelId
12
- * - startEventId
13
- * - crontab
14
- * - nextExecution
15
- * properties:
16
- * processDefinitionId:
17
- * type: string
18
- * description: The processDefinitionId that contains the ProcessModel with the cronjob.
19
- * processModelId:
20
- * type: string
21
- * description: The ID of the ProcessModel that contains the cronjob.
22
- * startEventId:
23
- * type: string
24
- * description: The ID of the StartEvent that contains the cronjob.
25
- * crontab:
26
- * type: string
27
- * description: The crontab that describs the cronjob.
28
- * nextExecution:
29
- * type: string
30
- * description: The next time the cronjob will be triggered.
31
- */
32
- export declare type ActiveCronjob = {
33
- /**
34
- * The processDefinitionId that contains the ProcessModel with the cronjob.
35
- */
36
- processDefinitionId: string;
37
- /**
38
- * The ID of the ProcessModel that contains the cronjob.
39
- */
40
- processModelId: string;
41
- /**
42
- * The ID of the StartEvent that contains the cronjob.
43
- */
44
- startEventId: string;
45
- /**
46
- * The crontab that describs the cronjob.
47
- */
48
- crontab: string;
49
- /**
50
- * The next time the cronjob will be triggered.
51
- */
52
- nextExecution: Date;
53
- };
54
- /**
55
- * @swagger
56
- * components:
57
- * schemas:
58
- * CronjobList:
59
- * description: A list of active cronjobs.
60
- * type: object
61
- * required:
62
- * - cronjobs
63
- * - totalCount
64
- * properties:
65
- * cronjobs:
66
- * type: array
67
- * items:
68
- * $ref: '#/components/schemas/ActiveCronjob'
69
- * description: The active cronjobs
70
- * totalCount:
71
- * type: number
72
- * description: The total number of active cronjobs
73
- */
74
- export declare type CronjobList = {
75
- cronjobs: Array<ActiveCronjob>;
76
- totalCount: number;
77
- };
78
2
  /**
79
3
  * @swagger
80
4
  * components:
@@ -1,2 +1 @@
1
- export * from './CronjobHistory';
2
1
  export * from './Cronjob';
@@ -1,8 +1,11 @@
1
1
  /**
2
+ * @deprecated This feature is no longer officially supported, since this is more of an App SDK Feature.
3
+ * Therefore, this functionality will soon be moved to the App SDK entirely.
2
4
  * @swagger
3
5
  * components:
4
6
  * schemas:
5
7
  * UserMetadata:
8
+ * deprecated: true
6
9
  * description: The user metadata
7
10
  * type: object
8
11
  * required:
@@ -34,10 +37,13 @@ export type UserMetadata<TKey extends string, TPIScope extends string, TFIScope
34
37
  flowNodeInstanceScope?: TFIScope;
35
38
  };
36
39
  /**
40
+ * @deprecated This feature is no longer officially supported, since this is more of an App SDK Feature.
41
+ * Therefore, this functionality will soon be moved to the App SDK entirely.
37
42
  * @swagger
38
43
  * components:
39
44
  * schemas:
40
45
  * UserMetadataObject:
46
+ * deprecated: true
41
47
  * description: A list of user metadata
42
48
  * type: object
43
49
  * required:
package/dist/Engine.d.ts CHANGED
@@ -167,6 +167,16 @@ export type CustomHttpRouteResult = {
167
167
  vary?: string | Array<string>;
168
168
  };
169
169
  export type CustomHttpRouteHandler = (request: CustomHttpRouteRequest) => Promise<CustomHttpRouteResult> | CustomHttpRouteResult;
170
+ /**
171
+ * Additional Settings for a Custom HTTP Route.
172
+ */
173
+ export type CustomHttpRouteOptions = {
174
+ /**
175
+ * If set, accessing the HTTP route will require a valid Auth Token.
176
+ * Defaults to 'true'.
177
+ */
178
+ protected?: boolean;
179
+ };
170
180
  export type RuntimeExpressionParameters = {
171
181
  token?: {
172
182
  current?: any;
@@ -363,7 +373,15 @@ export type Engine = {
363
373
  anonymousSessions: IAnonymousSessionExtensionAdapter;
364
374
  registerCustomServiceTask<TPayload extends object>(serviceTaskType: string, serviceTaskHandler: CustomServiceTaskHandler<TPayload>): void;
365
375
  removeCustomServiceTask(serviceTaskType: string): void;
366
- registerHttpRoute(httpRoute: string, method: 'get' | 'post' | 'put' | 'delete', routeHandler: CustomHttpRouteHandler): void;
376
+ /**
377
+ * Registers a HTTP Route at the Engine Server. These routes will be hosted by the engine itself and can be used to extend the Engine's native API.
378
+ *
379
+ * @param path The HTTP path to use
380
+ * @param method The HTTP Method for the route. Currently supports GET, POST, PUT and DELETE
381
+ * @param routeHandler A callback for handling requests against the route
382
+ * @param options Additional settings for the HTTP route.
383
+ */
384
+ registerHttpRoute(path: string, method: 'get' | 'post' | 'put' | 'delete', routeHandler: CustomHttpRouteHandler, options?: CustomHttpRouteOptions): void;
367
385
  executeRuntimeExpression<TExpectedResult>(expression: string, params: RuntimeExpressionParameters): Promise<TExpectedResult>;
368
386
  applicationInfo: IApplicationInfoExtensionAdapter;
369
387
  correlations: ICorrelationExtensionAdapter;
@@ -1,4 +1,4 @@
1
- import { CronjobQuery, CronjobSortSettings, DataModels, DeployedCronjobList, Identity } from '../index';
1
+ import { CronjobQuery, CronjobSortSettings, DeployedCronjobList, Identity } from '../index';
2
2
  export interface ICronjobExtensionAdapter {
3
3
  query(query: CronjobQuery, options?: {
4
4
  identity?: Identity;
@@ -8,21 +8,4 @@ export interface ICronjobExtensionAdapter {
8
8
  }): Promise<DeployedCronjobList>;
9
9
  enableCronjob(processModelId: string, flowNodeId: string, identity?: Identity): Promise<void>;
10
10
  disableCronjob(processModelId: string, flowNodeId: string, identity?: Identity): Promise<void>;
11
- /**
12
- * @deprecated Use "query" instead.
13
- */
14
- getActive(options?: {
15
- identity?: Identity;
16
- offset?: number;
17
- limit?: number;
18
- }): Promise<DataModels.Cronjob.CronjobList>;
19
- /**
20
- * @deprecated Use "query" instead.
21
- */
22
- queryHistory(query: DataModels.Cronjob.CronjobHistoryQuery, options?: {
23
- identity?: Identity;
24
- offset?: number;
25
- limit?: number;
26
- sortSettings?: DataModels.Cronjob.CronjobHistorySortSettings;
27
- }): Promise<DataModels.Cronjob.CronjobHistoryList>;
28
11
  }
@@ -1 +1 @@
1
- {"version":3,"file":"Cronjob.js","sourceRoot":"","sources":["../../../../src/DataModels/Cronjob/Cronjob.ts"],"names":[],"mappings":";;;;IAkLA,IAAY,sBAQX;IARD,WAAY,sBAAsB;QAChC,qEAA2C,CAAA;QAC3C,2DAAiC,CAAA;QACjC,uDAA6B,CAAA;QAC7B,6CAAmB,CAAA;QACnB,6CAAmB,CAAA;QACnB,6DAAmC,CAAA;QACnC,6DAAmC,CAAA;IACrC,CAAC,EARW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAQjC"}
1
+ {"version":3,"file":"Cronjob.js","sourceRoot":"","sources":["../../../../src/DataModels/Cronjob/Cronjob.ts"],"names":[],"mappings":";;;;IAoGA,IAAY,sBAQX;IARD,WAAY,sBAAsB;QAChC,qEAA2C,CAAA;QAC3C,2DAAiC,CAAA;QACjC,uDAA6B,CAAA;QAC7B,6CAAmB,CAAA;QACnB,6CAAmB,CAAA;QACnB,6DAAmC,CAAA;QACnC,6DAAmC,CAAA;IACrC,CAAC,EARW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAQjC"}
@@ -12,10 +12,9 @@ var __createBinding = (this && this.__createBinding) || (Object.create ? (functi
12
12
  var __exportStar = (this && this.__exportStar) || function(m, exports) {
13
13
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
14
14
  };
15
- define(["require", "exports", "./CronjobHistory", "./Cronjob"], function (require, exports, CronjobHistory_1, Cronjob_1) {
15
+ define(["require", "exports", "./Cronjob"], function (require, exports, Cronjob_1) {
16
16
  "use strict";
17
17
  Object.defineProperty(exports, "__esModule", { value: true });
18
- __exportStar(CronjobHistory_1, exports);
19
18
  __exportStar(Cronjob_1, exports);
20
19
  });
21
20
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/DataModels/Cronjob/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;IAAA,wCAAiC;IACjC,iCAA0B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/DataModels/Cronjob/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;IAAA,iCAA0B"}
@@ -1 +1 @@
1
- {"version":3,"file":"Cronjob.js","sourceRoot":"","sources":["../../../../src/DataModels/Cronjob/Cronjob.ts"],"names":[],"mappings":";;;AAkLA,IAAY,sBAQX;AARD,WAAY,sBAAsB;IAChC,qEAA2C,CAAA;IAC3C,2DAAiC,CAAA;IACjC,uDAA6B,CAAA;IAC7B,6CAAmB,CAAA;IACnB,6CAAmB,CAAA;IACnB,6DAAmC,CAAA;IACnC,6DAAmC,CAAA;AACrC,CAAC,EARW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAQjC"}
1
+ {"version":3,"file":"Cronjob.js","sourceRoot":"","sources":["../../../../src/DataModels/Cronjob/Cronjob.ts"],"names":[],"mappings":";;;AAoGA,IAAY,sBAQX;AARD,WAAY,sBAAsB;IAChC,qEAA2C,CAAA;IAC3C,2DAAiC,CAAA;IACjC,uDAA6B,CAAA;IAC7B,6CAAmB,CAAA;IACnB,6CAAmB,CAAA;IACnB,6DAAmC,CAAA;IACnC,6DAAmC,CAAA;AACrC,CAAC,EARW,sBAAsB,GAAtB,8BAAsB,KAAtB,8BAAsB,QAQjC"}
@@ -14,6 +14,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./CronjobHistory"), exports);
18
17
  __exportStar(require("./Cronjob"), exports);
19
18
  //# sourceMappingURL=index.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/DataModels/Cronjob/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mDAAiC;AACjC,4CAA0B"}
1
+ {"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../src/DataModels/Cronjob/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,4CAA0B"}
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@5minds/processcube_engine_sdk",
3
- "version": "4.0.0-alpha.2",
3
+ "version": "4.0.0-alpha.3",
4
4
  "description": "Software development kit for the Engine.",
5
5
  "main": "dist/commonjs/index.js",
6
6
  "types": "dist/index.d.ts",
@@ -30,21 +30,20 @@
30
30
  "build-commonjs": "tsc",
31
31
  "build-amd": "tsc --module amd --outDir ./dist/amd",
32
32
  "prepare": "npm run clean-build",
33
- "test:smoke": "ts-mocha -t 120000 -p ./tsconfig.json ./test/smoke-test-sample.spec.ts",
34
33
  "test:unit": "ts-mocha -p ./tsconfig.json \"./src/**/*.spec.ts\" ./test/**/*.spec.ts --exit"
35
34
  },
36
35
  "dependencies": {
37
- "dayjs": "^1.11.7",
36
+ "dayjs": "^1.11.9",
38
37
  "lodash.clonedeep": "^4.5.0",
39
38
  "pino": "^6.12.0",
40
39
  "xml2js": "^0.6.2"
41
40
  },
42
41
  "devDependencies": {
43
- "@atlas-engine/fullstack_server": "15.0.0",
42
+ "@types/express": "^4.17.1",
44
43
  "@types/mocha": "^10.0.1",
45
- "@types/node": "^18.16.0",
46
- "inversify": "6.0.1",
44
+ "@types/node": "^18.17.8",
47
45
  "mocha": "^10.2.0",
46
+ "reflect-metadata": "^0.1.13",
48
47
  "should": "^13.2.3",
49
48
  "ts-mocha": "^10.0.0",
50
49
  "typescript": "~5.0.4"
@@ -1,86 +0,0 @@
1
- /**
2
- * @swagger
3
- * components:
4
- * schemas:
5
- * CronjobHistoryEntry:
6
- * description: Describes a single entry in the list of cronjob histories.
7
- * type: object
8
- * required:
9
- * - processDefinitionId
10
- * - processModelId
11
- * - startEventId
12
- * - crontab
13
- * - executedAt
14
- * properties:
15
- * processDefinitionId:
16
- * description: The ID of the process definition
17
- * type: string
18
- * processModelId:
19
- * description: The ID of the process model
20
- * type: string
21
- * startEventId:
22
- * description: The ID of the start event
23
- * type: string
24
- * crontab:
25
- * description: The crontab that describs the cronjob.
26
- * type: string
27
- * executedAt:
28
- * description: The time the cronjob was executed.
29
- * type: string
30
- * processInstanceId:
31
- * description: The ID of the process instance that was started by the cronjob.
32
- * type: string
33
- */
34
- export declare type CronjobHistoryEntry = {
35
- processDefinitionId: string;
36
- processModelId: string;
37
- startEventId: string;
38
- crontab: string;
39
- executedAt: Date;
40
- processInstanceId?: string;
41
- };
42
- /**
43
- * @swagger
44
- * components:
45
- * schemas:
46
- * CronjobHistoryList:
47
- * description: A list of cronjob histories.
48
- * type: object
49
- * required:
50
- * - cronjobHistories
51
- * - totalCount
52
- * properties:
53
- * cronjobHistories:
54
- * description: The cronjob histories
55
- * type: array
56
- * items:
57
- * $ref: '#/components/schemas/CronjobHistoryEntry'
58
- * totalCount:
59
- * description: The total number of cronjob histories
60
- * type: number
61
- */
62
- export declare type CronjobHistoryList = {
63
- cronjobHistories: Array<CronjobHistoryEntry>;
64
- totalCount: number;
65
- };
66
- export declare type CronjobHistoryQuery = {
67
- processDefinitionId?: Array<string> | string;
68
- processModelId?: Array<string> | string;
69
- startEventId?: Array<string> | string;
70
- crontab?: Array<string> | string;
71
- executedAt?: Array<Date> | Date;
72
- createdAt?: Array<Date> | Date;
73
- updatedAt?: Array<Date> | Date;
74
- };
75
- export declare type CronjobHistorySortSettings = {
76
- sortBy: CronjobHistorySortableColumns;
77
- sortDir?: 'ASC' | 'DESC';
78
- };
79
- export declare enum CronjobHistorySortableColumns {
80
- processDefinitionId = "processDefinitionId",
81
- processModelId = "processModelId",
82
- startEventId = "startEventId",
83
- crontab = "crontab",
84
- createdAt = "createdAt",
85
- executedAt = "executedAt"
86
- }
@@ -1,15 +0,0 @@
1
- define(["require", "exports"], function (require, exports) {
2
- "use strict";
3
- Object.defineProperty(exports, "__esModule", { value: true });
4
- exports.CronjobHistorySortableColumns = void 0;
5
- var CronjobHistorySortableColumns;
6
- (function (CronjobHistorySortableColumns) {
7
- CronjobHistorySortableColumns["processDefinitionId"] = "processDefinitionId";
8
- CronjobHistorySortableColumns["processModelId"] = "processModelId";
9
- CronjobHistorySortableColumns["startEventId"] = "startEventId";
10
- CronjobHistorySortableColumns["crontab"] = "crontab";
11
- CronjobHistorySortableColumns["createdAt"] = "createdAt";
12
- CronjobHistorySortableColumns["executedAt"] = "executedAt";
13
- })(CronjobHistorySortableColumns = exports.CronjobHistorySortableColumns || (exports.CronjobHistorySortableColumns = {}));
14
- });
15
- //# sourceMappingURL=CronjobHistory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CronjobHistory.js","sourceRoot":"","sources":["../../../../src/DataModels/Cronjob/CronjobHistory.ts"],"names":[],"mappings":";;;;IAkFA,IAAY,6BAOX;IAPD,WAAY,6BAA6B;QACvC,4EAA2C,CAAA;QAC3C,kEAAiC,CAAA;QACjC,8DAA6B,CAAA;QAC7B,oDAAmB,CAAA;QACnB,wDAAuB,CAAA;QACvB,0DAAyB,CAAA;IAC3B,CAAC,EAPW,6BAA6B,GAA7B,qCAA6B,KAA7B,qCAA6B,QAOxC"}
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.CronjobHistorySortableColumns = void 0;
4
- var CronjobHistorySortableColumns;
5
- (function (CronjobHistorySortableColumns) {
6
- CronjobHistorySortableColumns["processDefinitionId"] = "processDefinitionId";
7
- CronjobHistorySortableColumns["processModelId"] = "processModelId";
8
- CronjobHistorySortableColumns["startEventId"] = "startEventId";
9
- CronjobHistorySortableColumns["crontab"] = "crontab";
10
- CronjobHistorySortableColumns["createdAt"] = "createdAt";
11
- CronjobHistorySortableColumns["executedAt"] = "executedAt";
12
- })(CronjobHistorySortableColumns = exports.CronjobHistorySortableColumns || (exports.CronjobHistorySortableColumns = {}));
13
- //# sourceMappingURL=CronjobHistory.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"CronjobHistory.js","sourceRoot":"","sources":["../../../../src/DataModels/Cronjob/CronjobHistory.ts"],"names":[],"mappings":";;;AAkFA,IAAY,6BAOX;AAPD,WAAY,6BAA6B;IACvC,4EAA2C,CAAA;IAC3C,kEAAiC,CAAA;IACjC,8DAA6B,CAAA;IAC7B,oDAAmB,CAAA;IACnB,wDAAuB,CAAA;IACvB,0DAAyB,CAAA;AAC3B,CAAC,EAPW,6BAA6B,GAA7B,qCAA6B,KAA7B,qCAA6B,QAOxC"}