@carecard/validate 3.4.0 → 3.5.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 CHANGED
@@ -8,6 +8,4 @@ module.exports = {
8
8
  tabWidth: 4,
9
9
  useTabs: false,
10
10
  endOfLine: 'auto',
11
- importOrderSeparation: true,
12
- importOrderSortSpecifiers: true,
13
11
  };
@@ -167,8 +167,12 @@ function validateProperties(obj = {}) {
167
167
  case 'campusId':
168
168
  case 'program_id':
169
169
  case 'programId':
170
- case 'program_requirement_document_id':
171
- case 'programRequirementDocumentId':
170
+ case 'program_requirement_for_user_id':
171
+ case 'programRequirementForUserId':
172
+ case 'document_item_status_id':
173
+ case 'documentItemStatusId':
174
+ case 'requirement_item_id':
175
+ case 'requirementItemId':
172
176
  case 'program_document_id':
173
177
  case 'programDocumentId':
174
178
  case 'id':
@@ -303,8 +307,6 @@ function validateProperties(obj = {}) {
303
307
  returnObj[key] = value;
304
308
  }
305
309
  break;
306
- case 'document_required_by_date':
307
- case 'documentRequiredByDate':
308
310
  case 'effective_start_date':
309
311
  case 'effectiveStartDate':
310
312
  case 'effective_end_date':
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carecard/validate",
3
- "version": "3.4.0",
3
+ "version": "3.5.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.1",
30
+ "@types/node": "25.9.3",
31
31
  "eslint": "9.39.4",
32
32
  "husky": "9.1.7",
33
- "lint-staged": "17.0.5",
33
+ "lint-staged": "17.0.7",
34
34
  "mocha": "11.7.6",
35
35
  "nyc": "18.0.0",
36
- "prettier": "3.8.3",
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`, `program_requirement_document_id`, `programRequirementDocumentId`, `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` | `document_required_by_date`, `documentRequiredByDate`, `effective_start_date`, `effectiveStartDate`, `effective_end_date`, `effectiveEndDate`, `valid_until_date`, `validUntilDate`, `renew_date`, `renewDate` |
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`, `program_requirement_for_user_id`, `programRequirementForUserId`, `document_item_status_id`, `documentItemStatusId`, `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