@carecard/validate 3.4.0 → 3.6.0
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/.prettierrc.js +0 -2
- package/lib/validateProperties.js +10 -4
- package/package.json +9 -4
- package/readme.md +24 -24
package/.prettierrc.js
CHANGED
|
@@ -167,8 +167,16 @@ function validateProperties(obj = {}) {
|
|
|
167
167
|
case 'campusId':
|
|
168
168
|
case 'program_id':
|
|
169
169
|
case 'programId':
|
|
170
|
-
case '
|
|
171
|
-
case '
|
|
170
|
+
case 'template_id':
|
|
171
|
+
case 'templateId':
|
|
172
|
+
case 'program_template_id':
|
|
173
|
+
case 'programTemplateId':
|
|
174
|
+
case 'user_item_id':
|
|
175
|
+
case 'userItemId':
|
|
176
|
+
case 'user_item_status_id':
|
|
177
|
+
case 'userItemStatusId':
|
|
178
|
+
case 'requirement_item_id':
|
|
179
|
+
case 'requirementItemId':
|
|
172
180
|
case 'program_document_id':
|
|
173
181
|
case 'programDocumentId':
|
|
174
182
|
case 'id':
|
|
@@ -303,8 +311,6 @@ function validateProperties(obj = {}) {
|
|
|
303
311
|
returnObj[key] = value;
|
|
304
312
|
}
|
|
305
313
|
break;
|
|
306
|
-
case 'document_required_by_date':
|
|
307
|
-
case 'documentRequiredByDate':
|
|
308
314
|
case 'effective_start_date':
|
|
309
315
|
case 'effectiveStartDate':
|
|
310
316
|
case 'effective_end_date':
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@carecard/validate",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.6.0",
|
|
4
4
|
"repository": {
|
|
5
5
|
"type": "git",
|
|
6
6
|
"url": "git+https://github.com/CareCard-ca/pkg-validate.git"
|
|
@@ -27,13 +27,13 @@
|
|
|
27
27
|
"license": "ISC",
|
|
28
28
|
"devDependencies": {
|
|
29
29
|
"@types/mocha": "10.0.10",
|
|
30
|
-
"@types/node": "25.9.
|
|
30
|
+
"@types/node": "25.9.3",
|
|
31
31
|
"eslint": "9.39.4",
|
|
32
32
|
"husky": "9.1.7",
|
|
33
|
-
"lint-staged": "17.0.
|
|
33
|
+
"lint-staged": "17.0.7",
|
|
34
34
|
"mocha": "11.7.6",
|
|
35
35
|
"nyc": "18.0.0",
|
|
36
|
-
"prettier": "3.8.
|
|
36
|
+
"prettier": "3.8.4",
|
|
37
37
|
"ts-node": "10.9.2",
|
|
38
38
|
"typescript": "6.0.3"
|
|
39
39
|
},
|
|
@@ -51,5 +51,10 @@
|
|
|
51
51
|
"functions": 100,
|
|
52
52
|
"lines": 100,
|
|
53
53
|
"statements": 100
|
|
54
|
+
},
|
|
55
|
+
"overrides": {
|
|
56
|
+
"diff": "8.0.4",
|
|
57
|
+
"serialize-javascript": "7.0.5",
|
|
58
|
+
"js-yaml": "4.2.0"
|
|
54
59
|
}
|
|
55
60
|
}
|
package/readme.md
CHANGED
|
@@ -96,30 +96,30 @@ validateProperties(input);
|
|
|
96
96
|
Keys are matched exactly. Both snake_case and camelCase variants are listed
|
|
97
97
|
where the package supports both.
|
|
98
98
|
|
|
99
|
-
| Validator | Keys
|
|
100
|
-
| --------------------------------------------------------- |
|
|
101
|
-
| `isNameString` | `first_name`, `firstName`, `last_name`, `lastName`, `username`, `new_status`, `newStatus`, `description`, `comment`, `status`, `name`, `title`, `brand`, `short_description`, `shortDescription`, `college_name`, `collegeName`, `campus_name`, `campusName`, `role`, `role_id`, `roleId`, `campus`, `institution_name`, `institutionName`, `program_name`, `programName`, `role_name`, `roleName`, `document_name`, `documentName`, `document_required_for_role_name`, `documentRequiredForRoleName`, `reason`, `entity_type`, `entityType`, `action_type`, `actionType`, `city`, `state`, `country`, `type`
|
|
102
|
-
| `isStreetString` | `street`
|
|
103
|
-
| `isCharactersString` | `postal_code`, `postalCode`, `period`
|
|
104
|
-
| `isBoolValue` | `is_primary`, `isPrimary`, `active`, `document_optional`, `documentOptional`
|
|
105
|
-
| `isSafeSearchString` | `search_string`, `searchString`
|
|
106
|
-
| `isString6To16CharacterLong` and `isSimplePasswordString` | `password`, `new_password`, `newPassword`
|
|
107
|
-
| `isString6To16CharacterLong` and `isPasswordString` | `strong_password`, `strongPassword`
|
|
108
|
-
| `isEmailString` | `email`
|
|
109
|
-
| `isPhoneNumber` | `phone_number`, `phoneNumber`
|
|
110
|
-
| `isCountryCodeString` | `country_code`, `countryCode`
|
|
111
|
-
| `isUrlSafeString` | `token`, `email_confirm_token`, `emailConfirmToken`, `verification_token`, `verificationToken`
|
|
112
|
-
| `isValidUuidString` | `uuid`, `item_id`, `itemId`, `user_id`, `userId`, `address_id`, `addressId`, `image_id`, `imageId`, `order_id`, `orderId`, `category_id`, `categoryId`, `parent_id`, `parentId`, `college_id`, `collegeId`, `campus_id`, `campusId`, `program_id`, `programId`, `
|
|
113
|
-
| `isCcIdString` | `cc_id`, `ccId`
|
|
114
|
-
| `isValidIntegerString` | `offset_number`, `offsetNumber`, `number_of_orders`, `numberOfOrders`, `price`, `from`, `number`, `limit`, `offset`
|
|
115
|
-
| `isValidJsonString` on the raw value | `about`
|
|
116
|
-
| `isValidJsonString(JSON.stringify(value))` | `weight`, `dimensions`, `permission`, `scope_data`, `scopeData`, `meta_data`, `metaData`
|
|
117
|
-
| `isTextString` | `document_description`, `documentDescription`, `nick_name`, `nickName`, `requested_by_name`, `requestedByName`, `requested_by_email`, `requestedByEmail`, `requested_by_phone`, `requestedByPhone`, `approved_by_name`, `approvedByName`, `approved_by_email`, `approvedByEmail`, `approved_by_phone`, `approvedByPhone`
|
|
118
|
-
| `isValidArrayOfStrings` | `aliases`
|
|
119
|
-
| `isImageUrl` or `isValidUrl` | `image_url`, `imageUrl`, `website`, `file_url`, `fileUrl`
|
|
120
|
-
| `isValidDomainName` | `domain_name`, `domainName`, `domain`, `email_domain`, `emailDomain`, `email_domain_name`, `emailDomainName`
|
|
121
|
-
| `isValidTimestampzString` or `isValidTimestampString` | `expires_at`, `expiresAt`, `start_time`, `startTime`, `end_time`, `endTime`
|
|
122
|
-
| `isValidDateString` | `
|
|
99
|
+
| Validator | Keys |
|
|
100
|
+
| --------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
101
|
+
| `isNameString` | `first_name`, `firstName`, `last_name`, `lastName`, `username`, `new_status`, `newStatus`, `description`, `comment`, `status`, `name`, `title`, `brand`, `short_description`, `shortDescription`, `college_name`, `collegeName`, `campus_name`, `campusName`, `role`, `role_id`, `roleId`, `campus`, `institution_name`, `institutionName`, `program_name`, `programName`, `role_name`, `roleName`, `document_name`, `documentName`, `document_required_for_role_name`, `documentRequiredForRoleName`, `reason`, `entity_type`, `entityType`, `action_type`, `actionType`, `city`, `state`, `country`, `type` |
|
|
102
|
+
| `isStreetString` | `street` |
|
|
103
|
+
| `isCharactersString` | `postal_code`, `postalCode`, `period` |
|
|
104
|
+
| `isBoolValue` | `is_primary`, `isPrimary`, `active`, `document_optional`, `documentOptional` |
|
|
105
|
+
| `isSafeSearchString` | `search_string`, `searchString` |
|
|
106
|
+
| `isString6To16CharacterLong` and `isSimplePasswordString` | `password`, `new_password`, `newPassword` |
|
|
107
|
+
| `isString6To16CharacterLong` and `isPasswordString` | `strong_password`, `strongPassword` |
|
|
108
|
+
| `isEmailString` | `email` |
|
|
109
|
+
| `isPhoneNumber` | `phone_number`, `phoneNumber` |
|
|
110
|
+
| `isCountryCodeString` | `country_code`, `countryCode` |
|
|
111
|
+
| `isUrlSafeString` | `token`, `email_confirm_token`, `emailConfirmToken`, `verification_token`, `verificationToken` |
|
|
112
|
+
| `isValidUuidString` | `uuid`, `item_id`, `itemId`, `user_id`, `userId`, `address_id`, `addressId`, `image_id`, `imageId`, `order_id`, `orderId`, `category_id`, `categoryId`, `parent_id`, `parentId`, `college_id`, `collegeId`, `campus_id`, `campusId`, `program_id`, `programId`, `template_id`, `templateId`, `program_template_id`, `programTemplateId`, `user_item_id`, `userItemId`, `user_item_status_id`, `userItemStatusId`, `requirement_item_id`, `requirementItemId`, `program_document_id`, `programDocumentId`, `id`, `institution_id`, `institutionId`, `role_assignment_id`, `roleAssignmentId`, `user_role_id`, `userRoleId`, `phone_number_id`, `phoneNumberId`, `entity_id`, `entityId`, `changed_by`, `changedBy`, `request_id`, `requestId` |
|
|
113
|
+
| `isCcIdString` | `cc_id`, `ccId` |
|
|
114
|
+
| `isValidIntegerString` | `offset_number`, `offsetNumber`, `number_of_orders`, `numberOfOrders`, `price`, `from`, `number`, `limit`, `offset` |
|
|
115
|
+
| `isValidJsonString` on the raw value | `about` |
|
|
116
|
+
| `isValidJsonString(JSON.stringify(value))` | `weight`, `dimensions`, `permission`, `scope_data`, `scopeData`, `meta_data`, `metaData` |
|
|
117
|
+
| `isTextString` | `document_description`, `documentDescription`, `nick_name`, `nickName`, `requested_by_name`, `requestedByName`, `requested_by_email`, `requestedByEmail`, `requested_by_phone`, `requestedByPhone`, `approved_by_name`, `approvedByName`, `approved_by_email`, `approvedByEmail`, `approved_by_phone`, `approvedByPhone` |
|
|
118
|
+
| `isValidArrayOfStrings` | `aliases` |
|
|
119
|
+
| `isImageUrl` or `isValidUrl` | `image_url`, `imageUrl`, `website`, `file_url`, `fileUrl` |
|
|
120
|
+
| `isValidDomainName` | `domain_name`, `domainName`, `domain`, `email_domain`, `emailDomain`, `email_domain_name`, `emailDomainName` |
|
|
121
|
+
| `isValidTimestampzString` or `isValidTimestampString` | `expires_at`, `expiresAt`, `start_time`, `startTime`, `end_time`, `endTime` |
|
|
122
|
+
| `isValidDateString` | `effective_start_date`, `effectiveStartDate`, `effective_end_date`, `effectiveEndDate`, `valid_until_date`, `validUntilDate`, `renew_date`, `renewDate` |
|
|
123
123
|
|
|
124
124
|
## `validateWhitelistProperties(inputObject, requiredProperties, options)`
|
|
125
125
|
|