@persei/perseed-api 5.0.18 → 5.0.20
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 +780 -71
- package/dist/client.cjs.map +1 -1
- package/dist/client.mjs +781 -72
- package/dist/client.mjs.map +1 -1
- package/dist/ecosystem-action-system.cjs +506 -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 +506 -0
- package/dist/ecosystem-action-system.mjs.map +1 -0
- package/dist/ecosystem-container-widget.cjs +4 -3
- package/dist/ecosystem-container-widget.cjs.map +1 -1
- package/dist/ecosystem-container-widget.mjs +4 -3
- package/dist/ecosystem-container-widget.mjs.map +1 -1
- 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 +4742 -678
- 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.map +1 -1
- package/dist/src/Services/ProjectService.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 +37 -1
- package/dist/src/controllers/AuthController.d.ts.map +1 -1
- package/dist/src/controllers/FormController.d.ts.map +1 -1
- package/dist/src/controllers/thryve-credentials-crypto.d.ts +25 -0
- package/dist/src/controllers/thryve-credentials-crypto.d.ts.map +1 -0
- package/dist/src/controllers/thryve-credentials-crypto.test.d.ts +2 -0
- package/dist/src/controllers/thryve-credentials-crypto.test.d.ts.map +1 -0
- 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/ProcessLog.d.ts +11 -0
- package/dist/src/models/ecosystem/ProcessLog.d.ts.map +1 -1
- package/dist/src/models/ecosystem/ProcessLog.test.d.ts +2 -0
- package/dist/src/models/ecosystem/ProcessLog.test.d.ts.map +1 -0
- 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/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/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 +127 -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 +4 -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.model.d.ts +121 -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 +579 -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 +28 -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 +137 -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 +52 -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/container-widget/container-widget.helper.d.ts +17 -10
- package/dist/src/v2/modules/ecosystem/container-widget/container-widget.helper.d.ts.map +1 -1
- 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.service.d.ts +2 -2
- 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 +27 -3
- 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
|
@@ -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,28 @@
|
|
|
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
|
+
declare function listAvailable(ctx: RequestContext, query: ManualTriggerAvailabilityQuery): Promise<ManualTriggerAvailability[]>;
|
|
16
|
+
/**
|
|
17
|
+
* Runs one trigger against an entity. Conditions are re-evaluated here: the
|
|
18
|
+
* listing is a UI aid, never the authorisation. `source`/`target` come from the
|
|
19
|
+
* row, so a caller cannot re-point it at another entity.
|
|
20
|
+
*/
|
|
21
|
+
declare function runManualTrigger(ctx: RequestContext, id: number, entityId: number, now?: Date): Promise<TriggerExecutionResult>;
|
|
22
|
+
export declare const ManualTriggerEngineService: {
|
|
23
|
+
listAvailable: typeof listAvailable;
|
|
24
|
+
run: typeof runManualTrigger;
|
|
25
|
+
resolveManualTriggers: typeof resolveManualTriggers;
|
|
26
|
+
};
|
|
27
|
+
export {};
|
|
28
|
+
//# 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,KAAK,EACV,yBAAyB,EACzB,8BAA8B,EAC9B,sBAAsB,EACtB,aAAa,EACd,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;;;;GAIG;AACH,iBAAe,aAAa,CAC1B,GAAG,EAAE,cAAc,EACnB,KAAK,EAAE,8BAA8B,GACpC,OAAO,CAAC,yBAAyB,EAAE,CAAC,CA4BtC;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,137 @@
|
|
|
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
|
+
retention_days?: number | null | undefined;
|
|
11
|
+
relations?: {
|
|
12
|
+
join?: string[] | undefined;
|
|
13
|
+
} | null | undefined;
|
|
14
|
+
id: number;
|
|
15
|
+
name: string;
|
|
16
|
+
target: string;
|
|
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 getManualTriggerById(ctx: RequestContext, id: number, includeActions?: boolean): Promise<({
|
|
39
|
+
enabled?: boolean | undefined;
|
|
40
|
+
project_id?: number | null | undefined;
|
|
41
|
+
conditions?: object | null | undefined;
|
|
42
|
+
retention_days?: number | null | undefined;
|
|
43
|
+
relations?: {
|
|
44
|
+
join?: string[] | undefined;
|
|
45
|
+
} | null | undefined;
|
|
46
|
+
id: number;
|
|
47
|
+
name: string;
|
|
48
|
+
target: string;
|
|
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
|
+
}) | ManualTrigger | undefined>;
|
|
68
|
+
declare function createManualTrigger(ctx: RequestContext, data: CreateManualTriggerData): Promise<ManualTrigger | {
|
|
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
|
+
name: string;
|
|
87
|
+
source: import('../action-system.schema').TriggerSource;
|
|
88
|
+
target: string;
|
|
89
|
+
conditions?: object | null;
|
|
90
|
+
relations?: import('../action-system.schema').TriggerRelations | null;
|
|
91
|
+
enabled?: boolean;
|
|
92
|
+
retention_days?: number | null;
|
|
93
|
+
trigger_actions?: import('../action-system.model').ManualTriggerAction[];
|
|
94
|
+
id: number;
|
|
95
|
+
$modelClass: import('objection').ModelClass<ManualTrigger>;
|
|
96
|
+
QueryBuilderType: import('objection').QueryBuilder<ManualTrigger, ManualTrigger[]>;
|
|
97
|
+
}>;
|
|
98
|
+
declare function updateManualTrigger(ctx: RequestContext, id: number, data: UpdateManualTriggerData): Promise<ManualTrigger | {
|
|
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
|
+
name: string;
|
|
117
|
+
source: import('../action-system.schema').TriggerSource;
|
|
118
|
+
target: string;
|
|
119
|
+
conditions?: object | null;
|
|
120
|
+
relations?: import('../action-system.schema').TriggerRelations | null;
|
|
121
|
+
enabled?: boolean;
|
|
122
|
+
retention_days?: number | null;
|
|
123
|
+
trigger_actions?: import('../action-system.model').ManualTriggerAction[];
|
|
124
|
+
id: number;
|
|
125
|
+
$modelClass: import('objection').ModelClass<ManualTrigger>;
|
|
126
|
+
QueryBuilderType: import('objection').QueryBuilder<ManualTrigger, ManualTrigger[]>;
|
|
127
|
+
}>;
|
|
128
|
+
declare function removeManualTrigger(ctx: RequestContext, id: number): Promise<boolean>;
|
|
129
|
+
export declare const ManualTriggerService: {
|
|
130
|
+
list: typeof listManualTriggers;
|
|
131
|
+
getById: typeof getManualTriggerById;
|
|
132
|
+
create: typeof createManualTrigger;
|
|
133
|
+
update: typeof updateManualTrigger;
|
|
134
|
+
remove: typeof removeManualTrigger;
|
|
135
|
+
};
|
|
136
|
+
export {};
|
|
137
|
+
//# 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,52 @@
|
|
|
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
|
+
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<{
|
|
15
|
+
context: ApiActionContextData;
|
|
16
|
+
relationsSkipped?: string;
|
|
17
|
+
}>;
|
|
18
|
+
/**
|
|
19
|
+
* Evaluates a trigger's jsonLogic conditions against the assembled context. A
|
|
20
|
+
* trigger with no `conditions` always matches. Exposed on its own (not only
|
|
21
|
+
* through `runTriggerBatch`) so a caller can evaluate a trigger without writing
|
|
22
|
+
* a `process_log` row.
|
|
23
|
+
*/
|
|
24
|
+
export declare function evaluateConditions(context: ApiActionContextData, trigger: Pick<EvaluableTrigger, 'id' | 'conditions'>): Promise<boolean>;
|
|
25
|
+
/**
|
|
26
|
+
* Executes the ordered actions of a matched trigger, one `process_log` row each.
|
|
27
|
+
*
|
|
28
|
+
* A context mismatch aborts that action only, never the rest. Retention: an action with `null`
|
|
29
|
+
* inherits the trigger's, `0` means never — so the two are not interchangeable.
|
|
30
|
+
*/
|
|
31
|
+
export declare function executeTriggerActions(ctx: RequestContext, trigger: EvaluableTrigger, context: ApiActionContextData, now: Date): Promise<{
|
|
32
|
+
actionsRun: number;
|
|
33
|
+
actionsAborted: number;
|
|
34
|
+
}>;
|
|
35
|
+
/**
|
|
36
|
+
* Runs a batch of already-resolved trigger candidates: per trigger, assembles
|
|
37
|
+
* the context, evaluates the conditions, records a trigger-level process_log row
|
|
38
|
+
* for every evaluation, and runs the ordered actions of the ones that matched.
|
|
39
|
+
* A failing trigger is caught and logged as an error without aborting the rest
|
|
40
|
+
* of the batch.
|
|
41
|
+
*
|
|
42
|
+
* `now` is threaded through the whole batch rather than read again per row, so
|
|
43
|
+
* every `expires_at` it computes shares a single timestamp.
|
|
44
|
+
*/
|
|
45
|
+
export declare function runTriggerBatch(ctx: RequestContext, batch: TriggerBatch, now: Date): Promise<TriggerExecutionResult[]>;
|
|
46
|
+
export declare const TriggerEngineService: {
|
|
47
|
+
buildTriggerContext: typeof buildTriggerContext;
|
|
48
|
+
evaluateConditions: typeof evaluateConditions;
|
|
49
|
+
executeTriggerActions: typeof executeTriggerActions;
|
|
50
|
+
runTriggerBatch: typeof runTriggerBatch;
|
|
51
|
+
};
|
|
52
|
+
//# 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;AAmBhC;;;;;;;;;GASG;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,CAYvE;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":""}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export { ActionSystemService, TriggerEngineService, AutomaticTriggerService, ActionService, ManualTriggerService, TriggerActionsService, ManualTriggerEngineService, } from './action-system.service';
|
|
2
|
+
export { ConditionsFormat, TriggerOperation, TriggerSource } from './action-system.schema';
|
|
3
|
+
export { conditionsMatch } from './action-system.helper';
|
|
4
|
+
export type { ActionEvent, EvaluableTrigger, TriggerBatch, TriggerExecutionResult } from './action-system.schema';
|
|
5
|
+
export { ActionSystemController } from './action-system.controller';
|
|
6
|
+
//# sourceMappingURL=index.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/ecosystem/action-system/index.ts"],"names":[],"mappings":"AAAA,OAAO,EACL,mBAAmB,EACnB,oBAAoB,EACpB,uBAAuB,EACvB,aAAa,EACb,oBAAoB,EACpB,qBAAqB,EACrB,0BAA0B,GAC3B,MAAM,yBAAyB,CAAA;AAChC,OAAO,EAAE,gBAAgB,EAAE,gBAAgB,EAAE,aAAa,EAAE,MAAM,wBAAwB,CAAA;AAC1F,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAA;AACxD,YAAY,EAAE,WAAW,EAAE,gBAAgB,EAAE,YAAY,EAAE,sBAAsB,EAAE,MAAM,wBAAwB,CAAA;AACjH,OAAO,EAAE,sBAAsB,EAAE,MAAM,4BAA4B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"lib.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/ecosystem/action-system/lib.ts"],"names":[],"mappings":"AAEA,cAAc,wBAAwB,CAAA"}
|
|
@@ -11,17 +11,19 @@ import { RelativePeriodConfig, TrendWindow, TrendWindowConfig } from './containe
|
|
|
11
11
|
*/
|
|
12
12
|
/**
|
|
13
13
|
* Resolves a `from`/`to` range into a concrete, calendar-aligned window. `fromValue` and `toValue`
|
|
14
|
-
* are inclusive bucket offsets ("N units ago"), so the window covers the buckets from
|
|
15
|
-
* up to `fromValue`-ago and spans `fromValue − toValue + 1`
|
|
14
|
+
* are inclusive bucket offsets ("N units ago"), so the window covers the **complete** buckets from
|
|
15
|
+
* `toValue`-ago up to `fromValue`-ago (both ends inclusive) and spans `fromValue − toValue + 1`
|
|
16
|
+
* buckets:
|
|
16
17
|
*
|
|
17
18
|
* - `start` (inclusive) = `getPeriodStart(now − fromValue·unit)` — start of the oldest bucket.
|
|
18
|
-
* - `end` (exclusive) = `now
|
|
19
|
-
*
|
|
20
|
-
*
|
|
19
|
+
* - `end` (exclusive ms bound) = `getPeriodStart(now − (toValue − 1)·unit)` — the start of the
|
|
20
|
+
* bucket just after the newest included one, i.e. the end of the `toValue` bucket. When
|
|
21
|
+
* `toValue = 0` this is the start of the next bucket, so the current (in-progress) bucket is
|
|
22
|
+
* included in full — the window has no `now` cap, both extremes are complete buckets.
|
|
21
23
|
*
|
|
22
24
|
* Example (unit = week, weekStart = 1 Monday, now = Tue 2026-07-07):
|
|
23
|
-
* from 2, to 0 → [Mon 22 Jun,
|
|
24
|
-
* from 3, to 1 → [Mon 15 Jun, Mon 06 Jul) (3 complete weeks, current one excluded)
|
|
25
|
+
* from 2, to 0 → [Mon 22 Jun, Mon 13 Jul) (3 weeks, the current one included in full)
|
|
26
|
+
* from 3, to 1 → [Mon 15 Jun, Mon 06 Jul) (3 complete weeks, the current one excluded)
|
|
25
27
|
*/
|
|
26
28
|
export declare function resolveTrendWindow(nowMs: number, config: TrendWindowConfig, weekStart?: number, utc?: boolean): TrendWindow;
|
|
27
29
|
/**
|
|
@@ -33,11 +35,16 @@ export declare function resolveTrendWindow(nowMs: number, config: TrendWindowCon
|
|
|
33
35
|
*/
|
|
34
36
|
export declare function resolveRelativePeriod(nowMs: number, { value, unit, excludeCurrentPeriod }: RelativePeriodConfig, weekStart?: number, utc?: boolean): TrendWindow;
|
|
35
37
|
/**
|
|
36
|
-
* Resolves a count-based relative period into a formatted date range
|
|
37
|
-
* (from/to mapping + the day-level rule + formatting) in one
|
|
38
|
+
* Resolves a count-based relative period into a formatted date range for the backend health-data
|
|
39
|
+
* query, keeping the whole calculation (from/to mapping + the day-level rule + formatting) in one
|
|
40
|
+
* shared place:
|
|
38
41
|
* - `daily`: date-only `YYYY-MM-DD`; when excluding the current period the inclusive end becomes the
|
|
39
42
|
* last completed calendar day (the day before the current period's start).
|
|
40
|
-
* - `discrete`: ISO-8601
|
|
43
|
+
* - `discrete`: ISO-8601.
|
|
44
|
+
*
|
|
45
|
+
* Unlike `resolveTrendWindow` (which now covers the current bucket in full for the front display), the
|
|
46
|
+
* query end is **capped at `now`**: a data query must never reach past the present into the rest of an
|
|
47
|
+
* in-progress bucket, so `to = 0` yields "up to now", not "up to the end of the current bucket".
|
|
41
48
|
*/
|
|
42
49
|
export declare function resolveRelativeDateRange(nowMs: number, config: RelativePeriodConfig, format: 'daily' | 'discrete', weekStart?: number, utc?: boolean): {
|
|
43
50
|
start_date: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"container-widget.helper.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/ecosystem/container-widget/container-widget.helper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,WAAW,EAAE,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAE/G;;;;;;;;;GASG;AAEH
|
|
1
|
+
{"version":3,"file":"container-widget.helper.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/ecosystem/container-widget/container-widget.helper.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,KAAK,oBAAoB,EAAE,KAAK,WAAW,EAAE,KAAK,iBAAiB,EAAE,MAAM,2BAA2B,CAAA;AAE/G;;;;;;;;;GASG;AAEH;;;;;;;;;;;;;;;GAeG;AACH,wBAAgB,kBAAkB,CAChC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,iBAAiB,EACzB,SAAS,GAAE,MAAuB,EAClC,GAAG,UAAQ,GACV,WAAW,CAOb;AAED;;;;;;GAMG;AACH,wBAAgB,qBAAqB,CACnC,KAAK,EAAE,MAAM,EACb,EAAE,KAAK,EAAE,IAAI,EAAE,oBAA4B,EAAE,EAAE,oBAAoB,EACnE,SAAS,GAAE,MAAuB,EAClC,GAAG,UAAQ,GACV,WAAW,CAOb;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,wBAAwB,CACtC,KAAK,EAAE,MAAM,EACb,MAAM,EAAE,oBAAoB,EAC5B,MAAM,EAAE,OAAO,GAAG,UAAU,EAC5B,SAAS,GAAE,MAAuB,EAClC,GAAG,UAAQ,GACV;IAAE,UAAU,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAS1C"}
|
|
@@ -23,6 +23,15 @@ export declare const apiForbiddenErrorSchema: Type.TIntersect<[Type.TObject<{
|
|
|
23
23
|
statusCode: Type.TLiteral<403>;
|
|
24
24
|
error: Type.TLiteral<"forbidden-error">;
|
|
25
25
|
}>]>;
|
|
26
|
+
export declare const apiBadRequestErrorSchema: Type.TIntersect<[Type.TObject<{
|
|
27
|
+
statusCode: Type.TNumber;
|
|
28
|
+
error: Type.TString;
|
|
29
|
+
message: Type.TString;
|
|
30
|
+
debug: Type.TOptional<Type.TObject<{}>>;
|
|
31
|
+
}>, Type.TObject<{
|
|
32
|
+
statusCode: Type.TLiteral<400>;
|
|
33
|
+
error: Type.TLiteral<"bad-request">;
|
|
34
|
+
}>]>;
|
|
26
35
|
export declare const apiNotFoundAndForbiddenResponseErrors: {
|
|
27
36
|
404: Type.TIntersect<[Type.TObject<{
|
|
28
37
|
statusCode: Type.TNumber;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"api-error.schema.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/global/api-error/api-error.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE9B,eAAO,MAAM,cAAc;;;;;EAOzB,CAAA;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;IASlC,CAAA;AAED,eAAO,MAAM,uBAAuB;;;;;;;;IASnC,CAAA;AAED,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;CAGjD,CAAA"}
|
|
1
|
+
{"version":3,"file":"api-error.schema.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/global/api-error/api-error.schema.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,IAAI,EAAE,MAAM,SAAS,CAAA;AAE9B,eAAO,MAAM,cAAc;;;;;EAOzB,CAAA;AAEF,eAAO,MAAM,sBAAsB;;;;;;;;IASlC,CAAA;AAED,eAAO,MAAM,uBAAuB;;;;;;;;IASnC,CAAA;AAED,eAAO,MAAM,wBAAwB;;;;;;;;IAYpC,CAAA;AAED,eAAO,MAAM,qCAAqC;;;;;;;;;;;;;;;;;;;CAGjD,CAAA"}
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import { E2eOperationParams } from './e2e-operation.schema';
|
|
2
2
|
export interface TrxLike {
|
|
3
|
-
raw
|
|
3
|
+
raw<Row = {
|
|
4
4
|
id: number;
|
|
5
|
-
}[]]>;
|
|
5
|
+
}>(sql: string, bindings?: unknown[]): Promise<[Row[]]>;
|
|
6
6
|
}
|
|
7
7
|
export interface WorldOptions {
|
|
8
8
|
projectName?: string;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"e2e-operation.service.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/global/e2e-operation/e2e-operation.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"e2e-operation.service.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/global/e2e-operation/e2e-operation.service.ts"],"names":[],"mappings":"AAMA,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,wBAAwB,CAAA;AA4ChE,MAAM,WAAW,OAAO;IAGtB,GAAG,CAAC,GAAG,GAAG;QAAE,EAAE,EAAE,MAAM,CAAA;KAAE,EAAE,GAAG,EAAE,MAAM,EAAE,QAAQ,CAAC,EAAE,OAAO,EAAE,GAAG,OAAO,CAAC,CAAC,GAAG,EAAE,CAAC,CAAC,CAAA;CAC/E;AAKD,MAAM,WAAW,YAAY;IAC3B,WAAW,CAAC,EAAE,MAAM,CAAA;IACpB,MAAM,CAAC,EAAE,MAAM,CAAA;CAChB;AA+BD,eAAO,MAAM,aAAa,GAAU,KAAK,OAAO,EAAE,SAAS,MAAM,EAAE,OAAM,YAAiB,KAAG,OAAO,CAAC,IAAI,CAwDxG,CAAA;AAYD,eAAO,MAAM,eAAe,GAC1B,KAAK,OAAO,EACZ,SAAS,MAAM,EACf,OAAM,YAAiB,KACtB,OAAO,CAAC;IAAE,MAAM,EAAE,MAAM,CAAC;IAAC,WAAW,EAAE,MAAM,CAAC;IAAC,SAAS,EAAE,MAAM,CAAC;IAAC,QAAQ,EAAE,MAAM,CAAA;CAAE,CAmFtF,CAAA;AA8PD,eAAO,MAAM,mBAAmB;sCATQ,kBAAkB,KAAK,OAAO,CAAC,IAAI,CAAC;mBAWrD,MAAM,UAAU,kBAAkB,GAAG,OAAO,CAAC,IAAI,CAAC;CAQxE,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"request-log.middleware.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/global/request-log/request-log.middleware.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"request-log.middleware.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/global/request-log/request-log.middleware.ts"],"names":[],"mappings":"AAUA,wBAAgB,gBAAgB,CAAC,GAAG,KAAA,EAAE,KAAK,KAAA,OAG1C;AAED,eAAO,MAAM,oBAAoB,qRAuB/B,CAAA"}
|