@goweekdays/core 2.1.4 → 2.2.1

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 CHANGED
@@ -1,5 +1,17 @@
1
1
  # @goweekdays/core
2
2
 
3
+ ## 2.2.1
4
+
5
+ ### Patch Changes
6
+
7
+ - 5973888: Fix org creation
8
+
9
+ ## 2.2.0
10
+
11
+ ### Minor Changes
12
+
13
+ - 5f5ef8e: Implemented role services
14
+
3
15
  ## 2.1.4
4
16
 
5
17
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -307,11 +307,13 @@ type TMember = {
307
307
  roleName?: string;
308
308
  type: string;
309
309
  status?: string;
310
- createdAt?: string;
311
- updatedAt?: string;
312
- deletedAt?: string;
310
+ createdAt?: string | Date;
311
+ updatedAt?: string | Date;
312
+ deletedAt?: string | Date;
313
313
  };
314
314
  declare function MMember(value: TMember): TMember;
315
+ declare const schemaMember: Joi.ObjectSchema<any>;
316
+ declare function modelMember(value: TMember): TMember;
315
317
 
316
318
  declare function useMemberRepo(): {
317
319
  createIndex: () => Promise<void>;
@@ -319,6 +321,7 @@ declare function useMemberRepo(): {
319
321
  createTextIndex: () => Promise<void>;
320
322
  add: (value: TMember, session?: ClientSession) => Promise<string>;
321
323
  getById: (_id: string | ObjectId) => Promise<TMember | null>;
324
+ getByRole: (role: string | ObjectId) => Promise<TMember | null>;
322
325
  getAll: ({ search, limit, page, user, org, type, status }?: {
323
326
  search: string;
324
327
  limit: number;
@@ -375,8 +378,7 @@ declare function useMemberController(): {
375
378
  type TOrg = {
376
379
  _id?: ObjectId;
377
380
  name: string;
378
- description: string;
379
- type?: string;
381
+ description?: string;
380
382
  email?: string;
381
383
  contact?: string;
382
384
  createdBy: string | ObjectId;
@@ -385,9 +387,8 @@ type TOrg = {
385
387
  updatedAt?: string | Date;
386
388
  deletedAt?: string | Date;
387
389
  };
388
- declare const OrgTypes: string[];
389
390
  declare const schemaOrg: Joi.ObjectSchema<any>;
390
- declare function MOrg(value: TOrg): TOrg;
391
+ declare function modelOrg(value: TOrg): TOrg;
391
392
 
392
393
  declare function useOrgRepo(): {
393
394
  createIndexes: () => Promise<void>;
@@ -414,7 +415,7 @@ declare function useOrgService(): {
414
415
  };
415
416
 
416
417
  declare function useOrgController(): {
417
- createOrg: (req: Request, res: Response, next: NextFunction) => Promise<void>;
418
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
418
419
  getOrgsByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
419
420
  getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
420
421
  getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
@@ -474,7 +475,6 @@ type TRole = {
474
475
  name?: string;
475
476
  description?: string;
476
477
  permissions?: Array<string>;
477
- type?: string;
478
478
  org?: string | ObjectId;
479
479
  status?: string;
480
480
  default?: boolean;
@@ -505,14 +505,18 @@ declare function useRoleRepo(): {
505
505
  pageRange: string;
506
506
  } | TRole[]>;
507
507
  getRoleByUserId: (value: ObjectId | string) => Promise<TRole | null>;
508
- getRoleById: (_id: ObjectId | string) => Promise<mongodb.WithId<bson.Document> | TRole | null>;
508
+ getById: (_id: ObjectId | string) => Promise<mongodb.WithId<bson.Document> | TRole | null>;
509
509
  getRoleByName: (name: string) => Promise<mongodb.WithId<bson.Document> | TRole | null>;
510
510
  updateRole: (_id: string | ObjectId, value: TMiniRole, session?: ClientSession) => Promise<string>;
511
- deleteRole: (_id: ObjectId | string, session?: ClientSession) => Promise<string>;
511
+ deleteById: (_id: ObjectId | string, session?: ClientSession) => Promise<string>;
512
512
  updatePermissionsById: (_id: string | ObjectId, permissions: TRole["permissions"], session?: ClientSession) => Promise<string>;
513
513
  delCachedData: () => void;
514
514
  };
515
515
 
516
+ declare function useRoleService(): {
517
+ deleteById: (id: string) => Promise<void>;
518
+ };
519
+
516
520
  declare function useRoleController(): {
517
521
  createRole: (req: Request, res: Response, next: NextFunction) => Promise<void>;
518
522
  getRoles: (req: Request, res: Response, next: NextFunction) => Promise<void>;
@@ -965,4 +969,4 @@ declare const XENDIT_SECRET_KEY: string;
965
969
  declare const XENDIT_BASE_URL: string;
966
970
  declare const DOMAIN: string;
967
971
 
968
- 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, MMember, MONGO_DB, MONGO_URI, MOrg, MUser, MUserRole, MVerification, OrgTypes, 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, TMiniRole, TOrg, TPSGC, TPermission, TPermissionGroup, TRole, TUser, TUserRole, TVerification, TVerificationMetadata, VERIFICATION_FORGET_PASSWORD_DURATION, VERIFICATION_USER_INVITE_DURATION, XENDIT_BASE_URL, XENDIT_SECRET_KEY, addressSchema, isDev, modelApp, modelPSGC, modelPermission, modelPermissionGroup, modelRole, schemaApp, schemaAppUpdate, schemaBuilding, schemaBuildingUnit, schemaOrg, schemaPSGC, schemaPermission, schemaPermissionGroup, schemaPermissionGroupUpdate, schemaPermissionUpdate, schemaRole, schemaUpdateOptions, 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, useUserController, useUserRepo, useUserService, useUtilController, useVerificationController, useVerificationRepo, useVerificationService };
972
+ 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, MMember, MONGO_DB, MONGO_URI, MUser, MUserRole, MVerification, 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, TMiniRole, TOrg, TPSGC, TPermission, TPermissionGroup, TRole, TUser, TUserRole, 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, schemaApp, schemaAppUpdate, schemaBuilding, schemaBuildingUnit, schemaMember, schemaOrg, schemaPSGC, schemaPermission, schemaPermissionGroup, schemaPermissionGroupUpdate, schemaPermissionUpdate, schemaRole, schemaUpdateOptions, 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 };