@awell-health/awell-extensions 1.0.103 → 1.0.105
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/extensions/docuSign/settings.d.ts +2 -2
- package/dist/extensions/elation/actions/createAppointment.d.ts +6 -6
- package/dist/extensions/elation/actions/createAppointment.js +12 -12
- package/dist/extensions/elation/actions/createAppointment.js.map +1 -1
- package/dist/extensions/elation/actions/createNonVisitNote.d.ts +6 -27
- package/dist/extensions/elation/actions/createNonVisitNote.js +25 -39
- package/dist/extensions/elation/actions/createNonVisitNote.js.map +1 -1
- package/dist/extensions/elation/actions/createPatient.d.ts +17 -2
- package/dist/extensions/elation/actions/createPatient.js +48 -19
- package/dist/extensions/elation/actions/createPatient.js.map +1 -1
- package/dist/extensions/elation/actions/deleteNonVisitNote.js +1 -1
- package/dist/extensions/elation/actions/deleteNonVisitNote.js.map +1 -1
- package/dist/extensions/elation/actions/findPhysician.js +0 -7
- package/dist/extensions/elation/actions/findPhysician.js.map +1 -1
- package/dist/extensions/elation/actions/getAppointment.js +1 -1
- package/dist/extensions/elation/actions/getAppointment.js.map +1 -1
- package/dist/extensions/elation/actions/getPatient.d.ts +5 -1
- package/dist/extensions/elation/actions/getPatient.js +11 -3
- package/dist/extensions/elation/actions/getPatient.js.map +1 -1
- package/dist/extensions/elation/actions/getPhysician/config/dataPoints.d.ts +30 -0
- package/dist/extensions/elation/actions/getPhysician/config/dataPoints.js +34 -0
- package/dist/extensions/elation/actions/getPhysician/config/dataPoints.js.map +1 -0
- package/dist/extensions/elation/actions/getPhysician/config/fields.d.ts +18 -0
- package/dist/extensions/elation/actions/getPhysician/config/fields.js +19 -0
- package/dist/extensions/elation/actions/getPhysician/config/fields.js.map +1 -0
- package/dist/extensions/elation/actions/getPhysician/config/index.d.ts +2 -0
- package/dist/extensions/elation/actions/getPhysician/config/index.js +9 -0
- package/dist/extensions/elation/actions/getPhysician/config/index.js.map +1 -0
- package/dist/extensions/elation/actions/getPhysician/getPhysician.d.ts +4 -0
- package/dist/extensions/elation/actions/getPhysician/getPhysician.js +86 -0
- package/dist/extensions/elation/actions/getPhysician/getPhysician.js.map +1 -0
- package/dist/extensions/elation/actions/getPhysician/getPhysician.test.d.ts +1 -0
- package/dist/extensions/elation/actions/getPhysician/getPhysician.test.js +46 -0
- package/dist/extensions/elation/actions/getPhysician/getPhysician.test.js.map +1 -0
- package/dist/extensions/elation/actions/getPhysician/index.d.ts +1 -0
- package/dist/extensions/elation/actions/getPhysician/index.js +6 -0
- package/dist/extensions/elation/actions/getPhysician/index.js.map +1 -0
- package/dist/extensions/elation/actions/index.d.ts +50 -119
- package/dist/extensions/elation/actions/index.js +4 -2
- package/dist/extensions/elation/actions/index.js.map +1 -1
- package/dist/extensions/elation/actions/updatePatient.d.ts +7 -7
- package/dist/extensions/elation/actions/updatePatient.js +37 -26
- package/dist/extensions/elation/actions/updatePatient.js.map +1 -1
- package/dist/extensions/elation/client.d.ts +5 -3
- package/dist/extensions/elation/client.js +12 -1
- package/dist/extensions/elation/client.js.map +1 -1
- package/dist/extensions/elation/types/patient.d.ts +3 -2
- package/dist/extensions/elation/utils/elationMobilePhoneToE164/elationMobilePhoneToE164.d.ts +9 -0
- package/dist/extensions/elation/utils/elationMobilePhoneToE164/elationMobilePhoneToE164.js +24 -0
- package/dist/extensions/elation/utils/elationMobilePhoneToE164/elationMobilePhoneToE164.js.map +1 -0
- package/dist/extensions/elation/utils/elationMobilePhoneToE164/elationMobilePhoneToE164.test.d.ts +1 -0
- package/dist/extensions/elation/utils/elationMobilePhoneToE164/elationMobilePhoneToE164.test.js +26 -0
- package/dist/extensions/elation/utils/elationMobilePhoneToE164/elationMobilePhoneToE164.test.js.map +1 -0
- package/dist/extensions/elation/utils/elationMobilePhoneToE164/index.d.ts +1 -0
- package/dist/extensions/elation/utils/elationMobilePhoneToE164/index.js +6 -0
- package/dist/extensions/elation/utils/elationMobilePhoneToE164/index.js.map +1 -0
- package/dist/extensions/elation/utils/getLastEmail/getLastEmail.d.ts +2 -0
- package/dist/extensions/elation/utils/getLastEmail/getLastEmail.js +21 -0
- package/dist/extensions/elation/utils/getLastEmail/getLastEmail.js.map +1 -0
- package/dist/extensions/elation/utils/getLastEmail/getLastEmail.test.d.ts +1 -0
- package/dist/extensions/elation/utils/getLastEmail/getLastEmail.test.js +29 -0
- package/dist/extensions/elation/utils/getLastEmail/getLastEmail.test.js.map +1 -0
- package/dist/extensions/elation/utils/getLastEmail/index.d.ts +1 -0
- package/dist/extensions/elation/utils/getLastEmail/index.js +6 -0
- package/dist/extensions/elation/utils/getLastEmail/index.js.map +1 -0
- package/dist/extensions/elation/validation/patient.zod.d.ts +591 -0
- package/dist/extensions/elation/validation/patient.zod.js +39 -1
- package/dist/extensions/elation/validation/patient.zod.js.map +1 -1
- package/dist/extensions/elation/webhooks/appointmentCreatedOrUpdated.d.ts +11 -0
- package/dist/extensions/elation/webhooks/appointmentCreatedOrUpdated.js +34 -0
- package/dist/extensions/elation/webhooks/appointmentCreatedOrUpdated.js.map +1 -0
- package/dist/extensions/elation/webhooks/index.d.ts +1 -2
- package/dist/extensions/elation/webhooks/index.js +2 -1
- package/dist/extensions/elation/webhooks/index.js.map +1 -1
- package/dist/extensions/elation/webhooks/patientCreatedOrUpdated.d.ts +1 -1
- package/dist/extensions/elation/webhooks/patientCreatedOrUpdated.js +1 -1
- package/dist/extensions/index.js +2 -0
- package/dist/extensions/index.js.map +1 -1
- package/dist/extensions/markdown.json +6 -2
- package/dist/extensions/zusHealth/client/client.d.ts +12 -0
- package/dist/extensions/zusHealth/client/client.js +42 -0
- package/dist/extensions/zusHealth/client/client.js.map +1 -0
- package/dist/extensions/zusHealth/client/index.d.ts +1 -0
- package/dist/extensions/zusHealth/client/index.js +6 -0
- package/dist/extensions/zusHealth/client/index.js.map +1 -0
- package/dist/extensions/zusHealth/client/type.d.ts +6 -0
- package/dist/extensions/zusHealth/client/type.js +3 -0
- package/dist/extensions/zusHealth/client/type.js.map +1 -0
- package/dist/extensions/zusHealth/index.d.ts +2 -0
- package/dist/extensions/zusHealth/index.js +20 -0
- package/dist/extensions/zusHealth/index.js.map +1 -0
- package/dist/extensions/zusHealth/settings.d.ts +37 -0
- package/dist/extensions/zusHealth/settings.js +41 -0
- package/dist/extensions/zusHealth/settings.js.map +1 -0
- package/dist/extensions/zusHealth/utils/error.d.ts +6 -0
- package/dist/extensions/zusHealth/utils/error.js +53 -0
- package/dist/extensions/zusHealth/utils/error.js.map +1 -0
- package/dist/extensions/zusHealth/utils/index.d.ts +1 -0
- package/dist/extensions/zusHealth/utils/index.js +18 -0
- package/dist/extensions/zusHealth/utils/index.js.map +1 -0
- package/dist/extensions/zusHealth/validation/encounter.zod.d.ts +2 -0
- package/dist/extensions/zusHealth/validation/encounter.zod.js +9 -0
- package/dist/extensions/zusHealth/validation/encounter.zod.js.map +1 -0
- package/dist/extensions/zusHealth/validation/index.d.ts +2 -0
- package/dist/extensions/zusHealth/validation/index.js +19 -0
- package/dist/extensions/zusHealth/validation/index.js.map +1 -0
- package/dist/extensions/zusHealth/validation/settings.zod.d.ts +20 -0
- package/dist/extensions/zusHealth/validation/settings.zod.js +22 -0
- package/dist/extensions/zusHealth/validation/settings.zod.js.map +1 -0
- package/dist/extensions/zusHealth/webhooks/index.d.ts +3 -0
- package/dist/extensions/zusHealth/webhooks/index.js +7 -0
- package/dist/extensions/zusHealth/webhooks/index.js.map +1 -0
- package/dist/extensions/zusHealth/webhooks/patientAdmitted.d.ts +43 -0
- package/dist/extensions/zusHealth/webhooks/patientAdmitted.js +93 -0
- package/dist/extensions/zusHealth/webhooks/patientAdmitted.js.map +1 -0
- package/dist/extensions/zusHealth/webhooks/patientDischarged.d.ts +47 -0
- package/dist/extensions/zusHealth/webhooks/patientDischarged.js +98 -0
- package/dist/extensions/zusHealth/webhooks/patientDischarged.js.map +1 -0
- package/dist/extensions/zusHealth/webhooks/types.d.ts +28 -0
- package/dist/extensions/zusHealth/webhooks/types.js +22 -0
- package/dist/extensions/zusHealth/webhooks/types.js.map +1 -0
- package/package.json +1 -1
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../extensions/elation/client.ts"],"names":[],"mappings":";;;AAAA,mEAMsC;
|
1
|
+
{"version":3,"file":"client.js","sourceRoot":"","sources":["../../../extensions/elation/client.ts"],"names":[],"mappings":";;;AAAA,mEAMsC;AAgBtC,4DAA0D;AAC1D,mCAA6C;AAO7C,MAAa,kBAAmB,SAAQ,6BAAW;IAC1C,KAAK,CAAC,cAAc,CAAC,EAAU;QACpC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAsB;YAC5C,MAAM,EAAE,KAAK;YACb,GAAG,EAAE,iBAAiB,EAAE,EAAE;SAC3B,CAAC,CAAA;QACF,MAAM,GAAG,GAAG,MAAM,GAAG,CAAA;QACrB,OAAO,GAAG,CAAA;IACZ,CAAC;IAEM,KAAK,CAAC,iBAAiB,CAC5B,GAA8B;QAE9B,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAsB;YAC5C,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,eAAe;YACpB,IAAI,EAAE,GAAG;SACV,CAAC,CAAA;QACF,MAAM,GAAG,GAAG,MAAM,GAAG,CAAA;QACrB,OAAO,GAAG,CAAA;IACZ,CAAC;IAEM,KAAK,CAAC,UAAU,CAAC,EAAU;QAChC,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAkB;YACxC,MAAM,EAAE,KAAK;YACb,GAAG,EAAE,aAAa,EAAE,EAAE;SACvB,CAAC,CAAA;QACF,MAAM,GAAG,GAAG,MAAM,GAAG,CAAA;QACrB,OAAO,GAAG,CAAA;IACZ,CAAC;IAEM,KAAK,CAAC,aAAa,CACxB,GAA0B;QAE1B,MAAM,GAAG,GAAG,IAAI,CAAC,OAAO,CAAkB;YACxC,MAAM,EAAE,MAAM;YACd,GAAG,EAAE,WAAW;YAChB,IAAI,EAAE,GAAG;SACV,CAAC,CA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EACV,GAA+B;QAE/B,OAAO,MAAM,IAAI,CAAC,SAAS,CACzB,KAAK,EAAE,EAAE,EAAE,EAAE,CAAC,MAAM,EAAE,CAAC,kBAAkB,CAAC,EAAE,EAAE,GAAG,CAAC,CACnD,CAAA;IACH,CAAC;IAEM,KAAK,CAAC,kBAAkB,CAAC,EAAU;QACxC,MAAM,IAAI,CAAC,SAAS,CAAC,KAAK,EAAE,EAAE,EAAE,EAAE;YAChC,MAAM,EAAE,CAAC,kBAAkB,CAAC,EAAE,CAAC,CAAA;QACjC,CAAC,CAAC,CAAA;IACJ,CAAC;CACF;AA1GD,4CA0GC;AAEM,MAAM,aAAa,GAAG,CAC3B,eAAkE,EAChD,EAAE;IACpB,MAAM,EAAE,QAAQ,EAAE,QAAQ,EAAE,GAAG,qBAAqB,EAAE,GACpD,6BAAc,CAAC,KAAK,CAAC,eAAe,CAAC,CAAA;IAEvC,OAAO,IAAI,gBAAgB,CAAC;QAC1B,OAAO,EAAE,QAAQ;QACjB,aAAa,EAAE,qBAAqB;QACpC,OAAO,EAAE,QAAQ;KAClB,CAAC,CAAA;AACJ,CAAC,CAAA;AAXY,QAAA,aAAa,iBAWzB"}
|
@@ -1,6 +1,7 @@
|
|
1
1
|
import { type z } from 'zod';
|
2
|
-
import { type patientStatusSchema, type patientSchema, type insuranceSchema, type guarantorSchema, type phoneSchema, type emailSchema } from '../validation/patient.zod';
|
2
|
+
import { type patientStatusSchema, type patientSchema, type updatePatientSchema, type insuranceSchema, type guarantorSchema, type phoneSchema, type emailSchema } from '../validation/patient.zod';
|
3
3
|
export type PatientInput = z.infer<typeof patientSchema>;
|
4
|
+
export type UpdatePatientInput = z.infer<typeof updatePatientSchema>;
|
4
5
|
/**
|
5
6
|
* There is a difference between `input` and `output` objects in Elation,
|
6
7
|
* some fields are readonly (not in input), some have different structure
|
@@ -23,7 +24,7 @@ interface Phone extends z.infer<typeof phoneSchema> {
|
|
23
24
|
created_date: string;
|
24
25
|
deleted_date?: string | null;
|
25
26
|
}
|
26
|
-
interface Email extends z.infer<typeof emailSchema> {
|
27
|
+
export interface Email extends z.infer<typeof emailSchema> {
|
27
28
|
created_date: string;
|
28
29
|
deleted_date?: string | null;
|
29
30
|
}
|
@@ -0,0 +1,9 @@
|
|
1
|
+
/**
|
2
|
+
* Elation is a US-only EHR and they store mobile numbers without country code.
|
3
|
+
* We can only work with mobile phones (e.g. to send an SMS) if the phone number is
|
4
|
+
* in international (E.164) format so will have to parse the phone number.
|
5
|
+
*
|
6
|
+
* If we can't parse the phone number to international format, we'll set the
|
7
|
+
* mobile phone to undefined.
|
8
|
+
*/
|
9
|
+
export declare const elationMobilePhoneToE164: (phoneNumber: string | undefined) => string | undefined;
|
@@ -0,0 +1,24 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.elationMobilePhoneToE164 = void 0;
|
4
|
+
const libphonenumber_js_1 = require("libphonenumber-js");
|
5
|
+
const lodash_1 = require("lodash");
|
6
|
+
/**
|
7
|
+
* Elation is a US-only EHR and they store mobile numbers without country code.
|
8
|
+
* We can only work with mobile phones (e.g. to send an SMS) if the phone number is
|
9
|
+
* in international (E.164) format so will have to parse the phone number.
|
10
|
+
*
|
11
|
+
* If we can't parse the phone number to international format, we'll set the
|
12
|
+
* mobile phone to undefined.
|
13
|
+
*/
|
14
|
+
const elationMobilePhoneToE164 = (phoneNumber) => {
|
15
|
+
if ((0, lodash_1.isNil)(phoneNumber))
|
16
|
+
return undefined;
|
17
|
+
const parsedNumber = (0, libphonenumber_js_1.parsePhoneNumberFromString)(phoneNumber, 'US');
|
18
|
+
if ((0, lodash_1.isNil)(parsedNumber) || !parsedNumber.isValid()) {
|
19
|
+
return undefined;
|
20
|
+
}
|
21
|
+
return parsedNumber.format('E.164');
|
22
|
+
};
|
23
|
+
exports.elationMobilePhoneToE164 = elationMobilePhoneToE164;
|
24
|
+
//# sourceMappingURL=elationMobilePhoneToE164.js.map
|
package/dist/extensions/elation/utils/elationMobilePhoneToE164/elationMobilePhoneToE164.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"elationMobilePhoneToE164.js","sourceRoot":"","sources":["../../../../../extensions/elation/utils/elationMobilePhoneToE164/elationMobilePhoneToE164.ts"],"names":[],"mappings":";;;AAAA,yDAA8D;AAC9D,mCAA8B;AAE9B;;;;;;;GAOG;AACI,MAAM,wBAAwB,GAAG,CACtC,WAA+B,EACX,EAAE;IACtB,IAAI,IAAA,cAAK,EAAC,WAAW,CAAC;QAAE,OAAO,SAAS,CAAA;IAExC,MAAM,YAAY,GAAG,IAAA,8CAA0B,EAAC,WAAW,EAAE,IAAI,CAAC,CAAA;IAElE,IAAI,IAAA,cAAK,EAAC,YAAY,CAAC,IAAI,CAAC,YAAY,CAAC,OAAO,EAAE,EAAE;QAClD,OAAO,SAAS,CAAA;KACjB;IAED,OAAO,YAAY,CAAC,MAAM,CAAC,OAAO,CAAC,CAAA;AACrC,CAAC,CAAA;AAZY,QAAA,wBAAwB,4BAYpC"}
|
package/dist/extensions/elation/utils/elationMobilePhoneToE164/elationMobilePhoneToE164.test.d.ts
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
package/dist/extensions/elation/utils/elationMobilePhoneToE164/elationMobilePhoneToE164.test.js
ADDED
@@ -0,0 +1,26 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const _1 = require(".");
|
4
|
+
describe('Elation: mobile number in national format to E.164 format', () => {
|
5
|
+
test('If mobile number is empty then it should return undefined', async () => {
|
6
|
+
const res = (0, _1.elationMobilePhoneToE164)('');
|
7
|
+
expect(res).toEqual(undefined);
|
8
|
+
});
|
9
|
+
test('If mobile number is undefined then it should return undefined', async () => {
|
10
|
+
const res = (0, _1.elationMobilePhoneToE164)(undefined);
|
11
|
+
expect(res).toEqual(undefined);
|
12
|
+
});
|
13
|
+
test('If mobile number is invalid then it should return undefined', async () => {
|
14
|
+
const res = (0, _1.elationMobilePhoneToE164)('12345678901432432');
|
15
|
+
expect(res).toEqual(undefined);
|
16
|
+
});
|
17
|
+
test('If mobile number is a valid US number in national format then it should transform to E.164 format', async () => {
|
18
|
+
const res = (0, _1.elationMobilePhoneToE164)('(213) 373-4253');
|
19
|
+
expect(res).toEqual('+12133734253');
|
20
|
+
});
|
21
|
+
test('If mobile number is a valid US number in E.164 format then it should return the phone number as is', async () => {
|
22
|
+
const res = (0, _1.elationMobilePhoneToE164)('+12133734253');
|
23
|
+
expect(res).toEqual('+12133734253');
|
24
|
+
});
|
25
|
+
});
|
26
|
+
//# sourceMappingURL=elationMobilePhoneToE164.test.js.map
|
package/dist/extensions/elation/utils/elationMobilePhoneToE164/elationMobilePhoneToE164.test.js.map
ADDED
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"elationMobilePhoneToE164.test.js","sourceRoot":"","sources":["../../../../../extensions/elation/utils/elationMobilePhoneToE164/elationMobilePhoneToE164.test.ts"],"names":[],"mappings":";;AAAA,wBAA4C;AAE5C,QAAQ,CAAC,2DAA2D,EAAE,GAAG,EAAE;IACzE,IAAI,CAAC,2DAA2D,EAAE,KAAK,IAAI,EAAE;QAC3E,MAAM,GAAG,GAAG,IAAA,2BAAwB,EAAC,EAAE,CAAC,CAAA;QAExC,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IAChC,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,+DAA+D,EAAE,KAAK,IAAI,EAAE;QAC/E,MAAM,GAAG,GAAG,IAAA,2BAAwB,EAAC,SAAS,CAAC,CAAA;QAE/C,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IAChC,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,6DAA6D,EAAE,KAAK,IAAI,EAAE;QAC7E,MAAM,GAAG,GAAG,IAAA,2BAAwB,EAAC,mBAAmB,CAAC,CAAA;QAEzD,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IAChC,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,mGAAmG,EAAE,KAAK,IAAI,EAAE;QACnH,MAAM,GAAG,GAAG,IAAA,2BAAwB,EAAC,gBAAgB,CAAC,CAAA;QAEtD,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,oGAAoG,EAAE,KAAK,IAAI,EAAE;QACpH,MAAM,GAAG,GAAG,IAAA,2BAAwB,EAAC,cAAc,CAAC,CAAA;QAEpD,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { elationMobilePhoneToE164 } from './elationMobilePhoneToE164';
|
@@ -0,0 +1,6 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.elationMobilePhoneToE164 = void 0;
|
4
|
+
var elationMobilePhoneToE164_1 = require("./elationMobilePhoneToE164");
|
5
|
+
Object.defineProperty(exports, "elationMobilePhoneToE164", { enumerable: true, get: function () { return elationMobilePhoneToE164_1.elationMobilePhoneToE164; } });
|
6
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/elation/utils/elationMobilePhoneToE164/index.ts"],"names":[],"mappings":";;;AAAA,uEAAqE;AAA5D,oIAAA,wBAAwB,OAAA"}
|
@@ -0,0 +1,21 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getLastEmail = void 0;
|
4
|
+
const lodash_1 = require("lodash");
|
5
|
+
const getLastEmail = (emails) => {
|
6
|
+
if ((0, lodash_1.isNil)(emails))
|
7
|
+
return undefined;
|
8
|
+
/**
|
9
|
+
* Filter out emails without a deleted_date
|
10
|
+
*/
|
11
|
+
const availableEmails = emails.filter((email) => (0, lodash_1.isNil)(email.deleted_date) || (0, lodash_1.isEmpty)(email.deleted_date));
|
12
|
+
/**
|
13
|
+
* According to Elation's documentation there is only only 1 email with empty deleted_date
|
14
|
+
*/
|
15
|
+
if (availableEmails.length === 1) {
|
16
|
+
return availableEmails[0].email;
|
17
|
+
}
|
18
|
+
return undefined;
|
19
|
+
};
|
20
|
+
exports.getLastEmail = getLastEmail;
|
21
|
+
//# sourceMappingURL=getLastEmail.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getLastEmail.js","sourceRoot":"","sources":["../../../../../extensions/elation/utils/getLastEmail/getLastEmail.ts"],"names":[],"mappings":";;;AAAA,mCAAuC;AAGhC,MAAM,YAAY,GAAG,CAAC,MAAgB,EAAsB,EAAE;IACnE,IAAI,IAAA,cAAK,EAAC,MAAM,CAAC;QAAE,OAAO,SAAS,CAAA;IAEnC;;OAEG;IACH,MAAM,eAAe,GAAG,MAAM,CAAC,MAAM,CACnC,CAAC,KAAK,EAAE,EAAE,CAAC,IAAA,cAAK,EAAC,KAAK,CAAC,YAAY,CAAC,IAAI,IAAA,gBAAO,EAAC,KAAK,CAAC,YAAY,CAAC,CACpE,CAAA;IAED;;OAEG;IACH,IAAI,eAAe,CAAC,MAAM,KAAK,CAAC,EAAE;QAChC,OAAO,eAAe,CAAC,CAAC,CAAC,CAAC,KAAK,CAAA;KAChC;IAED,OAAO,SAAS,CAAA;AAClB,CAAC,CAAA;AAlBY,QAAA,YAAY,gBAkBxB"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export {};
|
@@ -0,0 +1,29 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
const _1 = require(".");
|
4
|
+
describe('Elation: Get last email', () => {
|
5
|
+
test('It should return undefined if emails is undefined', async () => {
|
6
|
+
const res = (0, _1.getLastEmail)(undefined);
|
7
|
+
expect(res).toEqual(undefined);
|
8
|
+
});
|
9
|
+
test('It should return undefined if emails is empty array', async () => {
|
10
|
+
const res = (0, _1.getLastEmail)([]);
|
11
|
+
expect(res).toEqual(undefined);
|
12
|
+
});
|
13
|
+
test('It should pick the last email address', async () => {
|
14
|
+
const res = (0, _1.getLastEmail)([
|
15
|
+
{
|
16
|
+
email: 'john@doe.com',
|
17
|
+
created_date: '2016-10-10T23:31:49',
|
18
|
+
deleted_date: null,
|
19
|
+
},
|
20
|
+
{
|
21
|
+
email: 'doe@john.com',
|
22
|
+
created_date: '2016-10-10T23:31:49',
|
23
|
+
deleted_date: '2016-10-10T23:31:49',
|
24
|
+
},
|
25
|
+
]);
|
26
|
+
expect(res).toEqual('john@doe.com');
|
27
|
+
});
|
28
|
+
});
|
29
|
+
//# sourceMappingURL=getLastEmail.test.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"getLastEmail.test.js","sourceRoot":"","sources":["../../../../../extensions/elation/utils/getLastEmail/getLastEmail.test.ts"],"names":[],"mappings":";;AAAA,wBAAgC;AAEhC,QAAQ,CAAC,yBAAyB,EAAE,GAAG,EAAE;IACvC,IAAI,CAAC,mDAAmD,EAAE,KAAK,IAAI,EAAE;QACnE,MAAM,GAAG,GAAG,IAAA,eAAY,EAAC,SAAS,CAAC,CAAA;QAEnC,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IAChC,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,qDAAqD,EAAE,KAAK,IAAI,EAAE;QACrE,MAAM,GAAG,GAAG,IAAA,eAAY,EAAC,EAAE,CAAC,CAAA;QAE5B,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,SAAS,CAAC,CAAA;IAChC,CAAC,CAAC,CAAA;IAEF,IAAI,CAAC,uCAAuC,EAAE,KAAK,IAAI,EAAE;QACvD,MAAM,GAAG,GAAG,IAAA,eAAY,EAAC;YACvB;gBACE,KAAK,EAAE,cAAc;gBACrB,YAAY,EAAE,qBAAqB;gBACnC,YAAY,EAAE,IAAI;aACnB;YACD;gBACE,KAAK,EAAE,cAAc;gBACrB,YAAY,EAAE,qBAAqB;gBACnC,YAAY,EAAE,qBAAqB;aACpC;SACF,CAAC,CAAA;QAEF,MAAM,CAAC,GAAG,CAAC,CAAC,OAAO,CAAC,cAAc,CAAC,CAAA;IACrC,CAAC,CAAC,CAAA;AACJ,CAAC,CAAC,CAAA"}
|
@@ -0,0 +1 @@
|
|
1
|
+
export { getLastEmail } from './getLastEmail';
|
@@ -0,0 +1,6 @@
|
|
1
|
+
"use strict";
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
3
|
+
exports.getLastEmail = void 0;
|
4
|
+
var getLastEmail_1 = require("./getLastEmail");
|
5
|
+
Object.defineProperty(exports, "getLastEmail", { enumerable: true, get: function () { return getLastEmail_1.getLastEmail; } });
|
6
|
+
//# sourceMappingURL=index.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../extensions/elation/utils/getLastEmail/index.ts"],"names":[],"mappings":";;;AAAA,+CAA6C;AAApC,4GAAA,YAAY,OAAA"}
|