@careflair/common 1.0.47 → 1.0.49
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/enums/index.d.ts +2 -2
- package/dist/enums/index.js +2 -2
- package/dist/index.d.ts +8 -9
- package/dist/index.js +1 -4
- package/dist/schemas/forms.d.ts +55 -1
- package/dist/schemas/forms.js +23 -0
- package/dist/schemas/index.d.ts +8 -8
- package/dist/schemas/index.js +2 -2
- package/package.json +1 -6
package/dist/enums/index.d.ts
CHANGED
|
@@ -298,8 +298,8 @@ export declare enum SupportWorkerService {
|
|
|
298
298
|
SupportedIndependentLivingSIL = "supportedIndependentLivingSIL"
|
|
299
299
|
}
|
|
300
300
|
export declare enum JOB_WORKER_TYPE {
|
|
301
|
-
SUPPORT_WORKER = "
|
|
302
|
-
|
|
301
|
+
SUPPORT_WORKER = "support_worker",
|
|
302
|
+
PROVIDER = "provider"
|
|
303
303
|
}
|
|
304
304
|
export declare enum BOOKING_ACTIVITY_TYPE {
|
|
305
305
|
BOOKING_CREATED = "booking_created",
|
package/dist/enums/index.js
CHANGED
|
@@ -350,8 +350,8 @@ var SupportWorkerService;
|
|
|
350
350
|
})(SupportWorkerService || (exports.SupportWorkerService = SupportWorkerService = {}));
|
|
351
351
|
var JOB_WORKER_TYPE;
|
|
352
352
|
(function (JOB_WORKER_TYPE) {
|
|
353
|
-
JOB_WORKER_TYPE["SUPPORT_WORKER"] = "
|
|
354
|
-
JOB_WORKER_TYPE["
|
|
353
|
+
JOB_WORKER_TYPE["SUPPORT_WORKER"] = "support_worker";
|
|
354
|
+
JOB_WORKER_TYPE["PROVIDER"] = "provider";
|
|
355
355
|
})(JOB_WORKER_TYPE || (exports.JOB_WORKER_TYPE = JOB_WORKER_TYPE = {}));
|
|
356
356
|
// booking activity
|
|
357
357
|
var BOOKING_ACTIVITY_TYPE;
|
package/dist/index.d.ts
CHANGED
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
export { UserRegistrationInput, UserRegistrationSchema
|
|
2
|
-
export { EducationAndTrainingInputValidation, EducationAndTrainingSchema
|
|
3
|
-
export { WorkHistoryInputValidation, WorkHistorySchema
|
|
4
|
-
export { AvailabilitiesSchemaZod, AvailabilityZodInput
|
|
5
|
-
export { HourlyRateInputZod, HourlyRateInputZodType
|
|
6
|
-
export { SupportWorkerServicesSchema, validateSupportWorkerServices
|
|
7
|
-
export { detectVideoProvider, extractYouTubeVideoId, isValidCommunityVideoUrl, isValidYouTubeOrVimeoUrl, normalizeYouTubeUrl, validateVideoLink
|
|
8
|
-
export { ApplicationFormValues, applicationSchema, isValidVideoUrl
|
|
9
|
-
export { defineAbilitiesFor, type Actions, type AppAbility, type Subjects, type UserForAbility, } from "./abilities";
|
|
1
|
+
export { UserRegistrationInput, UserRegistrationSchema } from "./schemas/userValiationSchema";
|
|
2
|
+
export { EducationAndTrainingInputValidation, EducationAndTrainingSchema } from "./schemas/educationSchemas";
|
|
3
|
+
export { WorkHistoryInputValidation, WorkHistorySchema } from "./schemas/workHistorySchema";
|
|
4
|
+
export { AvailabilitiesSchemaZod, AvailabilityZodInput } from "./schemas/availabilitySchemaValidation";
|
|
5
|
+
export { HourlyRateInputZod, HourlyRateInputZodType } from "./schemas/hourlyRateSchemaValidation";
|
|
6
|
+
export { SupportWorkerServicesSchema, validateSupportWorkerServices } from "./schemas/businessServicesValidation";
|
|
7
|
+
export { VideoProvider, VideoValidationResult, detectVideoProvider, extractYouTubeVideoId, isValidCommunityVideoUrl, isValidYouTubeOrVimeoUrl, normalizeYouTubeUrl, validateVideoLink } from "./utils/videoValidation";
|
|
8
|
+
export { ApplicationFormValues, applicationSchema, isValidVideoUrl } from "./schemas/applicationSchema";
|
package/dist/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.isValidVideoUrl = exports.applicationSchema = exports.validateVideoLink = exports.normalizeYouTubeUrl = exports.isValidYouTubeOrVimeoUrl = exports.isValidCommunityVideoUrl = exports.extractYouTubeVideoId = exports.detectVideoProvider = exports.validateSupportWorkerServices = exports.SupportWorkerServicesSchema = exports.HourlyRateInputZod = exports.AvailabilitiesSchemaZod = exports.WorkHistorySchema = exports.EducationAndTrainingSchema = exports.UserRegistrationSchema = void 0;
|
|
4
4
|
var userValiationSchema_1 = require("./schemas/userValiationSchema");
|
|
5
5
|
Object.defineProperty(exports, "UserRegistrationSchema", { enumerable: true, get: function () { return userValiationSchema_1.UserRegistrationSchema; } });
|
|
6
6
|
var educationSchemas_1 = require("./schemas/educationSchemas");
|
|
@@ -24,6 +24,3 @@ Object.defineProperty(exports, "validateVideoLink", { enumerable: true, get: fun
|
|
|
24
24
|
var applicationSchema_1 = require("./schemas/applicationSchema");
|
|
25
25
|
Object.defineProperty(exports, "applicationSchema", { enumerable: true, get: function () { return applicationSchema_1.applicationSchema; } });
|
|
26
26
|
Object.defineProperty(exports, "isValidVideoUrl", { enumerable: true, get: function () { return applicationSchema_1.isValidVideoUrl; } });
|
|
27
|
-
// CASL Abilities
|
|
28
|
-
var abilities_1 = require("./abilities");
|
|
29
|
-
Object.defineProperty(exports, "defineAbilitiesFor", { enumerable: true, get: function () { return abilities_1.defineAbilitiesFor; } });
|
package/dist/schemas/forms.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { z } from "zod";
|
|
|
2
2
|
/**
|
|
3
3
|
* Registration form schema
|
|
4
4
|
*/
|
|
5
|
-
export declare const registrationFormSchema: z.ZodEffects<z.ZodObject<{
|
|
5
|
+
export declare const registrationFormSchema: z.ZodEffects<z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
6
6
|
firstName: z.ZodString;
|
|
7
7
|
lastName: z.ZodString;
|
|
8
8
|
email: z.ZodString;
|
|
@@ -11,6 +11,8 @@ export declare const registrationFormSchema: z.ZodEffects<z.ZodObject<{
|
|
|
11
11
|
password: z.ZodString;
|
|
12
12
|
confirmPassword: z.ZodString;
|
|
13
13
|
fingerPrint: z.ZodOptional<z.ZodString>;
|
|
14
|
+
companyRole: z.ZodOptional<z.ZodString>;
|
|
15
|
+
authorizationConfirmed: z.ZodOptional<z.ZodBoolean>;
|
|
14
16
|
}, "strip", z.ZodTypeAny, {
|
|
15
17
|
role: string;
|
|
16
18
|
username: string;
|
|
@@ -20,6 +22,8 @@ export declare const registrationFormSchema: z.ZodEffects<z.ZodObject<{
|
|
|
20
22
|
password: string;
|
|
21
23
|
confirmPassword: string;
|
|
22
24
|
fingerPrint?: string | undefined;
|
|
25
|
+
companyRole?: string | undefined;
|
|
26
|
+
authorizationConfirmed?: boolean | undefined;
|
|
23
27
|
}, {
|
|
24
28
|
role: string;
|
|
25
29
|
username: string;
|
|
@@ -29,6 +33,8 @@ export declare const registrationFormSchema: z.ZodEffects<z.ZodObject<{
|
|
|
29
33
|
password: string;
|
|
30
34
|
confirmPassword: string;
|
|
31
35
|
fingerPrint?: string | undefined;
|
|
36
|
+
companyRole?: string | undefined;
|
|
37
|
+
authorizationConfirmed?: boolean | undefined;
|
|
32
38
|
}>, {
|
|
33
39
|
role: string;
|
|
34
40
|
username: string;
|
|
@@ -38,6 +44,8 @@ export declare const registrationFormSchema: z.ZodEffects<z.ZodObject<{
|
|
|
38
44
|
password: string;
|
|
39
45
|
confirmPassword: string;
|
|
40
46
|
fingerPrint?: string | undefined;
|
|
47
|
+
companyRole?: string | undefined;
|
|
48
|
+
authorizationConfirmed?: boolean | undefined;
|
|
41
49
|
}, {
|
|
42
50
|
role: string;
|
|
43
51
|
username: string;
|
|
@@ -47,6 +55,52 @@ export declare const registrationFormSchema: z.ZodEffects<z.ZodObject<{
|
|
|
47
55
|
password: string;
|
|
48
56
|
confirmPassword: string;
|
|
49
57
|
fingerPrint?: string | undefined;
|
|
58
|
+
companyRole?: string | undefined;
|
|
59
|
+
authorizationConfirmed?: boolean | undefined;
|
|
60
|
+
}>, {
|
|
61
|
+
role: string;
|
|
62
|
+
username: string;
|
|
63
|
+
email: string;
|
|
64
|
+
firstName: string;
|
|
65
|
+
lastName: string;
|
|
66
|
+
password: string;
|
|
67
|
+
confirmPassword: string;
|
|
68
|
+
fingerPrint?: string | undefined;
|
|
69
|
+
companyRole?: string | undefined;
|
|
70
|
+
authorizationConfirmed?: boolean | undefined;
|
|
71
|
+
}, {
|
|
72
|
+
role: string;
|
|
73
|
+
username: string;
|
|
74
|
+
email: string;
|
|
75
|
+
firstName: string;
|
|
76
|
+
lastName: string;
|
|
77
|
+
password: string;
|
|
78
|
+
confirmPassword: string;
|
|
79
|
+
fingerPrint?: string | undefined;
|
|
80
|
+
companyRole?: string | undefined;
|
|
81
|
+
authorizationConfirmed?: boolean | undefined;
|
|
82
|
+
}>, {
|
|
83
|
+
role: string;
|
|
84
|
+
username: string;
|
|
85
|
+
email: string;
|
|
86
|
+
firstName: string;
|
|
87
|
+
lastName: string;
|
|
88
|
+
password: string;
|
|
89
|
+
confirmPassword: string;
|
|
90
|
+
fingerPrint?: string | undefined;
|
|
91
|
+
companyRole?: string | undefined;
|
|
92
|
+
authorizationConfirmed?: boolean | undefined;
|
|
93
|
+
}, {
|
|
94
|
+
role: string;
|
|
95
|
+
username: string;
|
|
96
|
+
email: string;
|
|
97
|
+
firstName: string;
|
|
98
|
+
lastName: string;
|
|
99
|
+
password: string;
|
|
100
|
+
confirmPassword: string;
|
|
101
|
+
fingerPrint?: string | undefined;
|
|
102
|
+
companyRole?: string | undefined;
|
|
103
|
+
authorizationConfirmed?: boolean | undefined;
|
|
50
104
|
}>;
|
|
51
105
|
/**
|
|
52
106
|
* Participant location form schema
|
package/dist/schemas/forms.js
CHANGED
|
@@ -34,11 +34,34 @@ exports.registrationFormSchema = zod_1.z
|
|
|
34
34
|
password: validation_1.passwordSchema,
|
|
35
35
|
confirmPassword: zod_1.z.string().min(1, "Confirm password is required"),
|
|
36
36
|
fingerPrint: zod_1.z.string().optional(),
|
|
37
|
+
companyRole: zod_1.z.string().optional(),
|
|
38
|
+
authorizationConfirmed: zod_1.z.boolean().optional(),
|
|
37
39
|
})
|
|
38
40
|
// Password match validation
|
|
39
41
|
.refine((data) => data.password === data.confirmPassword, {
|
|
40
42
|
message: "Passwords don't match",
|
|
41
43
|
path: ["confirmPassword"],
|
|
44
|
+
})
|
|
45
|
+
// Provider-specific validation
|
|
46
|
+
.refine((data) => {
|
|
47
|
+
// If role is provider, companyRole is required
|
|
48
|
+
if (data.role === "provider") {
|
|
49
|
+
return data.companyRole && data.companyRole.trim().length > 0;
|
|
50
|
+
}
|
|
51
|
+
return true;
|
|
52
|
+
}, {
|
|
53
|
+
message: "Company role is required for providers",
|
|
54
|
+
path: ["companyRole"],
|
|
55
|
+
})
|
|
56
|
+
.refine((data) => {
|
|
57
|
+
// If role is provider, authorizationConfirmed must be true
|
|
58
|
+
if (data.role === "provider") {
|
|
59
|
+
return data.authorizationConfirmed === true;
|
|
60
|
+
}
|
|
61
|
+
return true;
|
|
62
|
+
}, {
|
|
63
|
+
message: "You must confirm your authorization to proceed",
|
|
64
|
+
path: ["authorizationConfirmed"],
|
|
42
65
|
});
|
|
43
66
|
/**
|
|
44
67
|
* Participant location form schema
|
package/dist/schemas/index.d.ts
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
-
export { UserRegistrationInput, UserRegistrationSchema } from "./userValiationSchema";
|
|
2
|
-
export { EducationAndTrainingInputValidation, EducationAndTrainingSchema } from "./educationSchemas";
|
|
3
|
-
export { WorkHistoryInputValidation, WorkHistorySchema } from "./workHistorySchema";
|
|
4
|
-
export { AvailabilitiesSchemaZod, AvailabilityZodInput } from "./availabilitySchemaValidation";
|
|
5
|
-
export { HourlyRateInputZod, HourlyRateInputZodType } from "./hourlyRateSchemaValidation";
|
|
6
|
-
export { SupportWorkerServicesSchema, validateSupportWorkerServices } from "./businessServicesValidation";
|
|
7
|
-
export {
|
|
8
|
-
export { ApplicationFormValues, applicationSchema, isValidVideoUrl } from "./applicationSchema";
|
|
1
|
+
export { UserRegistrationInput, UserRegistrationSchema, } from "./userValiationSchema";
|
|
2
|
+
export { EducationAndTrainingInputValidation, EducationAndTrainingSchema, } from "./educationSchemas";
|
|
3
|
+
export { WorkHistoryInputValidation, WorkHistorySchema, } from "./workHistorySchema";
|
|
4
|
+
export { AvailabilitiesSchemaZod, AvailabilityZodInput, } from "./availabilitySchemaValidation";
|
|
5
|
+
export { HourlyRateInputZod, HourlyRateInputZodType, } from "./hourlyRateSchemaValidation";
|
|
6
|
+
export { SupportWorkerServicesSchema, validateSupportWorkerServices, } from "./businessServicesValidation";
|
|
7
|
+
export { generalOTPSchema, pinSchema, ResetPasswordSchema } from "./otp";
|
|
8
|
+
export { ApplicationFormValues, applicationSchema, isValidVideoUrl, } from "./applicationSchema";
|
package/dist/schemas/index.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.isValidVideoUrl = exports.applicationSchema = exports.
|
|
3
|
+
exports.isValidVideoUrl = exports.applicationSchema = exports.ResetPasswordSchema = exports.pinSchema = exports.generalOTPSchema = exports.validateSupportWorkerServices = exports.SupportWorkerServicesSchema = exports.HourlyRateInputZod = exports.AvailabilitiesSchemaZod = exports.WorkHistorySchema = exports.EducationAndTrainingSchema = exports.UserRegistrationSchema = void 0;
|
|
4
4
|
var userValiationSchema_1 = require("./userValiationSchema");
|
|
5
5
|
Object.defineProperty(exports, "UserRegistrationSchema", { enumerable: true, get: function () { return userValiationSchema_1.UserRegistrationSchema; } });
|
|
6
6
|
var educationSchemas_1 = require("./educationSchemas");
|
|
@@ -15,9 +15,9 @@ var businessServicesValidation_1 = require("./businessServicesValidation");
|
|
|
15
15
|
Object.defineProperty(exports, "SupportWorkerServicesSchema", { enumerable: true, get: function () { return businessServicesValidation_1.SupportWorkerServicesSchema; } });
|
|
16
16
|
Object.defineProperty(exports, "validateSupportWorkerServices", { enumerable: true, get: function () { return businessServicesValidation_1.validateSupportWorkerServices; } });
|
|
17
17
|
var otp_1 = require("./otp");
|
|
18
|
-
Object.defineProperty(exports, "ResetPasswordSchema", { enumerable: true, get: function () { return otp_1.ResetPasswordSchema; } });
|
|
19
18
|
Object.defineProperty(exports, "generalOTPSchema", { enumerable: true, get: function () { return otp_1.generalOTPSchema; } });
|
|
20
19
|
Object.defineProperty(exports, "pinSchema", { enumerable: true, get: function () { return otp_1.pinSchema; } });
|
|
20
|
+
Object.defineProperty(exports, "ResetPasswordSchema", { enumerable: true, get: function () { return otp_1.ResetPasswordSchema; } });
|
|
21
21
|
var applicationSchema_1 = require("./applicationSchema");
|
|
22
22
|
Object.defineProperty(exports, "applicationSchema", { enumerable: true, get: function () { return applicationSchema_1.applicationSchema; } });
|
|
23
23
|
Object.defineProperty(exports, "isValidVideoUrl", { enumerable: true, get: function () { return applicationSchema_1.isValidVideoUrl; } });
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@careflair/common",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.49",
|
|
4
4
|
"description": "Shared assets for CareFlair",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"types": "dist/index.d.ts",
|
|
@@ -18,7 +18,6 @@
|
|
|
18
18
|
"author": "Farhan Hossain",
|
|
19
19
|
"license": "ISC",
|
|
20
20
|
"dependencies": {
|
|
21
|
-
"@casl/ability": "^6.7.5",
|
|
22
21
|
"date-fns": "^4.1.0",
|
|
23
22
|
"libphonenumber-js": "^1.12.25"
|
|
24
23
|
},
|
|
@@ -72,10 +71,6 @@
|
|
|
72
71
|
"./interfaces/*": {
|
|
73
72
|
"types": "./dist/interfaces/*.d.ts",
|
|
74
73
|
"default": "./dist/interfaces/*.js"
|
|
75
|
-
},
|
|
76
|
-
"./abilities": {
|
|
77
|
-
"types": "./dist/abilities/index.d.ts",
|
|
78
|
-
"default": "./dist/abilities/index.js"
|
|
79
74
|
}
|
|
80
75
|
},
|
|
81
76
|
"typesVersions": {
|