@persei/perseed-api 5.0.19 → 5.0.21
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/client.cjs +875 -71
- package/dist/client.cjs.map +1 -1
- package/dist/client.mjs +876 -72
- package/dist/client.mjs.map +1 -1
- package/dist/ecosystem-action-system.cjs +586 -0
- package/dist/ecosystem-action-system.cjs.map +1 -0
- package/dist/ecosystem-action-system.d.ts +1 -0
- package/dist/ecosystem-action-system.mjs +586 -0
- package/dist/ecosystem-action-system.mjs.map +1 -0
- package/dist/lib/src/client/customFetch.d.ts +51 -0
- package/dist/lib/src/client/customFetch.d.ts.map +1 -0
- package/dist/lib/src/client/customFetch.test.d.ts +2 -0
- package/dist/lib/src/client/customFetch.test.d.ts.map +1 -0
- package/dist/lib/src/client/index.d.ts +1 -0
- package/dist/lib/src/client/index.d.ts.map +1 -1
- package/dist/lib/src/generated/client.d.ts +5251 -670
- package/dist/lib/src/generated/client.d.ts.map +1 -1
- package/dist/src/Services/AuthenticationSecurityService.d.ts +1 -1
- package/dist/src/Services/MobileService.d.ts +26 -1
- package/dist/src/Services/MobileService.d.ts.map +1 -1
- package/dist/src/Services/ProcessLogService.d.ts +1 -1
- package/dist/src/Services/ProcessLogService.d.ts.map +1 -1
- package/dist/src/Services/ProjectService.d.ts.map +1 -1
- package/dist/src/Services/QueryService.d.ts +24 -1
- package/dist/src/Services/QueryService.d.ts.map +1 -1
- package/dist/src/Services/RedisQueueService.d.ts +16 -0
- package/dist/src/Services/RedisQueueService.d.ts.map +1 -1
- package/dist/src/Services/TriggerProcessLogService.d.ts +90 -0
- package/dist/src/Services/TriggerProcessLogService.d.ts.map +1 -0
- package/dist/src/Services/TriggerService.d.ts +16 -11
- package/dist/src/Services/TriggerService.d.ts.map +1 -1
- package/dist/src/Services/trigger-process-log-service.test.d.ts +2 -0
- package/dist/src/Services/trigger-process-log-service.test.d.ts.map +1 -0
- package/dist/src/controllers/AuthController.d.ts.map +1 -1
- package/dist/src/controllers/FormController.d.ts.map +1 -1
- package/dist/src/helpers/error.d.ts +12 -0
- package/dist/src/helpers/error.d.ts.map +1 -1
- package/dist/src/lib.d.ts +1 -0
- package/dist/src/lib.d.ts.map +1 -1
- package/dist/src/models/ecosystem/NotificationConfiguration.d.ts +1 -1
- package/dist/src/models/ecosystem/NotificationConfiguration.d.ts.map +1 -1
- package/dist/src/models/ecosystem/User.d.ts +17 -0
- package/dist/src/models/ecosystem/User.d.ts.map +1 -1
- package/dist/src/models/ecosystem/User.getProjectUser.test.d.ts +2 -0
- package/dist/src/models/ecosystem/User.getProjectUser.test.d.ts.map +1 -0
- package/dist/src/models/perseed/PerseedEcosystem.d.ts +2 -0
- package/dist/src/models/perseed/PerseedEcosystem.d.ts.map +1 -1
- package/dist/src/models/project/DesignerCrf.d.ts +3 -2
- package/dist/src/models/project/DesignerCrf.d.ts.map +1 -1
- package/dist/src/models/project/designer-crf-after-save.test.d.ts +2 -0
- package/dist/src/models/project/designer-crf-after-save.test.d.ts.map +1 -0
- package/dist/src/module.d.ts +5 -0
- package/dist/src/schemas/api_action/ApiActionTypes.d.ts +11 -0
- package/dist/src/schemas/api_action/ApiActionTypes.d.ts.map +1 -1
- package/dist/src/schemas/index.d.ts +1 -0
- package/dist/src/schemas/index.d.ts.map +1 -1
- package/dist/src/schemas/notification_configuration/types.d.ts +19 -8
- package/dist/src/schemas/notification_configuration/types.d.ts.map +1 -1
- package/dist/src/schemas/process_log/create_process_log_payload.schema.json +4 -0
- package/dist/src/schemas/process_log/types.d.ts +3 -0
- package/dist/src/schemas/process_log/types.d.ts.map +1 -1
- package/dist/src/schemas/project_user/index.d.ts +2 -0
- package/dist/src/schemas/project_user/index.d.ts.map +1 -0
- package/dist/src/schemas/project_user/types.d.ts +44 -0
- package/dist/src/schemas/project_user/types.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.controller/action-system.controller.e2e.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.controller/action-system.controller.e2e.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.controller/action-system.controller.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.controller/action-system.controller.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.controller/action.controller.d.ts +3 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.controller/action.controller.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.controller/automatic-trigger.controller.d.ts +3 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.controller/automatic-trigger.controller.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.controller/index.d.ts +6 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.controller/index.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.controller/manual-trigger.controller.d.ts +3 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.controller/manual-trigger.controller.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/action-system.helper.d.ts +149 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/action-system.helper.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/action-system.helper.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/action-system.helper.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/conditions-matcher.helper.d.ts +5 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/conditions-matcher.helper.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/conditions-matcher.helper.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/conditions-matcher.helper.test.d.ts.map +1 -0
- package/dist/src/{Services/ConditionsMatcher/CustomConditionsFormat.d.ts → v2/modules/ecosystem/action-system/action-system.helper/custom-conditions-format.helper.d.ts} +2 -2
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/custom-conditions-format.helper.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/custom-conditions-format.helper.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/custom-conditions-format.helper.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/index.d.ts +5 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/index.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/manual-trigger.helper.d.ts +13 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/manual-trigger.helper.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/manual-trigger.helper.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/manual-trigger.helper.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.model.d.ts +122 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.model.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.schema.d.ts +744 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.schema.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/action-system.service.d.ts +37 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/action-system.service.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/action-system.service.e2e.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/action-system.service.e2e.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/action-system.service.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/action-system.service.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/action.service.d.ts +18 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/action.service.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/action.service.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/action.service.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/automatic-trigger.service.d.ts +137 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/automatic-trigger.service.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/automatic-trigger.service.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/automatic-trigger.service.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/index.d.ts +8 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/index.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/manual-trigger-engine.service.d.ts +34 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/manual-trigger-engine.service.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/manual-trigger-engine.service.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/manual-trigger-engine.service.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/manual-trigger.service.d.ts +179 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/manual-trigger.service.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/manual-trigger.service.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/manual-trigger.service.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/trigger-actions.service.d.ts +31 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/trigger-actions.service.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/trigger-actions.service.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/trigger-actions.service.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/trigger-engine.service.d.ts +57 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/trigger-engine.service.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/trigger-engine.service.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/action-system.service/trigger-engine.service.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/index.d.ts +6 -0
- package/dist/src/v2/modules/ecosystem/action-system/index.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/action-system/lib.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/action-system/lib.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/process-log/index.d.ts +3 -0
- package/dist/src/v2/modules/ecosystem/process-log/index.d.ts.map +1 -0
- package/dist/src/{models/ecosystem/ProcessLog.d.ts → v2/modules/ecosystem/process-log/process-log.model.d.ts} +16 -5
- package/dist/src/v2/modules/ecosystem/process-log/process-log.model.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/process-log/process-log.model.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/process-log/process-log.model.test.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/process-log/process-log.service.d.ts +20 -0
- package/dist/src/v2/modules/ecosystem/process-log/process-log.service.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/process-log/process-log.service.e2e.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/process-log/process-log.service.e2e.d.ts.map +1 -0
- package/dist/src/v2/modules/ecosystem/process-log/process-log.service.test.d.ts +2 -0
- package/dist/src/v2/modules/ecosystem/process-log/process-log.service.test.d.ts.map +1 -0
- package/dist/src/v2/modules/global/api-error/api-error.schema.d.ts +9 -0
- package/dist/src/v2/modules/global/api-error/api-error.schema.d.ts.map +1 -1
- package/dist/src/v2/modules/global/e2e-operation/e2e-operation.controller.d.ts.map +1 -1
- package/dist/src/v2/modules/global/e2e-operation/e2e-operation.service.d.ts.map +1 -1
- package/dist/src/v2/modules/global/request-log/request-log.middleware.d.ts.map +1 -1
- package/dist/src/v2/modules/project/document/document.controller.d.ts.map +1 -1
- package/dist/src/v2/modules/project/thryve/thryve.controller.d.ts.map +1 -1
- package/dist/src/v2/modules/project/thryve/thryve.service.d.ts +16 -4
- package/dist/src/v2/modules/project/thryve/thryve.service.d.ts.map +1 -1
- package/dist/src/v2/routes/v2/e2e/index.d.ts.map +1 -1
- package/dist/src/v2/routes/v2/ecosystem/_ecosystemName/project/_projectName/action/index.d.ts +3 -0
- package/dist/src/v2/routes/v2/ecosystem/_ecosystemName/project/_projectName/action/index.d.ts.map +1 -0
- package/dist/src/v2/routes/v2/ecosystem/_ecosystemName/project/_projectName/automatic-trigger/index.d.ts +3 -0
- package/dist/src/v2/routes/v2/ecosystem/_ecosystemName/project/_projectName/automatic-trigger/index.d.ts.map +1 -0
- package/dist/src/v2/routes/v2/ecosystem/_ecosystemName/project/_projectName/manual-trigger/index.d.ts +3 -0
- package/dist/src/v2/routes/v2/ecosystem/_ecosystemName/project/_projectName/manual-trigger/index.d.ts.map +1 -0
- package/dist/v1/perseed-api.cjs +8 -11
- package/dist/v1/perseed-api.cjs.map +1 -1
- package/dist/v1/perseed-api.mjs +7 -10
- package/dist/v1/perseed-api.mjs.map +1 -1
- package/package.json +1 -1
- package/dist/src/Services/ConditionsMatcher/CustomConditionsFormat.d.ts.map +0 -1
- package/dist/src/Services/ConditionsMatcher/index.d.ts +0 -4
- package/dist/src/Services/ConditionsMatcher/index.d.ts.map +0 -1
- package/dist/src/Services/conditions-matcher.test.d.ts +0 -2
- package/dist/src/Services/conditions-matcher.test.d.ts.map +0 -1
- package/dist/src/Services/custom-conditions-format.test.d.ts +0 -2
- package/dist/src/Services/custom-conditions-format.test.d.ts.map +0 -1
- package/dist/src/models/ecosystem/ProcessLog.d.ts.map +0 -1
|
@@ -0,0 +1,44 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A user as seen from within one project: the identity, plus what their profiling in that project
|
|
3
|
+
* grants them. The shared definition of "user associated with a project" — the same shape is read
|
|
4
|
+
* by the trigger evaluation context, by the query builder that writes conditions against it and by
|
|
5
|
+
* the front, so none of them has to restate the fields.
|
|
6
|
+
*
|
|
7
|
+
* Deliberately not the user row: it answers what the user *is* in the project, and spreading the
|
|
8
|
+
* row would put their personal data in reach of anything that renders the context.
|
|
9
|
+
*/
|
|
10
|
+
export interface ProjectUser {
|
|
11
|
+
/** Login id of the user. */
|
|
12
|
+
id: number;
|
|
13
|
+
/** Id of the project this view is resolved against; absent when the project is unknown. */
|
|
14
|
+
projectId?: number;
|
|
15
|
+
/** Role in the ecosystem, from the shared `ROLES` set. */
|
|
16
|
+
role?: string;
|
|
17
|
+
/** Administers the ecosystem or the platform. Independent of the profiling. */
|
|
18
|
+
isAdmin: boolean;
|
|
19
|
+
/**
|
|
20
|
+
* Whether the user is PRO in this project, as `User.isPro(projectName)` answers it everywhere
|
|
21
|
+
* else — there is a single criterion for it and this view reports that one rather than deriving
|
|
22
|
+
* its own. Administrators are never PRO; whether the user administers the ecosystem is a
|
|
23
|
+
* separate question, answered by `isAdmin`.
|
|
24
|
+
*/
|
|
25
|
+
isPro: boolean;
|
|
26
|
+
/** Names of the seed privileges of the profiling in this project. */
|
|
27
|
+
privileges: string[];
|
|
28
|
+
/** Clinics of the project the user belongs to, with their name — for templates and the UI. */
|
|
29
|
+
clinics: ProjectUserClinic[];
|
|
30
|
+
/**
|
|
31
|
+
* The ids of `clinics`, flat.
|
|
32
|
+
*
|
|
33
|
+
* Kept alongside the objects rather than derived on read because this is the form a condition
|
|
34
|
+
* is written against: jsonLogic resolves a `var` by path and cannot reach into an array of
|
|
35
|
+
* objects, so `requester.clinics` is unusable in a rule while `requester.clinicIds` is a plain
|
|
36
|
+
* `in` comparison.
|
|
37
|
+
*/
|
|
38
|
+
clinicIds: number[];
|
|
39
|
+
}
|
|
40
|
+
export interface ProjectUserClinic {
|
|
41
|
+
id: number;
|
|
42
|
+
name: string;
|
|
43
|
+
}
|
|
44
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../../../../src/schemas/project_user/types.ts"],"names":[],"mappings":"AAAA;;;;;;;;GAQG;AACH,MAAM,WAAW,WAAW;IAC1B,4BAA4B;IAC5B,EAAE,EAAE,MAAM,CAAA;IACV,2FAA2F;IAC3F,SAAS,CAAC,EAAE,MAAM,CAAA;IAClB,0DAA0D;IAC1D,IAAI,CAAC,EAAE,MAAM,CAAA;IACb,+EAA+E;IAC/E,OAAO,EAAE,OAAO,CAAA;IAChB;;;;;OAKG;IACH,KAAK,EAAE,OAAO,CAAA;IACd,qEAAqE;IACrE,UAAU,EAAE,MAAM,EAAE,CAAA;IACpB,8FAA8F;IAC9F,OAAO,EAAE,iBAAiB,EAAE,CAAA;IAC5B;;;;;;;OAOG;IACH,SAAS,EAAE,MAAM,EAAE,CAAA;CACpB;AAED,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAA;IACV,IAAI,EAAE,MAAM,CAAA;CACb"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-system.controller.e2e.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.controller/action-system.controller.e2e.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-system.controller.test.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.controller/action-system.controller.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action.controller.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.controller/action.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AAmB1E,eAAO,MAAM,YAAY,EAAE,yBAwH1B,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"automatic-trigger.controller.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.controller/automatic-trigger.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AAoB1E,eAAO,MAAM,sBAAsB,EAAE,yBA4HpC,CAAA"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
export declare const ActionSystemController: {
|
|
2
|
+
automaticTriggerRouter: import('@fastify/type-provider-typebox').FastifyPluginAsyncTypebox;
|
|
3
|
+
actionRouter: import('@fastify/type-provider-typebox').FastifyPluginAsyncTypebox;
|
|
4
|
+
manualTriggerRouter: import('@fastify/type-provider-typebox').FastifyPluginAsyncTypebox;
|
|
5
|
+
};
|
|
6
|
+
//# 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.controller/index.ts"],"names":[],"mappings":"AAIA,eAAO,MAAM,sBAAsB;;;;CAIlC,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manual-trigger.controller.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.controller/manual-trigger.controller.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,yBAAyB,EAAE,MAAM,gCAAgC,CAAA;AAyC1E,eAAO,MAAM,mBAAmB,EAAE,yBAgLjC,CAAA"}
|
package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/action-system.helper.d.ts
ADDED
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { TSchema } from 'typebox';
|
|
2
|
+
import { FastifyRequest } from 'fastify';
|
|
3
|
+
import { ActionType, ActionData, ContextValidationResult, ActionConfigLike, EffectiveConfigResult, TriggerSource, TriggerRelations } from '../action-system.schema';
|
|
4
|
+
import { ApiActionContextData } from '../../../../../schemas/api_action/ApiActionTypes';
|
|
5
|
+
import { ProjectUser } from '../../../../../schemas/project_user';
|
|
6
|
+
import { default as RequestContext, RequestContextData } from '../../../../../models/request/RequestContext';
|
|
7
|
+
/**
|
|
8
|
+
* Loads the entity a manual trigger runs against, scoped to the request project.
|
|
9
|
+
*
|
|
10
|
+
* The id comes from the caller here, unlike the automatic kind where it arrives from an event the
|
|
11
|
+
* platform emitted — hence the narrowing. A model without `project_id` (users are ecosystem-wide)
|
|
12
|
+
* cannot be narrowed and stays reachable across the projects of one ecosystem; see the README.
|
|
13
|
+
*/
|
|
14
|
+
export declare function loadTriggerEntity(ctx: RequestContext, source: TriggerSource, target: string, entityId: number): Promise<Record<string, unknown> | undefined>;
|
|
15
|
+
/**
|
|
16
|
+
* Eager-loads the relations declared in `relations.join` onto `current`, each under its own name,
|
|
17
|
+
* so conditions and action payloads can reference them as `current.patient.name`.
|
|
18
|
+
*
|
|
19
|
+
* The model is resolved by `resolveTargetQuery`, with the joins passed up front so a displayer
|
|
20
|
+
* target builds its model with them already in place.
|
|
21
|
+
*
|
|
22
|
+
* Never throws: returns `current` untouched, with a `skipped` reason, when there is nothing to
|
|
23
|
+
* load or no way to load it. The trigger is then evaluated without the relations instead of
|
|
24
|
+
* aborting the whole batch.
|
|
25
|
+
*/
|
|
26
|
+
export declare function loadRelations(ctx: RequestContext, source: TriggerSource, target: string | null | undefined, current: Record<string, unknown>, relations?: TriggerRelations | null): Promise<{
|
|
27
|
+
current: Record<string, unknown>;
|
|
28
|
+
skipped?: string;
|
|
29
|
+
}>;
|
|
30
|
+
export declare function safeGetRequestContextData(ctx: RequestContext): RequestContextData | undefined;
|
|
31
|
+
/**
|
|
32
|
+
* Describes the user making the request, for conditions and templates to read as `requester`.
|
|
33
|
+
*
|
|
34
|
+
* Thin wrapper over `User.getProjectUser`: the shape and the criteria live in the model, shared
|
|
35
|
+
* with the query builder and the front, and this only resolves the user off the request context.
|
|
36
|
+
*
|
|
37
|
+
* Returns `undefined` when the request carries no user: an internal call or a job has no
|
|
38
|
+
* requester, and an empty object would let a condition on `requester` match one as if it were an
|
|
39
|
+
* anonymous person, rather than not match at all. The accessor is called optionally for the same
|
|
40
|
+
* reason `safeGetRequestContextData` does: the engine is also driven from contexts that never
|
|
41
|
+
* carry one.
|
|
42
|
+
*/
|
|
43
|
+
export declare function buildRequesterContext(ctx: RequestContext): ProjectUser | undefined;
|
|
44
|
+
/**
|
|
45
|
+
* Returns whether an action type is registered (has a known config schema).
|
|
46
|
+
*/
|
|
47
|
+
export declare function isKnownActionType(type: string): type is ActionType;
|
|
48
|
+
/**
|
|
49
|
+
* Resolves the config schema for a given action type. Used as the single entry
|
|
50
|
+
* point to validate an action config against the structure expected by its type.
|
|
51
|
+
* Throws when the type has no registered schema.
|
|
52
|
+
*/
|
|
53
|
+
export declare function getActionConfigSchema(type: ActionType): TSchema;
|
|
54
|
+
/**
|
|
55
|
+
* Resolves the context schema for a given action type. Mirrors `getActionConfigSchema`.
|
|
56
|
+
* Throws when the type has no registered schema (unknown action type).
|
|
57
|
+
*/
|
|
58
|
+
export declare function getActionContextSchema(type: string): TSchema;
|
|
59
|
+
/**
|
|
60
|
+
* Validates `config` against the schema registered for `type`. Throws a public
|
|
61
|
+
* 400 listing the errors. `index` is the position within a trigger payload's
|
|
62
|
+
* `actions` array: the array validates as a whole, so without it the client
|
|
63
|
+
* cannot tell which item is malformed. Single-action endpoints omit it.
|
|
64
|
+
*/
|
|
65
|
+
export declare function assertValidActionConfig(type: ActionData['type'], config: ActionData['config'], index?: number): void;
|
|
66
|
+
/**
|
|
67
|
+
* Best-effort static extraction of the data paths a Handlebars payload references.
|
|
68
|
+
* Walks the payload recursively (objects/arrays/strings) and parses every mustache.
|
|
69
|
+
* A single-token mustache is a data path unless it names a helper/keyword. A helper
|
|
70
|
+
* invocation (`{{ json current.patient }}`, `{{#if current.enabled}}`) contributes
|
|
71
|
+
* its path-like arguments — never the helper name itself. Block markers (`#`/`/`),
|
|
72
|
+
* comments (`!`), partials (`>`), string/number literals and hash-arg keys are
|
|
73
|
+
* skipped. This is not a full Handlebars parser — it is a pragmatic scan good enough
|
|
74
|
+
* to validate that the referenced context paths exist before running the action.
|
|
75
|
+
*/
|
|
76
|
+
export declare function extractTemplateRefs(value: unknown): string[];
|
|
77
|
+
/**
|
|
78
|
+
* Resolves a dotted path (e.g. `current.patient.id`) against the assembled action
|
|
79
|
+
* context. A segment is considered found only when its parent is a plain object
|
|
80
|
+
* that owns the key and its value is not `undefined`.
|
|
81
|
+
*/
|
|
82
|
+
export declare function resolvePathValue(context: Record<string, unknown>, path: string): {
|
|
83
|
+
found: boolean;
|
|
84
|
+
value: unknown;
|
|
85
|
+
};
|
|
86
|
+
/**
|
|
87
|
+
* Resolves the expiry date-time for a process_log row from a *resolved* retention
|
|
88
|
+
* window in days. The caller passes `from` so this stays pure/testable.
|
|
89
|
+
*
|
|
90
|
+
* `retention_days` convention (issue #175, closed 2026-07-22). Three states,
|
|
91
|
+
* resolved differently per table (see `action-system.schema.ts`):
|
|
92
|
+
* - **desactivado** (`0`, or `null`/`0` on the trigger, the origin) → **never
|
|
93
|
+
* expires** → `null`.
|
|
94
|
+
* - **heredado** (`null` on an action) → inheritance sentinel, resolved by the
|
|
95
|
+
* caller *before* this call (see `executeTriggerActions`); a `null`
|
|
96
|
+
* still reaching here means "never".
|
|
97
|
+
* - **definido** (`N` (>0)) → expires `N` days after `from`.
|
|
98
|
+
*
|
|
99
|
+
* This function is retention-source-agnostic: it only turns an already-resolved
|
|
100
|
+
* value into an expiry (never stored/derived on the action row). `0` and
|
|
101
|
+
* `null`/`undefined` (and, defensively, any non-positive/non-finite value) map
|
|
102
|
+
* to "never".
|
|
103
|
+
*
|
|
104
|
+
* The result is formatted with `getMySQLDateTime` (UTC `YYYY-MM-DD HH:mm:ss`), the
|
|
105
|
+
* repo-wide convention for DATETIME columns. An ISO-8601 string is *not* usable
|
|
106
|
+
* here: MySQL rejects the `T`/`Z` form for a DATETIME under the default
|
|
107
|
+
* `STRICT_TRANS_TABLES` sql_mode, which would abort the process_log write.
|
|
108
|
+
*/
|
|
109
|
+
export declare function resolveExpiresAt(retentionDays: number | null | undefined, from: Date): string | null;
|
|
110
|
+
/**
|
|
111
|
+
* Resolves the effective config an action executes with, from its static config.
|
|
112
|
+
* Pure and type-agnostic — driven only by the presence of `overridable`:
|
|
113
|
+
* - Override-type (`overridable` is an array): `effective` merges `default` with
|
|
114
|
+
* only the `payload` keys allow-listed by `overridable`; `overridableErrors`
|
|
115
|
+
* lists payload keys outside that allow-list.
|
|
116
|
+
* - Non-override type (no `overridable`, e.g. ApiAction): `effective` is the
|
|
117
|
+
* payload unchanged (identity) and there are no `overridableErrors` — the
|
|
118
|
+
* payload is a data mapping, not an override of a default config.
|
|
119
|
+
*/
|
|
120
|
+
export declare function buildEffectiveConfig(config: ActionConfigLike): EffectiveConfigResult;
|
|
121
|
+
/**
|
|
122
|
+
* Three-level context validation for an action about to run:
|
|
123
|
+
* 0. Unknown `type` — returned (not thrown) as a single `baseErrors` entry, so
|
|
124
|
+
* callers get a uniform `ContextValidationResult` regardless of whether the
|
|
125
|
+
* type is registered; consistent with the other two checks below.
|
|
126
|
+
* 1. `baseErrors` — the assembled context matches the shape the action type expects.
|
|
127
|
+
* 2. `missingRefs` — every handlebars path referenced by the action payload resolves
|
|
128
|
+
* against the context (refs rooted at `ctx`, which is runtime-only, are ignored).
|
|
129
|
+
* 3. `overridableErrors` — for override-types, every payload key is allow-listed by
|
|
130
|
+
* `config.overridable` (via `buildEffectiveConfig`); always empty for non-override
|
|
131
|
+
* types such as ApiAction.
|
|
132
|
+
*/
|
|
133
|
+
export declare function validateActionContext(type: string, context: ApiActionContextData, config: ActionConfigLike | undefined): ContextValidationResult;
|
|
134
|
+
/**
|
|
135
|
+
* Permission preHandler for the endpoints that administer triggers — creating, reading,
|
|
136
|
+
* editing and deleting them. There is no read/write split here, unlike documents: seeing
|
|
137
|
+
* how a trigger is configured is already an administration capability.
|
|
138
|
+
*
|
|
139
|
+
* Running a trigger is NOT administering it, and does not go through this preHandler: any
|
|
140
|
+
* user of the project may press the button. See `manual-trigger.controller.ts`.
|
|
141
|
+
*
|
|
142
|
+
* Reuses the legacy v1 `SEED_PRIVILEGE.TRIGGERS_MANAGEMENT` privilege (see
|
|
143
|
+
* `src/controllers/TriggerController.ts`), and lets an administrator through without it:
|
|
144
|
+
* an ecosystem or platform administrator has no profiling row in the project, so the
|
|
145
|
+
* privilege lookup — which reads the profiling of `ctx.projectId` — finds nothing for them.
|
|
146
|
+
* Every other capability check of the user model opens the same way.
|
|
147
|
+
*/
|
|
148
|
+
export declare function requireTriggersManagement(req: FastifyRequest): Promise<void>;
|
|
149
|
+
//# sourceMappingURL=action-system.helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-system.helper.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.helper/action-system.helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,OAAO,EAAE,MAAM,SAAS,CAAA;AAEtC,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,SAAS,CAAA;AAC7C,OAAO,EACL,UAAU,EAGV,KAAK,UAAU,EACf,KAAK,uBAAuB,EAC5B,KAAK,gBAAgB,EACrB,KAAK,qBAAqB,EAC3B,MAAM,yBAAyB,CAAA;AAChC,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AACjF,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,0BAA0B,CAAA;AAC3D,OAAO,KAAK,cAAc,MAAM,mCAAmC,CAAA;AACnE,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,mCAAmC,CAAA;AAY3E,OAAO,EAAE,aAAa,EAAE,KAAK,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAgE9E;;;;;;GAMG;AACH,wBAAsB,iBAAiB,CACr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5D;AAED;;;;GAIG;AACH,wBAAgB,gBAAgB,CAAC,OAAO,EAAE,MAAM,CAAC,MAAM,EAAE,OAAO,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG;IAAE,KAAK,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,OAAO,CAAA;CAAE,CAanH;AAED;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,wBAAgB,gBAAgB,CAAC,aAAa,EAAE,MAAM,GAAG,IAAI,GAAG,SAAS,EAAE,IAAI,EAAE,IAAI,GAAG,MAAM,GAAG,IAAI,CAMpG;AAED;;;;;;;;;GASG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAE,gBAAgB,GAAG,qBAAqB,CAiBpF;AAED;;;;;;;;;;;GAWG;AACH,wBAAgB,qBAAqB,CACnC,IAAI,EAAE,MAAM,EACZ,OAAO,EAAE,oBAAoB,EAC7B,MAAM,EAAE,gBAAgB,GAAG,SAAS,GACnC,uBAAuB,CAiCzB;AAED;;;;;;;;;;;;;GAaG;AACH,wBAAsB,yBAAyB,CAAC,GAAG,EAAE,cAAc,GAAG,OAAO,CAAC,IAAI,CAAC,CAOlF"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-system.helper.test.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.helper/action-system.helper.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
import { ConditionsRules } from '../../../../../schemas/notification_configuration/types';
|
|
2
|
+
import { ConditionsFormat } from '../action-system.schema';
|
|
3
|
+
import { ApiActionContextData } from '../../../../../schemas/api_action/ApiActionTypes';
|
|
4
|
+
export declare function conditionsMatch(context: ApiActionContextData, conditions: ConditionsRules, format?: ConditionsFormat, logPrefix?: string): Promise<boolean>;
|
|
5
|
+
//# sourceMappingURL=conditions-matcher.helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditions-matcher.helper.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.helper/conditions-matcher.helper.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAc,eAAe,EAAE,MAAM,8CAA8C,CAAA;AAC/F,OAAO,EAAE,gBAAgB,EAAE,MAAM,yBAAyB,CAAA;AAM1D,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AA4BjF,wBAAsB,eAAe,CACnC,OAAO,EAAE,oBAAoB,EAC7B,UAAU,EAAE,eAAe,EAC3B,MAAM,CAAC,EAAE,gBAAgB,EACzB,SAAS,CAAC,EAAE,MAAM,GACjB,OAAO,CAAC,OAAO,CAAC,CAmBlB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"conditions-matcher.helper.test.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.helper/conditions-matcher.helper.test.ts"],"names":[],"mappings":""}
|
|
@@ -1,7 +1,7 @@
|
|
|
1
|
-
import { Conditions } from '
|
|
1
|
+
import { Conditions } from '../../../../../schemas/notification_configuration/types';
|
|
2
2
|
declare function conditionsToJqFilter(conditions: Conditions): string;
|
|
3
3
|
declare const CustomConditionsFormat: {
|
|
4
4
|
conditionsToJqFilter: typeof conditionsToJqFilter;
|
|
5
5
|
};
|
|
6
6
|
export default CustomConditionsFormat;
|
|
7
|
-
//# sourceMappingURL=
|
|
7
|
+
//# sourceMappingURL=custom-conditions-format.helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-conditions-format.helper.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.helper/custom-conditions-format.helper.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,UAAU,EAAkB,MAAM,8CAA8C,CAAA;AAK9F,iBAAS,oBAAoB,CAAC,UAAU,EAAE,UAAU,UAwCnD;AA+BD,QAAA,MAAM,sBAAsB;;CAE3B,CAAA;AAED,eAAe,sBAAsB,CAAA"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-conditions-format.helper.test.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.helper/custom-conditions-format.helper.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.helper/index.ts"],"names":[],"mappings":"AAAA,cAAc,wBAAwB,CAAA;AACtC,cAAc,6BAA6B,CAAA;AAC3C,cAAc,yBAAyB,CAAA;AACvC,OAAO,EAAE,OAAO,IAAI,sBAAsB,EAAE,MAAM,mCAAmC,CAAA"}
|
package/dist/src/v2/modules/ecosystem/action-system/action-system.helper/manual-trigger.helper.d.ts
ADDED
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
import { ApiActionContextData } from '../../../../../schemas/api_action/ApiActionTypes';
|
|
2
|
+
import { ManualTriggerButtonStyleData, ManualTriggerConfigData } from '../action-system.schema';
|
|
3
|
+
/**
|
|
4
|
+
* The style the consumer paints: base style, the winning conditional style merged over it, and the
|
|
5
|
+
* label template compiled against the trigger context.
|
|
6
|
+
*
|
|
7
|
+
* Presentation only: nothing resolved here decides whether the button is active. That is the
|
|
8
|
+
* trigger `conditions` plus `config.unmatchedBehavior`, both outside the style, so a conditional
|
|
9
|
+
* style can never turn a button off. The style is resolved whole and travels whole — the consumer
|
|
10
|
+
* gets `matched` and decides how it renders that state.
|
|
11
|
+
*/
|
|
12
|
+
export declare function resolveManualTriggerButtonStyle(context: ApiActionContextData, config: ManualTriggerConfigData | null | undefined, triggerId: number): Promise<ManualTriggerButtonStyleData | undefined>;
|
|
13
|
+
//# sourceMappingURL=manual-trigger.helper.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manual-trigger.helper.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.helper/manual-trigger.helper.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,uCAAuC,CAAA;AAEjF,OAAO,EAEL,KAAK,4BAA4B,EAEjC,KAAK,uBAAuB,EAC7B,MAAM,yBAAyB,CAAA;AAyDhC;;;;;;;;GAQG;AACH,wBAAsB,+BAA+B,CACnD,OAAO,EAAE,oBAAoB,EAC7B,MAAM,EAAE,uBAAuB,GAAG,IAAI,GAAG,SAAS,EAClD,SAAS,EAAE,MAAM,GAChB,OAAO,CAAC,4BAA4B,GAAG,SAAS,CAAC,CAanD"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"manual-trigger.helper.test.d.ts","sourceRoot":"","sources":["../../../../../../../../src/v2/modules/ecosystem/action-system/action-system.helper/manual-trigger.helper.test.ts"],"names":[],"mappings":""}
|
|
@@ -0,0 +1,122 @@
|
|
|
1
|
+
import { default as Objection } from 'objection';
|
|
2
|
+
import { default as BaseModel } from '../../../../models/BaseModel';
|
|
3
|
+
import { default as RequestContext } from '../../../../models/request/RequestContext';
|
|
4
|
+
import { TypedQueryBuilder } from '../../global/objection';
|
|
5
|
+
import { AutomaticTriggerData, ActionData, AutomaticTriggerActionData, ManualTriggerData, ManualTriggerActionData, ManualTriggerConfigData, ActionConfig, TriggerSource, TriggerOperation, TriggerRelations, ActionType } from './action-system.schema';
|
|
6
|
+
export declare class AutomaticTrigger extends BaseModel implements AutomaticTriggerData {
|
|
7
|
+
project_id?: number | null;
|
|
8
|
+
source: TriggerSource;
|
|
9
|
+
target?: string | null;
|
|
10
|
+
operation?: TriggerOperation | null;
|
|
11
|
+
conditions?: object | null;
|
|
12
|
+
relations?: TriggerRelations | null;
|
|
13
|
+
enabled?: boolean;
|
|
14
|
+
retention_days?: number | null;
|
|
15
|
+
trigger_actions?: AutomaticTriggerAction[];
|
|
16
|
+
static tableName: string;
|
|
17
|
+
static jsonAttributes: string[];
|
|
18
|
+
static jsonSchema: Objection.JSONSchema;
|
|
19
|
+
static get relationMappings(): {
|
|
20
|
+
trigger_actions: {
|
|
21
|
+
relation: Objection.RelationType;
|
|
22
|
+
modelClass: typeof AutomaticTriggerAction;
|
|
23
|
+
join: {
|
|
24
|
+
from: string;
|
|
25
|
+
to: string;
|
|
26
|
+
};
|
|
27
|
+
};
|
|
28
|
+
};
|
|
29
|
+
static QueryBuilder: typeof Objection.QueryBuilder;
|
|
30
|
+
static query(): TypedQueryBuilder<AutomaticTrigger, typeof AutomaticTrigger, never>;
|
|
31
|
+
static getModel(ctx: RequestContext): typeof AutomaticTrigger;
|
|
32
|
+
static getModelByPool(ecosystemPool: Objection.TransactionOrKnex): typeof AutomaticTrigger;
|
|
33
|
+
}
|
|
34
|
+
export declare class Action extends BaseModel implements ActionData {
|
|
35
|
+
project_id?: number | null;
|
|
36
|
+
name: string;
|
|
37
|
+
type: ActionType;
|
|
38
|
+
config: ActionConfig;
|
|
39
|
+
retention_days?: number | null;
|
|
40
|
+
library?: boolean;
|
|
41
|
+
static tableName: string;
|
|
42
|
+
static jsonAttributes: string[];
|
|
43
|
+
static jsonSchema: Objection.JSONSchema;
|
|
44
|
+
static QueryBuilder: typeof Objection.QueryBuilder;
|
|
45
|
+
static query(): TypedQueryBuilder<Action, typeof Action, never>;
|
|
46
|
+
static getModel(ctx: RequestContext): typeof Action;
|
|
47
|
+
static getModelByPool(ecosystemPool: Objection.TransactionOrKnex): typeof Action;
|
|
48
|
+
}
|
|
49
|
+
export declare class AutomaticTriggerAction extends BaseModel implements AutomaticTriggerActionData {
|
|
50
|
+
automatic_trigger_id: number;
|
|
51
|
+
action_id: number;
|
|
52
|
+
execution_order: number;
|
|
53
|
+
action?: Action;
|
|
54
|
+
static tableName: string;
|
|
55
|
+
static jsonSchema: Objection.JSONSchema;
|
|
56
|
+
static get relationMappings(): {
|
|
57
|
+
action: {
|
|
58
|
+
relation: Objection.RelationType;
|
|
59
|
+
modelClass: typeof Action;
|
|
60
|
+
join: {
|
|
61
|
+
from: string;
|
|
62
|
+
to: string;
|
|
63
|
+
};
|
|
64
|
+
};
|
|
65
|
+
};
|
|
66
|
+
static QueryBuilder: typeof Objection.QueryBuilder;
|
|
67
|
+
static query(): TypedQueryBuilder<AutomaticTriggerAction, typeof AutomaticTriggerAction, never>;
|
|
68
|
+
static getModel(ctx: RequestContext): typeof AutomaticTriggerAction;
|
|
69
|
+
static getModelByPool(ecosystemPool: Objection.TransactionOrKnex): typeof AutomaticTriggerAction;
|
|
70
|
+
}
|
|
71
|
+
export declare class ManualTrigger extends BaseModel implements ManualTriggerData {
|
|
72
|
+
project_id?: number | null;
|
|
73
|
+
name: string;
|
|
74
|
+
source: TriggerSource;
|
|
75
|
+
target: string;
|
|
76
|
+
conditions?: object | null;
|
|
77
|
+
relations?: TriggerRelations | null;
|
|
78
|
+
enabled?: boolean;
|
|
79
|
+
retention_days?: number | null;
|
|
80
|
+
config?: ManualTriggerConfigData | null;
|
|
81
|
+
trigger_actions?: ManualTriggerAction[];
|
|
82
|
+
static tableName: string;
|
|
83
|
+
static jsonAttributes: string[];
|
|
84
|
+
static jsonSchema: Objection.JSONSchema;
|
|
85
|
+
static get relationMappings(): {
|
|
86
|
+
trigger_actions: {
|
|
87
|
+
relation: Objection.RelationType;
|
|
88
|
+
modelClass: typeof ManualTriggerAction;
|
|
89
|
+
join: {
|
|
90
|
+
from: string;
|
|
91
|
+
to: string;
|
|
92
|
+
};
|
|
93
|
+
};
|
|
94
|
+
};
|
|
95
|
+
static QueryBuilder: typeof Objection.QueryBuilder;
|
|
96
|
+
static query(): TypedQueryBuilder<ManualTrigger, typeof ManualTrigger, never>;
|
|
97
|
+
static getModel(ctx: RequestContext): typeof ManualTrigger;
|
|
98
|
+
static getModelByPool(ecosystemPool: Objection.TransactionOrKnex): typeof ManualTrigger;
|
|
99
|
+
}
|
|
100
|
+
export declare class ManualTriggerAction extends BaseModel implements ManualTriggerActionData {
|
|
101
|
+
manual_trigger_id: number;
|
|
102
|
+
action_id: number;
|
|
103
|
+
execution_order: number;
|
|
104
|
+
action?: Action;
|
|
105
|
+
static tableName: string;
|
|
106
|
+
static jsonSchema: Objection.JSONSchema;
|
|
107
|
+
static get relationMappings(): {
|
|
108
|
+
action: {
|
|
109
|
+
relation: Objection.RelationType;
|
|
110
|
+
modelClass: typeof Action;
|
|
111
|
+
join: {
|
|
112
|
+
from: string;
|
|
113
|
+
to: string;
|
|
114
|
+
};
|
|
115
|
+
};
|
|
116
|
+
};
|
|
117
|
+
static QueryBuilder: typeof Objection.QueryBuilder;
|
|
118
|
+
static query(): TypedQueryBuilder<ManualTriggerAction, typeof ManualTriggerAction, never>;
|
|
119
|
+
static getModel(ctx: RequestContext): typeof ManualTriggerAction;
|
|
120
|
+
static getModelByPool(ecosystemPool: Objection.TransactionOrKnex): typeof ManualTriggerAction;
|
|
121
|
+
}
|
|
122
|
+
//# sourceMappingURL=action-system.model.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"action-system.model.d.ts","sourceRoot":"","sources":["../../../../../../../src/v2/modules/ecosystem/action-system/action-system.model.ts"],"names":[],"mappings":"AAAA,OAAO,SAAkC,MAAM,WAAW,CAAA;AAC1D,OAAO,SAAS,MAAM,sBAAsB,CAAA;AAC5C,OAAO,cAAc,MAAM,mCAAmC,CAAA;AAE9D,OAAO,EAAE,iBAAiB,EAAE,MAAM,4BAA4B,CAAA;AAG9D,OAAO,EACL,oBAAoB,EACpB,UAAU,EACV,0BAA0B,EAC1B,iBAAiB,EACjB,uBAAuB,EACvB,uBAAuB,EACvB,YAAY,EACZ,aAAa,EACb,gBAAgB,EAChB,gBAAgB,EAChB,UAAU,EAWX,MAAM,wBAAwB,CAAA;AA0B/B,qBAAa,gBAAiB,SAAQ,SAAU,YAAW,oBAAoB;IAC7E,UAAU,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;IAC1B,MAAM,EAAG,aAAa,CAAA;IACtB,MA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