@persei/perseed-api 5.0.19 → 5.0.21
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/dist/client.cjs +875 -71
- package/dist/client.cjs.map +1 -1
- package/dist/client.mjs +876 -72
- package/dist/client.mjs.map +1 -1
- package/dist/ecosystem-action-system.cjs +586 -0
- package/dist/ecosystem-action-system.cjs.map +1 -0
- package/dist/ecosystem-action-system.d.ts +1 -0
- package/dist/ecosystem-action-system.mjs +586 -0
- package/dist/ecosystem-action-system.mjs.map +1 -0
- package/dist/lib/src/client/customFetch.d.ts +51 -0
- package/dist/lib/src/client/customFetch.d.ts.map +1 -0
- package/dist/lib/src/client/customFetch.test.d.ts +2 -0
- package/dist/lib/src/client/customFetch.test.d.ts.map +1 -0
- package/dist/lib/src/client/index.d.ts +1 -0
- package/dist/lib/src/client/index.d.ts.map +1 -1
- package/dist/lib/src/generated/client.d.ts +5251 -670
- package/dist/lib/src/generated/client.d.ts.map +1 -1
- package/dist/src/Services/AuthenticationSecurityService.d.ts +1 -1
- package/dist/src/Services/MobileService.d.ts +26 -1
- package/dist/src/Services/MobileService.d.ts.map +1 -1
- package/dist/src/Services/ProcessLogService.d.ts +1 -1
- package/dist/src/Services/ProcessLogService.d.ts.map +1 -1
- package/dist/src/Services/ProjectService.d.ts.map +1 -1
- package/dist/src/Services/QueryService.d.ts +24 -1
- package/dist/src/Services/QueryService.d.ts.map +1 -1
- package/dist/src/Services/RedisQueueService.d.ts +16 -0
- package/dist/src/Services/RedisQueueService.d.ts.map +1 -1
- package/dist/src/Services/TriggerProcessLogService.d.ts +90 -0
- package/dist/src/Services/TriggerProcessLogService.d.ts.map +1 -0
- package/dist/src/Services/TriggerService.d.ts +16 -11
- package/dist/src/Services/TriggerService.d.ts.map +1 -1
- package/dist/src/Services/trigger-process-log-service.test.d.ts +2 -0
- package/dist/src/Services/trigger-process-log-service.test.d.ts.map +1 -0
- package/dist/src/controllers/AuthController.d.ts.map +1 -1
- package/dist/src/controllers/FormController.d.ts.map +1 -1
- package/dist/src/helpers/error.d.ts +12 -0
- package/dist/src/helpers/error.d.ts.map +1 -1
- package/dist/src/lib.d.ts +1 -0
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/models/ecosystem/NotificationConfiguration.d.ts +1 -1
- package/dist/src/models/ecosystem/NotificationConfiguration.d.ts.map +1 -1
- package/dist/src/models/ecosystem/User.d.ts +17 -0
- package/dist/src/models/ecosystem/User.d.ts.map +1 -1
- package/dist/src/models/ecosystem/User.getProjectUser.test.d.ts +2 -0
- package/dist/src/models/ecosystem/User.getProjectUser.test.d.ts.map +1 -0
- package/dist/src/models/perseed/PerseedEcosystem.d.ts +2 -0
- package/dist/src/models/perseed/PerseedEcosystem.d.ts.map +1 -1
- package/dist/src/models/project/DesignerCrf.d.ts +3 -2
- package/dist/src/models/project/DesignerCrf.d.ts.map +1 -1
- package/dist/src/models/project/designer-crf-after-save.test.d.ts +2 -0
- package/dist/src/models/project/designer-crf-after-save.test.d.ts.map +1 -0
- package/dist/src/module.d.ts +5 -0
- package/dist/src/schemas/api_action/ApiActionTypes.d.ts +11 -0
- package/dist/src/schemas/api_action/ApiActionTypes.d.ts.map +1 -1
- package/dist/src/schemas/index.d.ts +1 -0
- package/dist/src/schemas/index.d.ts.map +1 -1
- package/dist/src/schemas/notification_configuration/types.d.ts +19 -8
- package/dist/src/schemas/notification_configuration/types.d.ts.map +1 -1
- package/dist/src/schemas/process_log/create_process_log_payload.schema.json +4 -0
- package/dist/src/schemas/process_log/types.d.ts +3 -0
- package/dist/src/schemas/process_log/types.d.ts.map +1 -1
- package/dist/src/schemas/project_user/index.d.ts +2 -0
- package/dist/src/schemas/project_user/index.d.ts.map +1 -0
- package/dist/src/schemas/project_user/types.d.ts +44 -0
- package/dist/src/schemas/project_user/types.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.controller/action-system.controller.e2e.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.controller/action-system.controller.e2e.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.controller/action-system.controller.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.controller/action-system.controller.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.controller/action.controller.d.ts +3 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.controller/action.controller.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.controller/automatic-trigger.controller.d.ts +3 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.controller/automatic-trigger.controller.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.controller/index.d.ts +6 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.controller/index.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.controller/manual-trigger.controller.d.ts +3 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.controller/manual-trigger.controller.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/action-system.helper.d.ts +149 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/action-system.helper.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/action-system.helper.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/action-system.helper.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/conditions-matcher.helper.d.ts +5 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/conditions-matcher.helper.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/conditions-matcher.helper.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/conditions-matcher.helper.test.d.ts.map +1 -0
- package/dist/src/{Services/ConditionsMatcher/CustomConditionsFormat.d.ts → v2/modules/ecosystem/action-system/action-system.helper/custom-conditions-format.helper.d.ts} +2 -2
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/custom-conditions-format.helper.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/custom-conditions-format.helper.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/custom-conditions-format.helper.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/index.d.ts +5 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/index.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/manual-trigger.helper.d.ts +13 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/manual-trigger.helper.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/manual-trigger.helper.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/manual-trigger.helper.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.model.d.ts +122 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.model.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.schema.d.ts +744 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.schema.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/action-system.service.d.ts +37 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/action-system.service.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/action-system.service.e2e.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/action-system.service.e2e.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/action-system.service.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/action-system.service.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/action.service.d.ts +18 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/action.service.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/action.service.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/action.service.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/automatic-trigger.service.d.ts +137 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/automatic-trigger.service.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/automatic-trigger.service.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/automatic-trigger.service.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/index.d.ts +8 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/index.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/manual-trigger-engine.service.d.ts +34 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/manual-trigger-engine.service.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/manual-trigger-engine.service.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/manual-trigger-engine.service.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/manual-trigger.service.d.ts +179 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/manual-trigger.service.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/manual-trigger.service.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/manual-trigger.service.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/trigger-actions.service.d.ts +31 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/trigger-actions.service.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/trigger-actions.service.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/trigger-actions.service.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/trigger-engine.service.d.ts +57 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/trigger-engine.service.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/trigger-engine.service.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/trigger-engine.service.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/index.d.ts +6 -0
- package/dist/src/v2/modules/ecosystem/action-system/index.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/lib.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/lib.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/process-log/index.d.ts +3 -0
- package/dist/src/v2/modules/ecosystem/process-log/index.d.ts.map +1 -0
- package/dist/src/{models/ecosystem/ProcessLog.d.ts → v2/modules/ecosystem/process-log/process-log.model.d.ts} +16 -5
- package/dist/src/v2/modules/ecosystem/process-log/process-log.model.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/process-log/process-log.model.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/process-log/process-log.model.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/process-log/process-log.service.d.ts +20 -0
- package/dist/src/v2/modules/ecosystem/process-log/process-log.service.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/process-log/process-log.service.e2e.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/process-log/process-log.service.e2e.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/process-log/process-log.service.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/process-log/process-log.service.test.d.ts.map +1 -0
- package/dist/src/v2/modules/global/api-error/api-error.schema.d.ts +9 -0
- package/dist/src/v2/modules/global/api-error/api-error.schema.d.ts.map +1 -1
- package/dist/src/v2/modules/global/e2e-operation/e2e-operation.controller.d.ts.map +1 -1
- package/dist/src/v2/modules/global/e2e-operation/e2e-operation.service.d.ts.map +1 -1
- package/dist/src/v2/modules/global/request-log/request-log.middleware.d.ts.map +1 -1
- package/dist/src/v2/modules/project/document/document.controller.d.ts.map +1 -1
- package/dist/src/v2/modules/project/thryve/thryve.controller.d.ts.map +1 -1
- package/dist/src/v2/modules/project/thryve/thryve.service.d.ts +16 -4
- package/dist/src/v2/modules/project/thryve/thryve.service.d.ts.map +1 -1
- package/dist/src/v2/routes/v2/e2e/index.d.ts.map +1 -1
- package/dist/src/v2/routes/v2/ecosystem/_ecosystemName/project/_projectName/action/index.d.ts +3 -0
- package/dist/src/v2/routes/v2/ecosystem/_ecosystemName/project/_projectName/action/index.d.ts.map +1 -0
- package/dist/src/v2/routes/v2/ecosystem/_ecosystemName/project/_projectName/automatic-trigger/index.d.ts +3 -0
- package/dist/src/v2/routes/v2/ecosystem/_ecosystemName/project/_projectName/automatic-trigger/index.d.ts.map +1 -0
- package/dist/src/v2/routes/v2/ecosystem/_ecosystemName/project/_projectName/manual-trigger/index.d.ts +3 -0
- package/dist/src/v2/routes/v2/ecosystem/_ecosystemName/project/_projectName/manual-trigger/index.d.ts.map +1 -0
- package/dist/v1/perseed-api.cjs +8 -11
- package/dist/v1/perseed-api.cjs.map +1 -1
- package/dist/v1/perseed-api.mjs +7 -10
- package/dist/v1/perseed-api.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/src/Services/ConditionsMatcher/CustomConditionsFormat.d.ts.map +0 -1
- package/dist/src/Services/ConditionsMatcher/index.d.ts +0 -4
- package/dist/src/Services/ConditionsMatcher/index.d.ts.map +0 -1
- package/dist/src/Services/conditions-matcher.test.d.ts +0 -2
- package/dist/src/Services/conditions-matcher.test.d.ts.map +0 -1
- package/dist/src/Services/custom-conditions-format.test.d.ts +0 -2
- package/dist/src/Services/custom-conditions-format.test.d.ts.map +0 -1
- package/dist/src/models/ecosystem/ProcessLog.d.ts.map +0 -1
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-system.schema.d.ts","sourceRoot":"","sources":["../../../../../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-system.service/action-system.service.d.ts
ADDED
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
import { default as RequestContext } from '../../../../../models/request/RequestContext';
|
|
2
|
+
import { ActionEvent, TriggerExecutionResult } from '../action-system.schema';
|
|
3
|
+
import { JobParams } from '../../../../../Services/RedisQueueService';
|
|
4
|
+
import { AutomaticTrigger } from '../action-system.model';
|
|
5
|
+
/**
|
|
6
|
+
* Resolves the enabled automatic triggers that could fire for `event`, scoped by
|
|
7
|
+
* typed columns only (no LIKE): `source` always matches; `target`/`operation`/
|
|
8
|
+
* `project_id` match either the event's value or a NULL column (wildcard). Actions
|
|
9
|
+
* are eager-loaded ordered by `execution_order`.
|
|
10
|
+
*/
|
|
11
|
+
declare function resolveAutomaticTriggers(ctx: RequestContext, event: ActionEvent): Promise<AutomaticTrigger[]>;
|
|
12
|
+
/**
|
|
13
|
+
* Main entry point of the automatic-trigger execution engine. Resolves the
|
|
14
|
+
* triggers an event could fire and hands them to the shared engine, which
|
|
15
|
+
* evaluates their jsonLogic conditions (a trigger with no `conditions` always
|
|
16
|
+
* matches), runs the matched triggers' ordered actions, and records a
|
|
17
|
+
* trigger-level process_log row for every evaluation. A failing trigger is
|
|
18
|
+
* caught and logged as an error without aborting the rest of the batch.
|
|
19
|
+
*
|
|
20
|
+
* Never rejects: any engine-level failure is logged and resolves to an empty
|
|
21
|
+
* result, so a queue job running it is never retried by the queue and a caller
|
|
22
|
+
* never has to guard it.
|
|
23
|
+
*
|
|
24
|
+
* `now` defaults to `new Date()` but can be pinned by callers (tests) to keep
|
|
25
|
+
* `expires_at` computation deterministic — a single timestamp is threaded
|
|
26
|
+
* through the whole batch rather than read again per row.
|
|
27
|
+
*/
|
|
28
|
+
declare function handleEvent(ctx: RequestContext, event: ActionEvent, now?: Date): Promise<TriggerExecutionResult[]>;
|
|
29
|
+
/** Subscriber of the `MODEL_AFTER_SAVE` event: adapts its params to an `ActionEvent` and runs the engine. */
|
|
30
|
+
declare function afterModelSaveJob(ctx: RequestContext, params: JobParams): Promise<void>;
|
|
31
|
+
export declare const ActionSystemService: {
|
|
32
|
+
afterModelSaveJob: typeof afterModelSaveJob;
|
|
33
|
+
handleEvent: typeof handleEvent;
|
|
34
|
+
resolveAutomaticTriggers: typeof resolveAutomaticTriggers;
|
|
35
|
+
};
|
|
36
|
+
export {};
|
|
37
|
+
//# sourceMappingURL=action-system.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-system.service.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.service/action-system.service.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,mCAAmC,CAAA;AAC9D,OAAO,KAAK,EAAE,WAAW,EAAE,sBAAsB,EAAE,MAAM,yBAAyB,CAAA;AAIlF,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,gCAAgC,CAAA;AAE/D,OAAO,EAAE,gBAAgB,EAAE,MAAM,wBAAwB,CAAA;AAMzD;;;;;GAKG;AACH,iBAAe,wBAAwB,CAAC,GAAG,EAAE,cAAc,EAAE,KAAK,EAAE,WAAW,GAAG,OAAO,CAAC,gBAAgB,EAAE,CAAC,CA8B5G;AAID;;;;;;;;;;;;;;;GAeG;AACH,iBAAe,WAAW,CACxB,GAAG,EAAE,cAAc,EACnB,KAAK,EAAE,WAAW,EAClB,GAAG,GAAE,IAAiB,GACrB,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAOnC;AAED,6GAA6G;AAC7G,iBAAe,iBAAiB,CAAC,GAAG,EAAE,cAAc,EAAE,MAAM,EAAE,SAAS,GAAG,OAAO,CAAC,IAAI,CAAC,CAQtF;AAoCD,eAAO,MAAM,mBAAmB;;;;CAI/B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-system.service.e2e.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.service/action-system.service.e2e.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-system.service.test.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.service/action-system.service.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
import { default as RequestContext } from '../../../../../models/request/RequestContext';
|
|
2
|
+
import { PaginatedQuery } from '../../../global/pagination';
|
|
3
|
+
import { Action } from '../action-system.model';
|
|
4
|
+
import { CreateActionData, UpdateActionData } from '../action-system.schema';
|
|
5
|
+
declare function listActions(ctx: RequestContext, pagination: PaginatedQuery): Promise<import('objection').Page<Action>>;
|
|
6
|
+
declare function getActionById(ctx: RequestContext, id: number): Promise<Action | undefined>;
|
|
7
|
+
declare function createAction(ctx: RequestContext, data: CreateActionData): Promise<Action>;
|
|
8
|
+
declare function updateAction(ctx: RequestContext, id: number, data: UpdateActionData): Promise<Action>;
|
|
9
|
+
declare function removeAction(ctx: RequestContext, id: number): Promise<boolean>;
|
|
10
|
+
export declare const ActionService: {
|
|
11
|
+
list: typeof listActions;
|
|
12
|
+
getById: typeof getActionById;
|
|
13
|
+
create: typeof createAction;
|
|
14
|
+
update: typeof updateAction;
|
|
15
|
+
remove: typeof removeAction;
|
|
16
|
+
};
|
|
17
|
+
export {};
|
|
18
|
+
//# sourceMappingURL=action.service.d.ts.map
|
package/dist/src/v2/modules/ecosystem/action-system/action-system.service/action.service.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.service.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.service/action.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,mCAAmC,CAAA;AACnE,OAAO,EAAE,cAAc,EAAiB,MAAM,6BAA6B,CAAA;AAG3E,OAAO,EAAE,MAAM,EAAE,MAAM,wBAAwB,CAAA;AAE/C,OAAO,KAAK,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAEjF,iBAAe,WAAW,CAAC,GAAG,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc,6CAGzE;AAED,iBAAe,aAAa,CAAC,GAAG,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,+BAE3D;AAED,iBAAe,YAAY,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,gBAAgB,mBAKtE;AAED,iBAAe,YAAY,CAAC,GAAG,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,gBAAgB,mBAalF;AAED,iBAAe,YAAY,CAAC,GAAG,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,oBAE1D;AAED,eAAO,MAAM,aAAa;;;;;;CAMzB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.service.test.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.service/action.service.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,137 @@
|
|
|
1
|
+
import { default as RequestContext } from '../../../../../models/request/RequestContext';
|
|
2
|
+
import { PaginatedQuery } from '../../../global/pagination';
|
|
3
|
+
import { AutomaticTrigger, AutomaticTriggerAction } from '../action-system.model';
|
|
4
|
+
import { CreateAutomaticTriggerData, UpdateAutomaticTriggerData } from '../action-system.schema';
|
|
5
|
+
declare function listAutomaticTriggers(ctx: RequestContext, pagination: PaginatedQuery, includeActions?: boolean): Promise<import('objection').Page<AutomaticTrigger> | {
|
|
6
|
+
results: ({
|
|
7
|
+
enabled?: boolean | undefined;
|
|
8
|
+
project_id?: number | null | undefined;
|
|
9
|
+
target?: string | null | undefined;
|
|
10
|
+
conditions?: object | null | undefined;
|
|
11
|
+
operation?: "delete" | "update" | "create" | null | undefined;
|
|
12
|
+
retention_days?: number | null | undefined;
|
|
13
|
+
relations?: {
|
|
14
|
+
join?: string[] | undefined;
|
|
15
|
+
} | null | undefined;
|
|
16
|
+
id: number;
|
|
17
|
+
source: "model" | "designer" | "displayer";
|
|
18
|
+
} & {
|
|
19
|
+
actions?: {
|
|
20
|
+
project_id?: number | null | undefined;
|
|
21
|
+
retention_days?: number | null | undefined;
|
|
22
|
+
library?: boolean | undefined;
|
|
23
|
+
id: number;
|
|
24
|
+
type: "ApiAction";
|
|
25
|
+
name: string;
|
|
26
|
+
config: {
|
|
27
|
+
default?: Record<string, unknown> | undefined;
|
|
28
|
+
location?: string | undefined;
|
|
29
|
+
overridable?: string[] | undefined;
|
|
30
|
+
id: string;
|
|
31
|
+
} & {
|
|
32
|
+
payload: Record<string, unknown>;
|
|
33
|
+
};
|
|
34
|
+
}[] | undefined;
|
|
35
|
+
})[];
|
|
36
|
+
total: number;
|
|
37
|
+
}>;
|
|
38
|
+
declare function getAutomaticTriggerById(ctx: RequestContext, id: number, includeActions?: boolean): Promise<({
|
|
39
|
+
enabled?: boolean | undefined;
|
|
40
|
+
project_id?: number | null | undefined;
|
|
41
|
+
target?: string | null | undefined;
|
|
42
|
+
conditions?: object | null | undefined;
|
|
43
|
+
operation?: "delete" | "update" | "create" | null | undefined;
|
|
44
|
+
retention_days?: number | null | undefined;
|
|
45
|
+
relations?: {
|
|
46
|
+
join?: string[] | undefined;
|
|
47
|
+
} | null | undefined;
|
|
48
|
+
id: number;
|
|
49
|
+
source: "model" | "designer" | "displayer";
|
|
50
|
+
} & {
|
|
51
|
+
actions?: {
|
|
52
|
+
project_id?: number | null | undefined;
|
|
53
|
+
retention_days?: number | null | undefined;
|
|
54
|
+
library?: boolean | undefined;
|
|
55
|
+
id: number;
|
|
56
|
+
type: "ApiAction";
|
|
57
|
+
name: string;
|
|
58
|
+
config: {
|
|
59
|
+
default?: Record<string, unknown> | undefined;
|
|
60
|
+
location?: string | undefined;
|
|
61
|
+
overridable?: string[] | undefined;
|
|
62
|
+
id: string;
|
|
63
|
+
} & {
|
|
64
|
+
payload: Record<string, unknown>;
|
|
65
|
+
};
|
|
66
|
+
}[] | undefined;
|
|
67
|
+
}) | AutomaticTrigger | undefined>;
|
|
68
|
+
declare function createAutomaticTrigger(ctx: RequestContext, data: CreateAutomaticTriggerData): Promise<AutomaticTrigger | {
|
|
69
|
+
actions: {
|
|
70
|
+
project_id?: number | null | undefined;
|
|
71
|
+
retention_days?: number | null | undefined;
|
|
72
|
+
library?: boolean | undefined;
|
|
73
|
+
id: number;
|
|
74
|
+
type: "ApiAction";
|
|
75
|
+
name: string;
|
|
76
|
+
config: {
|
|
77
|
+
default?: Record<string, unknown> | undefined;
|
|
78
|
+
location?: string | undefined;
|
|
79
|
+
overridable?: string[] | undefined;
|
|
80
|
+
id: string;
|
|
81
|
+
} & {
|
|
82
|
+
payload: Record<string, unknown>;
|
|
83
|
+
};
|
|
84
|
+
}[];
|
|
85
|
+
project_id?: number | null;
|
|
86
|
+
source: import('../action-system.schema').TriggerSource;
|
|
87
|
+
target?: string | null;
|
|
88
|
+
operation?: import('../action-system.schema').TriggerOperation | null;
|
|
89
|
+
conditions?: object | null;
|
|
90
|
+
relations?: import('../action-system.schema').TriggerRelations | null;
|
|
91
|
+
enabled?: boolean;
|
|
92
|
+
retention_days?: number | null;
|
|
93
|
+
trigger_actions?: AutomaticTriggerAction[];
|
|
94
|
+
id: number;
|
|
95
|
+
$modelClass: import('objection').ModelClass<AutomaticTrigger>;
|
|
96
|
+
QueryBuilderType: import('objection').QueryBuilder<AutomaticTrigger, AutomaticTrigger[]>;
|
|
97
|
+
}>;
|
|
98
|
+
declare function updateAutomaticTrigger(ctx: RequestContext, id: number, data: UpdateAutomaticTriggerData): Promise<AutomaticTrigger | {
|
|
99
|
+
actions: {
|
|
100
|
+
project_id?: number | null | undefined;
|
|
101
|
+
retention_days?: number | null | undefined;
|
|
102
|
+
library?: boolean | undefined;
|
|
103
|
+
id: number;
|
|
104
|
+
type: "ApiAction";
|
|
105
|
+
name: string;
|
|
106
|
+
config: {
|
|
107
|
+
default?: Record<string, unknown> | undefined;
|
|
108
|
+
location?: string | undefined;
|
|
109
|
+
overridable?: string[] | undefined;
|
|
110
|
+
id: string;
|
|
111
|
+
} & {
|
|
112
|
+
payload: Record<string, unknown>;
|
|
113
|
+
};
|
|
114
|
+
}[];
|
|
115
|
+
project_id?: number | null;
|
|
116
|
+
source: import('../action-system.schema').TriggerSource;
|
|
117
|
+
target?: string | null;
|
|
118
|
+
operation?: import('../action-system.schema').TriggerOperation | null;
|
|
119
|
+
conditions?: object | null;
|
|
120
|
+
relations?: import('../action-system.schema').TriggerRelations | null;
|
|
121
|
+
enabled?: boolean;
|
|
122
|
+
retention_days?: number | null;
|
|
123
|
+
trigger_actions?: AutomaticTriggerAction[];
|
|
124
|
+
id: number;
|
|
125
|
+
$modelClass: import('objection').ModelClass<AutomaticTrigger>;
|
|
126
|
+
QueryBuilderType: import('objection').QueryBuilder<AutomaticTrigger, AutomaticTrigger[]>;
|
|
127
|
+
}>;
|
|
128
|
+
declare function removeAutomaticTrigger(ctx: RequestContext, id: number): Promise<boolean>;
|
|
129
|
+
export declare const AutomaticTriggerService: {
|
|
130
|
+
list: typeof listAutomaticTriggers;
|
|
131
|
+
getById: typeof getAutomaticTriggerById;
|
|
132
|
+
create: typeof createAutomaticTrigger;
|
|
133
|
+
update: typeof updateAutomaticTrigger;
|
|
134
|
+
remove: typeof removeAutomaticTrigger;
|
|
135
|
+
};
|
|
136
|
+
export {};
|
|
137
|
+
//# sourceMappingURL=automatic-trigger.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"automatic-trigger.service.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.service/automatic-trigger.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc,MAAM,mCAAmC,CAAA;AACnE,OAAO,EAAE,cAAc,EAAiB,MAAM,6BAA6B,CAAA;AAG3E,OAAO,EAAE,gBAAgB,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AACjF,OAAO,KAAK,EAEV,0BAA0B,EAC1B,0BAA0B,EAC3B,MAAM,yBAAyB,CAAA;AAqBhC,iBAAe,qBAAqB,CAAC,GAAG,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,UAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAa3G;AAED,iBAAe,uBAAuB,CAAC,GAAG,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,EAAE,cAAc,UAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;mCAW7F;AAMD,iBAAe,sBAAsB,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsB1F;AAyBD,iBAAe,sBAAsB,CAAC,GAAG,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,0BAA0B;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsBtG;AAED,iBAAe,sBAAsB,CAAC,GAAG,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,oBAEpE;AAED,eAAO,MAAM,uBAAuB;;;;;;CAMnC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"automatic-trigger.service.test.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.service/automatic-trigger.service.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export { ActionSystemService } from './action-system.service';
|
|
2
|
+
export { TriggerEngineService } from './trigger-engine.service';
|
|
3
|
+
export { AutomaticTriggerService } from './automatic-trigger.service';
|
|
4
|
+
export { ActionService } from './action.service';
|
|
5
|
+
export { ManualTriggerService } from './manual-trigger.service';
|
|
6
|
+
export { TriggerActionsService } from './trigger-actions.service';
|
|
7
|
+
export { ManualTriggerEngineService } from './manual-trigger-engine.service';
|
|
8
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.service/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,mBAAmB,EAAE,MAAM,yBAAyB,CAAA;AAC7D,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,EAAE,uBAAuB,EAAE,MAAM,6BAA6B,CAAA;AACrE,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAA;AAChD,OAAO,EAAE,oBAAoB,EAAE,MAAM,0BAA0B,CAAA;AAC/D,OAAO,EAAE,qBAAqB,EAAE,MAAM,2BAA2B,CAAA;AACjE,OAAO,EAAE,0BAA0B,EAAE,MAAM,iCAAiC,CAAA"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import { default as RequestContext } from '../../../../../models/request/RequestContext';
|
|
2
|
+
import { ManualTrigger } from '../action-system.model';
|
|
3
|
+
import { ManualTriggerAvailability, ManualTriggerAvailabilityQuery, TriggerExecutionResult, TriggerSource } from '../action-system.schema';
|
|
4
|
+
/**
|
|
5
|
+
* Enabled manual triggers bound to (`source`, `target`) in the current project.
|
|
6
|
+
* Plain equality on the three columns: there is no NULL wildcard here, `target`
|
|
7
|
+
* is NOT NULL. Actions eager-loaded in `execution_order`.
|
|
8
|
+
*/
|
|
9
|
+
declare function resolveManualTriggers(ctx: RequestContext, source: TriggerSource, target: string): Promise<ManualTrigger[]>;
|
|
10
|
+
/**
|
|
11
|
+
* Applicable triggers with their `conditions` already evaluated. Writes no
|
|
12
|
+
* `process_log` row — it runs on every render. Context is built per trigger
|
|
13
|
+
* because `relations` is a per-trigger column.
|
|
14
|
+
*
|
|
15
|
+
* Only what the consumer is going to paint travels: a trigger whose conditions
|
|
16
|
+
* do not hold and whose `config.unmatchedBehavior` is `hide` is dropped here,
|
|
17
|
+
* before its style is resolved — a button nobody will see does not pay for its
|
|
18
|
+
* own presentation. What survives with `matched: false` is therefore always a
|
|
19
|
+
* button shown disabled.
|
|
20
|
+
*/
|
|
21
|
+
declare function listAvailable(ctx: RequestContext, query: ManualTriggerAvailabilityQuery): Promise<ManualTriggerAvailability[]>;
|
|
22
|
+
/**
|
|
23
|
+
* Runs one trigger against an entity. Conditions are re-evaluated here: the
|
|
24
|
+
* listing is a UI aid, never the authorisation. `source`/`target` come from the
|
|
25
|
+
* row, so a caller cannot re-point it at another entity.
|
|
26
|
+
*/
|
|
27
|
+
declare function runManualTrigger(ctx: RequestContext, id: number, entityId: number, now?: Date): Promise<TriggerExecutionResult>;
|
|
28
|
+
export declare const ManualTriggerEngineService: {
|
|
29
|
+
listAvailable: typeof listAvailable;
|
|
30
|
+
run: typeof runManualTrigger;
|
|
31
|
+
resolveManualTriggers: typeof resolveManualTriggers;
|
|
32
|
+
};
|
|
33
|
+
export {};
|
|
34
|
+
//# sourceMappingURL=manual-trigger-engine.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manual-trigger-engine.service.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.service/manual-trigger-engine.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,cAAc,MAAM,mCAAmC,CAAA;AAInE,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAEtD,OAAO,EACL,KAAK,yBAAyB,EAC9B,KAAK,8BAA8B,EACnC,KAAK,sBAAsB,EAC3B,KAAK,aAAa,EAEnB,MAAM,yBAAyB,CAAA;AAOhC;;;;GAIG;AACH,iBAAe,qBAAqB,CAClC,GAAG,EAAE,cAAc,EACnB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,MAAM,GACb,OAAO,CAAC,aAAa,EAAE,CAAC,CAS1B;AAoBD;;;;;;;;;;GAUG;AACH,iBAAe,aAAa,CAC1B,GAAG,EAAE,cAAc,EACnB,KAAK,EAAE,8BAA8B,GACpC,OAAO,CAAC,yBAAyB,EAAE,CAAC,CAqCtC;AAED;;;;GAIG;AACH,iBAAe,gBAAgB,CAC7B,GAAG,EAAE,cAAc,EACnB,EAAE,EAAE,MAAM,EACV,QAAQ,EAAE,MAAM,EAChB,GAAG,GAAE,IAAiB,GACrB,OAAO,CAAC,sBAAsB,CAAC,CA4CjC;AAED,eAAO,MAAM,0BAA0B;;;;CAItC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manual-trigger-engine.service.test.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.service/manual-trigger-engine.service.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,179 @@
|
|
|
1
|
+
import { default as RequestContext } from '../../../../../models/request/RequestContext';
|
|
2
|
+
import { PaginatedQuery } from '../../../global/pagination';
|
|
3
|
+
import { ManualTrigger } from '../action-system.model';
|
|
4
|
+
import { CreateManualTriggerData, UpdateManualTriggerData } from '../action-system.schema';
|
|
5
|
+
declare function listManualTriggers(ctx: RequestContext, pagination: PaginatedQuery, includeActions?: boolean): Promise<import('objection').Page<ManualTrigger> | {
|
|
6
|
+
results: ({
|
|
7
|
+
enabled?: boolean | undefined;
|
|
8
|
+
project_id?: number | null | undefined;
|
|
9
|
+
conditions?: object | null | undefined;
|
|
10
|
+
config?: {
|
|
11
|
+
unmatchedBehavior?: "hide" | "disable" | undefined;
|
|
12
|
+
styles?: {
|
|
13
|
+
text?: string | undefined;
|
|
14
|
+
icon?: string | undefined;
|
|
15
|
+
textColor?: string | undefined;
|
|
16
|
+
bgColor?: string | undefined;
|
|
17
|
+
iconPosition?: "left" | "right" | undefined;
|
|
18
|
+
} | undefined;
|
|
19
|
+
conditionalStyles?: ({
|
|
20
|
+
text?: string | undefined;
|
|
21
|
+
icon?: string | undefined;
|
|
22
|
+
textColor?: string | undefined;
|
|
23
|
+
bgColor?: string | undefined;
|
|
24
|
+
iconPosition?: "left" | "right" | undefined;
|
|
25
|
+
} & {
|
|
26
|
+
conditions?: object | null | undefined;
|
|
27
|
+
continueEvaluate?: boolean | undefined;
|
|
28
|
+
})[] | undefined;
|
|
29
|
+
} | null | undefined;
|
|
30
|
+
retention_days?: number | null | undefined;
|
|
31
|
+
relations?: {
|
|
32
|
+
join?: string[] | undefined;
|
|
33
|
+
} | null | undefined;
|
|
34
|
+
id: number;
|
|
35
|
+
name: string;
|
|
36
|
+
target: string;
|
|
37
|
+
source: "model" | "designer" | "displayer";
|
|
38
|
+
} & {
|
|
39
|
+
actions?: {
|
|
40
|
+
project_id?: number | null | undefined;
|
|
41
|
+
retention_days?: number | null | undefined;
|
|
42
|
+
library?: boolean | undefined;
|
|
43
|
+
id: number;
|
|
44
|
+
type: "ApiAction";
|
|
45
|
+
name: string;
|
|
46
|
+
config: {
|
|
47
|
+
default?: Record<string, unknown> | undefined;
|
|
48
|
+
location?: string | undefined;
|
|
49
|
+
overridable?: string[] | undefined;
|
|
50
|
+
id: string;
|
|
51
|
+
} & {
|
|
52
|
+
payload: Record<string, unknown>;
|
|
53
|
+
};
|
|
54
|
+
}[] | undefined;
|
|
55
|
+
})[];
|
|
56
|
+
total: number;
|
|
57
|
+
}>;
|
|
58
|
+
declare function getManualTriggerById(ctx: RequestContext, id: number, includeActions?: boolean): Promise<({
|
|
59
|
+
enabled?: boolean | undefined;
|
|
60
|
+
project_id?: number | null | undefined;
|
|
61
|
+
conditions?: object | null | undefined;
|
|
62
|
+
config?: {
|
|
63
|
+
unmatchedBehavior?: "hide" | "disable" | undefined;
|
|
64
|
+
styles?: {
|
|
65
|
+
text?: string | undefined;
|
|
66
|
+
icon?: string | undefined;
|
|
67
|
+
textColor?: string | undefined;
|
|
68
|
+
bgColor?: string | undefined;
|
|
69
|
+
iconPosition?: "left" | "right" | undefined;
|
|
70
|
+
} | undefined;
|
|
71
|
+
conditionalStyles?: ({
|
|
72
|
+
text?: string | undefined;
|
|
73
|
+
icon?: string | undefined;
|
|
74
|
+
textColor?: string | undefined;
|
|
75
|
+
bgColor?: string | undefined;
|
|
76
|
+
iconPosition?: "left" | "right" | undefined;
|
|
77
|
+
} & {
|
|
78
|
+
conditions?: object | null | undefined;
|
|
79
|
+
continueEvaluate?: boolean | undefined;
|
|
80
|
+
})[] | undefined;
|
|
81
|
+
} | null | undefined;
|
|
82
|
+
retention_days?: number | null | undefined;
|
|
83
|
+
relations?: {
|
|
84
|
+
join?: string[] | undefined;
|
|
85
|
+
} | null | undefined;
|
|
86
|
+
id: number;
|
|
87
|
+
name: string;
|
|
88
|
+
target: string;
|
|
89
|
+
source: "model" | "designer" | "displayer";
|
|
90
|
+
} & {
|
|
91
|
+
actions?: {
|
|
92
|
+
project_id?: number | null | undefined;
|
|
93
|
+
retention_days?: number | null | undefined;
|
|
94
|
+
library?: boolean | undefined;
|
|
95
|
+
id: number;
|
|
96
|
+
type: "ApiAction";
|
|
97
|
+
name: string;
|
|
98
|
+
config: {
|
|
99
|
+
default?: Record<string, unknown> | undefined;
|
|
100
|
+
location?: string | undefined;
|
|
101
|
+
overridable?: string[] | undefined;
|
|
102
|
+
id: string;
|
|
103
|
+
} & {
|
|
104
|
+
payload: Record<string, unknown>;
|
|
105
|
+
};
|
|
106
|
+
}[] | undefined;
|
|
107
|
+
}) | ManualTrigger | undefined>;
|
|
108
|
+
declare function createManualTrigger(ctx: RequestContext, data: CreateManualTriggerData): Promise<ManualTrigger | {
|
|
109
|
+
actions: {
|
|
110
|
+
project_id?: number | null | undefined;
|
|
111
|
+
retention_days?: number | null | undefined;
|
|
112
|
+
library?: boolean | undefined;
|
|
113
|
+
id: number;
|
|
114
|
+
type: "ApiAction";
|
|
115
|
+
name: string;
|
|
116
|
+
config: {
|
|
117
|
+
default?: Record<string, unknown> | undefined;
|
|
118
|
+
location?: string | undefined;
|
|
119
|
+
overridable?: string[] | undefined;
|
|
120
|
+
id: string;
|
|
121
|
+
} & {
|
|
122
|
+
payload: Record<string, unknown>;
|
|
123
|
+
};
|
|
124
|
+
}[];
|
|
125
|
+
project_id?: number | null;
|
|
126
|
+
name: string;
|
|
127
|
+
source: import('../action-system.schema').TriggerSource;
|
|
128
|
+
target: string;
|
|
129
|
+
conditions?: object | null;
|
|
130
|
+
relations?: import('../action-system.schema').TriggerRelations | null;
|
|
131
|
+
enabled?: boolean;
|
|
132
|
+
retention_days?: number | null;
|
|
133
|
+
config?: import('../action-system.schema').ManualTriggerConfigData | null;
|
|
134
|
+
trigger_actions?: import('../action-system.model').ManualTriggerAction[];
|
|
135
|
+
id: number;
|
|
136
|
+
$modelClass: import('objection').ModelClass<ManualTrigger>;
|
|
137
|
+
QueryBuilderType: import('objection').QueryBuilder<ManualTrigger, ManualTrigger[]>;
|
|
138
|
+
}>;
|
|
139
|
+
declare function updateManualTrigger(ctx: RequestContext, id: number, data: UpdateManualTriggerData): Promise<ManualTrigger | {
|
|
140
|
+
actions: {
|
|
141
|
+
project_id?: number | null | undefined;
|
|
142
|
+
retention_days?: number | null | undefined;
|
|
143
|
+
library?: boolean | undefined;
|
|
144
|
+
id: number;
|
|
145
|
+
type: "ApiAction";
|
|
146
|
+
name: string;
|
|
147
|
+
config: {
|
|
148
|
+
default?: Record<string, unknown> | undefined;
|
|
149
|
+
location?: string | undefined;
|
|
150
|
+
overridable?: string[] | undefined;
|
|
151
|
+
id: string;
|
|
152
|
+
} & {
|
|
153
|
+
payload: Record<string, unknown>;
|
|
154
|
+
};
|
|
155
|
+
}[];
|
|
156
|
+
project_id?: number | null;
|
|
157
|
+
name: string;
|
|
158
|
+
source: import('../action-system.schema').TriggerSource;
|
|
159
|
+
target: string;
|
|
160
|
+
conditions?: object | null;
|
|
161
|
+
relations?: import('../action-system.schema').TriggerRelations | null;
|
|
162
|
+
enabled?: boolean;
|
|
163
|
+
retention_days?: number | null;
|
|
164
|
+
config?: import('../action-system.schema').ManualTriggerConfigData | null;
|
|
165
|
+
trigger_actions?: import('../action-system.model').ManualTriggerAction[];
|
|
166
|
+
id: number;
|
|
167
|
+
$modelClass: import('objection').ModelClass<ManualTrigger>;
|
|
168
|
+
QueryBuilderType: import('objection').QueryBuilder<ManualTrigger, ManualTrigger[]>;
|
|
169
|
+
}>;
|
|
170
|
+
declare function removeManualTrigger(ctx: RequestContext, id: number): Promise<boolean>;
|
|
171
|
+
export declare const ManualTriggerService: {
|
|
172
|
+
list: typeof listManualTriggers;
|
|
173
|
+
getById: typeof getManualTriggerById;
|
|
174
|
+
create: typeof createManualTrigger;
|
|
175
|
+
update: typeof updateManualTrigger;
|
|
176
|
+
remove: typeof removeManualTrigger;
|
|
177
|
+
};
|
|
178
|
+
export {};
|
|
179
|
+
//# sourceMappingURL=manual-trigger.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manual-trigger.service.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.service/manual-trigger.service.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,cAAc,MAAM,mCAAmC,CAAA;AACnE,OAAO,EAAE,cAAc,EAAiB,MAAM,6BAA6B,CAAA;AAG3E,OAAO,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AACtD,OAAO,KAAK,EACV,uBAAuB,EAEvB,uBAAuB,EACxB,MAAM,yBAAyB,CAAA;AAiBhC,iBAAe,kBAAkB,CAAC,GAAG,EAAE,cAAc,EAAE,UAAU,EAAE,cAAc,EAAE,cAAc,UAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAWxG;AAED,iBAAe,oBAAoB,CAAC,GAAG,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,EAAE,cAAc,UAAQ;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;gCAW1F;AAID,iBAAe,mBAAmB,CAAC,GAAG,EAAE,cAAc,EAAE,IAAI,EAAE,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAsBpF;AAyBD,iBAAe,mBAAmB,CAAC,GAAG,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,uBAAuB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAqBhG;AAED,iBAAe,mBAAmB,CAAC,GAAG,EAAE,cAAc,EAAE,EAAE,EAAE,MAAM,oBAEjE;AAED,eAAO,MAAM,oBAAoB;;;;;;CAMhC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manual-trigger.service.test.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.service/manual-trigger.service.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import { Knex } from 'knex';
|
|
2
|
+
import { default as RequestContext } from '../../../../../models/request/RequestContext';
|
|
3
|
+
import { AutomaticTriggerAction, ManualTriggerAction } from '../action-system.model';
|
|
4
|
+
import { ActionData, TriggerActionInput } from '../action-system.schema';
|
|
5
|
+
/**
|
|
6
|
+
* Reads an id `loadOwnedActions` has already vouched for. A lookup and not a
|
|
7
|
+
* cast: if that guard ever regresses this is a 404, not an `undefined` row
|
|
8
|
+
* travelling on as an action.
|
|
9
|
+
*/
|
|
10
|
+
declare function ownedOrThrow(owned: Map<number, ActionData>, id: number): ActionData;
|
|
11
|
+
/**
|
|
12
|
+
* Resolves the three item forms (see `triggerActionInputSchema`) into the catalog
|
|
13
|
+
* rows to link, in order, creating and updating as it goes. Runs inside the
|
|
14
|
+
* caller's transaction.
|
|
15
|
+
*/
|
|
16
|
+
declare function materializeActions(ctx: RequestContext, trx: Knex.Transaction, items: TriggerActionInput[]): Promise<ActionData[]>;
|
|
17
|
+
/**
|
|
18
|
+
* Rewrites the ordered link set inside the caller's transaction. Separate from
|
|
19
|
+
* the endpoint below so create/update can reuse it without opening a second one.
|
|
20
|
+
*/
|
|
21
|
+
declare function writeAutomaticTriggerLinks(ctx: RequestContext, trx: Knex.Transaction, triggerId: number, actionIds: number[]): Promise<AutomaticTriggerAction[]>;
|
|
22
|
+
/** Manual counterpart of `writeAutomaticTriggerLinks`. */
|
|
23
|
+
declare function writeManualTriggerLinks(ctx: RequestContext, trx: Knex.Transaction, triggerId: number, actionIds: number[]): Promise<ManualTriggerAction[]>;
|
|
24
|
+
export declare const TriggerActionsService: {
|
|
25
|
+
materializeActions: typeof materializeActions;
|
|
26
|
+
ownedOrThrow: typeof ownedOrThrow;
|
|
27
|
+
writeAutomaticTriggerLinks: typeof writeAutomaticTriggerLinks;
|
|
28
|
+
writeManualTriggerLinks: typeof writeManualTriggerLinks;
|
|
29
|
+
};
|
|
30
|
+
export {};
|
|
31
|
+
//# sourceMappingURL=trigger-actions.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger-actions.service.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.service/trigger-actions.service.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,IAAI,EAAE,MAAM,MAAM,CAAA;AAChC,OAAO,KAAK,cAAc,MAAM,mCAAmC,CAAA;AAInE,OAAO,EAIL,sBAAsB,EACtB,mBAAmB,EACpB,MAAM,wBAAwB,CAAA;AAC/B,OAAO,KAAK,EAAE,UAAU,EAAE,kBAAkB,EAAE,MAAM,yBAAyB,CAAA;AAwD7E;;;;GAIG;AACH,iBAAS,YAAY,CAAC,KAAK,EAAE,GAAG,CAAC,MAAM,EAAE,UAAU,CAAC,EAAE,EAAE,EAAE,MAAM,GAAG,UAAU,CAO5E;AAED;;;;GAIG;AACH,iBAAe,kBAAkB,CAC/B,GAAG,EAAE,cAAc,EACnB,GAAG,EAAE,IAAI,CAAC,WAAW,EACrB,KAAK,EAAE,kBAAkB,EAAE,GAC1B,OAAO,CAAC,UAAU,EAAE,CAAC,CAiCvB;AA8CD;;;GAGG;AACH,iBAAe,0BAA0B,CACvC,GAAG,EAAE,cAAc,EACnB,GAAG,EAAE,IAAI,CAAC,WAAW,EACrB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EAAE,qCAWpB;AAED,0DAA0D;AAC1D,iBAAe,uBAAuB,CACpC,GAAG,EAAE,cAAc,EACnB,GAAG,EAAE,IAAI,CAAC,WAAW,EACrB,SAAS,EAAE,MAAM,EACjB,SAAS,EAAE,MAAM,EAAE,kCASpB;AAED,eAAO,MAAM,qBAAqB;;;;;CAKjC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger-actions.service.test.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.service/trigger-actions.service.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
import { default as RequestContext } from '../../../../../models/request/RequestContext';
|
|
2
|
+
import { ApiActionContextData } from '../../../../../schemas/api_action/ApiActionTypes';
|
|
3
|
+
import { EvaluableTrigger, TriggerBatch, TriggerExecutionResult, TriggerRelations, TriggerSource } from '../action-system.schema';
|
|
4
|
+
/**
|
|
5
|
+
* Assembles the context that conditions and action payloads are evaluated
|
|
6
|
+
* against: the trigger's declared relations are loaded onto `current` ONCE,
|
|
7
|
+
* before evaluating, so a condition on `current.patient.x` and an action
|
|
8
|
+
* templating `{{current.patient.x}}` see the same data.
|
|
9
|
+
*
|
|
10
|
+
* A relation that cannot be loaded never aborts the evaluation — the reason is
|
|
11
|
+
* returned as `relationsSkipped` for the caller to record, and the trigger is
|
|
12
|
+
* evaluated with whatever context it has.
|
|
13
|
+
*
|
|
14
|
+
* `requester` describes the user the request comes from, so a condition can ask what
|
|
15
|
+
* they are — a doctor, someone of a given clinic — and not only what the entity holds.
|
|
16
|
+
* It is part of the one context, not a second one: the conditions and the templates of
|
|
17
|
+
* an action read the same object, so neither can ever see data the other does not.
|
|
18
|
+
*/
|
|
19
|
+
export declare function buildTriggerContext(ctx: RequestContext, source: TriggerSource, target: string | null | undefined, current: Record<string, unknown>, old: Record<string, unknown> | null, relations?: TriggerRelations | null): Promise<{
|
|
20
|
+
context: ApiActionContextData;
|
|
21
|
+
relationsSkipped?: string;
|
|
22
|
+
}>;
|
|
23
|
+
/**
|
|
24
|
+
* Evaluates a trigger's jsonLogic conditions against the assembled context. A
|
|
25
|
+
* trigger with no `conditions` always matches. Exposed on its own (not only
|
|
26
|
+
* through `runTriggerBatch`) so a caller can evaluate a trigger without writing
|
|
27
|
+
* a `process_log` row.
|
|
28
|
+
*/
|
|
29
|
+
export declare function evaluateConditions(context: ApiActionContextData, trigger: Pick<EvaluableTrigger, 'id' | 'conditions'>): Promise<boolean>;
|
|
30
|
+
/**
|
|
31
|
+
* Executes the ordered actions of a matched trigger, one `process_log` row each.
|
|
32
|
+
*
|
|
33
|
+
* A context mismatch aborts that action only, never the rest. Retention: an action with `null`
|
|
34
|
+
* inherits the trigger's, `0` means never — so the two are not interchangeable.
|
|
35
|
+
*/
|
|
36
|
+
export declare function executeTriggerActions(ctx: RequestContext, trigger: EvaluableTrigger, context: ApiActionContextData, now: Date): Promise<{
|
|
37
|
+
actionsRun: number;
|
|
38
|
+
actionsAborted: number;
|
|
39
|
+
}>;
|
|
40
|
+
/**
|
|
41
|
+
* Runs a batch of already-resolved trigger candidates: per trigger, assembles
|
|
42
|
+
* the context, evaluates the conditions, records a trigger-level process_log row
|
|
43
|
+
* for every evaluation, and runs the ordered actions of the ones that matched.
|
|
44
|
+
* A failing trigger is caught and logged as an error without aborting the rest
|
|
45
|
+
* of the batch.
|
|
46
|
+
*
|
|
47
|
+
* `now` is threaded through the whole batch rather than read again per row, so
|
|
48
|
+
* every `expires_at` it computes shares a single timestamp.
|
|
49
|
+
*/
|
|
50
|
+
export declare function runTriggerBatch(ctx: RequestContext, batch: TriggerBatch, now: Date): Promise<TriggerExecutionResult[]>;
|
|
51
|
+
export declare const TriggerEngineService: {
|
|
52
|
+
buildTriggerContext: typeof buildTriggerContext;
|
|
53
|
+
evaluateConditions: typeof evaluateConditions;
|
|
54
|
+
executeTriggerActions: typeof executeTriggerActions;
|
|
55
|
+
runTriggerBatch: typeof runTriggerBatch;
|
|
56
|
+
};
|
|
57
|
+
//# sourceMappingURL=trigger-engine.service.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger-engine.service.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.service/trigger-engine.service.ts"],"names":[],"mappings":"AAAA,OAAO,cAAc,MAAM,mCAAmC,CAAA;AAI9D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAGjF,OAAO,EAKL,KAAK,gBAAgB,EACrB,KAAK,YAAY,EACjB,KAAK,sBAAsB,EAC3B,KAAK,gBAAgB,EACrB,KAAK,aAAa,EACnB,MAAM,yBAAyB,CAAA;AAoBhC;;;;;;;;;;;;;;GAcG;AACH,wBAAsB,mBAAmB,CACvC,GAAG,EAAE,cAAc,EACnB,MAAM,EAAE,aAAa,EACrB,MAAM,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EACjC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAChC,GAAG,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,GAAG,IAAI,EACnC,SAAS,CAAC,EAAE,gBAAgB,GAAG,IAAI,GAClC,OAAO,CAAC;IAAE,OAAO,EAAE,oBAAoB,CAAC;IAAC,gBAAgB,CAAC,EAAE,MAAM,CAAA;CAAE,CAAC,CAavE;AAED;;;;;GAKG;AACH,wBAAsB,kBAAkB,CACtC,OAAO,EAAE,oBAAoB,EAC7B,OAAO,EAAE,IAAI,CAAC,gBAAgB,EAAE,IAAI,GAAG,YAAY,CAAC,GACnD,OAAO,CAAC,OAAO,CAAC,CAIlB;AAiDD;;;;;GAKG;AACH,wBAAsB,qBAAqB,CACzC,GAAG,EAAE,cAAc,EACnB,OAAO,EAAE,gBAAgB,EACzB,OAAO,EAAE,oBAAoB,EAC7B,GAAG,EAAE,IAAI,GACR,OAAO,CAAC;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,cAAc,EAAE,MAAM,CAAA;CAAE,CAAC,CA2CzD;AAID;;;;;;;;;GASG;AACH,wBAAsB,eAAe,CACnC,GAAG,EAAE,cAAc,EACnB,KAAK,EAAE,YAAY,EACnB,GAAG,EAAE,IAAI,GACR,OAAO,CAAC,sBAAsB,EAAE,CAAC,CAsDnC;AAED,eAAO,MAAM,oBAAoB;;;;;CAKhC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"trigger-engine.service.test.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.service/trigger-engine.service.test.ts"],"names":[],"mappings":""}
|