@pegasimed.com/shared-tools 1.0.12 → 1.0.15
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/constants/index.d.ts +4 -0
- package/dist/constants/index.js +21 -0
- package/dist/constants/index.js.map +1 -0
- package/dist/constants/kafkaEvents.d.ts +57 -0
- package/dist/constants/kafkaEvents.js +61 -0
- package/dist/constants/kafkaEvents.js.map +1 -0
- package/dist/constants/markers.d.ts +2 -0
- package/dist/constants/markers.js +6 -0
- package/dist/constants/markers.js.map +1 -0
- package/dist/constants/model-variables/appointment.d.ts +37 -0
- package/dist/constants/model-variables/appointment.js +41 -0
- package/dist/constants/model-variables/appointment.js.map +1 -0
- package/dist/constants/model-variables/appointmentRequest.d.ts +35 -0
- package/dist/constants/model-variables/appointmentRequest.js +39 -0
- package/dist/constants/model-variables/appointmentRequest.js.map +1 -0
- package/dist/constants/model-variables/index.d.ts +4 -0
- package/dist/constants/model-variables/index.js +21 -0
- package/dist/constants/model-variables/index.js.map +1 -0
- package/dist/constants/model-variables/location.d.ts +26 -0
- package/dist/constants/model-variables/location.js +30 -0
- package/dist/constants/model-variables/location.js.map +1 -0
- package/dist/constants/model-variables/scheduledProcedure.d.ts +21 -0
- package/dist/constants/model-variables/scheduledProcedure.js +25 -0
- package/dist/constants/model-variables/scheduledProcedure.js.map +1 -0
- package/dist/constants/patterns.d.ts +1 -0
- package/dist/constants/patterns.js +5 -0
- package/dist/constants/patterns.js.map +1 -0
- package/dist/custom-variable-resolvers/executeCondition.d.ts +4 -0
- package/dist/custom-variable-resolvers/executeCondition.js +40 -0
- package/dist/custom-variable-resolvers/executeCondition.js.map +1 -0
- package/dist/custom-variable-resolvers/executeFormula.d.ts +2 -0
- package/dist/custom-variable-resolvers/executeFormula.js +28 -0
- package/dist/custom-variable-resolvers/executeFormula.js.map +1 -0
- package/dist/custom-variable-resolvers/executeVariablesCondition.d.ts +8 -0
- package/dist/custom-variable-resolvers/executeVariablesCondition.js +84 -0
- package/dist/custom-variable-resolvers/executeVariablesCondition.js.map +1 -0
- package/dist/custom-variable-resolvers/findAllCustomVariables.d.ts +1 -0
- package/dist/custom-variable-resolvers/findAllCustomVariables.js +14 -0
- package/dist/custom-variable-resolvers/findAllCustomVariables.js.map +1 -0
- package/dist/custom-variable-resolvers/findDataObject.d.ts +1 -0
- package/dist/custom-variable-resolvers/findDataObject.js +16 -0
- package/dist/custom-variable-resolvers/findDataObject.js.map +1 -0
- package/dist/custom-variable-resolvers/index.d.ts +7 -0
- package/dist/custom-variable-resolvers/index.js +24 -0
- package/dist/custom-variable-resolvers/index.js.map +1 -0
- package/dist/custom-variable-resolvers/pipelines/arrayFilter.d.ts +1 -0
- package/dist/custom-variable-resolvers/pipelines/arrayFilter.js +28 -0
- package/dist/custom-variable-resolvers/pipelines/arrayFilter.js.map +1 -0
- package/dist/custom-variable-resolvers/pipelines/arrayJoin.d.ts +1 -0
- package/dist/custom-variable-resolvers/pipelines/arrayJoin.js +12 -0
- package/dist/custom-variable-resolvers/pipelines/arrayJoin.js.map +1 -0
- package/dist/custom-variable-resolvers/pipelines/arrayMap.d.ts +1 -0
- package/dist/custom-variable-resolvers/pipelines/arrayMap.js +23 -0
- package/dist/custom-variable-resolvers/pipelines/arrayMap.js.map +1 -0
- package/dist/custom-variable-resolvers/pipelines/calculateAge.d.ts +1 -0
- package/dist/custom-variable-resolvers/pipelines/calculateAge.js +9 -0
- package/dist/custom-variable-resolvers/pipelines/calculateAge.js.map +1 -0
- package/dist/custom-variable-resolvers/pipelines/documentSelect.d.ts +1 -0
- package/dist/custom-variable-resolvers/pipelines/documentSelect.js +7 -0
- package/dist/custom-variable-resolvers/pipelines/documentSelect.js.map +1 -0
- package/dist/custom-variable-resolvers/pipelines/index.d.ts +12 -0
- package/dist/custom-variable-resolvers/pipelines/index.js +29 -0
- package/dist/custom-variable-resolvers/pipelines/index.js.map +1 -0
- package/dist/custom-variable-resolvers/pipelines/toBoolean.d.ts +1 -0
- package/dist/custom-variable-resolvers/pipelines/toBoolean.js +6 -0
- package/dist/custom-variable-resolvers/pipelines/toBoolean.js.map +1 -0
- package/dist/custom-variable-resolvers/pipelines/toDate.d.ts +3 -0
- package/dist/custom-variable-resolvers/pipelines/toDate.js +12 -0
- package/dist/custom-variable-resolvers/pipelines/toDate.js.map +1 -0
- package/dist/custom-variable-resolvers/pipelines/toLowerCase.d.ts +1 -0
- package/dist/custom-variable-resolvers/pipelines/toLowerCase.js +6 -0
- package/dist/custom-variable-resolvers/pipelines/toLowerCase.js.map +1 -0
- package/dist/custom-variable-resolvers/pipelines/toNumber.d.ts +1 -0
- package/dist/custom-variable-resolvers/pipelines/toNumber.js +6 -0
- package/dist/custom-variable-resolvers/pipelines/toNumber.js.map +1 -0
- package/dist/custom-variable-resolvers/pipelines/toReplaceString.d.ts +1 -0
- package/dist/custom-variable-resolvers/pipelines/toReplaceString.js +26 -0
- package/dist/custom-variable-resolvers/pipelines/toReplaceString.js.map +1 -0
- package/dist/custom-variable-resolvers/pipelines/toString.d.ts +1 -0
- package/dist/custom-variable-resolvers/pipelines/toString.js +6 -0
- package/dist/custom-variable-resolvers/pipelines/toString.js.map +1 -0
- package/dist/custom-variable-resolvers/pipelines/toUpperCase.d.ts +1 -0
- package/dist/custom-variable-resolvers/pipelines/toUpperCase.js +6 -0
- package/dist/custom-variable-resolvers/pipelines/toUpperCase.js.map +1 -0
- package/dist/custom-variable-resolvers/replaceAllVariables.d.ts +5 -0
- package/dist/custom-variable-resolvers/replaceAllVariables.js +44 -0
- package/dist/custom-variable-resolvers/replaceAllVariables.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.js +20 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/functionOperations.d.ts +6 -0
- package/dist/utils/functionOperations.js +84 -0
- package/dist/utils/functionOperations.js.map +1 -0
- package/dist/utils/getAllJsonKeyAndValues.d.ts +1 -0
- package/dist/utils/getAllJsonKeyAndValues.js +49 -0
- package/dist/utils/getAllJsonKeyAndValues.js.map +1 -0
- package/dist/utils/index.d.ts +4 -0
- package/dist/utils/index.js +21 -0
- package/dist/utils/index.js.map +1 -0
- package/dist/utils/newValueInstance.d.ts +2 -0
- package/dist/utils/newValueInstance.js +47 -0
- package/dist/utils/newValueInstance.js.map +1 -0
- package/dist/utils/removeNullAndUndefinedValues.d.ts +1 -0
- package/dist/utils/removeNullAndUndefinedValues.js +17 -0
- package/dist/utils/removeNullAndUndefinedValues.js.map +1 -0
- package/dist/utils/validateArrayValues.d.ts +1 -0
- package/dist/utils/validateArrayValues.js +29 -0
- package/dist/utils/validateArrayValues.js.map +1 -0
- package/dist/utils/validateObjectValues.d.ts +1 -0
- package/dist/utils/validateObjectValues.js +33 -0
- package/dist/utils/validateObjectValues.js.map +1 -0
- package/package.json +5 -5
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./model-variables"), exports);
|
|
18
|
+
__exportStar(require("./kafkaEvents"), exports);
|
|
19
|
+
__exportStar(require("./markers"), exports);
|
|
20
|
+
__exportStar(require("./patterns"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/constants/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,oDAAkC;AAClC,gDAA8B;AAC9B,4CAA0B;AAC1B,6CAA2B"}
|
|
@@ -0,0 +1,57 @@
|
|
|
1
|
+
export declare const KAFKA_EVENTS: {
|
|
2
|
+
appointment: {
|
|
3
|
+
insert: string;
|
|
4
|
+
update: string;
|
|
5
|
+
delete: string;
|
|
6
|
+
};
|
|
7
|
+
appointmentRequest: {
|
|
8
|
+
insert: string;
|
|
9
|
+
update: string;
|
|
10
|
+
delete: string;
|
|
11
|
+
};
|
|
12
|
+
location: {
|
|
13
|
+
insert: string;
|
|
14
|
+
update: string;
|
|
15
|
+
delete: string;
|
|
16
|
+
};
|
|
17
|
+
locationLog: {
|
|
18
|
+
insert: string;
|
|
19
|
+
update: string;
|
|
20
|
+
delete: string;
|
|
21
|
+
};
|
|
22
|
+
reception: {
|
|
23
|
+
insert: string;
|
|
24
|
+
update: string;
|
|
25
|
+
delete: string;
|
|
26
|
+
};
|
|
27
|
+
scheduledProcedure: {
|
|
28
|
+
insert: string;
|
|
29
|
+
update: string;
|
|
30
|
+
delete: string;
|
|
31
|
+
};
|
|
32
|
+
scheduleProfile: {
|
|
33
|
+
insert: string;
|
|
34
|
+
update: string;
|
|
35
|
+
delete: string;
|
|
36
|
+
};
|
|
37
|
+
shift: {
|
|
38
|
+
insert: string;
|
|
39
|
+
update: string;
|
|
40
|
+
delete: string;
|
|
41
|
+
};
|
|
42
|
+
carePlan: {
|
|
43
|
+
insert: string;
|
|
44
|
+
update: string;
|
|
45
|
+
delete: string;
|
|
46
|
+
};
|
|
47
|
+
carePlanType: {
|
|
48
|
+
insert: string;
|
|
49
|
+
update: string;
|
|
50
|
+
delete: string;
|
|
51
|
+
};
|
|
52
|
+
stage: {
|
|
53
|
+
insert: string;
|
|
54
|
+
update: string;
|
|
55
|
+
delete: string;
|
|
56
|
+
};
|
|
57
|
+
};
|
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.KAFKA_EVENTS = void 0;
|
|
4
|
+
exports.KAFKA_EVENTS = {
|
|
5
|
+
appointment: {
|
|
6
|
+
insert: 'appointment-insert',
|
|
7
|
+
update: 'appointment-update',
|
|
8
|
+
delete: 'appointment-delete',
|
|
9
|
+
},
|
|
10
|
+
appointmentRequest: {
|
|
11
|
+
insert: 'appointment-request-insert',
|
|
12
|
+
update: 'appointment-request-update',
|
|
13
|
+
delete: 'appointment-request-delete',
|
|
14
|
+
},
|
|
15
|
+
location: {
|
|
16
|
+
insert: 'location-insert',
|
|
17
|
+
update: 'location-update',
|
|
18
|
+
delete: 'location-delete',
|
|
19
|
+
},
|
|
20
|
+
locationLog: {
|
|
21
|
+
insert: 'location-log-insert',
|
|
22
|
+
update: 'location-log-update',
|
|
23
|
+
delete: 'location-log-delete',
|
|
24
|
+
},
|
|
25
|
+
reception: {
|
|
26
|
+
insert: 'reception-insert',
|
|
27
|
+
update: 'reception-update',
|
|
28
|
+
delete: 'reception-delete',
|
|
29
|
+
},
|
|
30
|
+
scheduledProcedure: {
|
|
31
|
+
insert: 'scheduled-procedure-insert',
|
|
32
|
+
update: 'scheduled-procedure-update',
|
|
33
|
+
delete: 'scheduled-procedure-delete',
|
|
34
|
+
},
|
|
35
|
+
scheduleProfile: {
|
|
36
|
+
insert: 'schedule-profile-insert',
|
|
37
|
+
update: 'schedule-profile-update',
|
|
38
|
+
delete: 'schedule-profile-delete',
|
|
39
|
+
},
|
|
40
|
+
shift: {
|
|
41
|
+
insert: 'shift-insert',
|
|
42
|
+
update: 'shift-update',
|
|
43
|
+
delete: 'shift-delete',
|
|
44
|
+
},
|
|
45
|
+
carePlan: {
|
|
46
|
+
insert: 'care-plan-insert',
|
|
47
|
+
update: 'care-plan-update',
|
|
48
|
+
delete: 'care-plan-delete',
|
|
49
|
+
},
|
|
50
|
+
carePlanType: {
|
|
51
|
+
insert: 'care-plan-type-insert',
|
|
52
|
+
update: 'care-plan-type-update',
|
|
53
|
+
delete: 'care-plan-type-delete',
|
|
54
|
+
},
|
|
55
|
+
stage: {
|
|
56
|
+
insert: 'stage-insert',
|
|
57
|
+
update: 'stage-update',
|
|
58
|
+
delete: 'stage-delete',
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
//# sourceMappingURL=kafkaEvents.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"kafkaEvents.js","sourceRoot":"","sources":["../../src/constants/kafkaEvents.ts"],"names":[],"mappings":";;;AAAa,QAAA,YAAY,GAAG;IAC1B,WAAW,EAAE;QACX,MAAM,EAAE,oBAAoB;QAC5B,MAAM,EAAE,oBAAoB;QAC5B,MAAM,EAAE,oBAAoB;KAC7B;IACD,kBAAkB,EAAE;QAClB,MAAM,EAAE,4BAA4B;QACpC,MAAM,EAAE,4BAA4B;QACpC,MAAM,EAAE,4BAA4B;KACrC;IACD,QAAQ,EAAE;QACR,MAAM,EAAE,iBAAiB;QACzB,MAAM,EAAE,iBAAiB;QACzB,MAAM,EAAE,iBAAiB;KAC1B;IACD,WAAW,EAAE;QACX,MAAM,EAAE,qBAAqB;QAC7B,MAAM,EAAE,qBAAqB;QAC7B,MAAM,EAAE,qBAAqB;KAC9B;IACD,SAAS,EAAE;QACT,MAAM,EAAE,kBAAkB;QAC1B,MAAM,EAAE,kBAAkB;QAC1B,MAAM,EAAE,kBAAkB;KAC3B;IACD,kBAAkB,EAAE;QAClB,MAAM,EAAE,4BAA4B;QACpC,MAAM,EAAE,4BAA4B;QACpC,MAAM,EAAE,4BAA4B;KACrC;IACD,eAAe,EAAE;QACf,MAAM,EAAE,yBAAyB;QACjC,MAAM,EAAE,yBAAyB;QACjC,MAAM,EAAE,yBAAyB;KAClC;IACD,KAAK,EAAE;QACL,MAAM,EAAE,cAAc;QACtB,MAAM,EAAE,cAAc;QACtB,MAAM,EAAE,cAAc;KACvB;IACD,QAAQ,EAAE;QACR,MAAM,EAAE,kBAAkB;QAC1B,MAAM,EAAE,kBAAkB;QAC1B,MAAM,EAAE,kBAAkB;KAC3B;IACD,YAAY,EAAE;QACZ,MAAM,EAAE,uBAAuB;QAC/B,MAAM,EAAE,uBAAuB;QAC/B,MAAM,EAAE,uBAAuB;KAChC;IACD,KAAK,EAAE;QACL,MAAM,EAAE,cAAc;QACtB,MAAM,EAAE,cAAc;QACtB,MAAM,EAAE,cAAc;KACvB;CACF,CAAC"}
|
|
@@ -0,0 +1,6 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.ASYNC_FUNCTION_MARKER = exports.MARKER_TO_REPLACE = void 0;
|
|
4
|
+
exports.MARKER_TO_REPLACE = '[[ASYNC_FUNCTION]]';
|
|
5
|
+
exports.ASYNC_FUNCTION_MARKER = '/** {{ASYNC_FUNCTION}} */';
|
|
6
|
+
//# sourceMappingURL=markers.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"markers.js","sourceRoot":"","sources":["../../src/constants/markers.ts"],"names":[],"mappings":";;;AAAa,QAAA,iBAAiB,GAAG,oBAAoB,CAAC;AACzC,QAAA,qBAAqB,GAAG,2BAA2B,CAAC"}
|
|
@@ -0,0 +1,37 @@
|
|
|
1
|
+
export declare const APPOINTMENT_ENUM: {
|
|
2
|
+
eventType: string;
|
|
3
|
+
scheduleProfile: string;
|
|
4
|
+
patient: string;
|
|
5
|
+
date: string;
|
|
6
|
+
startTime: string;
|
|
7
|
+
endTime: string;
|
|
8
|
+
procedureType: string;
|
|
9
|
+
user: string;
|
|
10
|
+
notificationWay: string;
|
|
11
|
+
consultationType: string;
|
|
12
|
+
status: {
|
|
13
|
+
statusType: string;
|
|
14
|
+
confirmationMethod: string;
|
|
15
|
+
reasonSuspended: string;
|
|
16
|
+
user: string;
|
|
17
|
+
date: string;
|
|
18
|
+
};
|
|
19
|
+
active: string;
|
|
20
|
+
overshift: string;
|
|
21
|
+
licenseKey: string;
|
|
22
|
+
supplier: string;
|
|
23
|
+
attenderType: string;
|
|
24
|
+
host: string;
|
|
25
|
+
details: {
|
|
26
|
+
title: string;
|
|
27
|
+
description: string;
|
|
28
|
+
};
|
|
29
|
+
medicalBoard: {
|
|
30
|
+
participants: string;
|
|
31
|
+
patients: string;
|
|
32
|
+
};
|
|
33
|
+
externalId: string;
|
|
34
|
+
externalIdTwo: string;
|
|
35
|
+
physicalLocation: string;
|
|
36
|
+
virtualLocation: string;
|
|
37
|
+
};
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.APPOINTMENT_ENUM = void 0;
|
|
4
|
+
exports.APPOINTMENT_ENUM = {
|
|
5
|
+
eventType: 'Tipo de evento',
|
|
6
|
+
scheduleProfile: 'Id del perfil de horario',
|
|
7
|
+
patient: 'Información del paciente',
|
|
8
|
+
date: 'Fecha de la cita',
|
|
9
|
+
startTime: 'Hora de inicio',
|
|
10
|
+
endTime: 'Hora de fin',
|
|
11
|
+
procedureType: 'Tipo de procedimiento',
|
|
12
|
+
user: 'Usuario',
|
|
13
|
+
notificationWay: 'Forma de notificación',
|
|
14
|
+
consultationType: 'Tipo de consulta',
|
|
15
|
+
status: {
|
|
16
|
+
statusType: 'Estado de la cita',
|
|
17
|
+
confirmationMethod: 'Método de confirmación',
|
|
18
|
+
reasonSuspended: 'Motivo de suspensión',
|
|
19
|
+
user: 'Usuario que cambió el estado',
|
|
20
|
+
date: 'Fecha de cambio de estado',
|
|
21
|
+
},
|
|
22
|
+
active: 'Modelo activo',
|
|
23
|
+
overshift: 'Sobreturno activo',
|
|
24
|
+
licenseKey: 'Clave de licencia',
|
|
25
|
+
supplier: 'Información del proveedor',
|
|
26
|
+
attenderType: 'Tipo de asistente',
|
|
27
|
+
host: 'Información del anfitrión',
|
|
28
|
+
details: {
|
|
29
|
+
title: 'Título del detalle',
|
|
30
|
+
description: 'Descripción del detalle',
|
|
31
|
+
},
|
|
32
|
+
medicalBoard: {
|
|
33
|
+
participants: 'Participantes del consejo médico',
|
|
34
|
+
patients: 'Pacientes del consejo médico',
|
|
35
|
+
},
|
|
36
|
+
externalId: 'Id externo',
|
|
37
|
+
externalIdTwo: 'Id externo 2',
|
|
38
|
+
physicalLocation: 'Ubicación física',
|
|
39
|
+
virtualLocation: 'Ubicación virtual',
|
|
40
|
+
};
|
|
41
|
+
//# sourceMappingURL=appointment.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appointment.js","sourceRoot":"","sources":["../../../src/constants/model-variables/appointment.ts"],"names":[],"mappings":";;;AAAa,QAAA,gBAAgB,GAAG;IAC9B,SAAS,EAAE,gBAAgB;IAC3B,eAAe,EAAE,0BAA0B;IAC3C,OAAO,EAAE,0BAA0B;IACnC,IAAI,EAAE,kBAAkB;IACxB,SAAS,EAAE,gBAAgB;IAC3B,OAAO,EAAE,aAAa;IACtB,aAAa,EAAE,uBAAuB;IACtC,IAAI,EAAE,SAAS;IACf,eAAe,EAAE,uBAAuB;IACxC,gBAAgB,EAAE,kBAAkB;IACpC,MAAM,EAAE;QACN,UAAU,EAAE,mBAAmB;QAC/B,kBAAkB,EAAE,wBAAwB;QAC5C,eAAe,EAAE,sBAAsB;QACvC,IAAI,EAAE,8BAA8B;QACpC,IAAI,EAAE,2BAA2B;KAClC;IACD,MAAM,EAAE,eAAe;IACvB,SAAS,EAAE,mBAAmB;IAC9B,UAAU,EAAE,mBAAmB;IAC/B,QAAQ,EAAE,2BAA2B;IACrC,YAAY,EAAE,mBAAmB;IACjC,IAAI,EAAE,2BAA2B;IACjC,OAAO,EAAE;QACP,KAAK,EAAE,oBAAoB;QAC3B,WAAW,EAAE,yBAAyB;KACvC;IACD,YAAY,EAAE;QACZ,YAAY,EAAE,kCAAkC;QAChD,QAAQ,EAAE,8BAA8B;KACzC;IACD,UAAU,EAAE,YAAY;IACxB,aAAa,EAAE,cAAc;IAC7B,gBAAgB,EAAE,kBAAkB;IACpC,eAAe,EAAE,mBAAmB;CACrC,CAAC"}
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export declare const APPOINTMENT_REQUEST_ENUM: {
|
|
2
|
+
scheduleProfile: string;
|
|
3
|
+
date: string;
|
|
4
|
+
startTime: string;
|
|
5
|
+
endTime: string;
|
|
6
|
+
isPatient: string;
|
|
7
|
+
patient: string;
|
|
8
|
+
supplier: string;
|
|
9
|
+
procedureType: string;
|
|
10
|
+
active: string;
|
|
11
|
+
notificationWay: string;
|
|
12
|
+
consultationType: string;
|
|
13
|
+
licenseKey: string;
|
|
14
|
+
status: {
|
|
15
|
+
statusType: string;
|
|
16
|
+
confirmationMethod: string;
|
|
17
|
+
reasonSuspended: string;
|
|
18
|
+
user: string;
|
|
19
|
+
date: string;
|
|
20
|
+
comments: string;
|
|
21
|
+
cancelationReason: string;
|
|
22
|
+
};
|
|
23
|
+
requestType: string;
|
|
24
|
+
requestSource: string;
|
|
25
|
+
patientCoverageCondition: string;
|
|
26
|
+
referredBy: string;
|
|
27
|
+
referringOrganization: string;
|
|
28
|
+
referralReason: string;
|
|
29
|
+
referredSpecialty: string;
|
|
30
|
+
provisionalDiagnosis: string;
|
|
31
|
+
encounter: string;
|
|
32
|
+
priority: string;
|
|
33
|
+
notes: string;
|
|
34
|
+
user: string;
|
|
35
|
+
};
|
|
@@ -0,0 +1,39 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.APPOINTMENT_REQUEST_ENUM = void 0;
|
|
4
|
+
exports.APPOINTMENT_REQUEST_ENUM = {
|
|
5
|
+
scheduleProfile: 'Id del perfil de horario',
|
|
6
|
+
date: 'Fecha de la solicitud de cita',
|
|
7
|
+
startTime: 'Hora de inicio',
|
|
8
|
+
endTime: 'Hora de fin',
|
|
9
|
+
isPatient: 'Es paciente',
|
|
10
|
+
patient: 'Información del paciente',
|
|
11
|
+
supplier: 'Información del proveedor',
|
|
12
|
+
procedureType: 'Tipo de procedimiento',
|
|
13
|
+
active: 'Modelo activo',
|
|
14
|
+
notificationWay: 'Forma de notificación',
|
|
15
|
+
consultationType: 'Tipo de consulta',
|
|
16
|
+
licenseKey: 'Clave de licencia',
|
|
17
|
+
status: {
|
|
18
|
+
statusType: 'Estado de la solicitud',
|
|
19
|
+
confirmationMethod: 'Método de confirmación',
|
|
20
|
+
reasonSuspended: 'Motivo de suspensión',
|
|
21
|
+
user: 'Usuario que cambió el estado',
|
|
22
|
+
date: 'Fecha de cambio de estado',
|
|
23
|
+
comments: 'Comentarios del estado',
|
|
24
|
+
cancelationReason: 'Motivo de cancelación',
|
|
25
|
+
},
|
|
26
|
+
requestType: 'Tipo de solicitud',
|
|
27
|
+
requestSource: 'Fuente de la solicitud',
|
|
28
|
+
patientCoverageCondition: 'Condición de cobertura del paciente',
|
|
29
|
+
referredBy: 'Referido por',
|
|
30
|
+
referringOrganization: 'Organización referente',
|
|
31
|
+
referralReason: 'Motivo de la referencia',
|
|
32
|
+
referredSpecialty: 'Especialidad referida',
|
|
33
|
+
provisionalDiagnosis: 'Diagnóstico provisional',
|
|
34
|
+
encounter: 'Información de la consulta',
|
|
35
|
+
priority: 'Prioridad',
|
|
36
|
+
notes: 'Notas',
|
|
37
|
+
user: 'Usuario',
|
|
38
|
+
};
|
|
39
|
+
//# sourceMappingURL=appointmentRequest.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"appointmentRequest.js","sourceRoot":"","sources":["../../../src/constants/model-variables/appointmentRequest.ts"],"names":[],"mappings":";;;AAAa,QAAA,wBAAwB,GAAG;IACtC,eAAe,EAAE,0BAA0B;IAC3C,IAAI,EAAE,+BAA+B;IACrC,SAAS,EAAE,gBAAgB;IAC3B,OAAO,EAAE,aAAa;IACtB,SAAS,EAAE,aAAa;IACxB,OAAO,EAAE,0BAA0B;IACnC,QAAQ,EAAE,2BAA2B;IACrC,aAAa,EAAE,uBAAuB;IACtC,MAAM,EAAE,eAAe;IACvB,eAAe,EAAE,uBAAuB;IACxC,gBAAgB,EAAE,kBAAkB;IACpC,UAAU,EAAE,mBAAmB;IAC/B,MAAM,EAAE;QACN,UAAU,EAAE,wBAAwB;QACpC,kBAAkB,EAAE,wBAAwB;QAC5C,eAAe,EAAE,sBAAsB;QACvC,IAAI,EAAE,8BAA8B;QACpC,IAAI,EAAE,2BAA2B;QACjC,QAAQ,EAAE,wBAAwB;QAClC,iBAAiB,EAAE,uBAAuB;KAC3C;IACD,WAAW,EAAE,mBAAmB;IAChC,aAAa,EAAE,wBAAwB;IACvC,wBAAwB,EAAE,qCAAqC;IAC/D,UAAU,EAAE,cAAc;IAC1B,qBAAqB,EAAE,wBAAwB;IAC/C,cAAc,EAAE,yBAAyB;IACzC,iBAAiB,EAAE,uBAAuB;IAC1C,oBAAoB,EAAE,yBAAyB;IAC/C,SAAS,EAAE,4BAA4B;IACvC,QAAQ,EAAE,WAAW;IACrB,KAAK,EAAE,OAAO;IACd,IAAI,EAAE,SAAS;CAChB,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __exportStar = (this && this.__exportStar) || function(m, exports) {
|
|
14
|
+
for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
|
|
15
|
+
};
|
|
16
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17
|
+
__exportStar(require("./appointment"), exports);
|
|
18
|
+
__exportStar(require("./appointmentRequest"), exports);
|
|
19
|
+
__exportStar(require("./location"), exports);
|
|
20
|
+
__exportStar(require("./scheduledProcedure"), exports);
|
|
21
|
+
//# sourceMappingURL=index.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../src/constants/model-variables/index.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,gDAA8B;AAC9B,uDAAqC;AACrC,6CAA2B;AAC3B,uDAAqC"}
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
export declare const LOCATION_ENUM: {
|
|
2
|
+
managingOrganization: string;
|
|
3
|
+
partOf: string;
|
|
4
|
+
status: string;
|
|
5
|
+
operationalStatus: string;
|
|
6
|
+
name: string;
|
|
7
|
+
code: string;
|
|
8
|
+
alias: string;
|
|
9
|
+
mode: string;
|
|
10
|
+
locationType: string;
|
|
11
|
+
address: string;
|
|
12
|
+
telecom: string;
|
|
13
|
+
physicalType: string;
|
|
14
|
+
position: {
|
|
15
|
+
longitude: string;
|
|
16
|
+
latitude: string;
|
|
17
|
+
altitude: string;
|
|
18
|
+
};
|
|
19
|
+
description: string;
|
|
20
|
+
hoursOfOperation: string;
|
|
21
|
+
availabilityExceptions: string;
|
|
22
|
+
procedureCategory: string;
|
|
23
|
+
procedureType: string;
|
|
24
|
+
active: string;
|
|
25
|
+
licenseKey: string;
|
|
26
|
+
};
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.LOCATION_ENUM = void 0;
|
|
4
|
+
exports.LOCATION_ENUM = {
|
|
5
|
+
managingOrganization: 'Id de la organización que administra la ubicación',
|
|
6
|
+
partOf: 'Id de la dependencia',
|
|
7
|
+
status: 'Estado de la ubicación',
|
|
8
|
+
operationalStatus: 'Estatus de la operación',
|
|
9
|
+
name: 'Nombre de la ubicación',
|
|
10
|
+
code: 'Código de la ubicación',
|
|
11
|
+
alias: 'Alias de la ubicación',
|
|
12
|
+
mode: 'Modo de la ubicación',
|
|
13
|
+
locationType: 'Tipo de ubicación',
|
|
14
|
+
address: 'Dirección de la ubicación',
|
|
15
|
+
telecom: 'Contacto de la ubicación',
|
|
16
|
+
physicalType: 'Tipo de ubicación física',
|
|
17
|
+
position: {
|
|
18
|
+
longitude: 'Longitud',
|
|
19
|
+
latitude: 'Latitud',
|
|
20
|
+
altitude: 'Altitud',
|
|
21
|
+
},
|
|
22
|
+
description: 'Descripción de la ubicación',
|
|
23
|
+
hoursOfOperation: 'Horarios de la operación',
|
|
24
|
+
availabilityExceptions: 'Excepciones de disponibilidad',
|
|
25
|
+
procedureCategory: 'Categoría de procedimientos',
|
|
26
|
+
procedureType: 'Tipos de procedimientos',
|
|
27
|
+
active: 'Modelo activo',
|
|
28
|
+
licenseKey: 'Clave de licencia',
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=location.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"location.js","sourceRoot":"","sources":["../../../src/constants/model-variables/location.ts"],"names":[],"mappings":";;;AAAa,QAAA,aAAa,GAAG;IAC3B,oBAAoB,EAAE,mDAAmD;IACzE,MAAM,EAAE,sBAAsB;IAC9B,MAAM,EAAE,wBAAwB;IAChC,iBAAiB,EAAE,yBAAyB;IAC5C,IAAI,EAAE,wBAAwB;IAC9B,IAAI,EAAE,wBAAwB;IAC9B,KAAK,EAAE,uBAAuB;IAC9B,IAAI,EAAE,sBAAsB;IAC5B,YAAY,EAAE,mBAAmB;IACjC,OAAO,EAAE,2BAA2B;IACpC,OAAO,EAAE,0BAA0B;IACnC,YAAY,EAAE,0BAA0B;IACxC,QAAQ,EAAE;QACR,SAAS,EAAE,UAAU;QACrB,QAAQ,EAAE,SAAS;QACnB,QAAQ,EAAE,SAAS;KACpB;IACD,WAAW,EAAE,6BAA6B;IAC1C,gBAAgB,EAAE,0BAA0B;IAC5C,sBAAsB,EAAE,+BAA+B;IACvD,iBAAiB,EAAE,6BAA6B;IAChD,aAAa,EAAE,yBAAyB;IACxC,MAAM,EAAE,eAAe;IACvB,UAAU,EAAE,mBAAmB;CAChC,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
export declare const SCHEDULED_PROCEDURE_ENUM: {
|
|
2
|
+
scheduleProfile: string;
|
|
3
|
+
date: string;
|
|
4
|
+
startTime: string;
|
|
5
|
+
endTime: string;
|
|
6
|
+
location: string;
|
|
7
|
+
patient: string;
|
|
8
|
+
practitioners: string;
|
|
9
|
+
procedureType: string;
|
|
10
|
+
status: {
|
|
11
|
+
statusType: string;
|
|
12
|
+
confirmationMethod: string;
|
|
13
|
+
reasonSuspended: string;
|
|
14
|
+
user: string;
|
|
15
|
+
date: string;
|
|
16
|
+
};
|
|
17
|
+
observations: string;
|
|
18
|
+
active: string;
|
|
19
|
+
licenseKey: string;
|
|
20
|
+
overshift: string;
|
|
21
|
+
};
|
|
@@ -0,0 +1,25 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.SCHEDULED_PROCEDURE_ENUM = void 0;
|
|
4
|
+
exports.SCHEDULED_PROCEDURE_ENUM = {
|
|
5
|
+
scheduleProfile: 'Id del perfil de horario',
|
|
6
|
+
date: 'Fecha del procedimiento',
|
|
7
|
+
startTime: 'Hora de inicio',
|
|
8
|
+
endTime: 'Hora de fin',
|
|
9
|
+
location: 'Ubicación del procedimiento',
|
|
10
|
+
patient: 'Información del paciente',
|
|
11
|
+
practitioners: 'Información de los practicantes',
|
|
12
|
+
procedureType: 'Tipo de procedimiento',
|
|
13
|
+
status: {
|
|
14
|
+
statusType: 'Estado del procedimiento',
|
|
15
|
+
confirmationMethod: 'Método de confirmación',
|
|
16
|
+
reasonSuspended: 'Motivo de suspensión',
|
|
17
|
+
user: 'Usuario que cambió el estado',
|
|
18
|
+
date: 'Fecha de cambio de estado',
|
|
19
|
+
},
|
|
20
|
+
observations: 'Observaciones del procedimiento',
|
|
21
|
+
active: 'Modelo activo',
|
|
22
|
+
licenseKey: 'Clave de licencia',
|
|
23
|
+
overshift: 'Sobreturno activo',
|
|
24
|
+
};
|
|
25
|
+
//# sourceMappingURL=scheduledProcedure.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"scheduledProcedure.js","sourceRoot":"","sources":["../../../src/constants/model-variables/scheduledProcedure.ts"],"names":[],"mappings":";;;AAAa,QAAA,wBAAwB,GAAG;IACtC,eAAe,EAAE,0BAA0B;IAC3C,IAAI,EAAE,yBAAyB;IAC/B,SAAS,EAAE,gBAAgB;IAC3B,OAAO,EAAE,aAAa;IACtB,QAAQ,EAAE,6BAA6B;IACvC,OAAO,EAAE,0BAA0B;IACnC,aAAa,EAAE,iCAAiC;IAChD,aAAa,EAAE,uBAAuB;IACtC,MAAM,EAAE;QACN,UAAU,EAAE,0BAA0B;QACtC,kBAAkB,EAAE,wBAAwB;QAC5C,eAAe,EAAE,sBAAsB;QACvC,IAAI,EAAE,8BAA8B;QACpC,IAAI,EAAE,2BAA2B;KAClC;IACD,YAAY,EAAE,iCAAiC;IAC/C,MAAM,EAAE,eAAe;IACvB,UAAU,EAAE,mBAAmB;IAC/B,SAAS,EAAE,mBAAmB;CAC/B,CAAC"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare const PATTERN_VARIABLES_STRUCTURE: RegExp;
|
|
@@ -0,0 +1,5 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.PATTERN_VARIABLES_STRUCTURE = void 0;
|
|
4
|
+
exports.PATTERN_VARIABLES_STRUCTURE = /\[\[[a-zA-Z0-9áéíóúÁÉÍÓÚüÜñÑ\-\.\_, \(\)]+( \| [a-zA-Z0-9]+(: [a-zA-Z0-9áéíóúÁÉÍÓÚüÜñÑ ,{}\+\-/*()&\.<=>\|\?'"_\-\^]+)*)*\]\]/g;
|
|
5
|
+
//# sourceMappingURL=patterns.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"patterns.js","sourceRoot":"","sources":["../../src/constants/patterns.ts"],"names":[],"mappings":";;;AAAa,QAAA,2BAA2B,GACtC,gIAAgI,CAAC"}
|
|
@@ -0,0 +1,40 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.executeCondition = void 0;
|
|
4
|
+
const type_check_1 = require("type-check");
|
|
5
|
+
const findDataObject_1 = require("./findDataObject");
|
|
6
|
+
const executeCondition = (data, condition, regExpVariables, Options) => {
|
|
7
|
+
const options = Object.assign({ emitConditionError: false }, (Options || {}));
|
|
8
|
+
if (!(0, type_check_1.typeCheck)('String', condition) || !condition) {
|
|
9
|
+
throw new Error('execute condition: condition is not a string or is empty');
|
|
10
|
+
}
|
|
11
|
+
let newCondition = condition || '';
|
|
12
|
+
const regExp = new RegExp(regExpVariables);
|
|
13
|
+
const variables = condition.match(regExp) || [];
|
|
14
|
+
for (const variable of variables) {
|
|
15
|
+
const fieldPath = variable.replace('{{', '').replace('}}', '');
|
|
16
|
+
const splitFields = fieldPath.split('.');
|
|
17
|
+
try {
|
|
18
|
+
let value = (0, findDataObject_1.findDataObject)(splitFields, data, fieldPath);
|
|
19
|
+
if ((0, type_check_1.typeCheck)('String', value)) {
|
|
20
|
+
value = `'${value}'`;
|
|
21
|
+
}
|
|
22
|
+
newCondition = newCondition.replace(variable, value);
|
|
23
|
+
}
|
|
24
|
+
catch (error) {
|
|
25
|
+
if (options.emitConditionError) {
|
|
26
|
+
throw new Error(`execute condition: ${error.message}`);
|
|
27
|
+
}
|
|
28
|
+
newCondition = newCondition.replace(variable, 'null');
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
try {
|
|
32
|
+
const response = Function(`return ${newCondition}`)();
|
|
33
|
+
return response;
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
throw error;
|
|
37
|
+
}
|
|
38
|
+
};
|
|
39
|
+
exports.executeCondition = executeCondition;
|
|
40
|
+
//# sourceMappingURL=executeCondition.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executeCondition.js","sourceRoot":"","sources":["../../src/custom-variable-resolvers/executeCondition.ts"],"names":[],"mappings":";;;AAAA,2CAAuC;AACvC,qDAAkD;AAM3C,MAAM,gBAAgB,GAAG,CAC9B,IAAS,EACT,SAAiB,EACjB,eAAuB,EACvB,OAAkC,EAClC,EAAE;IACF,MAAM,OAAO,mBACX,kBAAkB,EAAE,KAAK,IACtB,CAAC,OAAO,IAAI,EAAE,CAAC,CACnB,CAAC;IACF,IAAI,CAAC,IAAA,sBAAS,EAAC,QAAQ,EAAE,SAAS,CAAC,IAAI,CAAC,SAAS,EAAE,CAAC;QAClD,MAAM,IAAI,KAAK,CAAC,0DAA0D,CAAC,CAAC;IAC9E,CAAC;IACD,IAAI,YAAY,GAAG,SAAS,IAAI,EAAE,CAAC;IACnC,MAAM,MAAM,GAAG,IAAI,MAAM,CAAC,eAAe,CAAC,CAAC;IAC3C,MAAM,SAAS,GAAG,SAAS,CAAC,KAAK,CAAC,MAAM,CAAC,IAAI,EAAE,CAAC;IAChD,KAAK,MAAM,QAAQ,IAAI,SAAS,EAAE,CAAC;QACjC,MAAM,SAAS,GAAG,QAAQ,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC,OAAO,CAAC,IAAI,EAAE,EAAE,CAAC,CAAC;QAC/D,MAAM,WAAW,GAAG,SAAS,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;QACzC,IAAI,CAAC;YACH,IAAI,KAAK,GAAG,IAAA,+BAAc,EAAC,WAAW,EAAE,IAAI,EAAE,SAAS,CAAC,CAAC;YACzD,IAAI,IAAA,sBAAS,EAAC,QAAQ,EAAE,KAAK,CAAC,EAAE,CAAC;gBAC/B,KAAK,GAAG,IAAI,KAAK,GAAG,CAAC;YACvB,CAAC;YAED,YAAY,GAAG,YAAY,CAAC,OAAO,CAAC,QAAQ,EAAE,KAAK,CAAC,CAAC;QACvD,CAAC;QAAC,OAAO,KAAU,EAAE,CAAC;YACpB,IAAI,OAAO,CAAC,kBAAkB,EAAE,CAAC;gBAC/B,MAAM,IAAI,KAAK,CAAC,sBAAsB,KAAK,CAAC,OAAO,EAAE,CAAC,CAAC;YACzD,CAAC;YACD,YAAY,GAAG,YAAY,CAAC,OAAO,CAAC,QAAQ,EAAE,MAAM,CAAC,CAAC;QACxD,CAAC;IACH,CAAC;IAED,IAAI,CAAC;QACH,MAAM,QAAQ,GAAG,QAAQ,CAAC,UAAU,YAAY,EAAE,CAAC,EAAE,CAAC;QACtD,OAAO,QAAQ,CAAC;IAClB,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAC;AAxCW,QAAA,gBAAgB,oBAwC3B"}
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
3
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
4
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
5
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
6
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
7
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
8
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
9
|
+
});
|
|
10
|
+
};
|
|
11
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
12
|
+
exports.executeFormula = void 0;
|
|
13
|
+
const type_check_1 = require("type-check");
|
|
14
|
+
const replaceAllVariables_1 = require("./replaceAllVariables");
|
|
15
|
+
const executeFormula = (formula, data, customPipelines) => __awaiter(void 0, void 0, void 0, function* () {
|
|
16
|
+
if (!(0, type_check_1.typeCheck)('String', formula) || !formula) {
|
|
17
|
+
throw new Error('execute formula: formula is not a string or is empty');
|
|
18
|
+
}
|
|
19
|
+
const variables = yield (0, replaceAllVariables_1.replaceAllVariables)(formula, data, customPipelines);
|
|
20
|
+
try {
|
|
21
|
+
return Function(`return ${variables}`)();
|
|
22
|
+
}
|
|
23
|
+
catch (error) {
|
|
24
|
+
throw error;
|
|
25
|
+
}
|
|
26
|
+
});
|
|
27
|
+
exports.executeFormula = executeFormula;
|
|
28
|
+
//# sourceMappingURL=executeFormula.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"executeFormula.js","sourceRoot":"","sources":["../../src/custom-variable-resolvers/executeFormula.ts"],"names":[],"mappings":";;;;;;;;;;;;AAAA,2CAAuC;AAEvC,+DAA4D;AAErD,MAAM,cAAc,GAAG,CAAO,OAAe,EAAE,IAAS,EAAE,eAA+B,EAAgB,EAAE;IAChH,IAAI,CAAC,IAAA,sBAAS,EAAC,QAAQ,EAAE,OAAO,CAAC,IAAI,CAAC,OAAO,EAAE,CAAC;QAC9C,MAAM,IAAI,KAAK,CAAC,sDAAsD,CAAC,CAAC;IAC1E,CAAC;IAED,MAAM,SAAS,GAAG,MAAM,IAAA,yCAAmB,EAAC,OAAO,EAAE,IAAI,EAAE,eAAe,CAAC,CAAC;IAE5E,IAAI,CAAC;QACH,OAAO,QAAQ,CAAC,UAAU,SAAS,EAAE,CAAC,EAAE,CAAC;IAC3C,CAAC;IAAC,OAAO,KAAK,EAAE,CAAC;QACf,MAAM,KAAK,CAAC;IACd,CAAC;AACH,CAAC,CAAA,CAAC;AAZW,QAAA,cAAc,kBAYzB"}
|
|
@@ -0,0 +1,8 @@
|
|
|
1
|
+
export interface IExecuteVariableEstructureOptions {
|
|
2
|
+
findDataObjectEmitError?: boolean;
|
|
3
|
+
pipelineEmitError?: boolean;
|
|
4
|
+
}
|
|
5
|
+
export interface IPipelinesMap {
|
|
6
|
+
[key: string]: Function;
|
|
7
|
+
}
|
|
8
|
+
export declare const executeVariableEstructure: (variable: string, data: any, customPipelines?: IPipelinesMap, Options?: IExecuteVariableEstructureOptions) => Promise<any>;
|