@timardex/cluemart-shared 1.0.11 → 1.0.13
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 +44 -5
- package/dist/index.d.mts +23 -29
- package/dist/index.d.ts +23 -29
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +43 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -69,6 +69,7 @@ __export(index_exports, {
|
|
|
69
69
|
mapArrayToOptions: () => mapArrayToOptions,
|
|
70
70
|
marketBasicInfoFields: () => marketBasicInfoFields,
|
|
71
71
|
marketEndDateFields: () => marketEndDateFields,
|
|
72
|
+
marketPriceByDateFields: () => marketPriceByDateFields,
|
|
72
73
|
marketSchema: () => marketSchema,
|
|
73
74
|
marketStartDateFields: () => marketStartDateFields,
|
|
74
75
|
packagingOptions: () => packagingOptions,
|
|
@@ -183,9 +184,11 @@ var import_utc = __toESM(require("dayjs/plugin/utc"));
|
|
|
183
184
|
var EnumInviteStatus = /* @__PURE__ */ ((EnumInviteStatus2) => {
|
|
184
185
|
EnumInviteStatus2["ACCEPTED"] = "ACCEPTED";
|
|
185
186
|
EnumInviteStatus2["COMPLETED"] = "COMPLETED";
|
|
187
|
+
EnumInviteStatus2["EXPIRED"] = "EXPIRED";
|
|
188
|
+
EnumInviteStatus2["NO_STATUS"] = "NO_STATUS";
|
|
186
189
|
EnumInviteStatus2["PENDING"] = "PENDING";
|
|
187
190
|
EnumInviteStatus2["REJECTED"] = "REJECTED";
|
|
188
|
-
EnumInviteStatus2["
|
|
191
|
+
EnumInviteStatus2["WAITING"] = "WAITING";
|
|
189
192
|
return EnumInviteStatus2;
|
|
190
193
|
})(EnumInviteStatus || {});
|
|
191
194
|
var EnumRejectionPolicy = /* @__PURE__ */ ((EnumRejectionPolicy2) => {
|
|
@@ -495,6 +498,14 @@ var startTimeCannotBeInPastTest = yup.string().test(
|
|
|
495
498
|
var dateTimeSchema = yup.object().shape({
|
|
496
499
|
endDate: yup.string().concat(endDateNotInPastTest).concat(endDateAfterStartDateTest).required("End date is required"),
|
|
497
500
|
endTime: yup.string().concat(endTimeMustBeAfterStartTimeTest).required("End time is required"),
|
|
501
|
+
marketPrice: yup.number().typeError("Market price must be a number").min(0.1, "Market price must be at least 0.1").required("Market price is required").test(
|
|
502
|
+
"no-leading-zeros",
|
|
503
|
+
"Market price must not have leading zeros",
|
|
504
|
+
(value, context) => {
|
|
505
|
+
const original = context.originalValue?.toString() ?? "";
|
|
506
|
+
return !/^0\d+(\.\d+)?$/.test(original);
|
|
507
|
+
}
|
|
508
|
+
),
|
|
498
509
|
startDate: yup.string().concat(startDateNotInPastTest).required("Start date is required"),
|
|
499
510
|
startTime: yup.string().concat(startTimeCannotBeInPastTest).required("Start time is required")
|
|
500
511
|
});
|
|
@@ -533,9 +544,23 @@ var marketSchema = globalResourceSchema.shape({
|
|
|
533
544
|
location: locationSchema,
|
|
534
545
|
provider: yup2.string().trim().min(3).required("Provider is required"),
|
|
535
546
|
stallApplicationInfo: yup2.object().shape({
|
|
536
|
-
applicationDeadlineHours: yup2.number().min(1).required("Application deadline hours is required")
|
|
547
|
+
applicationDeadlineHours: yup2.number().typeError("Application deadline hours must be a number").min(1, "Application deadline hours must be at least 1").required("Application deadline hours is required").test(
|
|
548
|
+
"no-leading-zeros",
|
|
549
|
+
"Application deadline hours must not start with leading zeros",
|
|
550
|
+
(value, context) => {
|
|
551
|
+
const original = context.originalValue?.toString() ?? "";
|
|
552
|
+
return !/^0\d+$/.test(original);
|
|
553
|
+
}
|
|
554
|
+
),
|
|
537
555
|
rejectionPolicy: yup2.mixed().oneOf(Object.values(EnumRejectionPolicy)).required("Rejection policy is required"),
|
|
538
|
-
stallCapacity: yup2.number().min(1).required("Stall capacity is required")
|
|
556
|
+
stallCapacity: yup2.number().typeError("Stall capacity must be a number").min(1, "Stall capacity must be at least 1").integer("Stall capacity must be a whole number").required("Stall capacity is required").test(
|
|
557
|
+
"no-leading-zeros",
|
|
558
|
+
"Stall capacity must not have leading zeros",
|
|
559
|
+
(value, context) => {
|
|
560
|
+
const original = context.originalValue?.toString() ?? "";
|
|
561
|
+
return !/^0\d+$/.test(original);
|
|
562
|
+
}
|
|
563
|
+
)
|
|
539
564
|
}),
|
|
540
565
|
tags: yup2.array().of(yup2.string().defined()).nullable()
|
|
541
566
|
});
|
|
@@ -669,12 +694,14 @@ var defaultMarketFormValues = {
|
|
|
669
694
|
{
|
|
670
695
|
endDate: "04-05-2025",
|
|
671
696
|
endTime: "15:00",
|
|
697
|
+
marketPrice: 0,
|
|
672
698
|
startDate: "04-05-2025",
|
|
673
699
|
startTime: "09:00"
|
|
674
700
|
},
|
|
675
701
|
{
|
|
676
702
|
endDate: "05-05-2025",
|
|
677
703
|
endTime: "15:00",
|
|
704
|
+
marketPrice: 0,
|
|
678
705
|
startDate: "05-05-2025",
|
|
679
706
|
startTime: "09:00"
|
|
680
707
|
}
|
|
@@ -693,9 +720,9 @@ var defaultMarketFormValues = {
|
|
|
693
720
|
},
|
|
694
721
|
provider: "Provider name",
|
|
695
722
|
stallApplicationInfo: {
|
|
696
|
-
applicationDeadlineHours:
|
|
723
|
+
applicationDeadlineHours: 0,
|
|
697
724
|
rejectionPolicy: "multi_date_allowed" /* MULTI_DATE_ALLOWED */,
|
|
698
|
-
stallCapacity:
|
|
725
|
+
stallCapacity: 0
|
|
699
726
|
},
|
|
700
727
|
tags: null
|
|
701
728
|
};
|
|
@@ -1570,6 +1597,7 @@ var MARKET_DATETIME_FIELDS_FRAGMENT = import_client8.gql`
|
|
|
1570
1597
|
fragment MarketDateTimeFields on MarketDateTimeType {
|
|
1571
1598
|
endDate
|
|
1572
1599
|
endTime
|
|
1600
|
+
marketPrice
|
|
1573
1601
|
startDate
|
|
1574
1602
|
startTime
|
|
1575
1603
|
}
|
|
@@ -1993,6 +2021,7 @@ var RELATION_LOGS_FRAGMENT = import_client14.gql`
|
|
|
1993
2021
|
var RELATION_DATES_FRAGMENT = import_client14.gql`
|
|
1994
2022
|
fragment RelationDates on RelationDateType {
|
|
1995
2023
|
lastUpdateBy
|
|
2024
|
+
marketPrice
|
|
1996
2025
|
startDate
|
|
1997
2026
|
status
|
|
1998
2027
|
}
|
|
@@ -2000,6 +2029,7 @@ var RELATION_DATES_FRAGMENT = import_client14.gql`
|
|
|
2000
2029
|
var RELATION_FIELDS_FRAGMENT = import_client14.gql`
|
|
2001
2030
|
fragment RelationFields on RelationType {
|
|
2002
2031
|
_id
|
|
2032
|
+
apiMessage
|
|
2003
2033
|
createdAt
|
|
2004
2034
|
lastUpdateBy
|
|
2005
2035
|
marketId
|
|
@@ -2924,6 +2954,14 @@ var marketStartDateFields = [
|
|
|
2924
2954
|
placeholder: "Start Time"
|
|
2925
2955
|
}
|
|
2926
2956
|
];
|
|
2957
|
+
var marketPriceByDateFields = [
|
|
2958
|
+
{
|
|
2959
|
+
helperText: "Market Price for this date *",
|
|
2960
|
+
keyboardType: "number-pad",
|
|
2961
|
+
name: "marketPrice",
|
|
2962
|
+
placeholder: "Market Price"
|
|
2963
|
+
}
|
|
2964
|
+
];
|
|
2927
2965
|
var marketEndDateFields = [
|
|
2928
2966
|
{
|
|
2929
2967
|
dateMode: "date",
|
|
@@ -3422,6 +3460,7 @@ var categoryColors = {
|
|
|
3422
3460
|
mapArrayToOptions,
|
|
3423
3461
|
marketBasicInfoFields,
|
|
3424
3462
|
marketEndDateFields,
|
|
3463
|
+
marketPriceByDateFields,
|
|
3425
3464
|
marketSchema,
|
|
3426
3465
|
marketStartDateFields,
|
|
3427
3466
|
packagingOptions,
|
package/dist/index.d.mts
CHANGED
|
@@ -5,9 +5,11 @@ import * as _apollo_client from '@apollo/client';
|
|
|
5
5
|
declare enum EnumInviteStatus {
|
|
6
6
|
ACCEPTED = "ACCEPTED",
|
|
7
7
|
COMPLETED = "COMPLETED",
|
|
8
|
+
EXPIRED = "EXPIRED",
|
|
9
|
+
NO_STATUS = "NO_STATUS",
|
|
8
10
|
PENDING = "PENDING",
|
|
9
11
|
REJECTED = "REJECTED",
|
|
10
|
-
|
|
12
|
+
WAITING = "WAITING"
|
|
11
13
|
}
|
|
12
14
|
declare enum EnumRejectionPolicy {
|
|
13
15
|
SINGLE_DATE_ALLOWED = "single_date_allowed",
|
|
@@ -186,11 +188,13 @@ type RelationLog = {
|
|
|
186
188
|
};
|
|
187
189
|
type RelationDate = {
|
|
188
190
|
lastUpdateBy: string;
|
|
191
|
+
marketPrice: number;
|
|
189
192
|
startDate: string;
|
|
190
193
|
status: EnumInviteStatus;
|
|
191
194
|
};
|
|
192
195
|
interface RelationType {
|
|
193
196
|
_id?: string;
|
|
197
|
+
apiMessage?: string;
|
|
194
198
|
createdAt?: string;
|
|
195
199
|
lastUpdateBy: EnumResourceType;
|
|
196
200
|
marketId: string;
|
|
@@ -201,8 +205,11 @@ interface RelationType {
|
|
|
201
205
|
updatedAt?: string;
|
|
202
206
|
}
|
|
203
207
|
|
|
208
|
+
type DateTimeWithPrice = DateTimeType & {
|
|
209
|
+
marketPrice: number;
|
|
210
|
+
};
|
|
204
211
|
interface MarketFormData extends BaseResourceTypeFormData {
|
|
205
|
-
dateTime:
|
|
212
|
+
dateTime: DateTimeWithPrice[];
|
|
206
213
|
location: LocationType;
|
|
207
214
|
provider: string;
|
|
208
215
|
stallApplicationInfo: {
|
|
@@ -235,23 +242,9 @@ interface MarketWithConnectionDatesType extends MarketType {
|
|
|
235
242
|
}
|
|
236
243
|
|
|
237
244
|
type StallholderLocation = {
|
|
238
|
-
dateTime:
|
|
239
|
-
startDate?: string | null;
|
|
240
|
-
startTime?: string | null;
|
|
241
|
-
endDate?: string | null;
|
|
242
|
-
endTime?: string | null;
|
|
243
|
-
} | null;
|
|
245
|
+
dateTime: Nullable<DateTimeType> | null;
|
|
244
246
|
description?: string | null;
|
|
245
|
-
location:
|
|
246
|
-
city?: string | null;
|
|
247
|
-
coordinates?: number[] | null;
|
|
248
|
-
country?: string | null;
|
|
249
|
-
fullAddress?: string | null;
|
|
250
|
-
latitude?: number | null;
|
|
251
|
-
longitude?: number | null;
|
|
252
|
-
region?: string | null;
|
|
253
|
-
type?: "Point" | null;
|
|
254
|
-
} | null;
|
|
247
|
+
location: Nullable<LocationType> | null;
|
|
255
248
|
resourceId?: MapMultiLocation["resourceId"];
|
|
256
249
|
resourceName?: MapMultiLocation["resourceName"];
|
|
257
250
|
resourceType?: MapMultiLocation["resourceType"];
|
|
@@ -395,6 +388,9 @@ interface UserType {
|
|
|
395
388
|
updatedAt: string;
|
|
396
389
|
}
|
|
397
390
|
|
|
391
|
+
type Nullable<T> = {
|
|
392
|
+
[K in keyof T]: T[K] | null | undefined;
|
|
393
|
+
};
|
|
398
394
|
type ResourceImageType = {
|
|
399
395
|
source: string;
|
|
400
396
|
title: string;
|
|
@@ -516,13 +512,10 @@ type DateFormat = "date" | "time" | "datetime";
|
|
|
516
512
|
* @returns formatted string based on display option
|
|
517
513
|
*/
|
|
518
514
|
declare const formatDate: (dateStr: string, display?: DateFormat, timeStr?: string) => string;
|
|
519
|
-
declare const getCurrentAndFutureDates:
|
|
520
|
-
startDate: string;
|
|
521
|
-
startTime: string;
|
|
522
|
-
}[]) => {
|
|
515
|
+
declare const getCurrentAndFutureDates: <T extends {
|
|
523
516
|
startDate: string;
|
|
524
517
|
startTime: string;
|
|
525
|
-
}[];
|
|
518
|
+
}>(dates: T[]) => T[];
|
|
526
519
|
declare const getFutureDatesAfterThreshold: (dates: {
|
|
527
520
|
startDate: string;
|
|
528
521
|
startTime: string;
|
|
@@ -561,13 +554,10 @@ declare const statusOptions: {
|
|
|
561
554
|
* @param dates - The array of date strings to sort.
|
|
562
555
|
* @returns - The sorted array of date strings.
|
|
563
556
|
*/
|
|
564
|
-
declare function sortDatesByProximity
|
|
557
|
+
declare function sortDatesByProximity<T extends {
|
|
565
558
|
startDate: string;
|
|
566
559
|
startTime: string;
|
|
567
|
-
}[]):
|
|
568
|
-
startDate: string;
|
|
569
|
-
startTime: string;
|
|
570
|
-
}[];
|
|
560
|
+
}>(dates: T[]): T[];
|
|
571
561
|
declare const availableRegionTypes: EnumRegions[];
|
|
572
562
|
declare const availableRegionOptions: OptionItem[];
|
|
573
563
|
|
|
@@ -651,11 +641,13 @@ declare const startTimeCannotBeInPastTest: yup.StringSchema<string | undefined,
|
|
|
651
641
|
declare const dateTimeSchema: yup.ObjectSchema<{
|
|
652
642
|
endDate: string;
|
|
653
643
|
endTime: string;
|
|
644
|
+
marketPrice: number;
|
|
654
645
|
startDate: string;
|
|
655
646
|
startTime: string;
|
|
656
647
|
}, yup.AnyObject, {
|
|
657
648
|
endDate: undefined;
|
|
658
649
|
endTime: undefined;
|
|
650
|
+
marketPrice: undefined;
|
|
659
651
|
startDate: undefined;
|
|
660
652
|
startTime: undefined;
|
|
661
653
|
}, "">;
|
|
@@ -714,6 +706,7 @@ declare const marketSchema: yup.ObjectSchema<{
|
|
|
714
706
|
endTime: string;
|
|
715
707
|
startDate: string;
|
|
716
708
|
startTime: string;
|
|
709
|
+
marketPrice: number;
|
|
717
710
|
}[];
|
|
718
711
|
location: {
|
|
719
712
|
region: string;
|
|
@@ -1238,6 +1231,7 @@ declare const paymentMethodOptions: OptionItem[];
|
|
|
1238
1231
|
declare const marketBasicInfoFields: FormField[];
|
|
1239
1232
|
declare const stallApplicationInfo: FormField[];
|
|
1240
1233
|
declare const marketStartDateFields: FormDateField[];
|
|
1234
|
+
declare const marketPriceByDateFields: FormField[];
|
|
1241
1235
|
declare const marketEndDateFields: FormDateField[];
|
|
1242
1236
|
declare const availableTagTypes: string[];
|
|
1243
1237
|
declare const tagOptions: OptionItem[];
|
|
@@ -1254,4 +1248,4 @@ declare const profileFields: FormField[];
|
|
|
1254
1248
|
declare const availableCategories: Category[];
|
|
1255
1249
|
declare const categoryColors: Record<string, string>;
|
|
1256
1250
|
|
|
1257
|
-
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 };
|
|
1251
|
+
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, type DateTimeWithPrice, 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 Nullable, 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, marketPriceByDateFields, 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 };
|
package/dist/index.d.ts
CHANGED
|
@@ -5,9 +5,11 @@ import * as _apollo_client from '@apollo/client';
|
|
|
5
5
|
declare enum EnumInviteStatus {
|
|
6
6
|
ACCEPTED = "ACCEPTED",
|
|
7
7
|
COMPLETED = "COMPLETED",
|
|
8
|
+
EXPIRED = "EXPIRED",
|
|
9
|
+
NO_STATUS = "NO_STATUS",
|
|
8
10
|
PENDING = "PENDING",
|
|
9
11
|
REJECTED = "REJECTED",
|
|
10
|
-
|
|
12
|
+
WAITING = "WAITING"
|
|
11
13
|
}
|
|
12
14
|
declare enum EnumRejectionPolicy {
|
|
13
15
|
SINGLE_DATE_ALLOWED = "single_date_allowed",
|
|
@@ -186,11 +188,13 @@ type RelationLog = {
|
|
|
186
188
|
};
|
|
187
189
|
type RelationDate = {
|
|
188
190
|
lastUpdateBy: string;
|
|
191
|
+
marketPrice: number;
|
|
189
192
|
startDate: string;
|
|
190
193
|
status: EnumInviteStatus;
|
|
191
194
|
};
|
|
192
195
|
interface RelationType {
|
|
193
196
|
_id?: string;
|
|
197
|
+
apiMessage?: string;
|
|
194
198
|
createdAt?: string;
|
|
195
199
|
lastUpdateBy: EnumResourceType;
|
|
196
200
|
marketId: string;
|
|
@@ -201,8 +205,11 @@ interface RelationType {
|
|
|
201
205
|
updatedAt?: string;
|
|
202
206
|
}
|
|
203
207
|
|
|
208
|
+
type DateTimeWithPrice = DateTimeType & {
|
|
209
|
+
marketPrice: number;
|
|
210
|
+
};
|
|
204
211
|
interface MarketFormData extends BaseResourceTypeFormData {
|
|
205
|
-
dateTime:
|
|
212
|
+
dateTime: DateTimeWithPrice[];
|
|
206
213
|
location: LocationType;
|
|
207
214
|
provider: string;
|
|
208
215
|
stallApplicationInfo: {
|
|
@@ -235,23 +242,9 @@ interface MarketWithConnectionDatesType extends MarketType {
|
|
|
235
242
|
}
|
|
236
243
|
|
|
237
244
|
type StallholderLocation = {
|
|
238
|
-
dateTime:
|
|
239
|
-
startDate?: string | null;
|
|
240
|
-
startTime?: string | null;
|
|
241
|
-
endDate?: string | null;
|
|
242
|
-
endTime?: string | null;
|
|
243
|
-
} | null;
|
|
245
|
+
dateTime: Nullable<DateTimeType> | null;
|
|
244
246
|
description?: string | null;
|
|
245
|
-
location:
|
|
246
|
-
city?: string | null;
|
|
247
|
-
coordinates?: number[] | null;
|
|
248
|
-
country?: string | null;
|
|
249
|
-
fullAddress?: string | null;
|
|
250
|
-
latitude?: number | null;
|
|
251
|
-
longitude?: number | null;
|
|
252
|
-
region?: string | null;
|
|
253
|
-
type?: "Point" | null;
|
|
254
|
-
} | null;
|
|
247
|
+
location: Nullable<LocationType> | null;
|
|
255
248
|
resourceId?: MapMultiLocation["resourceId"];
|
|
256
249
|
resourceName?: MapMultiLocation["resourceName"];
|
|
257
250
|
resourceType?: MapMultiLocation["resourceType"];
|
|
@@ -395,6 +388,9 @@ interface UserType {
|
|
|
395
388
|
updatedAt: string;
|
|
396
389
|
}
|
|
397
390
|
|
|
391
|
+
type Nullable<T> = {
|
|
392
|
+
[K in keyof T]: T[K] | null | undefined;
|
|
393
|
+
};
|
|
398
394
|
type ResourceImageType = {
|
|
399
395
|
source: string;
|
|
400
396
|
title: string;
|
|
@@ -516,13 +512,10 @@ type DateFormat = "date" | "time" | "datetime";
|
|
|
516
512
|
* @returns formatted string based on display option
|
|
517
513
|
*/
|
|
518
514
|
declare const formatDate: (dateStr: string, display?: DateFormat, timeStr?: string) => string;
|
|
519
|
-
declare const getCurrentAndFutureDates:
|
|
520
|
-
startDate: string;
|
|
521
|
-
startTime: string;
|
|
522
|
-
}[]) => {
|
|
515
|
+
declare const getCurrentAndFutureDates: <T extends {
|
|
523
516
|
startDate: string;
|
|
524
517
|
startTime: string;
|
|
525
|
-
}[];
|
|
518
|
+
}>(dates: T[]) => T[];
|
|
526
519
|
declare const getFutureDatesAfterThreshold: (dates: {
|
|
527
520
|
startDate: string;
|
|
528
521
|
startTime: string;
|
|
@@ -561,13 +554,10 @@ declare const statusOptions: {
|
|
|
561
554
|
* @param dates - The array of date strings to sort.
|
|
562
555
|
* @returns - The sorted array of date strings.
|
|
563
556
|
*/
|
|
564
|
-
declare function sortDatesByProximity
|
|
557
|
+
declare function sortDatesByProximity<T extends {
|
|
565
558
|
startDate: string;
|
|
566
559
|
startTime: string;
|
|
567
|
-
}[]):
|
|
568
|
-
startDate: string;
|
|
569
|
-
startTime: string;
|
|
570
|
-
}[];
|
|
560
|
+
}>(dates: T[]): T[];
|
|
571
561
|
declare const availableRegionTypes: EnumRegions[];
|
|
572
562
|
declare const availableRegionOptions: OptionItem[];
|
|
573
563
|
|
|
@@ -651,11 +641,13 @@ declare const startTimeCannotBeInPastTest: yup.StringSchema<string | undefined,
|
|
|
651
641
|
declare const dateTimeSchema: yup.ObjectSchema<{
|
|
652
642
|
endDate: string;
|
|
653
643
|
endTime: string;
|
|
644
|
+
marketPrice: number;
|
|
654
645
|
startDate: string;
|
|
655
646
|
startTime: string;
|
|
656
647
|
}, yup.AnyObject, {
|
|
657
648
|
endDate: undefined;
|
|
658
649
|
endTime: undefined;
|
|
650
|
+
marketPrice: undefined;
|
|
659
651
|
startDate: undefined;
|
|
660
652
|
startTime: undefined;
|
|
661
653
|
}, "">;
|
|
@@ -714,6 +706,7 @@ declare const marketSchema: yup.ObjectSchema<{
|
|
|
714
706
|
endTime: string;
|
|
715
707
|
startDate: string;
|
|
716
708
|
startTime: string;
|
|
709
|
+
marketPrice: number;
|
|
717
710
|
}[];
|
|
718
711
|
location: {
|
|
719
712
|
region: string;
|
|
@@ -1238,6 +1231,7 @@ declare const paymentMethodOptions: OptionItem[];
|
|
|
1238
1231
|
declare const marketBasicInfoFields: FormField[];
|
|
1239
1232
|
declare const stallApplicationInfo: FormField[];
|
|
1240
1233
|
declare const marketStartDateFields: FormDateField[];
|
|
1234
|
+
declare const marketPriceByDateFields: FormField[];
|
|
1241
1235
|
declare const marketEndDateFields: FormDateField[];
|
|
1242
1236
|
declare const availableTagTypes: string[];
|
|
1243
1237
|
declare const tagOptions: OptionItem[];
|
|
@@ -1254,4 +1248,4 @@ declare const profileFields: FormField[];
|
|
|
1254
1248
|
declare const availableCategories: Category[];
|
|
1255
1249
|
declare const categoryColors: Record<string, string>;
|
|
1256
1250
|
|
|
1257
|
-
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 };
|
|
1251
|
+
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, type DateTimeWithPrice, 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 Nullable, 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, marketPriceByDateFields, 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 };
|