@goweekdays/core 2.2.2 → 2.3.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/CHANGELOG.md +6 -0
- package/dist/index.d.ts +17 -7
- package/dist/index.js +1907 -1600
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1705 -1397
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -312,12 +312,11 @@ type TMember = {
|
|
|
312
312
|
deletedAt?: string | Date;
|
|
313
313
|
};
|
|
314
314
|
declare const schemaMember: Joi.ObjectSchema<any>;
|
|
315
|
+
declare const schemaMemberRole: Joi.ObjectSchema<any>;
|
|
316
|
+
declare const schemaMemberStatus: Joi.ObjectSchema<any>;
|
|
315
317
|
declare function modelMember(value: TMember): TMember;
|
|
316
318
|
|
|
317
319
|
declare function useMemberRepo(): {
|
|
318
|
-
createIndex: () => Promise<void>;
|
|
319
|
-
createUniqueIndex: () => Promise<void>;
|
|
320
|
-
createTextIndex: () => Promise<void>;
|
|
321
320
|
add: (value: TMember, session?: ClientSession) => Promise<string>;
|
|
322
321
|
getById: (_id: string | ObjectId) => Promise<TMember | null>;
|
|
323
322
|
getByRole: (role: string | ObjectId) => Promise<TMember | null>;
|
|
@@ -369,6 +368,12 @@ declare function useMemberRepo(): {
|
|
|
369
368
|
user?: string | ObjectId;
|
|
370
369
|
org?: string | ObjectId;
|
|
371
370
|
}) => Promise<TMember | null>;
|
|
371
|
+
updateRoleById: (_id: string | ObjectId, value: {
|
|
372
|
+
role: string | ObjectId;
|
|
373
|
+
roleName: string;
|
|
374
|
+
}, session?: ClientSession) => Promise<string>;
|
|
375
|
+
updateStatusById: (_id: string | ObjectId, status: string, session?: ClientSession) => Promise<string>;
|
|
376
|
+
deleteById: (_id: string | ObjectId, session?: ClientSession) => Promise<string>;
|
|
372
377
|
};
|
|
373
378
|
|
|
374
379
|
declare function useMemberController(): {
|
|
@@ -378,6 +383,9 @@ declare function useMemberController(): {
|
|
|
378
383
|
getOrgsByMembership: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
379
384
|
updateStatusByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
380
385
|
getByUserType: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
386
|
+
updateRoleById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
387
|
+
updateStatusById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
388
|
+
deleteById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
381
389
|
};
|
|
382
390
|
|
|
383
391
|
type TOrg = {
|
|
@@ -477,7 +485,7 @@ declare function usePSGCController(): {
|
|
|
477
485
|
type TRole = {
|
|
478
486
|
_id?: ObjectId;
|
|
479
487
|
id?: string | ObjectId;
|
|
480
|
-
name
|
|
488
|
+
name: string;
|
|
481
489
|
description?: string;
|
|
482
490
|
permissions?: Array<string>;
|
|
483
491
|
org?: string | ObjectId;
|
|
@@ -488,8 +496,8 @@ type TRole = {
|
|
|
488
496
|
updatedAt?: string | Date;
|
|
489
497
|
deletedAt?: string | Date;
|
|
490
498
|
};
|
|
491
|
-
type TMiniRole = Pick<TRole, "name" | "permissions">;
|
|
492
499
|
declare const schemaRole: Joi.ObjectSchema<any>;
|
|
500
|
+
declare const schemaRoleUpdate: Joi.ObjectSchema<any>;
|
|
493
501
|
declare function modelRole(value: TRole): TRole;
|
|
494
502
|
|
|
495
503
|
declare function useRoleRepo(): {
|
|
@@ -510,7 +518,7 @@ declare function useRoleRepo(): {
|
|
|
510
518
|
getRoleByUserId: (value: ObjectId | string) => Promise<TRole | null>;
|
|
511
519
|
getById: (_id: ObjectId | string) => Promise<mongodb.WithId<bson.Document> | TRole | null>;
|
|
512
520
|
getRoleByName: (name: string) => Promise<mongodb.WithId<bson.Document> | TRole | null>;
|
|
513
|
-
updateRole: (_id: string | ObjectId, value:
|
|
521
|
+
updateRole: (_id: string | ObjectId, value: Pick<TRole, "name" | "permissions" | "description">, session?: ClientSession) => Promise<string>;
|
|
514
522
|
deleteById: (_id: ObjectId | string, session?: ClientSession) => Promise<string>;
|
|
515
523
|
updatePermissionsById: (_id: string | ObjectId, permissions: TRole["permissions"], session?: ClientSession) => Promise<string>;
|
|
516
524
|
delCachedData: () => void;
|
|
@@ -729,6 +737,7 @@ declare function useVerificationService(): {
|
|
|
729
737
|
app: string;
|
|
730
738
|
org?: string;
|
|
731
739
|
}) => Promise<bson.ObjectId>;
|
|
740
|
+
cancelInviteMember: (id: string) => Promise<string>;
|
|
732
741
|
};
|
|
733
742
|
|
|
734
743
|
declare function useVerificationController(): {
|
|
@@ -739,6 +748,7 @@ declare function useVerificationController(): {
|
|
|
739
748
|
cancelUserInvitation: (req: Request, res: Response, next: NextFunction) => Promise<Response<any, Record<string, any>> | undefined>;
|
|
740
749
|
inviteMember: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
741
750
|
signUp: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
751
|
+
cancelInviteMember: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
742
752
|
};
|
|
743
753
|
|
|
744
754
|
type TApp = {
|
|
@@ -926,4 +936,4 @@ declare const XENDIT_SECRET_KEY: string;
|
|
|
926
936
|
declare const XENDIT_BASE_URL: string;
|
|
927
937
|
declare const DOMAIN: string;
|
|
928
938
|
|
|
929
|
-
export { ACCESS_TOKEN_EXPIRY, ACCESS_TOKEN_SECRET, APP_ACCOUNT, APP_MAIN, DEFAULT_USER_EMAIL, DEFAULT_USER_FIRST_NAME, DEFAULT_USER_LAST_NAME, DEFAULT_USER_PASSWORD, DOMAIN, MAILER_EMAIL, MAILER_PASSWORD, MAILER_TRANSPORT_HOST, MAILER_TRANSPORT_PORT, MAILER_TRANSPORT_SECURE, MAddress, MBuilding, MBuildingUnit, MFile, MONGO_DB, MONGO_URI, PAYPAL_API_URL, PAYPAL_CLIENT_ID, PAYPAL_CLIENT_SECRET, PORT, REDIS_HOST, REDIS_PASSWORD, REDIS_PORT, REFRESH_TOKEN_EXPIRY, REFRESH_TOKEN_SECRET, SECRET_KEY, SPACES_ACCESS_KEY, SPACES_BUCKET, SPACES_ENDPOINT, SPACES_REGION, SPACES_SECRET_KEY, TAddress, TApp, TBuilding, TBuildingUnit, TCounter, TFile, TMember,
|
|
939
|
+
export { ACCESS_TOKEN_EXPIRY, ACCESS_TOKEN_SECRET, APP_ACCOUNT, APP_MAIN, DEFAULT_USER_EMAIL, DEFAULT_USER_FIRST_NAME, DEFAULT_USER_LAST_NAME, DEFAULT_USER_PASSWORD, DOMAIN, MAILER_EMAIL, MAILER_PASSWORD, MAILER_TRANSPORT_HOST, MAILER_TRANSPORT_PORT, MAILER_TRANSPORT_SECURE, MAddress, MBuilding, MBuildingUnit, MFile, MONGO_DB, MONGO_URI, PAYPAL_API_URL, PAYPAL_CLIENT_ID, PAYPAL_CLIENT_SECRET, PORT, REDIS_HOST, REDIS_PASSWORD, REDIS_PORT, REFRESH_TOKEN_EXPIRY, REFRESH_TOKEN_SECRET, SECRET_KEY, SPACES_ACCESS_KEY, SPACES_BUCKET, SPACES_ENDPOINT, SPACES_REGION, SPACES_SECRET_KEY, TAddress, TApp, TBuilding, TBuildingUnit, TCounter, TFile, TMember, TOrg, TPSGC, TPermission, TPermissionGroup, TRole, TUser, TVerification, TVerificationMetadata, VERIFICATION_FORGET_PASSWORD_DURATION, VERIFICATION_USER_INVITE_DURATION, XENDIT_BASE_URL, XENDIT_SECRET_KEY, addressSchema, isDev, modelApp, modelMember, modelOrg, modelPSGC, modelPermission, modelPermissionGroup, modelRole, modelUser, modelVerification, schemaApp, schemaAppUpdate, schemaBuilding, schemaBuildingUnit, schemaInviteMember, schemaMember, schemaMemberRole, schemaMemberStatus, schemaOrg, schemaPSGC, schemaPermission, schemaPermissionGroup, schemaPermissionGroupUpdate, schemaPermissionUpdate, schemaRole, schemaRoleUpdate, schemaUpdateOptions, schemaUser, schemaVerification, transactionSchema, useAddressController, useAddressRepo, useAppController, useAppRepo, useAppService, useAuthController, useAuthService, useBuildingController, useBuildingRepo, useBuildingService, useBuildingUnitController, useBuildingUnitRepo, useBuildingUnitService, useCounterModel, useCounterRepo, useFileController, useFileRepo, useFileService, useGitHubService, useMemberController, useMemberRepo, useOrgController, useOrgRepo, useOrgService, usePSGCController, usePSGCRepo, usePermissionController, usePermissionGroupController, usePermissionGroupRepo, usePermissionGroupService, usePermissionRepo, usePermissionService, useRoleController, useRoleRepo, useRoleService, useUserController, useUserRepo, useUserService, useUtilController, useVerificationController, useVerificationRepo, useVerificationService };
|