@carecard/validate 3.6.1 → 3.7.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/index.d.ts CHANGED
@@ -98,6 +98,8 @@ export interface ValidateNewUserRoleRequestInput extends Record<string, unknown>
98
98
  campusId?: unknown;
99
99
  program_id?: unknown;
100
100
  programId?: unknown;
101
+ program_term_id?: unknown;
102
+ programTermId?: unknown;
101
103
  }
102
104
 
103
105
  export interface ValidateNewUserRoleRequestPayload extends Record<string, unknown> {
@@ -105,6 +107,7 @@ export interface ValidateNewUserRoleRequestPayload extends Record<string, unknow
105
107
  institution_id?: string;
106
108
  campus_id?: string;
107
109
  program_id?: string;
110
+ program_term_id?: string;
108
111
  }
109
112
 
110
113
  /**
@@ -39,12 +39,14 @@ function normalizeNewUserRoleRequestObject(roleRequest) {
39
39
  assignAlias(normalized, 'institution_id', 'institutionId');
40
40
  assignAlias(normalized, 'campus_id', 'campusId');
41
41
  assignAlias(normalized, 'program_id', 'programId');
42
+ assignAlias(normalized, 'program_term_id', 'programTermId');
42
43
 
43
44
  delete normalized.roleName;
44
45
  delete normalized.role;
45
46
  delete normalized.institutionId;
46
47
  delete normalized.campusId;
47
48
  delete normalized.programId;
49
+ delete normalized.programTermId;
48
50
 
49
51
  return normalized;
50
52
  }
@@ -63,7 +65,8 @@ function shouldRequireScope(roleRequest, requireScope) {
63
65
  roleRequest.role_name !== undefined ||
64
66
  roleRequest.institution_id !== undefined ||
65
67
  roleRequest.campus_id !== undefined ||
66
- roleRequest.program_id !== undefined
68
+ roleRequest.program_id !== undefined ||
69
+ roleRequest.program_term_id !== undefined
67
70
  );
68
71
  }
69
72
 
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@carecard/validate",
3
- "version": "3.6.1",
3
+ "version": "3.7.0",
4
4
  "repository": {
5
5
  "type": "git",
6
6
  "url": "git+https://github.com/CareCard-ca/pkg-validate.git"
package/readme.md CHANGED
@@ -102,30 +102,30 @@ validateProperties(input);
102
102
  Keys are matched exactly. Both snake_case and camelCase variants are listed
103
103
  where the package supports both.
104
104
 
105
- | Validator | Keys |
106
- | --------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
107
- | `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` |
108
- | `isStreetString` | `street` |
109
- | `isCharactersString` | `postal_code`, `postalCode`, `period` |
110
- | `isBoolValue` | `is_primary`, `isPrimary`, `active`, `document_optional`, `documentOptional` |
111
- | `isSafeSearchString` | `search_string`, `searchString` |
112
- | `isString6To16CharacterLong` and `isSimplePasswordString` | `password`, `new_password`, `newPassword` |
113
- | `isString6To16CharacterLong` and `isPasswordString` | `strong_password`, `strongPassword` |
114
- | `isEmailString` | `email` |
115
- | `isPhoneNumber` | `phone_number`, `phoneNumber` |
116
- | `isCountryCodeString` | `country_code`, `countryCode` |
117
- | `isUrlSafeString` | `token`, `email_confirm_token`, `emailConfirmToken`, `verification_token`, `verificationToken` |
118
- | `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` |
119
- | `isCcIdString` | `cc_id`, `ccId` |
120
- | `isValidIntegerString` | `offset_number`, `offsetNumber`, `number_of_orders`, `numberOfOrders`, `price`, `from`, `number`, `limit`, `offset` |
121
- | `isValidJsonString` on the raw value | `about` |
122
- | `isValidJsonString(JSON.stringify(value))` | `weight`, `dimensions`, `permission`, `scope_data`, `scopeData`, `meta_data`, `metaData` |
123
- | `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` |
124
- | `isValidArrayOfStrings` | `aliases` |
125
- | `isImageUrl` or `isValidUrl` | `image_url`, `imageUrl`, `website`, `file_url`, `fileUrl` |
126
- | `isValidDomainName` | `domain_name`, `domainName`, `domain`, `email_domain`, `emailDomain`, `email_domain_name`, `emailDomainName` |
127
- | `isValidTimestampzString` or `isValidTimestampString` | `expires_at`, `expiresAt`, `start_time`, `startTime`, `end_time`, `endTime` |
128
- | `isValidDateString` | `effective_start_date`, `effectiveStartDate`, `effective_end_date`, `effectiveEndDate`, `valid_until_date`, `validUntilDate`, `renew_date`, `renewDate` |
105
+ | Validator | Keys |
106
+ | --------------------------------------------------------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
107
+ | `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` |
108
+ | `isStreetString` | `street` |
109
+ | `isCharactersString` | `postal_code`, `postalCode`, `period` |
110
+ | `isBoolValue` | `is_primary`, `isPrimary`, `active`, `document_optional`, `documentOptional` |
111
+ | `isSafeSearchString` | `search_string`, `searchString` |
112
+ | `isString6To16CharacterLong` and `isSimplePasswordString` | `password`, `new_password`, `newPassword` |
113
+ | `isString6To16CharacterLong` and `isPasswordString` | `strong_password`, `strongPassword` |
114
+ | `isEmailString` | `email` |
115
+ | `isPhoneNumber` | `phone_number`, `phoneNumber` |
116
+ | `isCountryCodeString` | `country_code`, `countryCode` |
117
+ | `isUrlSafeString` | `token`, `email_confirm_token`, `emailConfirmToken`, `verification_token`, `verificationToken` |
118
+ | `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_term_id`, `programTermId`, `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` |
119
+ | `isCcIdString` | `cc_id`, `ccId` |
120
+ | `isValidIntegerString` | `offset_number`, `offsetNumber`, `number_of_orders`, `numberOfOrders`, `price`, `from`, `number`, `limit`, `offset` |
121
+ | `isValidJsonString` on the raw value | `about` |
122
+ | `isValidJsonString(JSON.stringify(value))` | `weight`, `dimensions`, `permission`, `scope_data`, `scopeData`, `meta_data`, `metaData` |
123
+ | `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` |
124
+ | `isValidArrayOfStrings` | `aliases` |
125
+ | `isImageUrl` or `isValidUrl` | `image_url`, `imageUrl`, `website`, `file_url`, `fileUrl` |
126
+ | `isValidDomainName` | `domain_name`, `domainName`, `domain`, `email_domain`, `emailDomain`, `email_domain_name`, `emailDomainName` |
127
+ | `isValidTimestampzString` or `isValidTimestampString` | `expires_at`, `expiresAt`, `start_time`, `startTime`, `end_time`, `endTime` |
128
+ | `isValidDateString` | `effective_start_date`, `effectiveStartDate`, `effective_end_date`, `effectiveEndDate`, `valid_until_date`, `validUntilDate`, `renew_date`, `renewDate` |
129
129
 
130
130
  ## `validateWhitelistProperties(inputObject, requiredProperties, options)`
131
131