@eeplatform/core 1.0.0 → 1.0.2

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
  # @eeplatform/core
2
2
 
3
+ ## 1.0.2
4
+
5
+ ### Patch Changes
6
+
7
+ - 77ac8e2: Revise schools, members and role queries
8
+
9
+ ## 1.0.1
10
+
11
+ ### Patch Changes
12
+
13
+ - c7593b0: Revise authentication function
14
+
3
15
  ## 1.0.0
4
16
 
5
17
  ### Major Changes
package/dist/index.d.ts CHANGED
@@ -295,7 +295,7 @@ declare function useAuthController(): {
295
295
 
296
296
  type TRole = {
297
297
  _id?: ObjectId;
298
- org?: string | ObjectId;
298
+ id?: string | ObjectId;
299
299
  name?: string;
300
300
  description?: string;
301
301
  permissions?: Array<string>;
@@ -310,7 +310,7 @@ type TRole = {
310
310
  type TMiniRole = Pick<TRole, "name" | "permissions">;
311
311
  declare class MRole implements TRole {
312
312
  _id: ObjectId;
313
- org: string | ObjectId;
313
+ id: string | ObjectId;
314
314
  name?: string;
315
315
  description?: string;
316
316
  permissions?: Array<string>;
@@ -329,13 +329,13 @@ declare function useRoleRepo(): {
329
329
  createTextIndex: () => Promise<void>;
330
330
  createUniqueIndex: () => Promise<void>;
331
331
  addRole: (value: TRole, session?: ClientSession) => Promise<ObjectId>;
332
- getRoles: ({ search, page, limit, sort, type, org, }?: {
332
+ getRoles: ({ search, page, limit, sort, type, id, }?: {
333
333
  search?: string | undefined;
334
334
  page?: number | undefined;
335
335
  limit?: number | undefined;
336
336
  sort?: any;
337
337
  type?: string | undefined;
338
- org?: string | ObjectId | undefined;
338
+ id?: string | ObjectId | undefined;
339
339
  }) => Promise<{
340
340
  items: any[];
341
341
  pages: number;
@@ -2268,6 +2268,155 @@ declare function usePaypalService(): {
2268
2268
  getInvoiceById: (invoiceId: string) => Promise<any>;
2269
2269
  };
2270
2270
 
2271
+ type TRegion = {
2272
+ _id?: ObjectId;
2273
+ name?: string;
2274
+ director?: string | ObjectId;
2275
+ directorName?: string;
2276
+ createdAt?: string;
2277
+ updatedAt?: string;
2278
+ deletedAt?: string;
2279
+ };
2280
+ declare const schemaRegion: Joi.ObjectSchema<any>;
2281
+ declare function MRegion(value: TRegion): TRegion;
2282
+
2283
+ declare function useRegionRepo(): {
2284
+ createIndex: () => Promise<void>;
2285
+ createTextIndex: () => Promise<void>;
2286
+ createUniqueIndex: () => Promise<void>;
2287
+ add: (value: TRegion, session?: ClientSession) => Promise<ObjectId>;
2288
+ getAll: ({ search, page, limit, sort }?: {
2289
+ search?: string | undefined;
2290
+ page?: number | undefined;
2291
+ limit?: number | undefined;
2292
+ sort?: {} | undefined;
2293
+ }) => Promise<Record<string, any>>;
2294
+ getById: (_id: string | ObjectId) => Promise<TRegion>;
2295
+ updateFieldById: ({ _id, field, value }?: {
2296
+ _id: string | ObjectId;
2297
+ field: string;
2298
+ value: string;
2299
+ }, session?: ClientSession) => Promise<string>;
2300
+ deleteById: (_id: string | ObjectId) => Promise<string>;
2301
+ getByName: (name: string) => Promise<TRegion>;
2302
+ };
2303
+
2304
+ declare function useRegionController(): {
2305
+ createRegion: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2306
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2307
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2308
+ getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2309
+ updateField: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2310
+ deleteRegion: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2311
+ };
2312
+
2313
+ type TDivision = {
2314
+ _id?: ObjectId;
2315
+ name?: string;
2316
+ region?: string | ObjectId;
2317
+ regionName?: string;
2318
+ superintendent?: string | ObjectId;
2319
+ superintendentName?: string;
2320
+ createdAt?: string;
2321
+ updatedAt?: string;
2322
+ deletedAt?: string;
2323
+ };
2324
+ declare const schemaDivision: Joi.ObjectSchema<any>;
2325
+ declare function MDivision(value: TDivision): TDivision;
2326
+
2327
+ declare function useDivisionRepo(): {
2328
+ createIndex: () => Promise<void>;
2329
+ createTextIndex: () => Promise<void>;
2330
+ createUniqueIndex: () => Promise<void>;
2331
+ add: (value: TDivision, session?: ClientSession) => Promise<ObjectId>;
2332
+ getAll: ({ search, page, limit, sort, region, }?: {
2333
+ search?: string | undefined;
2334
+ page?: number | undefined;
2335
+ limit?: number | undefined;
2336
+ sort?: {} | undefined;
2337
+ region?: string | undefined;
2338
+ }) => Promise<Record<string, any>>;
2339
+ getById: (_id: string | ObjectId) => Promise<TDivision>;
2340
+ updateFieldById: ({ _id, field, value }?: {
2341
+ _id: string | ObjectId;
2342
+ field: string;
2343
+ value: string;
2344
+ }, session?: ClientSession) => Promise<string>;
2345
+ deleteById: (_id: string | ObjectId) => Promise<string>;
2346
+ getByName: (name: string) => Promise<TDivision>;
2347
+ };
2348
+
2349
+ declare function useDivisionController(): {
2350
+ createDivision: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2351
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2352
+ getById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2353
+ getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2354
+ updateField: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2355
+ deleteDivision: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2356
+ };
2357
+
2358
+ type TSchool = {
2359
+ _id?: ObjectId;
2360
+ id: string;
2361
+ name: string;
2362
+ country: string;
2363
+ address: string;
2364
+ continuedAddress: string;
2365
+ city: string;
2366
+ province: string;
2367
+ postalCode: string;
2368
+ courses: Array<string>;
2369
+ principalName: string;
2370
+ principalEmail: string;
2371
+ principalNumber: string;
2372
+ region: string | ObjectId;
2373
+ regionName?: string;
2374
+ division: string | ObjectId;
2375
+ divisionName?: string;
2376
+ status?: string;
2377
+ createdAt?: string;
2378
+ updatedAt?: string;
2379
+ createdBy?: string | ObjectId;
2380
+ };
2381
+ declare const schemaSchool: Joi.ObjectSchema<any>;
2382
+ declare function MSchool(value: TSchool): TSchool;
2383
+
2384
+ declare function useSchoolRepo(): {
2385
+ createIndex: () => Promise<void>;
2386
+ add: (value: TSchool, session?: ClientSession) => Promise<ObjectId>;
2387
+ getAll: ({ page, limit, sort, status, org, app, search, }?: {
2388
+ page?: number | undefined;
2389
+ limit?: number | undefined;
2390
+ sort?: Record<string, number> | undefined;
2391
+ status?: string | undefined;
2392
+ org?: string | undefined;
2393
+ app?: string | undefined;
2394
+ search?: string | undefined;
2395
+ }) => Promise<{}>;
2396
+ updateStatusById: (_id: string | ObjectId, status: string, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2397
+ updateFieldById: ({ _id, field, value }?: {
2398
+ _id: string | ObjectId;
2399
+ field: string;
2400
+ value: string | ObjectId;
2401
+ }, session?: ClientSession) => Promise<mongodb.UpdateResult<bson.Document>>;
2402
+ getPendingByCreatedBy: (createdBy: string | ObjectId) => Promise<{} | null>;
2403
+ getPendingById: (_id: string | ObjectId) => Promise<TSchool>;
2404
+ };
2405
+
2406
+ declare function useSchoolService(): {
2407
+ register: (value: TSchool) => Promise<string>;
2408
+ approve: (id: string) => Promise<string>;
2409
+ };
2410
+
2411
+ declare function useSchoolController(): {
2412
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2413
+ getAll: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2414
+ getByCreatedBy: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2415
+ updateStatusById: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2416
+ registerSchool: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2417
+ approveSchool: (req: Request, res: Response, next: NextFunction) => Promise<void>;
2418
+ };
2419
+
2271
2420
  declare const MONGO_URI: string;
2272
2421
  declare const MONGO_DB: string;
2273
2422
  declare const PORT: number;
@@ -2304,4 +2453,4 @@ declare const PAYPAL_API_URL: string;
2304
2453
  declare const XENDIT_SECRET_KEY: string;
2305
2454
  declare const XENDIT_BASE_URL: string;
2306
2455
 
2307
- export { ACCESS_TOKEN_EXPIRY, ACCESS_TOKEN_SECRET, APP_ACCOUNT, APP_MAIN, CardPayment, CardPaymentSchema, DEFAULT_USER_EMAIL, DEFAULT_USER_FIRST_NAME, DEFAULT_USER_LAST_NAME, DEFAULT_USER_PASSWORD, DirectDebit, DirectDebitSchema, EWalletPayment, EWalletPaymentSchema, MAILER_EMAIL, MAILER_PASSWORD, MAILER_TRANSPORT_HOST, MAILER_TRANSPORT_PORT, MAILER_TRANSPORT_SECURE, MAddress, MEntity, MFile, MMember, MONGO_DB, MONGO_URI, MOrder, MOrg, MPaymentMethod, MPromoCode, MRole, MSubscription, MToken, 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, TBillingRecipient, TCounter, TEntity, TFile, TInvoice, TMember, TMiniRole, TOrder, TOrderMetadata, TOrg, TPayment, TPaymentMethod$1 as TPaymentMethod, TPaymentMethodType, TPrice, TPriceType, TPromoCode, TPromoTier, TRole, TSubscription, TToken, TUser, TUserRole, TVerification, TVerificationMetadata, VERIFICATION_FORGET_PASSWORD_DURATION, VERIFICATION_USER_INVITE_DURATION, XENDIT_BASE_URL, XENDIT_SECRET_KEY, addressSchema, isDev, schema, useAddressController, useAddressRepo, useAuthController, useAuthService, useCounterModel, useCounterRepo, useEntityController, useEntityRepo, useFileController, useFileRepo, useFileService, useInvoiceController, useInvoiceModel, useInvoiceRepo, useInvoiceService, useMemberController, useMemberRepo, useOrderController, useOrderRepo, useOrgController, useOrgRepo, useOrgService, usePaymentController, usePaymentMethodController, usePaymentMethodRepo, usePaymentMethodService, usePaymentModel, usePaymentRepo, usePaypalService, usePriceController, usePriceModel, usePriceRepo, usePromoCodeController, usePromoCodeRepo, useRoleController, useRoleRepo, useSubscriptionController, useSubscriptionRepo, useSubscriptionService, useTokenRepo, useUserController, useUserRepo, useUserService, useVerificationController, useVerificationRepo, useVerificationService, useXenditService, validateCardPayment, validateDirectDebit, validateEWalletPayment };
2456
+ export { ACCESS_TOKEN_EXPIRY, ACCESS_TOKEN_SECRET, APP_ACCOUNT, APP_MAIN, CardPayment, CardPaymentSchema, DEFAULT_USER_EMAIL, DEFAULT_USER_FIRST_NAME, DEFAULT_USER_LAST_NAME, DEFAULT_USER_PASSWORD, DirectDebit, DirectDebitSchema, EWalletPayment, EWalletPaymentSchema, MAILER_EMAIL, MAILER_PASSWORD, MAILER_TRANSPORT_HOST, MAILER_TRANSPORT_PORT, MAILER_TRANSPORT_SECURE, MAddress, MDivision, MEntity, MFile, MMember, MONGO_DB, MONGO_URI, MOrder, MOrg, MPaymentMethod, MPromoCode, MRegion, MRole, MSchool, MSubscription, MToken, 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, TBillingRecipient, TCounter, TDivision, TEntity, TFile, TInvoice, TMember, TMiniRole, TOrder, TOrderMetadata, TOrg, TPayment, TPaymentMethod$1 as TPaymentMethod, TPaymentMethodType, TPrice, TPriceType, TPromoCode, TPromoTier, TRegion, TRole, TSchool, TSubscription, TToken, TUser, TUserRole, TVerification, TVerificationMetadata, VERIFICATION_FORGET_PASSWORD_DURATION, VERIFICATION_USER_INVITE_DURATION, XENDIT_BASE_URL, XENDIT_SECRET_KEY, addressSchema, isDev, schema, schemaDivision, schemaRegion, schemaSchool, useAddressController, useAddressRepo, useAuthController, useAuthService, useCounterModel, useCounterRepo, useDivisionController, useDivisionRepo, useEntityController, useEntityRepo, useFileController, useFileRepo, useFileService, useInvoiceController, useInvoiceModel, useInvoiceRepo, useInvoiceService, useMemberController, useMemberRepo, useOrderController, useOrderRepo, useOrgController, useOrgRepo, useOrgService, usePaymentController, usePaymentMethodController, usePaymentMethodRepo, usePaymentMethodService, usePaymentModel, usePaymentRepo, usePaypalService, usePriceController, usePriceModel, usePriceRepo, usePromoCodeController, usePromoCodeRepo, useRegionController, useRegionRepo, useRoleController, useRoleRepo, useSchoolController, useSchoolRepo, useSchoolService, useSubscriptionController, useSubscriptionRepo, useSubscriptionService, useTokenRepo, useUserController, useUserRepo, useUserService, useVerificationController, useVerificationRepo, useVerificationService, useXenditService, validateCardPayment, validateDirectDebit, validateEWalletPayment };