@geniehr/utilities 1.0.7 → 1.0.9
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/mq/client.d.ts +1 -0
- package/dist/mq/client.js +2 -2
- package/dist/schema/files/person/personSchema.d.ts +51 -48
- package/dist/schema/files/person/personSchema.js +18 -17
- package/dist/schema/schemaMappings.js +2 -0
- package/dist/schema/validation.js +1 -0
- package/dist/types/GHRContext.d.ts +1 -0
- package/package.json +3 -2
package/dist/mq/client.d.ts
CHANGED
package/dist/mq/client.js
CHANGED
|
@@ -12,9 +12,9 @@ export class MQClient {
|
|
|
12
12
|
* @param creds - RabbitMQ connection credentials.
|
|
13
13
|
*/
|
|
14
14
|
async init(creds) {
|
|
15
|
-
const { host, port, user, password } = creds;
|
|
15
|
+
const { host, port, user, password, protocol } = creds;
|
|
16
16
|
// Construct the connection string for AMQPS (secure AMQP).
|
|
17
|
-
const connStr =
|
|
17
|
+
const connStr = `${protocol || 'amqps'}://${user}:${password}@${host}:${port}`;
|
|
18
18
|
try {
|
|
19
19
|
// Connect to RabbitMQ.
|
|
20
20
|
const rawConn = await amqp.connect(connStr);
|
|
@@ -1,59 +1,62 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const personSchema: z.ZodObject<{
|
|
3
3
|
firstName: z.ZodString;
|
|
4
|
-
middleName: z.ZodOptional<z.ZodString
|
|
5
|
-
lastName: z.ZodOptional<z.ZodString
|
|
6
|
-
dateOfBirth: z.ZodOptional<z.ZodDate
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
bloodGroupId: z.ZodOptional<z.ZodNumber>;
|
|
10
|
-
bloodGroupName: z.ZodOptional<z.ZodString>;
|
|
11
|
-
maritalStatus: z.ZodOptional<z.ZodString>;
|
|
12
|
-
maritalStatusId: z.ZodOptional<z.ZodNumber>;
|
|
13
|
-
mobileNo: z.ZodOptional<z.ZodString>;
|
|
14
|
-
emailAddress: z.ZodOptional<z.ZodString>;
|
|
15
|
-
about: z.ZodOptional<z.ZodString>;
|
|
16
|
-
iamId: z.ZodOptional<z.ZodString>;
|
|
17
|
-
employeeNo: z.ZodOptional<z.ZodString>;
|
|
18
|
-
ghrId: z.ZodNumber;
|
|
4
|
+
middleName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
5
|
+
lastName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
6
|
+
dateOfBirth: z.ZodNullable<z.ZodOptional<z.ZodDate>>;
|
|
7
|
+
mobileNo: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
8
|
+
emailAddress: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
19
9
|
personTypeId: z.ZodNumber;
|
|
20
|
-
|
|
10
|
+
maritalStatusId: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
11
|
+
genderId: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
12
|
+
bloodGroupId: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
13
|
+
ghrId: z.ZodNullable<z.ZodOptional<z.ZodNumber>>;
|
|
14
|
+
orgPath: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
15
|
+
personTypeName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
16
|
+
maritalStatusName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
17
|
+
genderName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
18
|
+
bloodGroupName: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
19
|
+
about: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
20
|
+
iamId: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
21
|
+
employeeNo: z.ZodNullable<z.ZodOptional<z.ZodString>>;
|
|
21
22
|
}, "strip", z.ZodTypeAny, {
|
|
22
23
|
firstName: string;
|
|
23
|
-
ghrId: number;
|
|
24
24
|
personTypeId: number;
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
|
|
36
|
-
|
|
37
|
-
|
|
38
|
-
|
|
39
|
-
|
|
25
|
+
middleName?: string | null | undefined;
|
|
26
|
+
lastName?: string | null | undefined;
|
|
27
|
+
dateOfBirth?: Date | null | undefined;
|
|
28
|
+
mobileNo?: string | null | undefined;
|
|
29
|
+
emailAddress?: string | null | undefined;
|
|
30
|
+
maritalStatusId?: number | null | undefined;
|
|
31
|
+
genderId?: number | null | undefined;
|
|
32
|
+
bloodGroupId?: number | null | undefined;
|
|
33
|
+
ghrId?: number | null | undefined;
|
|
34
|
+
orgPath?: string | null | undefined;
|
|
35
|
+
personTypeName?: string | null | undefined;
|
|
36
|
+
maritalStatusName?: string | null | undefined;
|
|
37
|
+
genderName?: string | null | undefined;
|
|
38
|
+
bloodGroupName?: string | null | undefined;
|
|
39
|
+
about?: string | null | undefined;
|
|
40
|
+
iamId?: string | null | undefined;
|
|
41
|
+
employeeNo?: string | null | undefined;
|
|
40
42
|
}, {
|
|
41
43
|
firstName: string;
|
|
42
|
-
ghrId: number;
|
|
43
44
|
personTypeId: number;
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
45
|
+
middleName?: string | null | undefined;
|
|
46
|
+
lastName?: string | null | undefined;
|
|
47
|
+
dateOfBirth?: Date | null | undefined;
|
|
48
|
+
mobileNo?: string | null | undefined;
|
|
49
|
+
emailAddress?: string | null | undefined;
|
|
50
|
+
maritalStatusId?: number | null | undefined;
|
|
51
|
+
genderId?: number | null | undefined;
|
|
52
|
+
bloodGroupId?: number | null | undefined;
|
|
53
|
+
ghrId?: number | null | undefined;
|
|
54
|
+
orgPath?: string | null | undefined;
|
|
55
|
+
personTypeName?: string | null | undefined;
|
|
56
|
+
maritalStatusName?: string | null | undefined;
|
|
57
|
+
genderName?: string | null | undefined;
|
|
58
|
+
bloodGroupName?: string | null | undefined;
|
|
59
|
+
about?: string | null | undefined;
|
|
60
|
+
iamId?: string | null | undefined;
|
|
61
|
+
employeeNo?: string | null | undefined;
|
|
59
62
|
}>;
|
|
@@ -1,21 +1,22 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export const personSchema = z.object({
|
|
3
3
|
firstName: z.string().trim().min(1).max(45),
|
|
4
|
-
middleName: z.string().trim().max(45).optional(),
|
|
5
|
-
lastName: z.string().trim().max(45).optional(),
|
|
6
|
-
dateOfBirth: z.coerce.date().optional(),
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
4
|
+
middleName: z.string().trim().max(45).optional().nullable(),
|
|
5
|
+
lastName: z.string().trim().max(45).optional().nullable(),
|
|
6
|
+
dateOfBirth: z.coerce.date().optional().nullable(),
|
|
7
|
+
mobileNo: z.string().trim().max(15).optional().nullable(),
|
|
8
|
+
emailAddress: z.string().trim().email().max(46).optional().nullable(),
|
|
9
|
+
personTypeId: z.coerce.number().int(),
|
|
10
|
+
maritalStatusId: z.coerce.number().int().optional().nullable(),
|
|
11
|
+
genderId: z.coerce.number().int().optional().nullable(),
|
|
12
|
+
bloodGroupId: z.coerce.number().int().optional().nullable(),
|
|
13
|
+
ghrId: z.coerce.number().int().optional().nullable(),
|
|
14
|
+
orgPath: z.string().trim().optional().nullable(),
|
|
15
|
+
personTypeName: z.string().trim().max(100).optional().nullable(),
|
|
16
|
+
maritalStatusName: z.string().trim().max(100).optional().nullable(),
|
|
17
|
+
genderName: z.string().trim().max(100).optional().nullable(),
|
|
18
|
+
bloodGroupName: z.string().trim().max(100).optional().nullable(),
|
|
19
|
+
about: z.string().trim().optional().nullable(),
|
|
20
|
+
iamId: z.string().trim().max(50).optional().nullable(),
|
|
21
|
+
employeeNo: z.string().trim().max(45).optional().nullable(),
|
|
21
22
|
});
|
|
@@ -2,6 +2,7 @@ import { emergencyContactsSchema, pastExperiencesSchema, personSchema, primaryCo
|
|
|
2
2
|
export const mappings = {
|
|
3
3
|
'people-ms': {
|
|
4
4
|
'post': {
|
|
5
|
+
'/people/person': personSchema,
|
|
5
6
|
'/people/person/profile': personSchema,
|
|
6
7
|
'/people/work/details': workDetailsSchema,
|
|
7
8
|
'/people/work/past-experience': pastExperiencesSchema,
|
|
@@ -13,6 +14,7 @@ export const mappings = {
|
|
|
13
14
|
},
|
|
14
15
|
'bff-ms': {
|
|
15
16
|
'post': {
|
|
17
|
+
'/api/person': personSchema,
|
|
16
18
|
'/api/employee/profile': personSchema,
|
|
17
19
|
'/api/employee/work/details': workDetailsSchema,
|
|
18
20
|
'/api/employee/work/past-experience': pastExperiencesSchema,
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@geniehr/utilities",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.9",
|
|
4
4
|
"description": "",
|
|
5
5
|
"homepage": "https://github.com/Genie-HR/ghr-utilities#readme",
|
|
6
6
|
"bugs": {
|
|
@@ -39,6 +39,7 @@
|
|
|
39
39
|
"axios": "^1.10.0",
|
|
40
40
|
"express": "^5.1.0",
|
|
41
41
|
"ioredis": "^5.8.2",
|
|
42
|
+
"mongodb": "^6.13.1",
|
|
42
43
|
"sharp": "^0.34.4",
|
|
43
44
|
"winston": "^3.17.0",
|
|
44
45
|
"winston-cloudwatch": "^6.3.0",
|
|
@@ -53,4 +54,4 @@
|
|
|
53
54
|
"tsx": "^4.20.3",
|
|
54
55
|
"typescript": "^5.4.0"
|
|
55
56
|
}
|
|
56
|
-
}
|
|
57
|
+
}
|