@timardex/cluemart-shared 1.0.0 → 1.0.1
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 +3 -6
- package/dist/index.d.mts +2 -3
- package/dist/index.d.ts +2 -3
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +3 -5
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.cjs
CHANGED
|
@@ -38,7 +38,6 @@ __export(index_exports, {
|
|
|
38
38
|
EnumResourceTypeIcon: () => EnumResourceTypeIcon,
|
|
39
39
|
EnumUserLicence: () => EnumUserLicence,
|
|
40
40
|
EnumUserRole: () => EnumUserRole,
|
|
41
|
-
GOOGLE_API_KEY: () => GOOGLE_API_KEY,
|
|
42
41
|
ImageTypeEnum: () => ImageTypeEnum,
|
|
43
42
|
availableCategories: () => availableCategories,
|
|
44
43
|
availableCityOptions: () => availableCityOptions,
|
|
@@ -282,7 +281,6 @@ var formatTimestamp = (timestamp) => {
|
|
|
282
281
|
const formattedTime = (0, import_dayjs.default)(timestamp).tz("Pacific/Auckland").format(timeFormat);
|
|
283
282
|
return formatDate(formattedDate, "date");
|
|
284
283
|
};
|
|
285
|
-
var GOOGLE_API_KEY = "AIzaSyC8UkMGkrF6lIInF9yHxaVQQvlN-zqCfMc";
|
|
286
284
|
var defaultRegion = {
|
|
287
285
|
latitude: -36.8624942,
|
|
288
286
|
// Default: New Zealand
|
|
@@ -340,11 +338,11 @@ function sortDatesByProximity(dates) {
|
|
|
340
338
|
var handleApiError = (error, message) => {
|
|
341
339
|
console.error(message, error);
|
|
342
340
|
};
|
|
343
|
-
var useLocationSearch = () => {
|
|
341
|
+
var useLocationSearch = (googleApi) => {
|
|
344
342
|
const getPredictions = async (text) => {
|
|
345
343
|
try {
|
|
346
344
|
const response = await fetch(
|
|
347
|
-
`https://maps.googleapis.com/maps/api/place/autocomplete/json?input=${text}&components=country:nz&key=${
|
|
345
|
+
`https://maps.googleapis.com/maps/api/place/autocomplete/json?input=${text}&components=country:nz&key=${googleApi}`
|
|
348
346
|
);
|
|
349
347
|
if (!response.ok) {
|
|
350
348
|
throw new Error(`HTTP error! Status: ${response.status}`);
|
|
@@ -359,7 +357,7 @@ var useLocationSearch = () => {
|
|
|
359
357
|
const getPlaceDetails = async (placeId) => {
|
|
360
358
|
try {
|
|
361
359
|
const response = await fetch(
|
|
362
|
-
`https://maps.googleapis.com/maps/api/place/details/json?place_id=${placeId}&key=${
|
|
360
|
+
`https://maps.googleapis.com/maps/api/place/details/json?place_id=${placeId}&key=${googleApi}`
|
|
363
361
|
);
|
|
364
362
|
if (!response.ok) {
|
|
365
363
|
throw new Error(`HTTP error! Status: ${response.status}`);
|
|
@@ -3032,7 +3030,6 @@ var categoryColors = {
|
|
|
3032
3030
|
EnumResourceTypeIcon,
|
|
3033
3031
|
EnumUserLicence,
|
|
3034
3032
|
EnumUserRole,
|
|
3035
|
-
GOOGLE_API_KEY,
|
|
3036
3033
|
ImageTypeEnum,
|
|
3037
3034
|
availableCategories,
|
|
3038
3035
|
availableCityOptions,
|
package/dist/index.d.mts
CHANGED
|
@@ -497,7 +497,6 @@ declare const getFutureDatesAfterThreshold: (dates: {
|
|
|
497
497
|
startTime: string;
|
|
498
498
|
}[];
|
|
499
499
|
declare const formatTimestamp: (timestamp: string) => string;
|
|
500
|
-
declare const GOOGLE_API_KEY = "AIzaSyC8UkMGkrF6lIInF9yHxaVQQvlN-zqCfMc";
|
|
501
500
|
declare const defaultRegion: Region;
|
|
502
501
|
/**
|
|
503
502
|
* Function to remove __typename from an object or array of objects.
|
|
@@ -549,7 +548,7 @@ interface UseLocation {
|
|
|
549
548
|
*
|
|
550
549
|
* @returns {UseLocation} - The functions to get predictions and place details.
|
|
551
550
|
*/
|
|
552
|
-
declare const useLocationSearch: () => UseLocation;
|
|
551
|
+
declare const useLocationSearch: (googleApi: string) => UseLocation;
|
|
553
552
|
|
|
554
553
|
/**
|
|
555
554
|
* Custom hook to manage the stallholder form state and validation.
|
|
@@ -1157,4 +1156,4 @@ declare const profileFields: FormField[];
|
|
|
1157
1156
|
declare const availableCategories: Category[];
|
|
1158
1157
|
declare const categoryColors: Record<string, string>;
|
|
1159
1158
|
|
|
1160
|
-
export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type CreateForgotPasswordFormData, type CreateLoginFormData, type CreateMarketFormData, type CreateRegisterFormData, type CreateResetPasswordFormData, type CreateStallholderApplyFormFormData, type CreateStallholderFormData, type CreateUserFormData, type CreateVerifyEmailFormData, type DateTimeType, EnumInviteStatus, EnumRegions, EnumRejectionPolicy, EnumRelationResource, EnumResourceType, EnumResourceTypeIcon, EnumUserLicence, EnumUserRole, type ForgotPasswordFormData, type FormDateField, type FormField,
|
|
1159
|
+
export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type CreateForgotPasswordFormData, type CreateLoginFormData, type CreateMarketFormData, type CreateRegisterFormData, type CreateResetPasswordFormData, type CreateStallholderApplyFormFormData, type CreateStallholderFormData, type CreateUserFormData, type CreateVerifyEmailFormData, type DateTimeType, EnumInviteStatus, EnumRegions, EnumRejectionPolicy, EnumRelationResource, EnumResourceType, EnumResourceTypeIcon, EnumUserLicence, EnumUserRole, type ForgotPasswordFormData, 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 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 VerifyEmailFormData, availableCategories, availableCityOptions, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, dateFormat, dateTimeSchema, defaultMarketFormValues, defaultRegion, defaultStallholderApplyFormValues, defaultStallholderFormValues, emailSchema, endDateAfterStartDateTest, endDateNotInPastTest, endTimeMustBeAfterStartTimeTest, forgotPasswordFields, forgotPasswordSchema, formatDate, formatTimestamp, getCurrentAndFutureDates, getFutureDatesAfterThreshold, globalDefaultValues, globalResourceSchema, locationSchema, loginFields, loginSchema, mapArrayToOptions, marketBasicInfoFields, marketEndDateFields, marketSchema, marketStartDateFields, packagingOptions, passwordSchema, paymentMethodOptions, producedIngOptions, profileFields, registerFields, registerSchema, rejectionPolicyOptions, removeTypename, 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, useAddUserFavouriteResource, useCreateMarket, useCreateRelation, useCreateStallholder, useCreateStallholderApplyForm, useCreateUser, useDeleteMarket, useDeleteRelation, useDeleteStallholder, useForgotPassword, useGetMarket, useGetMarketRelations, useGetMarkets, useGetMarketsByRegion, useGetMarketsNearMe, useGetNotification, useGetRelation, useGetRelationByMarketAndStallholder, useGetResourceConnections, useGetStallholder, useGetStallholderApplyForm, useGetStallholderRelations, useGetStallholders, useGetStallholdersByRegion, useGetUser, useGetUserFavourites, useGetUserMarkets, useGetUserNotifications, useGetUsers, useLocationSearch, useLogin, useLoginForm, useMarketForm, useRegister, useRegisterForm, useRemoveUserFavouriteResource, useSearchMarkets, useSearchStallholders, useStallholderApplyForm, useStallholderForm, useUpdateMarket, useUpdateRelation, useUpdateStallholder, useUpdateStallholderApplyForm, useUpdateUser, useUserForm, useVerifyEmail, userSchema, validateEmailSchema };
|
package/dist/index.d.ts
CHANGED
|
@@ -497,7 +497,6 @@ declare const getFutureDatesAfterThreshold: (dates: {
|
|
|
497
497
|
startTime: string;
|
|
498
498
|
}[];
|
|
499
499
|
declare const formatTimestamp: (timestamp: string) => string;
|
|
500
|
-
declare const GOOGLE_API_KEY = "AIzaSyC8UkMGkrF6lIInF9yHxaVQQvlN-zqCfMc";
|
|
501
500
|
declare const defaultRegion: Region;
|
|
502
501
|
/**
|
|
503
502
|
* Function to remove __typename from an object or array of objects.
|
|
@@ -549,7 +548,7 @@ interface UseLocation {
|
|
|
549
548
|
*
|
|
550
549
|
* @returns {UseLocation} - The functions to get predictions and place details.
|
|
551
550
|
*/
|
|
552
|
-
declare const useLocationSearch: () => UseLocation;
|
|
551
|
+
declare const useLocationSearch: (googleApi: string) => UseLocation;
|
|
553
552
|
|
|
554
553
|
/**
|
|
555
554
|
* Custom hook to manage the stallholder form state and validation.
|
|
@@ -1157,4 +1156,4 @@ declare const profileFields: FormField[];
|
|
|
1157
1156
|
declare const availableCategories: Category[];
|
|
1158
1157
|
declare const categoryColors: Record<string, string>;
|
|
1159
1158
|
|
|
1160
|
-
export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type CreateForgotPasswordFormData, type CreateLoginFormData, type CreateMarketFormData, type CreateRegisterFormData, type CreateResetPasswordFormData, type CreateStallholderApplyFormFormData, type CreateStallholderFormData, type CreateUserFormData, type CreateVerifyEmailFormData, type DateTimeType, EnumInviteStatus, EnumRegions, EnumRejectionPolicy, EnumRelationResource, EnumResourceType, EnumResourceTypeIcon, EnumUserLicence, EnumUserRole, type ForgotPasswordFormData, type FormDateField, type FormField,
|
|
1159
|
+
export { type BaseResourceType, type BaseResourceTypeFormData, type Category, type CreateForgotPasswordFormData, type CreateLoginFormData, type CreateMarketFormData, type CreateRegisterFormData, type CreateResetPasswordFormData, type CreateStallholderApplyFormFormData, type CreateStallholderFormData, type CreateUserFormData, type CreateVerifyEmailFormData, type DateTimeType, EnumInviteStatus, EnumRegions, EnumRejectionPolicy, EnumRelationResource, EnumResourceType, EnumResourceTypeIcon, EnumUserLicence, EnumUserRole, type ForgotPasswordFormData, 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 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 VerifyEmailFormData, availableCategories, availableCityOptions, availableRegionOptions, availableRegionTypes, availableTagTypes, capitalizeFirstLetter, categoryColors, dateFormat, dateTimeSchema, defaultMarketFormValues, defaultRegion, defaultStallholderApplyFormValues, defaultStallholderFormValues, emailSchema, endDateAfterStartDateTest, endDateNotInPastTest, endTimeMustBeAfterStartTimeTest, forgotPasswordFields, forgotPasswordSchema, formatDate, formatTimestamp, getCurrentAndFutureDates, getFutureDatesAfterThreshold, globalDefaultValues, globalResourceSchema, locationSchema, loginFields, loginSchema, mapArrayToOptions, marketBasicInfoFields, marketEndDateFields, marketSchema, marketStartDateFields, packagingOptions, passwordSchema, paymentMethodOptions, producedIngOptions, profileFields, registerFields, registerSchema, rejectionPolicyOptions, removeTypename, 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, useAddUserFavouriteResource, useCreateMarket, useCreateRelation, useCreateStallholder, useCreateStallholderApplyForm, useCreateUser, useDeleteMarket, useDeleteRelation, useDeleteStallholder, useForgotPassword, useGetMarket, useGetMarketRelations, useGetMarkets, useGetMarketsByRegion, useGetMarketsNearMe, useGetNotification, useGetRelation, useGetRelationByMarketAndStallholder, useGetResourceConnections, useGetStallholder, useGetStallholderApplyForm, useGetStallholderRelations, useGetStallholders, useGetStallholdersByRegion, useGetUser, useGetUserFavourites, useGetUserMarkets, useGetUserNotifications, useGetUsers, useLocationSearch, useLogin, useLoginForm, useMarketForm, useRegister, useRegisterForm, useRemoveUserFavouriteResource, useSearchMarkets, useSearchStallholders, useStallholderApplyForm, useStallholderForm, useUpdateMarket, useUpdateRelation, useUpdateStallholder, useUpdateStallholderApplyForm, useUpdateUser, useUserForm, useVerifyEmail, userSchema, validateEmailSchema };
|