@timardex/cluemart-shared 1.0.8 → 1.0.9
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/dist/index.cjs +208 -50
- package/dist/index.d.mts +51 -28
- package/dist/index.d.ts +51 -28
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +183 -31
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -57,8 +57,6 @@ __export(index_exports, {
|
|
|
57
57
|
endDateAfterStartDateTest: () => endDateAfterStartDateTest,
|
|
58
58
|
endDateNotInPastTest: () => endDateNotInPastTest,
|
|
59
59
|
endTimeMustBeAfterStartTimeTest: () => endTimeMustBeAfterStartTimeTest,
|
|
60
|
-
forgotPasswordFields: () => forgotPasswordFields,
|
|
61
|
-
forgotPasswordSchema: () => forgotPasswordSchema,
|
|
62
60
|
formatDate: () => formatDate,
|
|
63
61
|
formatTimestamp: () => formatTimestamp,
|
|
64
62
|
getCurrentAndFutureDates: () => getCurrentAndFutureDates,
|
|
@@ -82,6 +80,8 @@ __export(index_exports, {
|
|
|
82
80
|
registerSchema: () => registerSchema,
|
|
83
81
|
rejectionPolicyOptions: () => rejectionPolicyOptions,
|
|
84
82
|
removeTypename: () => removeTypename,
|
|
83
|
+
requestPasswordResetFields: () => requestPasswordResetFields,
|
|
84
|
+
requestPasswordResetSchema: () => requestPasswordResetSchema,
|
|
85
85
|
resetPasswordFields: () => resetPasswordFields,
|
|
86
86
|
resetPasswordSchema: () => resetPasswordSchema,
|
|
87
87
|
sortDatesByProximity: () => sortDatesByProximity,
|
|
@@ -120,8 +120,8 @@ __export(index_exports, {
|
|
|
120
120
|
useDeleteMarket: () => useDeleteMarket,
|
|
121
121
|
useDeleteRelation: () => useDeleteRelation,
|
|
122
122
|
useDeleteStallholder: () => useDeleteStallholder,
|
|
123
|
-
useForgotPassword: () => useForgotPassword,
|
|
124
123
|
useGetChat: () => useGetChat,
|
|
124
|
+
useGetChatSubscription: () => useGetChatSubscription,
|
|
125
125
|
useGetMarket: () => useGetMarket,
|
|
126
126
|
useGetMarketRelations: () => useGetMarketRelations,
|
|
127
127
|
useGetMarkets: () => useGetMarkets,
|
|
@@ -150,6 +150,10 @@ __export(index_exports, {
|
|
|
150
150
|
useRegisterForm: () => useRegisterForm,
|
|
151
151
|
useRemoveParticipantFromChat: () => useRemoveParticipantFromChat,
|
|
152
152
|
useRemoveUserFavouriteResource: () => useRemoveUserFavouriteResource,
|
|
153
|
+
useRequestPasswordReset: () => useRequestPasswordReset,
|
|
154
|
+
useRequestPasswordResetForm: () => useRequestPasswordResetForm,
|
|
155
|
+
useResetPassword: () => useResetPassword,
|
|
156
|
+
useResetPasswordForm: () => useResetPasswordForm,
|
|
153
157
|
useSearchMarkets: () => useSearchMarkets,
|
|
154
158
|
useSearchStallholders: () => useSearchStallholders,
|
|
155
159
|
useSendChatMessage: () => useSendChatMessage,
|
|
@@ -161,9 +165,11 @@ __export(index_exports, {
|
|
|
161
165
|
useUpdateStallholderApplyForm: () => useUpdateStallholderApplyForm,
|
|
162
166
|
useUpdateUser: () => useUpdateUser,
|
|
163
167
|
useUserForm: () => useUserForm,
|
|
164
|
-
|
|
168
|
+
useValidateToken: () => useValidateToken,
|
|
169
|
+
useValidateTokenForm: () => useValidateTokenForm,
|
|
165
170
|
userSchema: () => userSchema,
|
|
166
|
-
|
|
171
|
+
validateTokenFields: () => validateTokenFields,
|
|
172
|
+
validateTokenSchema: () => validateTokenSchema
|
|
167
173
|
});
|
|
168
174
|
module.exports = __toCommonJS(index_exports);
|
|
169
175
|
|
|
@@ -619,16 +625,18 @@ var registerSchema = yup5.object().shape({
|
|
|
619
625
|
password: passwordSchema,
|
|
620
626
|
role: yup5.mixed().oneOf(Object.values(EnumUserRole)).required("Role is required")
|
|
621
627
|
});
|
|
622
|
-
var
|
|
628
|
+
var requestPasswordResetSchema = yup5.object().shape({
|
|
623
629
|
email: emailSchema
|
|
624
630
|
});
|
|
625
631
|
var resetPasswordSchema = yup5.object().shape({
|
|
632
|
+
email: emailSchema,
|
|
626
633
|
password: passwordSchema,
|
|
627
634
|
// eslint-disable-next-line sort-keys
|
|
628
635
|
confirmPassword: yup5.string().oneOf([yup5.ref("password")], "Passwords must match").required("Confirm Password is required")
|
|
629
636
|
});
|
|
630
|
-
var
|
|
631
|
-
|
|
637
|
+
var validateTokenSchema = yup5.object().shape({
|
|
638
|
+
email: emailSchema,
|
|
639
|
+
token: yup5.string().required("Verification code is required").matches(/^\d{5}$/, "Verification code must be exactly 5 digits")
|
|
632
640
|
});
|
|
633
641
|
|
|
634
642
|
// src/hooks/utils.ts
|
|
@@ -1115,6 +1123,111 @@ function useRegisterForm() {
|
|
|
1115
1123
|
};
|
|
1116
1124
|
}
|
|
1117
1125
|
|
|
1126
|
+
// src/hooks/auth/useRequestPasswordResetForm.ts
|
|
1127
|
+
var import_yup7 = require("@hookform/resolvers/yup");
|
|
1128
|
+
var import_react_hook_form7 = require("react-hook-form");
|
|
1129
|
+
var defaultValues4 = {
|
|
1130
|
+
email: ""
|
|
1131
|
+
};
|
|
1132
|
+
function useRequestPasswordResetForm() {
|
|
1133
|
+
const {
|
|
1134
|
+
control,
|
|
1135
|
+
formState: { errors },
|
|
1136
|
+
getValues,
|
|
1137
|
+
handleSubmit,
|
|
1138
|
+
reset,
|
|
1139
|
+
setValue,
|
|
1140
|
+
watch
|
|
1141
|
+
} = (0, import_react_hook_form7.useForm)({
|
|
1142
|
+
defaultValues: defaultValues4,
|
|
1143
|
+
resolver: (0, import_yup7.yupResolver)(requestPasswordResetSchema)
|
|
1144
|
+
});
|
|
1145
|
+
const { email } = getValues();
|
|
1146
|
+
return {
|
|
1147
|
+
control,
|
|
1148
|
+
fields: {
|
|
1149
|
+
email
|
|
1150
|
+
},
|
|
1151
|
+
formState: { errors },
|
|
1152
|
+
handleSubmit,
|
|
1153
|
+
reset,
|
|
1154
|
+
setValue,
|
|
1155
|
+
watch
|
|
1156
|
+
};
|
|
1157
|
+
}
|
|
1158
|
+
|
|
1159
|
+
// src/hooks/auth/useValidateTokenForm.ts
|
|
1160
|
+
var import_yup8 = require("@hookform/resolvers/yup");
|
|
1161
|
+
var import_react_hook_form8 = require("react-hook-form");
|
|
1162
|
+
var defaultValues5 = {
|
|
1163
|
+
email: "",
|
|
1164
|
+
token: ""
|
|
1165
|
+
};
|
|
1166
|
+
function useValidateTokenForm() {
|
|
1167
|
+
const {
|
|
1168
|
+
control,
|
|
1169
|
+
formState: { errors },
|
|
1170
|
+
getValues,
|
|
1171
|
+
handleSubmit,
|
|
1172
|
+
reset,
|
|
1173
|
+
setValue,
|
|
1174
|
+
watch
|
|
1175
|
+
} = (0, import_react_hook_form8.useForm)({
|
|
1176
|
+
defaultValues: defaultValues5,
|
|
1177
|
+
resolver: (0, import_yup8.yupResolver)(validateTokenSchema)
|
|
1178
|
+
});
|
|
1179
|
+
const { email, token } = getValues();
|
|
1180
|
+
return {
|
|
1181
|
+
control,
|
|
1182
|
+
fields: {
|
|
1183
|
+
email,
|
|
1184
|
+
token
|
|
1185
|
+
},
|
|
1186
|
+
formState: { errors },
|
|
1187
|
+
handleSubmit,
|
|
1188
|
+
reset,
|
|
1189
|
+
setValue,
|
|
1190
|
+
watch
|
|
1191
|
+
};
|
|
1192
|
+
}
|
|
1193
|
+
|
|
1194
|
+
// src/hooks/auth/useResetPasswordForm.ts
|
|
1195
|
+
var import_yup9 = require("@hookform/resolvers/yup");
|
|
1196
|
+
var import_react_hook_form9 = require("react-hook-form");
|
|
1197
|
+
var defaultValues6 = {
|
|
1198
|
+
confirmPassword: "",
|
|
1199
|
+
email: "",
|
|
1200
|
+
password: ""
|
|
1201
|
+
};
|
|
1202
|
+
function useResetPasswordForm() {
|
|
1203
|
+
const {
|
|
1204
|
+
control,
|
|
1205
|
+
formState: { errors },
|
|
1206
|
+
getValues,
|
|
1207
|
+
handleSubmit,
|
|
1208
|
+
reset,
|
|
1209
|
+
setValue,
|
|
1210
|
+
watch
|
|
1211
|
+
} = (0, import_react_hook_form9.useForm)({
|
|
1212
|
+
defaultValues: defaultValues6,
|
|
1213
|
+
resolver: (0, import_yup9.yupResolver)(resetPasswordSchema)
|
|
1214
|
+
});
|
|
1215
|
+
const { confirmPassword, email, password } = getValues();
|
|
1216
|
+
return {
|
|
1217
|
+
control,
|
|
1218
|
+
fields: {
|
|
1219
|
+
confirmPassword,
|
|
1220
|
+
email,
|
|
1221
|
+
password
|
|
1222
|
+
},
|
|
1223
|
+
formState: { errors },
|
|
1224
|
+
handleSubmit,
|
|
1225
|
+
reset,
|
|
1226
|
+
setValue,
|
|
1227
|
+
watch
|
|
1228
|
+
};
|
|
1229
|
+
}
|
|
1230
|
+
|
|
1118
1231
|
// src/graphql/hooks/auth.ts
|
|
1119
1232
|
var import_client3 = require("@apollo/client");
|
|
1120
1233
|
|
|
@@ -1203,16 +1316,16 @@ var RESET_PASSWORD_MUTATION = import_client2.gql`
|
|
|
1203
1316
|
}
|
|
1204
1317
|
}
|
|
1205
1318
|
`;
|
|
1206
|
-
var
|
|
1207
|
-
mutation
|
|
1208
|
-
|
|
1319
|
+
var REQUEST_PASSWORD_RESET_MUTATION = import_client2.gql`
|
|
1320
|
+
mutation requestPasswordReset($input: RequestPasswordResetInputType!) {
|
|
1321
|
+
requestPasswordReset(input: $input) {
|
|
1209
1322
|
message
|
|
1210
1323
|
}
|
|
1211
1324
|
}
|
|
1212
1325
|
`;
|
|
1213
|
-
var
|
|
1214
|
-
mutation
|
|
1215
|
-
|
|
1326
|
+
var VALIDATE_TOKEN_MUTATION = import_client2.gql`
|
|
1327
|
+
mutation validateToken($input: ValidateTokenInputType!) {
|
|
1328
|
+
validateToken(input: $input) {
|
|
1216
1329
|
message
|
|
1217
1330
|
}
|
|
1218
1331
|
}
|
|
@@ -1227,15 +1340,23 @@ var useRegister = () => {
|
|
|
1227
1340
|
const [register, { loading, error }] = (0, import_client3.useMutation)(REGISTER_MUTATION);
|
|
1228
1341
|
return { error, loading, register };
|
|
1229
1342
|
};
|
|
1230
|
-
var
|
|
1231
|
-
const [
|
|
1232
|
-
|
|
1343
|
+
var useRequestPasswordReset = () => {
|
|
1344
|
+
const [requestPasswordReset, { loading, error }] = (0, import_client3.useMutation)(
|
|
1345
|
+
REQUEST_PASSWORD_RESET_MUTATION
|
|
1346
|
+
);
|
|
1347
|
+
return { error, loading, requestPasswordReset };
|
|
1348
|
+
};
|
|
1349
|
+
var useValidateToken = () => {
|
|
1350
|
+
const [validateToken, { loading, error }] = (0, import_client3.useMutation)(
|
|
1351
|
+
VALIDATE_TOKEN_MUTATION
|
|
1233
1352
|
);
|
|
1234
|
-
return { error,
|
|
1353
|
+
return { error, loading, validateToken };
|
|
1235
1354
|
};
|
|
1236
|
-
var
|
|
1237
|
-
const [
|
|
1238
|
-
|
|
1355
|
+
var useResetPassword = () => {
|
|
1356
|
+
const [resetPassword, { loading, error }] = (0, import_client3.useMutation)(
|
|
1357
|
+
RESET_PASSWORD_MUTATION
|
|
1358
|
+
);
|
|
1359
|
+
return { error, loading, resetPassword };
|
|
1239
1360
|
};
|
|
1240
1361
|
|
|
1241
1362
|
// src/graphql/hooks/chat/hooksMutation.ts
|
|
@@ -2373,11 +2494,22 @@ var useGetStallholderApplyForm = (stallholderId) => {
|
|
|
2373
2494
|
};
|
|
2374
2495
|
|
|
2375
2496
|
// src/graphql/hooks/subscriptions.ts
|
|
2376
|
-
var
|
|
2497
|
+
var import_client23 = require("@apollo/client");
|
|
2377
2498
|
|
|
2378
|
-
// src/graphql/subscriptions/
|
|
2499
|
+
// src/graphql/subscriptions/chat.ts
|
|
2379
2500
|
var import_client21 = require("@apollo/client");
|
|
2380
|
-
var
|
|
2501
|
+
var GET_CHAT_MESSAGE = import_client21.gql`
|
|
2502
|
+
subscription {
|
|
2503
|
+
getChatMessage {
|
|
2504
|
+
...ChatFields
|
|
2505
|
+
}
|
|
2506
|
+
}
|
|
2507
|
+
${CHAT_FIELDS_FRAGMENT}
|
|
2508
|
+
`;
|
|
2509
|
+
|
|
2510
|
+
// src/graphql/subscriptions/notification.ts
|
|
2511
|
+
var import_client22 = require("@apollo/client");
|
|
2512
|
+
var NOTIFICATION_FIELDS_FRAGMENT = import_client22.gql`
|
|
2381
2513
|
fragment NotificationFields on NotificationType {
|
|
2382
2514
|
createdBy
|
|
2383
2515
|
important
|
|
@@ -2387,7 +2519,7 @@ var NOTIFICATION_FIELDS_FRAGMENT = import_client21.gql`
|
|
|
2387
2519
|
resourceType
|
|
2388
2520
|
}
|
|
2389
2521
|
`;
|
|
2390
|
-
var GET_GLOBAL_NOTIFICATION =
|
|
2522
|
+
var GET_GLOBAL_NOTIFICATION = import_client22.gql`
|
|
2391
2523
|
subscription {
|
|
2392
2524
|
getGlobalNotification {
|
|
2393
2525
|
...NotificationFields
|
|
@@ -2395,7 +2527,7 @@ var GET_GLOBAL_NOTIFICATION = import_client21.gql`
|
|
|
2395
2527
|
}
|
|
2396
2528
|
${NOTIFICATION_FIELDS_FRAGMENT}
|
|
2397
2529
|
`;
|
|
2398
|
-
var GET_RELATION_NOTIFICATION =
|
|
2530
|
+
var GET_RELATION_NOTIFICATION = import_client22.gql`
|
|
2399
2531
|
subscription {
|
|
2400
2532
|
getRelationNotification {
|
|
2401
2533
|
...NotificationFields
|
|
@@ -2410,24 +2542,29 @@ var useGetNotification = () => {
|
|
|
2410
2542
|
data: global,
|
|
2411
2543
|
loading: loadingGlobal,
|
|
2412
2544
|
error: errorGlobal
|
|
2413
|
-
} = (0,
|
|
2545
|
+
} = (0, import_client23.useSubscription)(GET_GLOBAL_NOTIFICATION);
|
|
2414
2546
|
const {
|
|
2415
2547
|
data: relation,
|
|
2416
2548
|
loading: loadingImportant,
|
|
2417
2549
|
error: errorImportant
|
|
2418
|
-
} = (0,
|
|
2550
|
+
} = (0, import_client23.useSubscription)(GET_RELATION_NOTIFICATION);
|
|
2419
2551
|
const error = errorGlobal || errorImportant;
|
|
2420
2552
|
const loading = loadingGlobal || loadingImportant;
|
|
2421
2553
|
const notification = relation?.getRelationNotification || global?.getGlobalNotification;
|
|
2422
2554
|
return { error, loading, notification };
|
|
2423
2555
|
};
|
|
2556
|
+
var useGetChatSubscription = () => {
|
|
2557
|
+
const { data, loading, error } = (0, import_client23.useSubscription)(GET_CHAT_MESSAGE);
|
|
2558
|
+
const chat = data?.getChat;
|
|
2559
|
+
return { chat, error, loading };
|
|
2560
|
+
};
|
|
2424
2561
|
|
|
2425
2562
|
// src/graphql/hooks/user/hooksMutation.ts
|
|
2426
|
-
var
|
|
2563
|
+
var import_client25 = require("@apollo/client");
|
|
2427
2564
|
|
|
2428
2565
|
// src/graphql/mutations/user.ts
|
|
2429
|
-
var
|
|
2430
|
-
var CREATE_USER_MUTATION =
|
|
2566
|
+
var import_client24 = require("@apollo/client");
|
|
2567
|
+
var CREATE_USER_MUTATION = import_client24.gql`
|
|
2431
2568
|
mutation createUser($input: UserInputType!) {
|
|
2432
2569
|
createUser(input: $input) {
|
|
2433
2570
|
...UserFields
|
|
@@ -2435,7 +2572,7 @@ var CREATE_USER_MUTATION = import_client23.gql`
|
|
|
2435
2572
|
}
|
|
2436
2573
|
${USER_FIELDS_FRAGMENT}
|
|
2437
2574
|
`;
|
|
2438
|
-
var UPDATE_USER_MUTATION =
|
|
2575
|
+
var UPDATE_USER_MUTATION = import_client24.gql`
|
|
2439
2576
|
mutation updateUser($_id: ID!, $input: UserInputType!) {
|
|
2440
2577
|
updateUser(_id: $_id, input: $input) {
|
|
2441
2578
|
...UserFields
|
|
@@ -2443,7 +2580,7 @@ var UPDATE_USER_MUTATION = import_client23.gql`
|
|
|
2443
2580
|
}
|
|
2444
2581
|
${USER_FIELDS_FRAGMENT}
|
|
2445
2582
|
`;
|
|
2446
|
-
var ADD_USER_FAVOURITE_RESOURCE_MUTATION =
|
|
2583
|
+
var ADD_USER_FAVOURITE_RESOURCE_MUTATION = import_client24.gql`
|
|
2447
2584
|
mutation addUserFavouriteResource(
|
|
2448
2585
|
$resourceId: ID!
|
|
2449
2586
|
$resourceType: ResourceTypeEnum!
|
|
@@ -2459,7 +2596,7 @@ var ADD_USER_FAVOURITE_RESOURCE_MUTATION = import_client23.gql`
|
|
|
2459
2596
|
}
|
|
2460
2597
|
${USER_FIELDS_FRAGMENT}
|
|
2461
2598
|
`;
|
|
2462
|
-
var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION =
|
|
2599
|
+
var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION = import_client24.gql`
|
|
2463
2600
|
mutation removeUserFavouriteResource(
|
|
2464
2601
|
$resourceId: ID!
|
|
2465
2602
|
$resourceType: ResourceTypeEnum!
|
|
@@ -2478,19 +2615,19 @@ var REMOVE_USER_FAVOURITE_RESOURCE_MUTATION = import_client23.gql`
|
|
|
2478
2615
|
|
|
2479
2616
|
// src/graphql/hooks/user/hooksMutation.ts
|
|
2480
2617
|
var useCreateUser = () => {
|
|
2481
|
-
const [createUser, { loading, error }] = (0,
|
|
2618
|
+
const [createUser, { loading, error }] = (0, import_client25.useMutation)(CREATE_USER_MUTATION, {
|
|
2482
2619
|
awaitRefetchQueries: true
|
|
2483
2620
|
});
|
|
2484
2621
|
return { createUser, error, loading };
|
|
2485
2622
|
};
|
|
2486
2623
|
var useUpdateUser = () => {
|
|
2487
|
-
const [updateUser, { loading, error }] = (0,
|
|
2624
|
+
const [updateUser, { loading, error }] = (0, import_client25.useMutation)(UPDATE_USER_MUTATION, {
|
|
2488
2625
|
awaitRefetchQueries: true
|
|
2489
2626
|
});
|
|
2490
2627
|
return { error, loading, updateUser };
|
|
2491
2628
|
};
|
|
2492
2629
|
var useAddUserFavouriteResource = () => {
|
|
2493
|
-
const [addUserFavouriteResource, { loading, error }] = (0,
|
|
2630
|
+
const [addUserFavouriteResource, { loading, error }] = (0, import_client25.useMutation)(
|
|
2494
2631
|
ADD_USER_FAVOURITE_RESOURCE_MUTATION,
|
|
2495
2632
|
{
|
|
2496
2633
|
awaitRefetchQueries: true,
|
|
@@ -2500,7 +2637,7 @@ var useAddUserFavouriteResource = () => {
|
|
|
2500
2637
|
return { addUserFavouriteResource, error, loading };
|
|
2501
2638
|
};
|
|
2502
2639
|
var useRemoveUserFavouriteResource = () => {
|
|
2503
|
-
const [removeUserFavouriteResource, { loading, error }] = (0,
|
|
2640
|
+
const [removeUserFavouriteResource, { loading, error }] = (0, import_client25.useMutation)(
|
|
2504
2641
|
REMOVE_USER_FAVOURITE_RESOURCE_MUTATION,
|
|
2505
2642
|
{
|
|
2506
2643
|
awaitRefetchQueries: true,
|
|
@@ -2511,30 +2648,30 @@ var useRemoveUserFavouriteResource = () => {
|
|
|
2511
2648
|
};
|
|
2512
2649
|
|
|
2513
2650
|
// src/graphql/hooks/user/hooksQuery.ts
|
|
2514
|
-
var
|
|
2651
|
+
var import_client26 = require("@apollo/client");
|
|
2515
2652
|
var useGetUsers = () => {
|
|
2516
|
-
const { loading, error, data, refetch } = (0,
|
|
2653
|
+
const { loading, error, data, refetch } = (0, import_client26.useQuery)(GET_USERS, {
|
|
2517
2654
|
fetchPolicy: "network-only"
|
|
2518
2655
|
});
|
|
2519
2656
|
const users = data?.users;
|
|
2520
2657
|
return { error, loading, refetch, users };
|
|
2521
2658
|
};
|
|
2522
2659
|
var useGetUser = (id) => {
|
|
2523
|
-
const { loading, error, data, refetch } = (0,
|
|
2660
|
+
const { loading, error, data, refetch } = (0, import_client26.useQuery)(GET_USER, {
|
|
2524
2661
|
variables: { id }
|
|
2525
2662
|
});
|
|
2526
2663
|
const user = data?.user;
|
|
2527
2664
|
return { error, loading, refetch, user };
|
|
2528
2665
|
};
|
|
2529
2666
|
var useGetUserMarkets = () => {
|
|
2530
|
-
const { loading, error, data, refetch } = (0,
|
|
2667
|
+
const { loading, error, data, refetch } = (0, import_client26.useQuery)(GET_USER_MARKETS, {
|
|
2531
2668
|
fetchPolicy: "network-only"
|
|
2532
2669
|
});
|
|
2533
2670
|
const userMarkets = data?.userMarkets;
|
|
2534
2671
|
return { error, loading, refetch, userMarkets };
|
|
2535
2672
|
};
|
|
2536
2673
|
var useGetUserFavourites = () => {
|
|
2537
|
-
const { loading, error, data, refetch } = (0,
|
|
2674
|
+
const { loading, error, data, refetch } = (0, import_client26.useQuery)(GET_USER_FAVOURITES, {
|
|
2538
2675
|
fetchPolicy: "network-only"
|
|
2539
2676
|
});
|
|
2540
2677
|
const markets = data?.userFavourites.markets;
|
|
@@ -2546,7 +2683,7 @@ var useGetUserFavourites = () => {
|
|
|
2546
2683
|
return { error, loading, refetch, userFavourites };
|
|
2547
2684
|
};
|
|
2548
2685
|
var useGetUserNotifications = () => {
|
|
2549
|
-
const { loading, error, data, refetch } = (0,
|
|
2686
|
+
const { loading, error, data, refetch } = (0, import_client26.useQuery)(GET_USER_NOTIFICATIONS, {
|
|
2550
2687
|
fetchPolicy: "network-only"
|
|
2551
2688
|
});
|
|
2552
2689
|
const userNotifications = data?.userNotifications;
|
|
@@ -2857,7 +2994,7 @@ var registerFields = [
|
|
|
2857
2994
|
secureTextEntry: true
|
|
2858
2995
|
}
|
|
2859
2996
|
];
|
|
2860
|
-
var
|
|
2997
|
+
var requestPasswordResetFields = [
|
|
2861
2998
|
{
|
|
2862
2999
|
helperText: "Enter your email address",
|
|
2863
3000
|
keyboardType: "email-address",
|
|
@@ -2881,6 +3018,21 @@ var resetPasswordFields = [
|
|
|
2881
3018
|
secureTextEntry: true
|
|
2882
3019
|
}
|
|
2883
3020
|
];
|
|
3021
|
+
var validateTokenFields = [
|
|
3022
|
+
{
|
|
3023
|
+
disabled: true,
|
|
3024
|
+
helperText: "Your email address",
|
|
3025
|
+
keyboardType: "email-address",
|
|
3026
|
+
name: "email",
|
|
3027
|
+
placeholder: "Email"
|
|
3028
|
+
},
|
|
3029
|
+
{
|
|
3030
|
+
helperText: "Enter the Verification code sent to your email",
|
|
3031
|
+
keyboardType: "number-pad",
|
|
3032
|
+
name: "token",
|
|
3033
|
+
placeholder: "Verification code"
|
|
3034
|
+
}
|
|
3035
|
+
];
|
|
2884
3036
|
|
|
2885
3037
|
// src/formFields/user.ts
|
|
2886
3038
|
var profileFields = [
|
|
@@ -3249,8 +3401,6 @@ var categoryColors = {
|
|
|
3249
3401
|
endDateAfterStartDateTest,
|
|
3250
3402
|
endDateNotInPastTest,
|
|
3251
3403
|
endTimeMustBeAfterStartTimeTest,
|
|
3252
|
-
forgotPasswordFields,
|
|
3253
|
-
forgotPasswordSchema,
|
|
3254
3404
|
formatDate,
|
|
3255
3405
|
formatTimestamp,
|
|
3256
3406
|
getCurrentAndFutureDates,
|
|
@@ -3274,6 +3424,8 @@ var categoryColors = {
|
|
|
3274
3424
|
registerSchema,
|
|
3275
3425
|
rejectionPolicyOptions,
|
|
3276
3426
|
removeTypename,
|
|
3427
|
+
requestPasswordResetFields,
|
|
3428
|
+
requestPasswordResetSchema,
|
|
3277
3429
|
resetPasswordFields,
|
|
3278
3430
|
resetPasswordSchema,
|
|
3279
3431
|
sortDatesByProximity,
|
|
@@ -3312,8 +3464,8 @@ var categoryColors = {
|
|
|
3312
3464
|
useDeleteMarket,
|
|
3313
3465
|
useDeleteRelation,
|
|
3314
3466
|
useDeleteStallholder,
|
|
3315
|
-
useForgotPassword,
|
|
3316
3467
|
useGetChat,
|
|
3468
|
+
useGetChatSubscription,
|
|
3317
3469
|
useGetMarket,
|
|
3318
3470
|
useGetMarketRelations,
|
|
3319
3471
|
useGetMarkets,
|
|
@@ -3342,6 +3494,10 @@ var categoryColors = {
|
|
|
3342
3494
|
useRegisterForm,
|
|
3343
3495
|
useRemoveParticipantFromChat,
|
|
3344
3496
|
useRemoveUserFavouriteResource,
|
|
3497
|
+
useRequestPasswordReset,
|
|
3498
|
+
useRequestPasswordResetForm,
|
|
3499
|
+
useResetPassword,
|
|
3500
|
+
useResetPasswordForm,
|
|
3345
3501
|
useSearchMarkets,
|
|
3346
3502
|
useSearchStallholders,
|
|
3347
3503
|
useSendChatMessage,
|
|
@@ -3353,8 +3509,10 @@ var categoryColors = {
|
|
|
3353
3509
|
useUpdateStallholderApplyForm,
|
|
3354
3510
|
useUpdateUser,
|
|
3355
3511
|
useUserForm,
|
|
3356
|
-
|
|
3512
|
+
useValidateToken,
|
|
3513
|
+
useValidateTokenForm,
|
|
3357
3514
|
userSchema,
|
|
3358
|
-
|
|
3515
|
+
validateTokenFields,
|
|
3516
|
+
validateTokenSchema
|
|
3359
3517
|
});
|
|
3360
3518
|
//# sourceMappingURL=index.js.map
|
package/dist/index.d.mts
CHANGED
|
@@ -100,23 +100,24 @@ interface CreateRegisterFormData {
|
|
|
100
100
|
setValue: UseFormSetValue<RegisterFormData>;
|
|
101
101
|
watch: UseFormWatch<RegisterFormData>;
|
|
102
102
|
}
|
|
103
|
-
type
|
|
103
|
+
type RequestPasswordResetFormData = {
|
|
104
104
|
email: string;
|
|
105
105
|
};
|
|
106
|
-
interface
|
|
107
|
-
control: Control<
|
|
108
|
-
fields:
|
|
106
|
+
interface CreateRequestPasswordResetFormData {
|
|
107
|
+
control: Control<RequestPasswordResetFormData, any>;
|
|
108
|
+
fields: RequestPasswordResetFormData;
|
|
109
109
|
formState: {
|
|
110
|
-
errors: FieldErrors<
|
|
110
|
+
errors: FieldErrors<RequestPasswordResetFormData>;
|
|
111
111
|
};
|
|
112
|
-
handleSubmit: UseFormHandleSubmit<
|
|
113
|
-
reset: UseFormReset<
|
|
114
|
-
setValue: UseFormSetValue<
|
|
115
|
-
watch: UseFormWatch<
|
|
112
|
+
handleSubmit: UseFormHandleSubmit<RequestPasswordResetFormData, any>;
|
|
113
|
+
reset: UseFormReset<RequestPasswordResetFormData>;
|
|
114
|
+
setValue: UseFormSetValue<RequestPasswordResetFormData>;
|
|
115
|
+
watch: UseFormWatch<RequestPasswordResetFormData>;
|
|
116
116
|
}
|
|
117
117
|
type ResetPasswordFormData = {
|
|
118
|
-
password: string;
|
|
119
118
|
confirmPassword: string;
|
|
119
|
+
email: string;
|
|
120
|
+
password: string;
|
|
120
121
|
};
|
|
121
122
|
interface CreateResetPasswordFormData {
|
|
122
123
|
control: Control<ResetPasswordFormData, any>;
|
|
@@ -124,24 +125,25 @@ interface CreateResetPasswordFormData {
|
|
|
124
125
|
formState: {
|
|
125
126
|
errors: FieldErrors<ResetPasswordFormData>;
|
|
126
127
|
};
|
|
127
|
-
handleSubmit: UseFormHandleSubmit<ResetPasswordFormData,
|
|
128
|
+
handleSubmit: UseFormHandleSubmit<ResetPasswordFormData, any>;
|
|
128
129
|
reset: UseFormReset<ResetPasswordFormData>;
|
|
129
130
|
setValue: UseFormSetValue<ResetPasswordFormData>;
|
|
130
131
|
watch: UseFormWatch<ResetPasswordFormData>;
|
|
131
132
|
}
|
|
132
|
-
type
|
|
133
|
+
type ValidateTokenFormData = {
|
|
134
|
+
email: string;
|
|
133
135
|
token: string;
|
|
134
136
|
};
|
|
135
|
-
interface
|
|
136
|
-
control: Control<
|
|
137
|
-
fields:
|
|
137
|
+
interface CreateValidateTokenFormData {
|
|
138
|
+
control: Control<ValidateTokenFormData, any>;
|
|
139
|
+
fields: ValidateTokenFormData;
|
|
138
140
|
formState: {
|
|
139
|
-
errors: FieldErrors<
|
|
141
|
+
errors: FieldErrors<ValidateTokenFormData>;
|
|
140
142
|
};
|
|
141
|
-
handleSubmit: UseFormHandleSubmit<
|
|
142
|
-
reset: UseFormReset<
|
|
143
|
-
setValue: UseFormSetValue<
|
|
144
|
-
watch: UseFormWatch<
|
|
143
|
+
handleSubmit: UseFormHandleSubmit<ValidateTokenFormData, any>;
|
|
144
|
+
reset: UseFormReset<ValidateTokenFormData>;
|
|
145
|
+
setValue: UseFormSetValue<ValidateTokenFormData>;
|
|
146
|
+
watch: UseFormWatch<ValidateTokenFormData>;
|
|
145
147
|
}
|
|
146
148
|
|
|
147
149
|
interface ChatInput {
|
|
@@ -625,6 +627,12 @@ declare function useLoginForm(): CreateLoginFormData;
|
|
|
625
627
|
*/
|
|
626
628
|
declare function useRegisterForm(): CreateRegisterFormData;
|
|
627
629
|
|
|
630
|
+
declare function useRequestPasswordResetForm(): CreateRequestPasswordResetFormData;
|
|
631
|
+
|
|
632
|
+
declare function useValidateTokenForm(): CreateValidateTokenFormData;
|
|
633
|
+
|
|
634
|
+
declare function useResetPasswordForm(): CreateResetPasswordFormData;
|
|
635
|
+
|
|
628
636
|
declare const globalDefaultValues: BaseResourceTypeFormData;
|
|
629
637
|
declare const defaultMarketFormValues: MarketFormData;
|
|
630
638
|
declare const defaultStallholderFormValues: StallholderFormData;
|
|
@@ -875,21 +883,25 @@ declare const registerSchema: yup.ObjectSchema<{
|
|
|
875
883
|
password: undefined;
|
|
876
884
|
role: undefined;
|
|
877
885
|
}, "">;
|
|
878
|
-
declare const
|
|
886
|
+
declare const requestPasswordResetSchema: yup.ObjectSchema<{
|
|
879
887
|
email: string;
|
|
880
888
|
}, yup.AnyObject, {
|
|
881
889
|
email: undefined;
|
|
882
890
|
}, "">;
|
|
883
891
|
declare const resetPasswordSchema: yup.ObjectSchema<{
|
|
892
|
+
email: string;
|
|
884
893
|
password: string;
|
|
885
894
|
confirmPassword: string;
|
|
886
895
|
}, yup.AnyObject, {
|
|
896
|
+
email: undefined;
|
|
887
897
|
password: undefined;
|
|
888
898
|
confirmPassword: undefined;
|
|
889
899
|
}, "">;
|
|
890
|
-
declare const
|
|
900
|
+
declare const validateTokenSchema: yup.ObjectSchema<{
|
|
901
|
+
email: string;
|
|
891
902
|
token: string;
|
|
892
903
|
}, yup.AnyObject, {
|
|
904
|
+
email: undefined;
|
|
893
905
|
token: undefined;
|
|
894
906
|
}, "">;
|
|
895
907
|
|
|
@@ -903,15 +915,20 @@ declare const useRegister: () => {
|
|
|
903
915
|
loading: boolean;
|
|
904
916
|
register: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
|
|
905
917
|
};
|
|
906
|
-
declare const
|
|
918
|
+
declare const useRequestPasswordReset: () => {
|
|
919
|
+
error: _apollo_client.ApolloError | undefined;
|
|
920
|
+
loading: boolean;
|
|
921
|
+
requestPasswordReset: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
|
|
922
|
+
};
|
|
923
|
+
declare const useValidateToken: () => {
|
|
907
924
|
error: _apollo_client.ApolloError | undefined;
|
|
908
|
-
forgotPassword: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
|
|
909
925
|
loading: boolean;
|
|
926
|
+
validateToken: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
|
|
910
927
|
};
|
|
911
|
-
declare const
|
|
928
|
+
declare const useResetPassword: () => {
|
|
912
929
|
error: _apollo_client.ApolloError | undefined;
|
|
913
930
|
loading: boolean;
|
|
914
|
-
|
|
931
|
+
resetPassword: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
|
|
915
932
|
};
|
|
916
933
|
|
|
917
934
|
declare const useCreateChat: () => {
|
|
@@ -1113,6 +1130,11 @@ declare const useGetNotification: () => {
|
|
|
1113
1130
|
loading: boolean;
|
|
1114
1131
|
notification: NotificationType;
|
|
1115
1132
|
};
|
|
1133
|
+
declare const useGetChatSubscription: () => {
|
|
1134
|
+
chat: ChatType;
|
|
1135
|
+
error: _apollo_client.ApolloError | undefined;
|
|
1136
|
+
loading: boolean;
|
|
1137
|
+
};
|
|
1116
1138
|
|
|
1117
1139
|
declare const useCreateUser: () => {
|
|
1118
1140
|
createUser: (options?: _apollo_client.MutationFunctionOptions<any, _apollo_client.OperationVariables, _apollo_client.DefaultContext, _apollo_client.ApolloCache<any>> | undefined) => Promise<_apollo_client.FetchResult<any>>;
|
|
@@ -1216,12 +1238,13 @@ declare const rejectionPolicyOptions: OptionItem[];
|
|
|
1216
1238
|
|
|
1217
1239
|
declare const loginFields: FormField[];
|
|
1218
1240
|
declare const registerFields: FormField[];
|
|
1219
|
-
declare const
|
|
1241
|
+
declare const requestPasswordResetFields: FormField[];
|
|
1220
1242
|
declare const resetPasswordFields: FormField[];
|
|
1243
|
+
declare const validateTokenFields: FormField[];
|
|
1221
1244
|
|
|
1222
1245
|
declare const profileFields: FormField[];
|
|
1223
1246
|
|
|
1224
1247
|
declare const availableCategories: Category[];
|
|
1225
1248
|
declare const categoryColors: Record<string, string>;
|
|
1226
1249
|
|
|
1227
|
-
export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type
|
|
1250
|
+
export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type ChatInput, type ChatMessageInput, type ChatMessageType, type ChatType, type CreateLoginFormData, type CreateMarketFormData, type CreateRegisterFormData, type CreateRequestPasswordResetFormData, type CreateResetPasswordFormData, type CreateStallholderApplyFormFormData, type CreateStallholderFormData, type CreateUserFormData, type CreateValidateTokenFormData, type DateTimeType, EnumInviteStatus, EnumNotification, EnumRegions, EnumRejectionPolicy, EnumRelationResource, EnumResourceType, EnumResourceTypeIcon, EnumUserLicence, EnumUserRole, type FormDateField, type FormField, type GeocodeLocation, type ImageObjectType, ImageTypeEnum, type LocationType, type LoginFormData, type MapMultiLocation, type MarketFormData, type MarketType, type MarketWithConnectionDatesType, type NotificationType, type OptionItem, type PlacePrediction, type Region, type RegisterFormData, type RelationDate, type RelationLog, type RelationType, type RequestPasswordResetFormData, type ResetPasswordFormData, type ResourceConnectionsType, type ResourceImageType, type SatllholderWithConnectionDatesType, type StallholderApplyFormFormData, type StallholderApplyFormType, type StallholderAttributes, type StallholderFormData, type StallholderLocation, type StallholderType, type Subcategory, type UserFormData, type UserType, type ValidateTokenFormData, availableCategories, availableCityOptions, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, dateFormat, dateTimeSchema, defaultMarketFormValues, defaultRegion, defaultStallholderApplyFormValues, defaultStallholderFormValues, emailSchema, endDateAfterStartDateTest, endDateNotInPastTest, endTimeMustBeAfterStartTimeTest, formatDate, formatTimestamp, getCurrentAndFutureDates, getFutureDatesAfterThreshold, globalDefaultValues, globalResourceSchema, locationSchema, loginFields, loginSchema, mapArrayToOptions, marketBasicInfoFields, marketEndDateFields, marketSchema, marketStartDateFields, packagingOptions, passwordSchema, paymentMethodOptions, producedIngOptions, profileFields, registerFields, registerSchema, rejectionPolicyOptions, removeTypename, requestPasswordResetFields, requestPasswordResetSchema, resetPasswordFields, resetPasswordSchema, sortDatesByProximity, stallApplicationInfo, stallHolderSchema, stallholderApplyFormSchema, stallholderBasicInfoFields, stallholderElectricity, stallholderEndDateFields, stallholderFullAddress, stallholderGazebo, stallholderLocationDescription, stallholderMultiLocation, stallholderPackaging, stallholderPaymentMethod, stallholderPriceRange, stallholderProducedIn, stallholderStallSize, stallholderStartDateFields, stallholderTable, startDateNotInPastTest, startTimeCannotBeInPastTest, statusOptions, tagOptions, timeFormat, truncateText, useAddParticipantToChat, useAddUserFavouriteResource, useCreateChat, useCreateMarket, useCreateRelation, useCreateStallholder, useCreateStallholderApplyForm, useCreateUser, useDeleteChat, useDeleteMarket, useDeleteRelation, useDeleteStallholder, useGetChat, useGetChatSubscription, useGetMarket, useGetMarketRelations, useGetMarkets, useGetMarketsByRegion, useGetMarketsNearMe, useGetNotification, useGetRelation, useGetRelationByMarketAndStallholder, useGetResourceConnections, useGetStallholder, useGetStallholderApplyForm, useGetStallholderRelations, useGetStallholders, useGetStallholdersByRegion, useGetUser, useGetUserChats, useGetUserFavourites, useGetUserMarkets, useGetUserNotifications, useGetUsers, useLocationSearch, useLogin, useLoginForm, useMarketForm, useRegister, useRegisterForm, useRemoveParticipantFromChat, useRemoveUserFavouriteResource, useRequestPasswordReset, useRequestPasswordResetForm, useResetPassword, useResetPasswordForm, useSearchMarkets, useSearchStallholders, useSendChatMessage, useStallholderApplyForm, useStallholderForm, useUpdateMarket, useUpdateRelation, useUpdateStallholder, useUpdateStallholderApplyForm, useUpdateUser, useUserForm, useValidateToken, useValidateTokenForm, userSchema, validateTokenFields, validateTokenSchema };
|