@goweekdays/core 0.0.3 → 0.0.4

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,11 @@
1
1
  # @goweekdays/core
2
2
 
3
+ ## 0.0.4
4
+
5
+ ### Patch Changes
6
+
7
+ - aa34fdb: Add subscription
8
+
3
9
  ## 0.0.3
4
10
 
5
11
  ### Patch Changes
package/dist/index.d.ts CHANGED
@@ -57,7 +57,7 @@ type TKeyValuePair<K extends string | number | symbol = string, V = any> = {
57
57
  };
58
58
 
59
59
  declare function useVerificationService(): {
60
- createForgetPassword: (email: string) => Promise<bson.ObjectId>;
60
+ createForgetPassword: (email: string) => Promise<string>;
61
61
  createUserInvite: ({ email, metadata, }: {
62
62
  email: string;
63
63
  metadata: TKeyValuePair;
@@ -810,6 +810,54 @@ declare function useCommentController(): {
810
810
  getComments: (req: Request, res: Response, next: NextFunction) => Promise<void>;
811
811
  };
812
812
 
813
+ type TSubscription = {
814
+ _id?: ObjectId;
815
+ user: ObjectId | string;
816
+ subscriptionId: string;
817
+ status?: string;
818
+ createdAt?: string;
819
+ updatedAt?: string;
820
+ deletedAt?: string;
821
+ };
822
+ declare function MSubscription(value: TSubscription): TSubscription;
823
+
824
+ declare function useSubscriptionRepo(): {
825
+ createIndex: () => Promise<void>;
826
+ createUniqueIndex: () => Promise<void>;
827
+ add: (value: TSubscription) => Promise<ObjectId>;
828
+ getById: (_id: string | ObjectId) => Promise<TSubscription | null>;
829
+ getBySubscriptionId: (subscriptionId: string) => Promise<TSubscription | null>;
830
+ getByUserId: (user: string | ObjectId) => Promise<TSubscription | null>;
831
+ getSubscriptions: ({ search, page, limit, sort, status, }?: {
832
+ search?: string | undefined;
833
+ page?: number | undefined;
834
+ limit?: number | undefined;
835
+ sort?: {} | undefined;
836
+ status?: string | undefined;
837
+ }) => Promise<{
838
+ items: any[];
839
+ pages: number;
840
+ pageRange: string;
841
+ }>;
842
+ updateStatus: (_id: string | ObjectId, status: string) => Promise<string>;
843
+ };
844
+
845
+ declare function useSubscriptionService(): {
846
+ getByUserId: (id: string) => Promise<TSubscription>;
847
+ getSubscriptionStatus: (subscriptionId: string) => Promise<any>;
848
+ cancelSubscription: (subscriptionId: string) => Promise<{
849
+ message: string;
850
+ }>;
851
+ };
852
+
853
+ declare function useSubscriptionController(): {
854
+ add: (req: Request, res: Response, next: NextFunction) => Promise<void>;
855
+ getByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
856
+ getSubscriptions: (req: Request, res: Response, next: NextFunction) => Promise<void>;
857
+ getSubscriptionStatus: (req: Request, res: Response, next: NextFunction) => Promise<void>;
858
+ cancelSubscription: (req: Request, res: Response, next: NextFunction) => Promise<void>;
859
+ };
860
+
813
861
  declare const MONGO_URI: string;
814
862
  declare const MONGO_DB: string;
815
863
  declare const PORT: number;
@@ -840,5 +888,8 @@ declare const SPACES_SECRET_KEY: string;
840
888
  declare const SPACES_ENDPOINT: string;
841
889
  declare const SPACES_REGION: string;
842
890
  declare const SPACES_BUCKET: string;
891
+ declare const PAYPAL_CLIENT_ID: string;
892
+ declare const PAYPAL_CLIENT_SECRET: string;
893
+ declare const PAYPAL_API_URL: string;
843
894
 
844
- 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, MAILER_EMAIL, MAILER_PASSWORD, MAILER_TRANSPORT_HOST, MAILER_TRANSPORT_PORT, MAILER_TRANSPORT_SECURE, MCapBldgAct, MComment, MEntity, MFile, MONGO_DB, MONGO_URI, MRole, MToken, MUser, MUserRole, MVerification, MWorkflow, 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, TAttachment, TCapBldgAct, TCapBldgActAssmtCriteria, TCapBldgActBasicInfo, TCapBldgActInitRevEval, TComment, TEntity, TFile, TMiniRole, TRole, TToken, TUser, TUserRole, TVerification, TVerificationMetadata, TWorkflow, TWorkflowStep, VERIFICATION_FORGET_PASSWORD_DURATION, VERIFICATION_USER_INVITE_DURATION, isDev, useAuthController, useAuthService, useCapBldgActController, useCapBldgActRepo, useCapBldgActService, useCommentController, useCommentRepo, useCommentService, useEntityController, useEntityRepo, useEntityService, useFileController, useFileRepo, useFileService, useRoleController, useRoleRepo, useRoleService, useTokenRepo, useUserController, useUserRepo, useUserService, useVerificationController, useVerificationRepo, useVerificationService, useWorkflowController, useWorkflowRepo, useWorkflowService };
895
+ 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, MAILER_EMAIL, MAILER_PASSWORD, MAILER_TRANSPORT_HOST, MAILER_TRANSPORT_PORT, MAILER_TRANSPORT_SECURE, MCapBldgAct, MComment, MEntity, MFile, MONGO_DB, MONGO_URI, MRole, MSubscription, MToken, MUser, MUserRole, MVerification, MWorkflow, 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, TAttachment, TCapBldgAct, TCapBldgActAssmtCriteria, TCapBldgActBasicInfo, TCapBldgActInitRevEval, TComment, TEntity, TFile, TMiniRole, TRole, TSubscription, TToken, TUser, TUserRole, TVerification, TVerificationMetadata, TWorkflow, TWorkflowStep, VERIFICATION_FORGET_PASSWORD_DURATION, VERIFICATION_USER_INVITE_DURATION, isDev, useAuthController, useAuthService, useCapBldgActController, useCapBldgActRepo, useCapBldgActService, useCommentController, useCommentRepo, useCommentService, useEntityController, useEntityRepo, useEntityService, useFileController, useFileRepo, useFileService, useRoleController, useRoleRepo, useRoleService, useSubscriptionController, useSubscriptionRepo, useSubscriptionService, useTokenRepo, useUserController, useUserRepo, useUserService, useVerificationController, useVerificationRepo, useVerificationService, useWorkflowController, useWorkflowRepo, useWorkflowService };