@goweekdays/core 0.0.9 → 0.0.11
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 +12 -0
- package/dist/index.d.ts +23 -9
- package/dist/index.js +1310 -1129
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +1280 -1100
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/dist/index.d.ts
CHANGED
|
@@ -65,9 +65,7 @@ declare function useVerificationService(): {
|
|
|
65
65
|
email: string;
|
|
66
66
|
metadata: TKeyValuePair;
|
|
67
67
|
}) => Promise<bson.ObjectId>;
|
|
68
|
-
verify: (id: string) => Promise<TVerification
|
|
69
|
-
message: string;
|
|
70
|
-
}>;
|
|
68
|
+
verify: (id: string) => Promise<TVerification>;
|
|
71
69
|
getById: (id: string) => Promise<TVerification>;
|
|
72
70
|
getVerifications: ({ search, page, status, type, email, limit, }?: {
|
|
73
71
|
search?: string | undefined;
|
|
@@ -144,7 +142,7 @@ type TUser = {
|
|
|
144
142
|
birthDay?: number;
|
|
145
143
|
birthYear?: number;
|
|
146
144
|
gender?: string;
|
|
147
|
-
|
|
145
|
+
defaultOrg?: ObjectId;
|
|
148
146
|
status?: string;
|
|
149
147
|
referralCode?: string;
|
|
150
148
|
referredBy?: string;
|
|
@@ -211,7 +209,7 @@ declare function useUserRepo(): {
|
|
|
211
209
|
updateUserFieldById: ({ _id, field, value }?: {
|
|
212
210
|
_id: string | ObjectId;
|
|
213
211
|
field: string;
|
|
214
|
-
value: string;
|
|
212
|
+
value: string | ObjectId;
|
|
215
213
|
}, session?: ClientSession) => Promise<string>;
|
|
216
214
|
addUserRole: ({ _id, role }?: {
|
|
217
215
|
_id: string | ObjectId;
|
|
@@ -243,7 +241,6 @@ declare function useUserService(): {
|
|
|
243
241
|
lastName: string;
|
|
244
242
|
suffix?: string | undefined;
|
|
245
243
|
type: string;
|
|
246
|
-
roles: TUserRole[];
|
|
247
244
|
}) => Promise<bson.ObjectId>;
|
|
248
245
|
resetPassword: (id: string, newPassword: string, passwordConfirmation: string) => Promise<string>;
|
|
249
246
|
updateName: (_id: string, firstName?: string, lastName?: string) => Promise<string>;
|
|
@@ -311,6 +308,7 @@ type TRole = {
|
|
|
311
308
|
permissions?: Array<string>;
|
|
312
309
|
type?: string;
|
|
313
310
|
status?: string;
|
|
311
|
+
default?: boolean;
|
|
314
312
|
createdBy?: string | ObjectId;
|
|
315
313
|
createdAt?: string;
|
|
316
314
|
updatedAt?: string;
|
|
@@ -325,6 +323,7 @@ declare class MRole implements TRole {
|
|
|
325
323
|
permissions?: Array<string>;
|
|
326
324
|
type?: string;
|
|
327
325
|
status?: string;
|
|
326
|
+
default?: boolean;
|
|
328
327
|
createdBy?: string | ObjectId;
|
|
329
328
|
createdAt?: string;
|
|
330
329
|
updatedAt?: string;
|
|
@@ -983,20 +982,21 @@ declare function usePaymentMethodRepo(): {
|
|
|
983
982
|
createIndex: () => Promise<void>;
|
|
984
983
|
add: (value: TPaymentMethod, session?: ClientSession) => Promise<string>;
|
|
985
984
|
getByUser: (user: string | ObjectId) => Promise<bson.Document[]>;
|
|
985
|
+
getByOrg: (org: string | ObjectId) => Promise<bson.Document[]>;
|
|
986
986
|
deleteById: (_id: string | ObjectId) => Promise<string>;
|
|
987
987
|
createUniqueIndex: () => Promise<void>;
|
|
988
988
|
getByPaymentMethodId: (paymentId: string | ObjectId) => Promise<TPaymentMethod | null>;
|
|
989
989
|
};
|
|
990
990
|
|
|
991
991
|
declare function usePaymentMethodService(): {
|
|
992
|
-
linkEWallet: ({ user, mobile_number, type, success_return_url, failure_return_url, cancel_return_url,
|
|
992
|
+
linkEWallet: ({ user, org, mobile_number, type, success_return_url, failure_return_url, cancel_return_url, }?: {
|
|
993
993
|
user?: string | undefined;
|
|
994
|
+
org?: string | undefined;
|
|
994
995
|
mobile_number?: string | undefined;
|
|
995
996
|
type?: string | undefined;
|
|
996
997
|
success_return_url?: string | undefined;
|
|
997
998
|
failure_return_url?: string | undefined;
|
|
998
999
|
cancel_return_url?: string | undefined;
|
|
999
|
-
metadata?: {} | undefined;
|
|
1000
1000
|
}) => Promise<{
|
|
1001
1001
|
paymentMethod: any;
|
|
1002
1002
|
customer: any;
|
|
@@ -1020,6 +1020,7 @@ declare function usePaymentMethodController(): {
|
|
|
1020
1020
|
linkEWallet: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1021
1021
|
linkCard: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1022
1022
|
getByUser: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1023
|
+
getByOrg: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1023
1024
|
};
|
|
1024
1025
|
|
|
1025
1026
|
declare function useAddressRepo(): {
|
|
@@ -1056,6 +1057,7 @@ declare function useOrgRepo(): {
|
|
|
1056
1057
|
value: string;
|
|
1057
1058
|
}, session?: ClientSession) => Promise<string>;
|
|
1058
1059
|
deleteById: (_id: string | ObjectId) => Promise<string>;
|
|
1060
|
+
getByName: (name: string) => Promise<TOrg>;
|
|
1059
1061
|
};
|
|
1060
1062
|
|
|
1061
1063
|
declare function useOrgService(): {
|
|
@@ -1069,11 +1071,13 @@ declare function useOrgService(): {
|
|
|
1069
1071
|
declare function useOrgController(): {
|
|
1070
1072
|
createOrg: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1071
1073
|
getOrgsByUserId: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1074
|
+
getByName: (req: Request, res: Response, next: NextFunction) => Promise<void>;
|
|
1072
1075
|
};
|
|
1073
1076
|
|
|
1074
1077
|
type TMember = {
|
|
1075
1078
|
_id?: ObjectId;
|
|
1076
1079
|
org: string | ObjectId;
|
|
1080
|
+
orgName: string;
|
|
1077
1081
|
name: string;
|
|
1078
1082
|
user: string | ObjectId;
|
|
1079
1083
|
role: string | ObjectId;
|
|
@@ -1090,7 +1094,16 @@ declare function useMemberRepo(): {
|
|
|
1090
1094
|
createTextIndex: () => Promise<void>;
|
|
1091
1095
|
add: (value: TMember, session?: ClientSession) => Promise<string>;
|
|
1092
1096
|
getById: (_id: string | ObjectId) => Promise<TMember | null>;
|
|
1093
|
-
|
|
1097
|
+
getByUserId: ({ user, search, limit, page }?: {
|
|
1098
|
+
user: string | ObjectId;
|
|
1099
|
+
search: string;
|
|
1100
|
+
limit: number;
|
|
1101
|
+
page: number;
|
|
1102
|
+
}) => Promise<{
|
|
1103
|
+
items: any[];
|
|
1104
|
+
pages: number;
|
|
1105
|
+
pageRange: string;
|
|
1106
|
+
}>;
|
|
1094
1107
|
getOrgsByUserId: ({ search, page, limit, sort, user, status, }?: {
|
|
1095
1108
|
user: string | ObjectId;
|
|
1096
1109
|
page: number;
|
|
@@ -1104,6 +1117,7 @@ declare function useMemberRepo(): {
|
|
|
1104
1117
|
pageRange: string;
|
|
1105
1118
|
}>;
|
|
1106
1119
|
updateStatusByUserId: (user: string | ObjectId, status: string) => Promise<string>;
|
|
1120
|
+
updateName: (value: Pick<TMember, "name" | "user">, session?: ClientSession) => Promise<string>;
|
|
1107
1121
|
};
|
|
1108
1122
|
|
|
1109
1123
|
declare const MONGO_URI: string;
|