@getcommunity/gc-validators 0.0.213 → 0.0.215
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/README.md +43 -124
- package/dist/{chunk-Q6TCMSOO.js → chunk-BYTL5J7D.js} +7 -7
- package/dist/{chunk-Q6TCMSOO.js.map → chunk-BYTL5J7D.js.map} +1 -1
- package/dist/{chunk-B4H2XFKV.js → chunk-DU5WCXJJ.js} +12 -3
- package/dist/{chunk-B4H2XFKV.js.map → chunk-DU5WCXJJ.js.map} +1 -1
- package/dist/{chunk-JULLUORM.cjs → chunk-IMI6XEMX.cjs} +12 -12
- package/dist/{chunk-JULLUORM.cjs.map → chunk-IMI6XEMX.cjs.map} +1 -1
- package/dist/{chunk-KUKR2YJV.cjs → chunk-NMDMJZPF.cjs} +12 -2
- package/dist/{chunk-KUKR2YJV.cjs.map → chunk-NMDMJZPF.cjs.map} +1 -1
- package/dist/{monday-workspace.document-C3MD5or8.d.cts → comment.document-HT6qJLh5.d.cts} +7 -6
- package/dist/{monday-workspace.document-Cg5L2bfK.d.ts → comment.document-xCsfHOer.d.ts} +7 -6
- package/dist/index.cjs +235 -231
- package/dist/index.d.cts +3 -3
- package/dist/index.d.ts +3 -3
- package/dist/index.js +2 -2
- package/dist/permissions.cjs +10 -6
- package/dist/permissions.d.cts +4 -3
- package/dist/permissions.d.ts +4 -3
- package/dist/permissions.js +1 -1
- package/dist/schemas.cjs +226 -226
- package/dist/schemas.d.cts +5 -5
- package/dist/schemas.d.ts +5 -5
- package/dist/schemas.js +2 -2
- package/dist/types.d.cts +2 -2
- package/dist/types.d.ts +2 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -122,136 +122,55 @@ gc-validators/
|
|
|
122
122
|
- Ensure that all tests pass before merging.
|
|
123
123
|
- Use descriptive titles and provide context in the PR description.
|
|
124
124
|
|
|
125
|
-
##
|
|
126
|
-
|
|
127
|
-
Each submodule contains an .env.example file that outlines the necessary environment variables. Copy this file to .env and fill in the appropriate values. Many of the env variable are managed in a secure vault and can be retrieved from the project manager.
|
|
128
|
-
|
|
129
|
-
### Development Requirements
|
|
130
|
-
|
|
131
|
-
- Node.js version: >=22.x (LTS)
|
|
132
|
-
- Package manager: pnpm
|
|
133
|
-
- Other dependencies: Git
|
|
134
|
-
|
|
135
|
-
### Installation Steps
|
|
136
|
-
|
|
137
|
-
```bash
|
|
138
|
-
# 1. Clone the library
|
|
139
|
-
git clone [repository-url]
|
|
140
|
-
|
|
141
|
-
# 2. Install dependencies
|
|
142
|
-
pnpm install
|
|
143
|
-
|
|
144
|
-
# 3. Build the library
|
|
145
|
-
pnpm build
|
|
146
|
-
```
|
|
147
|
-
|
|
148
|
-
## Core Feature Implementation (TO DO)
|
|
149
|
-
|
|
150
|
-
### Feature Module 1
|
|
125
|
+
## Examples
|
|
151
126
|
|
|
152
|
-
|
|
127
|
+
### Check if a user can be assigned a specific resource permission
|
|
153
128
|
|
|
154
|
-
```
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
129
|
+
```ts
|
|
130
|
+
const userDoc: UserDocument = {
|
|
131
|
+
id: 1,
|
|
132
|
+
documentId: "1234asdfhjkl",
|
|
133
|
+
createdAt: "2024-01-01T00:00:00.000Z",
|
|
134
|
+
updatedAt: "2024-01-01T00:00:00.000Z",
|
|
135
|
+
publishedAt: "2024-01-01T00:00:00.000Z",
|
|
136
|
+
username: "tester",
|
|
137
|
+
email: "test@test.com",
|
|
138
|
+
provider: "local",
|
|
139
|
+
confirmed: true,
|
|
140
|
+
blocked: true,
|
|
141
|
+
clerk_user_id: ""
|
|
142
|
+
}
|
|
143
|
+
const user: AuthorizedUserDocument = {
|
|
144
|
+
...userDoc,
|
|
145
|
+
role: {
|
|
146
|
+
id: 1,
|
|
147
|
+
documentId: "1234asdfhjkl",
|
|
148
|
+
createdAt: "2024-01-01T00:00:00.000Z",
|
|
149
|
+
updatedAt: "2024-01-01T00:00:00.000Z",
|
|
150
|
+
publishedAt: "2024-01-01T00:00:00.000Z",
|
|
151
|
+
type: "employee",
|
|
152
|
+
name: "Employee",
|
|
153
|
+
description: "Employee role with access to client data",
|
|
154
|
+
permissions: []
|
|
155
|
+
},
|
|
156
|
+
account: {
|
|
157
|
+
id: 1,
|
|
158
|
+
documentId: "1234asdfhjkl",
|
|
159
|
+
createdAt: "2024-01-01T00:00:00.000Z",
|
|
160
|
+
updatedAt: "2024-01-01T00:00:00.000Z",
|
|
161
|
+
publishedAt: "2024-01-01T00:00:00.000Z",
|
|
162
|
+
preferred_name: "Test Account",
|
|
163
|
+
first_name: "Test",
|
|
164
|
+
last_name: "User"
|
|
165
|
+
}
|
|
158
166
|
}
|
|
159
|
-
```
|
|
160
|
-
|
|
161
|
-
## Testing Strategy
|
|
162
|
-
|
|
163
|
-
### Unit Testing
|
|
164
|
-
|
|
165
|
-
- Testing framework:
|
|
166
|
-
- Test coverage requirements:
|
|
167
|
-
- Test file organization:
|
|
168
|
-
|
|
169
|
-
### Integration Testing
|
|
170
|
-
|
|
171
|
-
- Test scenarios:
|
|
172
|
-
- Testing tools:
|
|
173
|
-
|
|
174
|
-
### End-to-End Testing
|
|
175
|
-
|
|
176
|
-
- Test workflow:
|
|
177
|
-
- Automation tools:
|
|
178
|
-
|
|
179
|
-
## Deployment Guide
|
|
180
|
-
|
|
181
|
-
### Build Process
|
|
182
|
-
|
|
183
|
-
```bash
|
|
184
|
-
# Build command
|
|
185
|
-
pnpm build
|
|
186
|
-
```
|
|
187
|
-
|
|
188
|
-
### Deployment Steps
|
|
189
|
-
|
|
190
|
-
1. Prepare production environment
|
|
191
|
-
2. Configure environment variables
|
|
192
|
-
3. Execute deployment scripts
|
|
193
|
-
4. Verify deployment results
|
|
194
|
-
|
|
195
|
-
### Environment Variables
|
|
196
167
|
|
|
197
|
-
|
|
198
|
-
|
|
168
|
+
// Check if user can be assigned permission to create client projects
|
|
169
|
+
canAssignPermission(user, "client-project", "create")
|
|
170
|
+
// true
|
|
199
171
|
```
|
|
200
172
|
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
### Frontend Optimization
|
|
204
|
-
|
|
205
|
-
- Code splitting
|
|
206
|
-
- Lazy loading
|
|
207
|
-
- Caching strategies
|
|
208
|
-
|
|
209
|
-
### Backend Optimization
|
|
210
|
-
|
|
211
|
-
- Database query optimization
|
|
212
|
-
- Caching mechanisms
|
|
213
|
-
- Load balancing
|
|
214
|
-
|
|
215
|
-
## Security Considerations
|
|
216
|
-
|
|
217
|
-
### Data Security
|
|
218
|
-
|
|
219
|
-
- Input validation
|
|
220
|
-
- SQL injection protection
|
|
221
|
-
- XSS protection
|
|
222
|
-
|
|
223
|
-
### Authentication & Authorization
|
|
224
|
-
|
|
225
|
-
- User authentication flow
|
|
226
|
-
- Permission control
|
|
227
|
-
- Token management
|
|
228
|
-
|
|
229
|
-
## Monitoring and Logging
|
|
230
|
-
|
|
231
|
-
### Application Monitoring
|
|
232
|
-
|
|
233
|
-
- Performance metrics
|
|
234
|
-
- Error tracking
|
|
235
|
-
- User behavior analytics
|
|
236
|
-
|
|
237
|
-
### Log Management
|
|
238
|
-
|
|
239
|
-
- Log levels
|
|
240
|
-
- Log format
|
|
241
|
-
- Log storage
|
|
242
|
-
|
|
243
|
-
## Reference Resources
|
|
244
|
-
|
|
245
|
-
- [Official Documentation Link]
|
|
246
|
-
- [Related Tutorials]
|
|
247
|
-
- [Community Resources]
|
|
248
|
-
- [Best Practices Guide]
|
|
249
|
-
|
|
250
|
-
---
|
|
251
|
-
|
|
252
|
-
## Examples
|
|
253
|
-
|
|
254
|
-
### Permission Constants Usage
|
|
173
|
+
### Check if a user has permission to access a client assigned entity
|
|
255
174
|
|
|
256
175
|
```ts
|
|
257
176
|
const userDoc: UserDocument = {
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { LIMIT_MIN_VALUE, LIMIT_SHORT_STRING_MAX_LENGTH, ClientProjectPhaseOptions, ClientProjectStatusOptions, ERROR_MESSAGE_ONE_PROJECT_STATUS, IsValidClientClassificationSelectOptions, CommentApprovalStatusOptions, ReportCommentReasonOptions, ERROR_MESSAGE_ROBOT, LIMIT_LONG_STRING_MAX_LENGTH, ERROR_MESSAGE_COMMA_SEPPARATED_URLS, LIMIT_VAL_100, LIMIT_BLOG_POST_PAGINATION_MAX_SIZE, LIMIT_REDIRECT_PAGINATION_DEFAULT_SIZE, LIMIT_VAL_10, ERROR_MESSAGE_INVALID_URL, ERROR_MESSAGE_URL_NO_QUERY_PARAMS, ERROR_MESSAGE_UTM_URL, ERROR_MESSAGE_REGEX_URL_SLUG, REGEX_URL_SLUG, LIMIT_MIN_PHONE, LIMIT_MAX_PHONE, REGEX_NANP_PHONE, ERROR_MESSAGE_REGEX_PHONE, ERROR_MESSAGE_URL_PREFIX, ERROR_MESSAGE_REGEX_UTM_VALUE, REGEX_UTM_VALUE, LIMIT_MAX_UTM_KEY, LIMIT_MIN_UTM_KEY, LIMIT_MIN_EMAIL, LIMIT_MAX_EMAIL, LIMIT_MAX_DESTINATION, LIMIT_MAX_UTM_CAMPAIGN, LIMIT_MIN_UTM_CAMPAIGN, LIMIT_MAX_UTM_MEDIUM, LIMIT_MIN_UTM_MEDIUM, LIMIT_MAX_UTM_SOURCE, LIMIT_MIN_UTM_SOURCE, LIMIT_CLIENT_CONTENT_PILLAR_PAGINATION_MAX_SIZE, LIMIT_CLIENT_MEDIA_PLATFORM_PAGINATION_MAX_SIZE, LIMIT_CLIENT_PROJECT_PAGINATION_MAX_SIZE, LIMIT_CLIENT_REPORT_PAGINATION_MAX_SIZE, LIMIT_CLIENT_STYLEGUIDE_PAGINATION_MAX_SIZE, LIMIT_CLIENT_USER_PAGINATION_MAX_SIZE_LIMIT, LIMIT_CLIENT_PAGINATION_MAX_SIZE, LIMIT_PAGINATION_MAX_SIZE, LIMIT_MONDAY_WORKSPACE_PAGINATION_MAX_SIZE, LIMIT_PAGINATION_DEFAULT_SIZE, LIMIT_MAX_PASSWORD, LIMIT_MIN_PASSWORD, LIMIT_MAX_USERNAME, LIMIT_MIN_USERNAME, LIMIT_USER_PAGINATION_MAX_SIZE, LIMIT_MAX_UTM_ID, LIMIT_MIN_UTM_ID, LIMIT_MAX_UTM_CREATIVE_FORMAT, LIMIT_MIN_UTM_CREATIVE_FORMAT, LIMIT_MAX_UTM_CONTENT, LIMIT_MIN_UTM_CONTENT, LIMIT_UTM_TRACKING_LINK_PAGINATION_MAX_SIZE } from './chunk-ABPKJ5AP.js';
|
|
2
|
-
import { CLIENT_ENTITY_SCOPES } from './chunk-
|
|
2
|
+
import { CLIENT_ENTITY_SCOPES } from './chunk-DU5WCXJJ.js';
|
|
3
3
|
import * as v35 from 'valibot';
|
|
4
4
|
|
|
5
5
|
var VNumberNullable = () => v35.optional(v35.nullable(v35.number()));
|
|
@@ -1435,7 +1435,7 @@ var MondayWorkspaceSortKeys = [
|
|
|
1435
1435
|
"createdAt",
|
|
1436
1436
|
"updatedAt"
|
|
1437
1437
|
];
|
|
1438
|
-
var
|
|
1438
|
+
var QuerySortMondayWorkspaces = v35.optional(
|
|
1439
1439
|
v35.pipe(
|
|
1440
1440
|
v35.array(
|
|
1441
1441
|
v35.picklist(
|
|
@@ -1445,13 +1445,13 @@ var QuerySortMondayWorkspace = v35.optional(
|
|
|
1445
1445
|
v35.maxLength(MondayWorkspaceSortKeys.length)
|
|
1446
1446
|
)
|
|
1447
1447
|
);
|
|
1448
|
-
var
|
|
1448
|
+
var QueryStrapiSearchMondayWorkspaces = v35.object({
|
|
1449
1449
|
page: VPage(),
|
|
1450
1450
|
size: VSize(LIMIT_MONDAY_WORKSPACE_PAGINATION_MAX_SIZE),
|
|
1451
1451
|
clients: v35.optional(v35.pipe(v35.array(VStringShort()), v35.minLength(LIMIT_MIN_VALUE))),
|
|
1452
1452
|
title: v35.optional(VStringMax()),
|
|
1453
1453
|
workspace_id: v35.optional(VStringMax()),
|
|
1454
|
-
sort:
|
|
1454
|
+
sort: QuerySortMondayWorkspaces
|
|
1455
1455
|
});
|
|
1456
1456
|
var SCreateMondayWorkspaceDocument = v35.object({
|
|
1457
1457
|
clients: v35.pipe(v35.array(VStringShort()), v35.minLength(LIMIT_MIN_VALUE)),
|
|
@@ -2601,6 +2601,6 @@ var SUpdateUtmTrackingLinkDocumentRequest = v35.object({
|
|
|
2601
2601
|
data: SUpdateUtmTrackingLinkDocument
|
|
2602
2602
|
});
|
|
2603
2603
|
|
|
2604
|
-
export { BlogPostSortKeys, CategorySortKeys, ClientContentPillarSortKeys, ClientMediaPlatformContentTypeSortKeys, ClientMediaPlatformSortKeys, ClientProjectSortKeys, ClientReportSortKeys, ClientSortKeys, ClientStyleguideSortKeys, ClientUserSortKeys, ContentPillarSortKeys, EntitySortKeys, GCFlyTourSnapSortKeys, GCFlyTourSortKeys, MediaContentTypeSortKeys, MediaPlatformSortKeys, MondayWorkspaceSortKeys, QueryFilterStrapiComments, QuerySortBlogPosts, QuerySortCategories, QuerySortClientContentPillars, QuerySortClientMediaPlatformContentTypes, QuerySortClientMediaPlatforms, QuerySortClientProjects, QuerySortClientReports, QuerySortClientStyleguides, QuerySortClientUsers, QuerySortClients, QuerySortContentPillars, QuerySortEntities, QuerySortGCFlyTourSnaps, QuerySortGCFlyTours, QuerySortMediaContentType, QuerySortMediaPlatforms,
|
|
2605
|
-
//# sourceMappingURL=chunk-
|
|
2606
|
-
//# sourceMappingURL=chunk-
|
|
2604
|
+
export { BlogPostSortKeys, CategorySortKeys, ClientContentPillarSortKeys, ClientMediaPlatformContentTypeSortKeys, ClientMediaPlatformSortKeys, ClientProjectSortKeys, ClientReportSortKeys, ClientSortKeys, ClientStyleguideSortKeys, ClientUserSortKeys, ContentPillarSortKeys, EntitySortKeys, GCFlyTourSnapSortKeys, GCFlyTourSortKeys, MediaContentTypeSortKeys, MediaPlatformSortKeys, MondayWorkspaceSortKeys, QueryFilterStrapiComments, QuerySortBlogPosts, QuerySortCategories, QuerySortClientContentPillars, QuerySortClientMediaPlatformContentTypes, QuerySortClientMediaPlatforms, QuerySortClientProjects, QuerySortClientReports, QuerySortClientStyleguides, QuerySortClientUsers, QuerySortClients, QuerySortContentPillars, QuerySortEntities, QuerySortGCFlyTourSnaps, QuerySortGCFlyTours, QuerySortMediaContentType, QuerySortMediaPlatforms, QuerySortMondayWorkspaces, QuerySortStrapiComments, QuerySortTags, QuerySortTeamMembers, QuerySortTeamworkProjectHealth, QuerySortUrlRedirects, QuerySortUsers, QuerySortUtmTrackingLinks, QueryStrapiByDocumentId, QueryStrapiByEmail, QueryStrapiById, QueryStrapiByName, QueryStrapiByPhone, QueryStrapiBySlug, QueryStrapiCommentsFlat, QueryStrapiCommentsInHeirarchy, QueryStrapiPaginated, QueryStrapiPaginatedUrlRedirects, QueryStrapiSearchBlogPosts, QueryStrapiSearchBlogPostsBySlug, QueryStrapiSearchCategories, QueryStrapiSearchClientContentPillars, QueryStrapiSearchClientMediaPlatformContentTypes, QueryStrapiSearchClientMediaPlatforms, QueryStrapiSearchClientProjects, QueryStrapiSearchClientReports, QueryStrapiSearchClientStyleguide, QueryStrapiSearchClients, QueryStrapiSearchContentPillars, QueryStrapiSearchGCFlyTourSnaps, QueryStrapiSearchGCFlyTours, QueryStrapiSearchMediaContentTypes, QueryStrapiSearchMediaPlatforms, QueryStrapiSearchMondayWorkspaces, QueryStrapiSearchTags, QueryStrapiSearchTeamMembers, QueryStrapiSearchTeamworkProjectHealth, QueryStrapiSearchUtmTrackingLinks, QueryStrapiUrlRedirectsByFrom, QueryStrapiUsers, QueryStrapiUsersByIdentifier, SAssociateClientMediaPlatformContentTypesToMediaContentType, SAssociateClientToClientProjectDocument, SAssociateClientsToGCFlyTour, SAssociateGcFlyTourSnapsToGCFlyTour, SAssociateMediaContentTypesToClientMediaPlatform, SAssociateMediaContentTypesToMediaPlatform, SAssociateMediaPlatformsToMediaContentType, SAuthConnectProviderConfirmation, SAuthConnectProviderRedirectSearch, SAuthRawAccessToken, SChangePassword, SConnectManyEntityRelation, SConnectOneEntityRelation, SCreateCategoryDocument, SCreateClientContentPillarDocument, SCreateClientDocument, SCreateClientMediaPlatformContentTypeDocument, SCreateClientMediaPlatformDocument, SCreateClientProjectDocument, SCreateClientReportDocument, SCreateClientStyleguideDocument, SCreateClientUserDocument, SCreateCommentDocument, SCreateContentPillarDocument, SCreateGCFlyTourDocument, SCreateGCFlyTourSnapDocument, SCreateLeadDocument, SCreateMediaContentTypeDocument, SCreateMediaPlatformDocument, SCreateMondayWorkspaceDocument, SCreateMultipleStrapiMediaUploadDocument, SCreateNewsletterSignup, SCreateNewsletterSignupDocument, SCreateResume, SCreateResumeInfo, SCreateResumeInfoDocument, SCreateStrapiMediaUploadDocument, SCreateTagDocument, SCreateUserDocument, SCreateUtmTrackingLinkDocument, SCreateUtmTrackingLinkDocumentRequest, SCreateUtmTrackingLinkParts, SDeleteCommentDocument, SDisconnectManyEntityRelation, SDisconnectOneEntityRelation, SEntityRelation, SEntityRelationPosition, SEntityRelationPositionAfter, SEntityRelationPositionBefore, SEntityRelationPositionEnd, SEntityRelationPositionStart, SForgotUserPassword, SFormCreateMultipleUtmTrackingLinkDocuments, SLoginUser, SQueryListClientUserDocuments, SReadUserAccountByDocumentId, SReadUserAccountById, SReadUtmTrackingLinkDocumentByUrl, SRegisterUser, SReportCommentDocument, SRequestConfirmEmail, SResetUserPassword, SSetManyEntityRelation, SSetOneEntityRelation, SUpdateCategoryDocument, SUpdateCategoryDocumentRequest, SUpdateClientContentPillarDocument, SUpdateClientContentPillarDocumentRequest, SUpdateClientDocument, SUpdateClientDocumentRequest, SUpdateClientMediaPlatformContentTypeDocument, SUpdateClientMediaPlatformContentTypeDocumentRequest, SUpdateClientMediaPlatformDocument, SUpdateClientMediaPlatformDocumentRequest, SUpdateClientProjectDocument, SUpdateClientProjectDocumentRequest, SUpdateClientReportDocument, SUpdateClientReportDocumentRequest, SUpdateClientStyleguideDocument, SUpdateClientStyleguideDocumentRequest, SUpdateClientUserDocument, SUpdateClientUserDocumentRequest, SUpdateCommentDocument, SUpdateContentPillarDocument, SUpdateContentPillarDocumentRequest, SUpdateGCFlyTourDocument, SUpdateGCFlyTourDocumentRequest, SUpdateGCFlyTourSnapDocument, SUpdateGCFlyTourSnapDocumentRequest, SUpdateLeadDocument, SUpdateLeadRequest, SUpdateMediaContentTypeDocument, SUpdateMediaContentTypeDocumentRequest, SUpdateMediaPlatformDocument, SUpdateMediaPlatformDocumentRequest, SUpdateMondayWorkspaceDocument, SUpdateMondayWorkspaceDocumentRequest, SUpdateNewsletterSignupDocument, SUpdateNewsletterSignupRequest, SUpdateResumeInfo, SUpdateResumeInfoDocument, SUpdateResumeInfoRequest, SUpdateStrapiMediaFileInfo, SUpdateTagDocument, SUpdateTagDocumentRequest, SUpdateTrendsLikes, SUpdateUserAccount, SUpdateUserAccountFirstName, SUpdateUserAccountLastName, SUpdateUserAccountPreferredName, SUpdateUtmTrackingLinkDocument, SUpdateUtmTrackingLinkDocumentRequest, SUserToken, SUtmLinkBuilderPartCampaignDateOptions, SUtmLinkBuilderTableForm, SVerifyClientUserDocument, SharpSpringSignUpToDownload, StrapiCommentSortKeys, TagSortKeys, TeamMemberSortKeys, TeamworkProjectHealthProjectStatusOptions, TeamworkProjectHealthSelectSortOptions, UrlRedirectSortKeys, UserSortKeys, UtmTrackingLinkSortKeys, VIntegerNullable, VNumberNullable, VPage, VSize, VString, VStringEmail, VStringLong, VStringLongNullable, VStringMax, VStringMaxRegex, VStringMinMax, VStringMinMaxRegex, VStringPhone, VStringPhoneNullable, VStringShort, VStringShortNullable, VStringSlug, VStringUrl, VStringUrlNoUtm, VStringUrlNullable, VStringUrlUtm, checkIsValidUrlList };
|
|
2605
|
+
//# sourceMappingURL=chunk-BYTL5J7D.js.map
|
|
2606
|
+
//# sourceMappingURL=chunk-BYTL5J7D.js.map
|