@persei/perseed-api 5.0.19 → 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/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.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/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/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.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
|
@@ -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"}
|
|
@@ -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 +1 @@
|
|
|
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;
|
|
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"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"document.controller.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/project/document/document.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AA6O1E,eAAO,MAAM,kBAAkB;;CAE9B,CAAA;
|
|
1
|
+
{"version":3,"file":"document.controller.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/project/document/document.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AA6O1E,eAAO,MAAM,kBAAkB;;CAE9B,CAAA;AAoID,eAAO,MAAM,0BAA0B;;CAEtC,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thryve.controller.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/project/thryve/thryve.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;
|
|
1
|
+
{"version":3,"file":"thryve.controller.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/project/thryve/thryve.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AA8D1E,eAAO,MAAM,gBAAgB;;CAE5B,CAAA"}
|
|
@@ -1,9 +1,13 @@
|
|
|
1
1
|
import { default as RequestContext } from '../../../../models/request/RequestContext';
|
|
2
2
|
/**
|
|
3
|
-
* Checks
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
3
|
+
* Checks whether health data sync is enabled for the project. `SYNC_HEALTH_DATA` is the single
|
|
4
|
+
* flag governing it, both here and in the login: it covers cloud provider sync and on-device
|
|
5
|
+
* sync (Apple Health / Health Connect) alike. The value can be defined at project level (winning)
|
|
6
|
+
* or at ecosystem level as a fallback. When it is not truthy the Thryve feature is considered
|
|
7
|
+
* disabled for that project and every endpoint will return 404 to the client.
|
|
8
|
+
*
|
|
9
|
+
* The value is normalized with the same helper the login uses, so the endpoints and the login
|
|
10
|
+
* cannot disagree on whether a project has the feature enabled.
|
|
7
11
|
*
|
|
8
12
|
* Fails fast if the caller did not resolve a `projectId` — every Thryve endpoint is mounted
|
|
9
13
|
* under `/v2/ecosystem/:ecosystemName/project/:projectName/thryve/...` so the upstream middleware
|
|
@@ -24,6 +28,14 @@ declare function resolveOrCreatePartnerUserId(ctx: RequestContext): Promise<stri
|
|
|
24
28
|
/**
|
|
25
29
|
* Requests a short-lived Thryve Connection Widget URL. The caller embeds this URL in an iframe
|
|
26
30
|
* (web) or a WebView (native) so the end user can authorize their wearable sources.
|
|
31
|
+
*
|
|
32
|
+
* @deprecated The native app builds the connection widget URL itself and no longer calls this
|
|
33
|
+
* endpoint from the current version onwards. Its last consumer was the app's
|
|
34
|
+
* `CaaringThryve.initialize()`, removed when the app moved to the SDK-owned widget URL — but the
|
|
35
|
+
* app version deployed in production *before* that change still calls it in its connection flow, so
|
|
36
|
+
* it is kept for those older installed clients. Remove it (and the `/iframe-url` route) once the
|
|
37
|
+
* backend access logs for `/thryve/iframe-url` drop to zero — i.e. once the app version that stops
|
|
38
|
+
* calling it has fully propagated and no client hits it anymore.
|
|
27
39
|
*/
|
|
28
40
|
declare function getIframeUrl(ctx: RequestContext): Promise<string>;
|
|
29
41
|
/**
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"thryve.service.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/project/thryve/thryve.service.ts"],"names":[],"mappings":"AAOA,OAAO,cAAc,MAAM,mCAAmC,CAAA;
|
|
1
|
+
{"version":3,"file":"thryve.service.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/project/thryve/thryve.service.ts"],"names":[],"mappings":"AAOA,OAAO,cAAc,MAAM,mCAAmC,CAAA;AA0E9D;;;;;;;;;;;;;;GAcG;AACH,iBAAe,SAAS,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAM9D;AAoFD;;;;;;;;GAQG;AACH,iBAAe,4BAA4B,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAYhF;AAoCD;;;;;;;;;;;GAWG;AACH,iBAAe,YAAY,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,MAAM,CAAC,CAehE;AAED;;;;GAIG;AACH,iBAAe,gBAAgB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,OAAO,CAAC,CAIrE;AAED,eAAO,MAAM,aAAa;;;;;CAKzB,CAAA"}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/routes/v2/e2e/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/routes/v2/e2e/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,kBAAkB,EAAE,MAAM,SAAS,CAAA;AAM5C,QAAA,MAAM,MAAM,EAAE,kBAKb,CAAA;AAED,eAAe,MAAM,CAAA"}
|
package/dist/src/v2/routes/v2/ecosystem/_ecosystemName/project/_projectName/action/index.d.ts.map
ADDED
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../../../../src/v2/routes/v2/ecosystem/_ecosystemName/project/_projectName/action/index.ts"],"names":[],"mappings":";AAEA,wBAAkD"}
|