@timardex/cluemart-shared 1.4.82 → 1.4.84
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/{chunk-AOPQ64JU.mjs → chunk-4LT5GOOP.mjs} +3 -3
- package/dist/{chunk-RADLC3LV.mjs → chunk-5QOEADCK.mjs} +10 -2
- package/dist/chunk-5QOEADCK.mjs.map +1 -0
- package/dist/{chunk-T6D7HTHH.mjs → chunk-BXV7NUGQ.mjs} +94 -87
- package/dist/chunk-BXV7NUGQ.mjs.map +1 -0
- package/dist/{chunk-2VZKL2X6.mjs → chunk-KYDS4REE.mjs} +2 -2
- package/dist/{chunk-VE6JFCH2.mjs → chunk-USQKKCIA.mjs} +2 -8
- package/dist/{chunk-VE6JFCH2.mjs.map → chunk-USQKKCIA.mjs.map} +1 -1
- package/dist/enums/index.cjs +0 -7
- package/dist/enums/index.cjs.map +1 -1
- package/dist/enums/index.d.mts +1 -5
- package/dist/enums/index.d.ts +1 -5
- package/dist/enums/index.mjs +1 -3
- package/dist/formFields/index.cjs.map +1 -1
- package/dist/formFields/index.mjs +3 -3
- package/dist/graphql/index.cjs +107 -100
- package/dist/graphql/index.cjs.map +1 -1
- package/dist/graphql/index.d.mts +2 -2
- package/dist/graphql/index.d.ts +2 -2
- package/dist/graphql/index.mjs +2 -2
- package/dist/hooks/index.cjs +97 -90
- package/dist/hooks/index.cjs.map +1 -1
- package/dist/hooks/index.d.mts +1 -1
- package/dist/hooks/index.d.ts +1 -1
- package/dist/hooks/index.mjs +5 -5
- package/dist/index.cjs +114 -105
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +31 -32
- package/dist/index.d.ts +31 -32
- package/dist/index.mjs +100 -91
- package/dist/index.mjs.map +1 -1
- package/dist/{post-Bf1vI1ev.d.mts → post-Ca1JIE74.d.ts} +33 -11
- package/dist/{post-BBT1GXKC.d.ts → post-Dh2m6dzT.d.mts} +33 -11
- package/dist/{resourceActivities-BqRajS8s.d.ts → resourceActivities-2FaGRW-i.d.ts} +2 -21
- package/dist/{resourceActivities-Bvu7XDKv.d.mts → resourceActivities-CqrscA5x.d.mts} +2 -21
- package/dist/types/index.cjs +9 -0
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +2 -2
- package/dist/types/index.d.ts +2 -2
- package/dist/types/index.mjs +3 -1
- package/dist/utils/index.cjs.map +1 -1
- package/dist/utils/index.mjs +2 -2
- package/package.json +1 -1
- package/dist/chunk-RADLC3LV.mjs.map +0 -1
- package/dist/chunk-T6D7HTHH.mjs.map +0 -1
- /package/dist/{chunk-AOPQ64JU.mjs.map → chunk-4LT5GOOP.mjs.map} +0 -0
- /package/dist/{chunk-2VZKL2X6.mjs.map → chunk-KYDS4REE.mjs.map} +0 -0
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EnumUserLicence, EnumSubscriptionStatus, EnumOSPlatform, EnumUserRole, EnumResourceType, EnumPartnerType
|
|
2
|
-
import { A as AssociateType, Q as ResourceImageType, h as UserLicenceType, Y as TermsAgreement, D as DateTimeType, s as CreateFormData, r as BaseResourceType, L as LocationType, B as BaseResourceTypeFormData } from './global-
|
|
1
|
+
import { EnumUserLicence, EnumSubscriptionStatus, EnumOSPlatform, EnumUserRole, EnumResourceType, EnumPartnerType } from './enums/index.js';
|
|
2
|
+
import { A as AssociateType, Q as ResourceImageType, h as UserLicenceType, Y as TermsAgreement, D as DateTimeType, s as CreateFormData, r as BaseResourceType, L as LocationType, B as BaseResourceTypeFormData, y as OwnerType } from './global-B0WdAD-8.js';
|
|
3
3
|
|
|
4
4
|
type UserFormData = {
|
|
5
5
|
_id?: string;
|
|
@@ -137,6 +137,35 @@ type AppSettingsType = AppSettingsFormData & {
|
|
|
137
137
|
updatedAt: Date | null;
|
|
138
138
|
};
|
|
139
139
|
|
|
140
|
+
declare enum EnumGameType {
|
|
141
|
+
DAILY_CLUE = "daily_clue",
|
|
142
|
+
DAILY_REWARD = "daily_reward"
|
|
143
|
+
}
|
|
144
|
+
type BaseGame = {
|
|
145
|
+
gameDate: DateTimeType;
|
|
146
|
+
gameSolution: string;
|
|
147
|
+
gameType: EnumGameType;
|
|
148
|
+
title: string;
|
|
149
|
+
};
|
|
150
|
+
type DailyClueGameData = BaseGame & {
|
|
151
|
+
collectedLetters?: string[];
|
|
152
|
+
lastFoundDate?: string | null;
|
|
153
|
+
points: number;
|
|
154
|
+
streak: number;
|
|
155
|
+
};
|
|
156
|
+
type GameData = {
|
|
157
|
+
dailyClue?: DailyClueGameData | null;
|
|
158
|
+
};
|
|
159
|
+
type GameType = {
|
|
160
|
+
_id: string;
|
|
161
|
+
active: boolean;
|
|
162
|
+
createdAt: Date;
|
|
163
|
+
deletedAt: Date | null;
|
|
164
|
+
gameData: GameData | null;
|
|
165
|
+
updatedAt: Date | null;
|
|
166
|
+
owner: OwnerType;
|
|
167
|
+
};
|
|
168
|
+
|
|
140
169
|
declare enum EnumAdShowOn {
|
|
141
170
|
EVENTS_PAGE = "Events_page",
|
|
142
171
|
FRONT_PAGE = "Front_page",
|
|
@@ -227,14 +256,7 @@ type PostContentList = {
|
|
|
227
256
|
};
|
|
228
257
|
};
|
|
229
258
|
type PostContentGame = {
|
|
230
|
-
game:
|
|
231
|
-
title: string;
|
|
232
|
-
gameType: EnumGameType;
|
|
233
|
-
gameInfo: {
|
|
234
|
-
dailyClue?: string | null;
|
|
235
|
-
};
|
|
236
|
-
gameEndDate: string;
|
|
237
|
-
};
|
|
259
|
+
game: BaseGame;
|
|
238
260
|
};
|
|
239
261
|
type PostContentData = PostContentGame | PostContentTextarea | PostContentImage | PostContentVideo | PostContentList;
|
|
240
262
|
type PostContentFormData = {
|
|
@@ -268,4 +290,4 @@ type PostType = Omit<PostFormData, "content" | "coverUpload"> & {
|
|
|
268
290
|
updatedAt: Date | null;
|
|
269
291
|
};
|
|
270
292
|
|
|
271
|
-
export { type AdType as A, type
|
|
293
|
+
export { type AdType as A, type BaseGame as B, type CreateUserFormData as C, type DailyClueGameData as D, EnumAdStatus as E, type PostContentType as F, type GameType as G, type PostContentVideo as H, type PostFileInput as I, type StripeSubscription as J, type SubscriptionPlanData as K, type SubscriptionPricingData as L, type UserActivity as M, type UserActivityEvent as N, type PartnerType as P, type ResourceByUser as R, type SubscriptionPlansResponse as S, type UserType as U, type SubscriptionStatusData as a, type PostType as b, EnumPostType as c, type AppSettingsType as d, type UserFormData as e, type PartnerFormData as f, type AdFormData as g, type CreateAdFormData as h, type CreatePartnerFormData as i, type PostFormData as j, type CreatePostFormData as k, type AppSettingsFormData as l, type CreateAppSettingsFormData as m, type AdResource as n, EnumAdShowOn as o, EnumAdStyle as p, EnumAdType as q, EnumGameType as r, EnumPostContentType as s, type GameData as t, type PostContentData as u, type PostContentFormData as v, type PostContentGame as w, type PostContentImage as x, type PostContentList as y, type PostContentTextarea as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
|
-
import { EnumUserLicence, EnumSubscriptionStatus, EnumOSPlatform, EnumUserRole, EnumResourceType, EnumPartnerType
|
|
2
|
-
import { A as AssociateType, Q as ResourceImageType, h as UserLicenceType, Y as TermsAgreement, D as DateTimeType, s as CreateFormData, r as BaseResourceType, L as LocationType, B as BaseResourceTypeFormData } from './global-
|
|
1
|
+
import { EnumUserLicence, EnumSubscriptionStatus, EnumOSPlatform, EnumUserRole, EnumResourceType, EnumPartnerType } from './enums/index.mjs';
|
|
2
|
+
import { A as AssociateType, Q as ResourceImageType, h as UserLicenceType, Y as TermsAgreement, D as DateTimeType, s as CreateFormData, r as BaseResourceType, L as LocationType, B as BaseResourceTypeFormData, y as OwnerType } from './global-MMBYi34A.mjs';
|
|
3
3
|
|
|
4
4
|
type UserFormData = {
|
|
5
5
|
_id?: string;
|
|
@@ -137,6 +137,35 @@ type AppSettingsType = AppSettingsFormData & {
|
|
|
137
137
|
updatedAt: Date | null;
|
|
138
138
|
};
|
|
139
139
|
|
|
140
|
+
declare enum EnumGameType {
|
|
141
|
+
DAILY_CLUE = "daily_clue",
|
|
142
|
+
DAILY_REWARD = "daily_reward"
|
|
143
|
+
}
|
|
144
|
+
type BaseGame = {
|
|
145
|
+
gameDate: DateTimeType;
|
|
146
|
+
gameSolution: string;
|
|
147
|
+
gameType: EnumGameType;
|
|
148
|
+
title: string;
|
|
149
|
+
};
|
|
150
|
+
type DailyClueGameData = BaseGame & {
|
|
151
|
+
collectedLetters?: string[];
|
|
152
|
+
lastFoundDate?: string | null;
|
|
153
|
+
points: number;
|
|
154
|
+
streak: number;
|
|
155
|
+
};
|
|
156
|
+
type GameData = {
|
|
157
|
+
dailyClue?: DailyClueGameData | null;
|
|
158
|
+
};
|
|
159
|
+
type GameType = {
|
|
160
|
+
_id: string;
|
|
161
|
+
active: boolean;
|
|
162
|
+
createdAt: Date;
|
|
163
|
+
deletedAt: Date | null;
|
|
164
|
+
gameData: GameData | null;
|
|
165
|
+
updatedAt: Date | null;
|
|
166
|
+
owner: OwnerType;
|
|
167
|
+
};
|
|
168
|
+
|
|
140
169
|
declare enum EnumAdShowOn {
|
|
141
170
|
EVENTS_PAGE = "Events_page",
|
|
142
171
|
FRONT_PAGE = "Front_page",
|
|
@@ -227,14 +256,7 @@ type PostContentList = {
|
|
|
227
256
|
};
|
|
228
257
|
};
|
|
229
258
|
type PostContentGame = {
|
|
230
|
-
game:
|
|
231
|
-
title: string;
|
|
232
|
-
gameType: EnumGameType;
|
|
233
|
-
gameInfo: {
|
|
234
|
-
dailyClue?: string | null;
|
|
235
|
-
};
|
|
236
|
-
gameEndDate: string;
|
|
237
|
-
};
|
|
259
|
+
game: BaseGame;
|
|
238
260
|
};
|
|
239
261
|
type PostContentData = PostContentGame | PostContentTextarea | PostContentImage | PostContentVideo | PostContentList;
|
|
240
262
|
type PostContentFormData = {
|
|
@@ -268,4 +290,4 @@ type PostType = Omit<PostFormData, "content" | "coverUpload"> & {
|
|
|
268
290
|
updatedAt: Date | null;
|
|
269
291
|
};
|
|
270
292
|
|
|
271
|
-
export { type AdType as A, type
|
|
293
|
+
export { type AdType as A, type BaseGame as B, type CreateUserFormData as C, type DailyClueGameData as D, EnumAdStatus as E, type PostContentType as F, type GameType as G, type PostContentVideo as H, type PostFileInput as I, type StripeSubscription as J, type SubscriptionPlanData as K, type SubscriptionPricingData as L, type UserActivity as M, type UserActivityEvent as N, type PartnerType as P, type ResourceByUser as R, type SubscriptionPlansResponse as S, type UserType as U, type SubscriptionStatusData as a, type PostType as b, EnumPostType as c, type AppSettingsType as d, type UserFormData as e, type PartnerFormData as f, type AdFormData as g, type CreateAdFormData as h, type CreatePartnerFormData as i, type PostFormData as j, type CreatePostFormData as k, type AppSettingsFormData as l, type CreateAppSettingsFormData as m, type AdResource as n, EnumAdShowOn as o, EnumAdStyle as p, EnumAdType as q, EnumGameType as r, EnumPostContentType as s, type GameData as t, type PostContentData as u, type PostContentFormData as v, type PostContentGame as w, type PostContentImage as x, type PostContentList as y, type PostContentTextarea as z };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EnumChatType, EnumChatReportReason, EnumNotificationType, EnumNotificationResourceType, EnumResourceType, EnumEventDateStatus, EnumOSPlatform } from './enums/index.js';
|
|
2
|
-
import {
|
|
2
|
+
import { x as LocationGeoType } from './global-B0WdAD-8.js';
|
|
3
3
|
|
|
4
4
|
type ParticipantType = {
|
|
5
5
|
active: boolean;
|
|
@@ -64,25 +64,6 @@ interface ReportChatUser {
|
|
|
64
64
|
updatedAt: Date | null;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
type DailyClueGameData = {
|
|
68
|
-
lastFoundDate: string;
|
|
69
|
-
streak: number;
|
|
70
|
-
points: number;
|
|
71
|
-
collectedLetters?: string[];
|
|
72
|
-
gameEndDate: string;
|
|
73
|
-
};
|
|
74
|
-
type GameType = {
|
|
75
|
-
_id: string;
|
|
76
|
-
active: boolean;
|
|
77
|
-
createdAt: Date;
|
|
78
|
-
deletedAt: Date | null;
|
|
79
|
-
gameData: {
|
|
80
|
-
dailyClue?: DailyClueGameData | null;
|
|
81
|
-
} | null;
|
|
82
|
-
updatedAt: Date | null;
|
|
83
|
-
owner: OwnerType;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
67
|
interface NotificationDataType {
|
|
87
68
|
resourceId: string;
|
|
88
69
|
resourceName: string;
|
|
@@ -140,4 +121,4 @@ type ResourceActivityInputType = {
|
|
|
140
121
|
activity: Omit<ResourceActivityEntry, "timestamp">;
|
|
141
122
|
};
|
|
142
123
|
|
|
143
|
-
export { type ChatType as C,
|
|
124
|
+
export { type ChatType as C, EnumActivity as E, type NotificationCount as N, type ParticipantType as P, type ReportChatUser as R, type NotificationType as a, type ResourceActivityType as b, type ChatMessageInput as c, type ChatMessageReaction as d, type ChatMessageReplyPreview as e, type ChatMessageSeen as f, type ChatMessageType as g, type CreateBulkNotificationInput as h, type NotificationDataType as i, type ResourceActivityEntry as j, type ResourceActivityInputType as k };
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { EnumChatType, EnumChatReportReason, EnumNotificationType, EnumNotificationResourceType, EnumResourceType, EnumEventDateStatus, EnumOSPlatform } from './enums/index.mjs';
|
|
2
|
-
import {
|
|
2
|
+
import { x as LocationGeoType } from './global-MMBYi34A.mjs';
|
|
3
3
|
|
|
4
4
|
type ParticipantType = {
|
|
5
5
|
active: boolean;
|
|
@@ -64,25 +64,6 @@ interface ReportChatUser {
|
|
|
64
64
|
updatedAt: Date | null;
|
|
65
65
|
}
|
|
66
66
|
|
|
67
|
-
type DailyClueGameData = {
|
|
68
|
-
lastFoundDate: string;
|
|
69
|
-
streak: number;
|
|
70
|
-
points: number;
|
|
71
|
-
collectedLetters?: string[];
|
|
72
|
-
gameEndDate: string;
|
|
73
|
-
};
|
|
74
|
-
type GameType = {
|
|
75
|
-
_id: string;
|
|
76
|
-
active: boolean;
|
|
77
|
-
createdAt: Date;
|
|
78
|
-
deletedAt: Date | null;
|
|
79
|
-
gameData: {
|
|
80
|
-
dailyClue?: DailyClueGameData | null;
|
|
81
|
-
} | null;
|
|
82
|
-
updatedAt: Date | null;
|
|
83
|
-
owner: OwnerType;
|
|
84
|
-
};
|
|
85
|
-
|
|
86
67
|
interface NotificationDataType {
|
|
87
68
|
resourceId: string;
|
|
88
69
|
resourceName: string;
|
|
@@ -140,4 +121,4 @@ type ResourceActivityInputType = {
|
|
|
140
121
|
activity: Omit<ResourceActivityEntry, "timestamp">;
|
|
141
122
|
};
|
|
142
123
|
|
|
143
|
-
export { type ChatType as C,
|
|
124
|
+
export { type ChatType as C, EnumActivity as E, type NotificationCount as N, type ParticipantType as P, type ReportChatUser as R, type NotificationType as a, type ResourceActivityType as b, type ChatMessageInput as c, type ChatMessageReaction as d, type ChatMessageReplyPreview as e, type ChatMessageSeen as f, type ChatMessageType as g, type CreateBulkNotificationInput as h, type NotificationDataType as i, type ResourceActivityEntry as j, type ResourceActivityInputType as k };
|
package/dist/types/index.cjs
CHANGED
|
@@ -25,6 +25,7 @@ __export(types_exports, {
|
|
|
25
25
|
EnumAdStatus: () => EnumAdStatus,
|
|
26
26
|
EnumAdStyle: () => EnumAdStyle,
|
|
27
27
|
EnumAdType: () => EnumAdType,
|
|
28
|
+
EnumGameType: () => EnumGameType,
|
|
28
29
|
EnumPostContentType: () => EnumPostContentType,
|
|
29
30
|
EnumPostType: () => EnumPostType,
|
|
30
31
|
EnumVerificationType: () => EnumVerificationType
|
|
@@ -88,6 +89,13 @@ var EnumPostContentType = /* @__PURE__ */ ((EnumPostContentType2) => {
|
|
|
88
89
|
EnumPostContentType2["VIDEO"] = "video";
|
|
89
90
|
return EnumPostContentType2;
|
|
90
91
|
})(EnumPostContentType || {});
|
|
92
|
+
|
|
93
|
+
// src/types/game.ts
|
|
94
|
+
var EnumGameType = /* @__PURE__ */ ((EnumGameType2) => {
|
|
95
|
+
EnumGameType2["DAILY_CLUE"] = "daily_clue";
|
|
96
|
+
EnumGameType2["DAILY_REWARD"] = "daily_reward";
|
|
97
|
+
return EnumGameType2;
|
|
98
|
+
})(EnumGameType || {});
|
|
91
99
|
// Annotate the CommonJS export names for ESM import in node:
|
|
92
100
|
0 && (module.exports = {
|
|
93
101
|
EnumActivity,
|
|
@@ -95,6 +103,7 @@ var EnumPostContentType = /* @__PURE__ */ ((EnumPostContentType2) => {
|
|
|
95
103
|
EnumAdStatus,
|
|
96
104
|
EnumAdStyle,
|
|
97
105
|
EnumAdType,
|
|
106
|
+
EnumGameType,
|
|
98
107
|
EnumPostContentType,
|
|
99
108
|
EnumPostType,
|
|
100
109
|
EnumVerificationType
|
package/dist/types/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/index.ts","../../src/types/auth.ts","../../src/types/ad.ts","../../src/types/resourceActivities.ts","../../src/types/post.ts"],"sourcesContent":["export * from \"./admin\";\nexport * from \"./auth\";\nexport * from \"./chat\";\nexport * from \"./contactUs\";\nexport * from \"./global\";\nexport * from \"./event\";\nexport * from \"./notification\";\nexport * from \"./poster\";\nexport * from \"./relation\";\nexport * from \"./vendor\";\nexport * from \"./user\";\nexport * from \"./ad\";\nexport * from \"./resourceActivities\";\nexport * from \"./partner\";\nexport * from \"./post\";\nexport * from \"./appSettings\";\nexport * from \"./googleImportedMarket\";\nexport * from \"./game\";\n","import { CreateFormData, EnumOSPlatform, TermsAgreement } from \"src\";\n\nexport enum EnumVerificationType {\n REGISTER = \"register\",\n RESET_PASSWORD = \"resetPassword\",\n}\n\nexport type LoginFormData = {\n email: string;\n isAdminPage?: boolean;\n password: string;\n platform?: EnumOSPlatform;\n};\n\nexport type CreateLoginFormData = CreateFormData<LoginFormData>;\n\nexport type RegisterFormData = {\n email: string;\n firstName: string;\n lastName: string;\n password: string;\n platform?: EnumOSPlatform;\n preferredRegion: string;\n promoCode?: string | null;\n termsAgreement?: TermsAgreement | null;\n};\n\nexport type CreateRegisterFormData = CreateFormData<RegisterFormData>;\n\nexport type RequestPasswordResetFormData = {\n email: string;\n};\n\nexport type CreateRequestPasswordResetFormData =\n CreateFormData<RequestPasswordResetFormData>;\n\nexport type ResetPasswordFormData = {\n confirmPassword: string;\n email: string;\n password: string;\n};\n\nexport type CreateResetPasswordFormData = CreateFormData<ResetPasswordFormData>;\n\nexport type ValidateVerificationTokenFormData = {\n email: string;\n verificationToken: string;\n verificationType?: EnumVerificationType;\n};\n\nexport type CreateValidateVerificationTokenFormData =\n CreateFormData<ValidateVerificationTokenFormData>;\n","import { EnumResourceType } from \"src/enums\";\n\nimport { CreateFormData, SocialMediaType } from \"./global\";\n\nexport enum EnumAdShowOn {\n EVENTS_PAGE = \"Events_page\",\n FRONT_PAGE = \"Front_page\",\n PARTNERS_PAGE = \"Partners_page\",\n VENDORS_PAGE = \"Vendors_page\",\n}\n\nexport enum EnumAdStatus {\n ACTIVE = \"Active\",\n PAUSED = \"Paused\",\n EXPIRED = \"Expired\",\n}\n\nexport enum EnumAdType {\n SPONSORED = \"Sponsored\",\n FREE = \"Free\",\n}\n\nexport enum EnumAdStyle {\n BLOOM = \"Bloom\",\n RISE = \"Rise\",\n}\n\nexport type AdResource = {\n adDescription: string | null;\n adImage: string | null;\n adStyle: EnumAdStyle | null;\n adTitle: string | null;\n adType: EnumAdType | null;\n resourceId: string | null;\n resourceName: string | null;\n resourceRegion: string | null;\n resourceType: EnumResourceType | null;\n};\n\nexport interface AdFormData {\n active: boolean;\n end: Date; // ISO date string\n resource: AdResource;\n showOn: EnumAdShowOn[];\n start?: Date; // ISO date string\n status: EnumAdStatus;\n targetRegion: string[];\n}\n\nexport type CreateAdFormData = CreateFormData<AdFormData>;\n\nexport interface AdType extends AdFormData {\n _id: string;\n clicks?: number; // How many times the ad was clicked\n createdAt: Date;\n impressions?: number; // How often the ad was seen\n start: Date; // ISO date string\n updatedAt: Date | null;\n}\n","import {\n EnumEventDateStatus,\n EnumOSPlatform,\n EnumResourceType,\n} from \"src/enums\";\n\nimport { LocationGeoType } from \"./global\";\n\nexport enum EnumActivity {\n FAVORITE = \"FAVORITE\",\n GOING = \"GOING\",\n INTERESTED = \"INTERESTED\",\n PRESENT = \"PRESENT\",\n VIEW = \"VIEW\",\n}\n\nexport type ResourceActivityEntry = {\n activityType: EnumActivity;\n location: LocationGeoType | null;\n dateStatus?: EnumEventDateStatus | null;\n startDate?: string | null;\n startTime?: string | null;\n timestamp: Date;\n userAgent: EnumOSPlatform;\n userId?: string | null;\n};\n\nexport type ResourceActivityType = {\n _id: string;\n resourceType: EnumResourceType;\n resourceId: string;\n activity: ResourceActivityEntry[];\n};\n\nexport type ResourceActivityInputType = {\n resourceId: string;\n resourceType: EnumResourceType;\n activity: Omit<ResourceActivityEntry, \"timestamp\">;\n};\n","import {
|
|
1
|
+
{"version":3,"sources":["../../src/types/index.ts","../../src/types/auth.ts","../../src/types/ad.ts","../../src/types/resourceActivities.ts","../../src/types/post.ts","../../src/types/game.ts"],"sourcesContent":["export * from \"./admin\";\nexport * from \"./auth\";\nexport * from \"./chat\";\nexport * from \"./contactUs\";\nexport * from \"./global\";\nexport * from \"./event\";\nexport * from \"./notification\";\nexport * from \"./poster\";\nexport * from \"./relation\";\nexport * from \"./vendor\";\nexport * from \"./user\";\nexport * from \"./ad\";\nexport * from \"./resourceActivities\";\nexport * from \"./partner\";\nexport * from \"./post\";\nexport * from \"./appSettings\";\nexport * from \"./googleImportedMarket\";\nexport * from \"./game\";\n","import { CreateFormData, EnumOSPlatform, TermsAgreement } from \"src\";\n\nexport enum EnumVerificationType {\n REGISTER = \"register\",\n RESET_PASSWORD = \"resetPassword\",\n}\n\nexport type LoginFormData = {\n email: string;\n isAdminPage?: boolean;\n password: string;\n platform?: EnumOSPlatform;\n};\n\nexport type CreateLoginFormData = CreateFormData<LoginFormData>;\n\nexport type RegisterFormData = {\n email: string;\n firstName: string;\n lastName: string;\n password: string;\n platform?: EnumOSPlatform;\n preferredRegion: string;\n promoCode?: string | null;\n termsAgreement?: TermsAgreement | null;\n};\n\nexport type CreateRegisterFormData = CreateFormData<RegisterFormData>;\n\nexport type RequestPasswordResetFormData = {\n email: string;\n};\n\nexport type CreateRequestPasswordResetFormData =\n CreateFormData<RequestPasswordResetFormData>;\n\nexport type ResetPasswordFormData = {\n confirmPassword: string;\n email: string;\n password: string;\n};\n\nexport type CreateResetPasswordFormData = CreateFormData<ResetPasswordFormData>;\n\nexport type ValidateVerificationTokenFormData = {\n email: string;\n verificationToken: string;\n verificationType?: EnumVerificationType;\n};\n\nexport type CreateValidateVerificationTokenFormData =\n CreateFormData<ValidateVerificationTokenFormData>;\n","import { EnumResourceType } from \"src/enums\";\n\nimport { CreateFormData, SocialMediaType } from \"./global\";\n\nexport enum EnumAdShowOn {\n EVENTS_PAGE = \"Events_page\",\n FRONT_PAGE = \"Front_page\",\n PARTNERS_PAGE = \"Partners_page\",\n VENDORS_PAGE = \"Vendors_page\",\n}\n\nexport enum EnumAdStatus {\n ACTIVE = \"Active\",\n PAUSED = \"Paused\",\n EXPIRED = \"Expired\",\n}\n\nexport enum EnumAdType {\n SPONSORED = \"Sponsored\",\n FREE = \"Free\",\n}\n\nexport enum EnumAdStyle {\n BLOOM = \"Bloom\",\n RISE = \"Rise\",\n}\n\nexport type AdResource = {\n adDescription: string | null;\n adImage: string | null;\n adStyle: EnumAdStyle | null;\n adTitle: string | null;\n adType: EnumAdType | null;\n resourceId: string | null;\n resourceName: string | null;\n resourceRegion: string | null;\n resourceType: EnumResourceType | null;\n};\n\nexport interface AdFormData {\n active: boolean;\n end: Date; // ISO date string\n resource: AdResource;\n showOn: EnumAdShowOn[];\n start?: Date; // ISO date string\n status: EnumAdStatus;\n targetRegion: string[];\n}\n\nexport type CreateAdFormData = CreateFormData<AdFormData>;\n\nexport interface AdType extends AdFormData {\n _id: string;\n clicks?: number; // How many times the ad was clicked\n createdAt: Date;\n impressions?: number; // How often the ad was seen\n start: Date; // ISO date string\n updatedAt: Date | null;\n}\n","import {\n EnumEventDateStatus,\n EnumOSPlatform,\n EnumResourceType,\n} from \"src/enums\";\n\nimport { LocationGeoType } from \"./global\";\n\nexport enum EnumActivity {\n FAVORITE = \"FAVORITE\",\n GOING = \"GOING\",\n INTERESTED = \"INTERESTED\",\n PRESENT = \"PRESENT\",\n VIEW = \"VIEW\",\n}\n\nexport type ResourceActivityEntry = {\n activityType: EnumActivity;\n location: LocationGeoType | null;\n dateStatus?: EnumEventDateStatus | null;\n startDate?: string | null;\n startTime?: string | null;\n timestamp: Date;\n userAgent: EnumOSPlatform;\n userId?: string | null;\n};\n\nexport type ResourceActivityType = {\n _id: string;\n resourceType: EnumResourceType;\n resourceId: string;\n activity: ResourceActivityEntry[];\n};\n\nexport type ResourceActivityInputType = {\n resourceId: string;\n resourceType: EnumResourceType;\n activity: Omit<ResourceActivityEntry, \"timestamp\">;\n};\n","import { EnumResourceType } from \"src/enums\";\n\nimport { BaseGame } from \"./game\";\nimport { CreateFormData, ResourceImageType } from \"./global\";\n\nexport enum EnumPostType {\n DAILY_MEETS = \"daily_meets\",\n DAILY_TIPS = \"daily_tips\",\n DAILY_GAMES = \"daily_games\",\n}\n\nexport enum EnumPostContentType {\n GAME = \"game\",\n IMAGE = \"image\",\n LIST = \"list\",\n TEXTAREA = \"textarea\",\n VIDEO = \"video\",\n}\n\nexport type PostFileInput = {\n source: File;\n title?: string;\n};\n\nexport type PostContentTextarea = {\n textarea: {\n title?: string;\n data: string;\n };\n};\n\nexport type PostContentImage = {\n images: ResourceImageType[] | null;\n imagesUpload?: PostFileInput[] | null;\n};\n\nexport type PostContentVideo = {\n video: {\n source: string;\n title?: string;\n };\n};\n\nexport type PostContentList = {\n list: {\n title?: string;\n items: {\n text: string;\n }[];\n };\n};\n\nexport type PostContentGame = {\n game: BaseGame;\n};\n\nexport type PostContentData =\n | PostContentGame\n | PostContentTextarea\n | PostContentImage\n | PostContentVideo\n | PostContentList;\n\nexport type PostContentFormData = {\n contentData?: PostContentData | null;\n contentOrder?: number | null;\n contentType?: EnumPostContentType | null;\n};\n\nexport interface PostFormData {\n active: boolean;\n caption: string;\n content: PostContentFormData[];\n cover?: ResourceImageType | null;\n coverUpload?: PostFileInput | null;\n postType: EnumPostType;\n resource?: {\n resourceId: string;\n resourceType: EnumResourceType;\n } | null;\n tags?: string[] | null;\n title: string;\n}\n\nexport type CreatePostFormData = CreateFormData<PostFormData>;\n\nexport type PostContentType = Omit<PostContentFormData, \"contentData\"> & {\n contentData: Omit<PostContentData, \"imagesUpload\">;\n};\n\nexport type PostType = Omit<PostFormData, \"content\" | \"coverUpload\"> & {\n _id: string;\n content: PostContentType[];\n createdAt: Date;\n deletedAt: Date | null;\n updatedAt: Date | null;\n};\n","import { DateTimeType, OwnerType } from \"./global\";\n\nexport enum EnumGameType {\n DAILY_CLUE = \"daily_clue\",\n DAILY_REWARD = \"daily_reward\",\n}\n\nexport type BaseGame = {\n gameDate: DateTimeType;\n gameSolution: string;\n gameType: EnumGameType;\n title: string;\n};\n\nexport type DailyClueGameData = BaseGame & {\n collectedLetters?: string[]; // Tracks which letters the user has found, e.g. [\"C\", \"L\", \"U\"]\n lastFoundDate?: string | null; // \"YYYY-MM-DD\" Stores the last day the user found the character\n points: number; // Total points earned from the game\n streak: number; // User has found the clue 3 days in a row, this is incrementing if the user finds the clue and decrements if user misses a day\n};\n\nexport type GameData = {\n dailyClue?: DailyClueGameData | null;\n};\n\nexport type GameType = {\n _id: string;\n active: boolean;\n createdAt: Date;\n deletedAt: Date | null;\n gameData: GameData | null;\n updatedAt: Date | null;\n owner: OwnerType;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;ACEO,IAAK,uBAAL,kBAAKA,0BAAL;AACL,EAAAA,sBAAA,cAAW;AACX,EAAAA,sBAAA,oBAAiB;AAFP,SAAAA;AAAA,GAAA;;;ACEL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,iBAAc;AACd,EAAAA,cAAA,gBAAa;AACb,EAAAA,cAAA,mBAAgB;AAChB,EAAAA,cAAA,kBAAe;AAJL,SAAAA;AAAA,GAAA;AAOL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,aAAU;AAHA,SAAAA;AAAA,GAAA;AAML,IAAK,aAAL,kBAAKC,gBAAL;AACL,EAAAA,YAAA,eAAY;AACZ,EAAAA,YAAA,UAAO;AAFG,SAAAA;AAAA,GAAA;AAKL,IAAK,cAAL,kBAAKC,iBAAL;AACL,EAAAA,aAAA,WAAQ;AACR,EAAAA,aAAA,UAAO;AAFG,SAAAA;AAAA,GAAA;;;ACdL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,WAAQ;AACR,EAAAA,cAAA,gBAAa;AACb,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,UAAO;AALG,SAAAA;AAAA,GAAA;;;ACHL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,iBAAc;AACd,EAAAA,cAAA,gBAAa;AACb,EAAAA,cAAA,iBAAc;AAHJ,SAAAA;AAAA,GAAA;AAML,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,WAAQ;AACR,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,cAAW;AACX,EAAAA,qBAAA,WAAQ;AALE,SAAAA;AAAA,GAAA;;;ACTL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,gBAAa;AACb,EAAAA,cAAA,kBAAe;AAFL,SAAAA;AAAA,GAAA;","names":["EnumVerificationType","EnumAdShowOn","EnumAdStatus","EnumAdType","EnumAdStyle","EnumActivity","EnumPostType","EnumPostContentType","EnumGameType"]}
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EnumResourceType } from '../enums/index.mjs';
|
|
2
2
|
export { e as ContactUsFormData, f as CreateContactUsFormData, C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, d as CreateResetPasswordFormData, c as CreateValidateVerificationTokenFormData, E as EnumVerificationType, L as LoginFormData, R as RegisterFormData, g as RequestPasswordResetFormData, h as ResetPasswordFormData, V as ValidateVerificationTokenFormData } from '../auth-DtPfNKc4.mjs';
|
|
3
|
-
export { c as ChatMessageInput, d as ChatMessageReaction, e as ChatMessageReplyPreview, f as ChatMessageSeen, g as ChatMessageType, C as ChatType, h as CreateBulkNotificationInput,
|
|
3
|
+
export { c as ChatMessageInput, d as ChatMessageReaction, e as ChatMessageReplyPreview, f as ChatMessageSeen, g as ChatMessageType, C as ChatType, h as CreateBulkNotificationInput, E as EnumActivity, N as NotificationCount, i as NotificationDataType, a as NotificationType, P as ParticipantType, R as ReportChatUser, j as ResourceActivityEntry, k as ResourceActivityInputType, b as ResourceActivityType } from '../resourceActivities-CqrscA5x.mjs';
|
|
4
4
|
import { c as EventListItemType } from '../global-MMBYi34A.mjs';
|
|
5
5
|
export { A as AssociateType, r as BaseResourceType, B as BaseResourceTypeFormData, C as Category, n as CreateEventFormData, p as CreateEventInfoFormData, s as CreateFormData, t as CreateUnregisteredVendorFormData, j as CreateVendorFormData, l as CreateVendorInfoFormData, D as DateTimeType, u as DateTimeWithPriceType, v as DeviceInfo, m as EventFormData, o as EventInfoFormData, d as EventInfoType, w as EventStatusType, E as EventType, a as FormDateField, F as FormField, G as GeocodeLocation, I as ImageObjectType, x as LocationGeoType, L as LocationType, N as Nullable, O as OptionItem, y as OwnerType, P as PaymentInfoType, z as PosterUsageType, R as RefundPolicy, H as Region, J as RelationDate, e as RelationType, b as Requirement, f as ResourceConnectionsType, K as ResourceContactDetailsType, M as ResourceDetails, Q as ResourceImageType, T as SocialMediaType, S as StallType, W as Subcategory, X as SubcategoryItems, Y as TermsAgreement, q as UnregisteredVendorFormData, Z as UnregisteredVendorInvitationType, U as UnregisteredVendorType, h as UserLicenceType, _ as VendorAttributes, $ as VendorCalendarData, i as VendorFormData, k as VendorInfoFormData, g as VendorInfoType, a0 as VendorProductList, V as VendorType } from '../global-MMBYi34A.mjs';
|
|
6
|
-
export { g as AdFormData, n as AdResource, A as AdType, l as AppSettingsFormData, d as AppSettingsType, h as CreateAdFormData, m as CreateAppSettingsFormData, i as CreatePartnerFormData, k as CreatePostFormData, C as CreateUserFormData, o as EnumAdShowOn, E as EnumAdStatus, p as EnumAdStyle, q as EnumAdType, r as EnumPostContentType, c as EnumPostType, f as PartnerFormData, P as PartnerType,
|
|
6
|
+
export { g as AdFormData, n as AdResource, A as AdType, l as AppSettingsFormData, d as AppSettingsType, B as BaseGame, h as CreateAdFormData, m as CreateAppSettingsFormData, i as CreatePartnerFormData, k as CreatePostFormData, C as CreateUserFormData, D as DailyClueGameData, o as EnumAdShowOn, E as EnumAdStatus, p as EnumAdStyle, q as EnumAdType, r as EnumGameType, s as EnumPostContentType, c as EnumPostType, t as GameData, G as GameType, f as PartnerFormData, P as PartnerType, u as PostContentData, v as PostContentFormData, w as PostContentGame, x as PostContentImage, y as PostContentList, z as PostContentTextarea, F as PostContentType, H as PostContentVideo, I as PostFileInput, j as PostFormData, b as PostType, R as ResourceByUser, J as StripeSubscription, K as SubscriptionPlanData, S as SubscriptionPlansResponse, L as SubscriptionPricingData, a as SubscriptionStatusData, M as UserActivity, N as UserActivityEvent, e as UserFormData, U as UserType } from '../post-Dh2m6dzT.mjs';
|
|
7
7
|
import 'react-hook-form';
|
|
8
8
|
|
|
9
9
|
interface AdminUpdateResourceType {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import { EnumResourceType } from '../enums/index.js';
|
|
2
2
|
export { e as ContactUsFormData, f as CreateContactUsFormData, C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, d as CreateResetPasswordFormData, c as CreateValidateVerificationTokenFormData, E as EnumVerificationType, L as LoginFormData, R as RegisterFormData, g as RequestPasswordResetFormData, h as ResetPasswordFormData, V as ValidateVerificationTokenFormData } from '../auth-B5tprOIL.js';
|
|
3
|
-
export { c as ChatMessageInput, d as ChatMessageReaction, e as ChatMessageReplyPreview, f as ChatMessageSeen, g as ChatMessageType, C as ChatType, h as CreateBulkNotificationInput,
|
|
3
|
+
export { c as ChatMessageInput, d as ChatMessageReaction, e as ChatMessageReplyPreview, f as ChatMessageSeen, g as ChatMessageType, C as ChatType, h as CreateBulkNotificationInput, E as EnumActivity, N as NotificationCount, i as NotificationDataType, a as NotificationType, P as ParticipantType, R as ReportChatUser, j as ResourceActivityEntry, k as ResourceActivityInputType, b as ResourceActivityType } from '../resourceActivities-2FaGRW-i.js';
|
|
4
4
|
import { c as EventListItemType } from '../global-B0WdAD-8.js';
|
|
5
5
|
export { A as AssociateType, r as BaseResourceType, B as BaseResourceTypeFormData, C as Category, n as CreateEventFormData, p as CreateEventInfoFormData, s as CreateFormData, t as CreateUnregisteredVendorFormData, j as CreateVendorFormData, l as CreateVendorInfoFormData, D as DateTimeType, u as DateTimeWithPriceType, v as DeviceInfo, m as EventFormData, o as EventInfoFormData, d as EventInfoType, w as EventStatusType, E as EventType, a as FormDateField, F as FormField, G as GeocodeLocation, I as ImageObjectType, x as LocationGeoType, L as LocationType, N as Nullable, O as OptionItem, y as OwnerType, P as PaymentInfoType, z as PosterUsageType, R as RefundPolicy, H as Region, J as RelationDate, e as RelationType, b as Requirement, f as ResourceConnectionsType, K as ResourceContactDetailsType, M as ResourceDetails, Q as ResourceImageType, T as SocialMediaType, S as StallType, W as Subcategory, X as SubcategoryItems, Y as TermsAgreement, q as UnregisteredVendorFormData, Z as UnregisteredVendorInvitationType, U as UnregisteredVendorType, h as UserLicenceType, _ as VendorAttributes, $ as VendorCalendarData, i as VendorFormData, k as VendorInfoFormData, g as VendorInfoType, a0 as VendorProductList, V as VendorType } from '../global-B0WdAD-8.js';
|
|
6
|
-
export { g as AdFormData, n as AdResource, A as AdType, l as AppSettingsFormData, d as AppSettingsType, h as CreateAdFormData, m as CreateAppSettingsFormData, i as CreatePartnerFormData, k as CreatePostFormData, C as CreateUserFormData, o as EnumAdShowOn, E as EnumAdStatus, p as EnumAdStyle, q as EnumAdType, r as EnumPostContentType, c as EnumPostType, f as PartnerFormData, P as PartnerType,
|
|
6
|
+
export { g as AdFormData, n as AdResource, A as AdType, l as AppSettingsFormData, d as AppSettingsType, B as BaseGame, h as CreateAdFormData, m as CreateAppSettingsFormData, i as CreatePartnerFormData, k as CreatePostFormData, C as CreateUserFormData, D as DailyClueGameData, o as EnumAdShowOn, E as EnumAdStatus, p as EnumAdStyle, q as EnumAdType, r as EnumGameType, s as EnumPostContentType, c as EnumPostType, t as GameData, G as GameType, f as PartnerFormData, P as PartnerType, u as PostContentData, v as PostContentFormData, w as PostContentGame, x as PostContentImage, y as PostContentList, z as PostContentTextarea, F as PostContentType, H as PostContentVideo, I as PostFileInput, j as PostFormData, b as PostType, R as ResourceByUser, J as StripeSubscription, K as SubscriptionPlanData, S as SubscriptionPlansResponse, L as SubscriptionPricingData, a as SubscriptionStatusData, M as UserActivity, N as UserActivityEvent, e as UserFormData, U as UserType } from '../post-Ca1JIE74.js';
|
|
7
7
|
import 'react-hook-form';
|
|
8
8
|
|
|
9
9
|
interface AdminUpdateResourceType {
|
package/dist/types/index.mjs
CHANGED
|
@@ -4,16 +4,18 @@ import {
|
|
|
4
4
|
EnumAdStatus,
|
|
5
5
|
EnumAdStyle,
|
|
6
6
|
EnumAdType,
|
|
7
|
+
EnumGameType,
|
|
7
8
|
EnumPostContentType,
|
|
8
9
|
EnumPostType,
|
|
9
10
|
EnumVerificationType
|
|
10
|
-
} from "../chunk-
|
|
11
|
+
} from "../chunk-5QOEADCK.mjs";
|
|
11
12
|
export {
|
|
12
13
|
EnumActivity,
|
|
13
14
|
EnumAdShowOn,
|
|
14
15
|
EnumAdStatus,
|
|
15
16
|
EnumAdStyle,
|
|
16
17
|
EnumAdType,
|
|
18
|
+
EnumGameType,
|
|
17
19
|
EnumPostContentType,
|
|
18
20
|
EnumPostType,
|
|
19
21
|
EnumVerificationType
|
package/dist/utils/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/utils/index.ts","../../src/enums/index.ts"],"sourcesContent":["import dayjs from \"dayjs\";\nimport customParseFormat from \"dayjs/plugin/customParseFormat.js\";\nimport isSameOrAfter from \"dayjs/plugin/isSameOrAfter.js\";\nimport timezone from \"dayjs/plugin/timezone.js\";\nimport utc from \"dayjs/plugin/utc.js\";\n\nimport {\n EnumInviteStatus,\n EnumPaymentMethod,\n EnumRegions,\n EnumSocialMedia,\n EnumUserLicence,\n} from \"../enums\";\nimport { OptionItem, SocialMediaType } from \"../types/global\";\n\nexport const dateFormat = \"DD-MM-YYYY\";\nexport const timeFormat = \"HH:mm\";\n\n// Enable custom format parsing\ndayjs.extend(customParseFormat);\ndayjs.extend(utc);\ndayjs.extend(timezone);\ndayjs.extend(isSameOrAfter);\n\nconst NZ_TZ = \"Pacific/Auckland\";\n\nexport function toNZTime(date: Date | string) {\n return dayjs(date).tz(NZ_TZ).format();\n}\n\ntype DateFormat = \"date\" | \"time\" | \"datetime\";\n\n/**\n * Format a date string to a more readable format.\n * @param dateStr - the date string\n * @param timeStr - optional time string\n * @param display - 'date' | 'time' | 'datetime'\n * @returns formatted string based on display option\n */\nexport const formatDate = (\n dateStr: string,\n display: DateFormat = \"datetime\",\n timeStr?: string,\n) => {\n // Combine date and time into a single string if time is provided\n const dateTimeStr = timeStr ? `${dateStr} ${timeStr}` : dateStr;\n\n // Parse with formats\n const dateTime = timeStr\n ? dayjs(dateTimeStr, `${dateFormat} ${timeFormat}`)\n : dayjs(dateStr, dateFormat);\n\n // Format parts\n const formattedDate = dateTime.format(\"dddd, D MMMM, YYYY\");\n const formattedTime = dateTime.format(\"h:mm a\");\n\n // Return based on display option\n switch (display) {\n case \"date\":\n return formattedDate;\n case \"time\":\n return formattedTime;\n case \"datetime\":\n return `${formattedDate} at ${formattedTime}`;\n default:\n return formattedDate;\n }\n};\n\nexport const getCurrentAndFutureDates = <\n T extends { startDate: string; startTime: string },\n>(\n dates: T[],\n): T[] => {\n const now = dayjs(); // current date and time\n\n return dates.filter((dateObj) => {\n const dateTime = dayjs(\n `${dateObj.startDate} ${dateObj.startTime}`,\n `${dateFormat} ${timeFormat}`,\n );\n return dateTime.isSameOrAfter(now);\n });\n};\n\nexport const isFutureDatesBeforeThreshold = (\n date: {\n startDate: string;\n startTime: string;\n },\n minHoursFromNow: number,\n): boolean => {\n const threshold = minHoursFromNow\n ? dayjs().add(minHoursFromNow, \"hour\")\n : dayjs().startOf(\"day\");\n\n const dateTime = dayjs(\n `${date.startDate} ${date.startTime}`,\n `${dateFormat} ${timeFormat}`,\n );\n\n return dateTime.isSameOrAfter(threshold);\n};\n\nexport const formatTimestamp = (timestamp: string) => {\n const formattedDate = dayjs(timestamp)\n .tz(\"Pacific/Auckland\")\n .format(dateFormat);\n\n const formattedTime = dayjs(timestamp)\n .tz(\"Pacific/Auckland\")\n .format(timeFormat);\n\n return formatDate(formattedDate, \"date\");\n};\n\nconst isIsoDateString = (value: unknown): value is string => {\n return typeof value === \"string\" && !isNaN(Date.parse(value));\n};\n\nexport const removeTypename = (obj: any): any => {\n // Preserve Date objects\n if (obj instanceof Date) {\n return obj;\n }\n\n // Preserve File objects (for apollo-upload-client)\n if (obj instanceof File) {\n return obj;\n }\n\n // Preserve ISO date strings\n if (isIsoDateString(obj)) {\n return obj;\n }\n\n // Handle arrays\n if (Array.isArray(obj)) {\n return obj.map(removeTypename);\n }\n\n // Handle plain objects only\n if (obj !== null && typeof obj === \"object\") {\n const { __typename, ...cleanedObj } = obj;\n\n return Object.keys(cleanedObj).reduce((acc: any, key) => {\n acc[key] = removeTypename(cleanedObj[key]);\n return acc;\n }, {});\n }\n\n // Primitives\n return obj;\n};\n\n/**\n * Truncate text to a specified length and append ellipsis if necessary.\n * @param text\n * @param maxLength\n * @returns\n */\nexport const truncateText = (text: string, maxLength: number = 30): string => {\n return text.length > maxLength ? text.substring(0, maxLength) + \"...\" : text;\n};\n\n/**\n * Convert an array of strings to an array of objects with label and value properties.\n * @param items - The array of strings to convert.\n * @returns - The converted array of objects.\n */\nexport const mapArrayToOptions = (items: string[]): OptionItem[] =>\n items.map((item) => ({\n label: item,\n value: item,\n }));\n\nexport const capitalizeFirstLetter = (str: string): string => {\n return str\n .split(\" \")\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(\" \");\n};\n\nexport const statusOptions = [\n ...Object.values(EnumInviteStatus)\n .map((status) => ({\n label: status,\n value: status,\n }))\n .sort((a, b) => a.label.localeCompare(b.label)), // Sort the options alphabetically\n];\n\n/**\n * Sort an array of date strings by their proximity to the current date.\n * @param dates - The array of date strings to sort.\n * @returns - The sorted array of date strings.\n */\nexport function sortDatesChronologically<\n T extends { startDate: string; startTime: string },\n>(dates: T[]): T[] {\n if (!dates || !dates.length) {\n return [];\n }\n\n return [...dates].sort((a, b) => {\n const dateTimeFormat = `${dateFormat} ${timeFormat}`;\n const dateA = dayjs(`${a.startDate} ${a.startTime}`, dateTimeFormat);\n const dateB = dayjs(`${b.startDate} ${b.startTime}`, dateTimeFormat);\n return dateA.valueOf() - dateB.valueOf(); // chronological order\n });\n}\n\nexport const availableRegionTypes = Object.values(EnumRegions);\nexport const availableRegionOptions: OptionItem[] =\n mapArrayToOptions(availableRegionTypes);\n\nexport const paymentMethodOptions: OptionItem[] = mapArrayToOptions(\n Object.values(EnumPaymentMethod),\n);\n\nexport function normalizeUrl(url: string): string {\n if (!url.startsWith(\"http://\") && !url.startsWith(\"https://\")) {\n return `https://${url}`;\n }\n return url;\n}\n\nexport const licenseNiceNames: Record<EnumUserLicence, string> = {\n [EnumUserLicence.PRO_EVENT]: \"Pro Event\",\n [EnumUserLicence.PRO_VENDOR]: \"Pro Stallholder\",\n [EnumUserLicence.STANDARD_EVENT]: \"Standard Event\",\n [EnumUserLicence.STANDARD_VENDOR]: \"Standard Stallholder\",\n [EnumUserLicence.PRO_PLUS_EVENT]: \"Pro+Ads Event\",\n [EnumUserLicence.PRO_PLUS_VENDOR]: \"Pro+Ads Stallholder\",\n [EnumUserLicence.STANDARD_PARTNER]: \"Partner\",\n};\n\nexport const cluemartSocialMedia: SocialMediaType[] = [\n {\n link: \"https://www.facebook.com/ClueMartApp\",\n name: EnumSocialMedia.FACEBOOK,\n },\n {\n link: \"https://www.instagram.com/cluemart_app\",\n name: EnumSocialMedia.INSTAGRAM,\n },\n {\n link: \"https://www.tiktok.com/@cluemart\",\n name: EnumSocialMedia.TIKTOK,\n },\n {\n link: \"https://www.youtube.com/@ClueMart-App-NZ\",\n name: EnumSocialMedia.YOUTUBE,\n },\n];\n\nexport const IOS_URL = \"https://apps.apple.com/nz/app/cluemart/id6747251008\";\nexport const ANDROID_URL =\n \"https://play.google.com/store/apps/details?id=com.timardex.cluemart\";\n","export enum EnumInviteStatus {\n ACCEPTED = \"Accepted\",\n COMPLETED = \"Completed\",\n EXPIRED = \"Expired\",\n NO_STATUS = \"No_Status\",\n PENDING = \"Pending\",\n REJECTED = \"Rejected\",\n UNAVAILABLE = \"Unavailable\",\n}\n\nexport enum EnumChatReportReason {\n INAPPROPRIATE_CONTENT = \"Inappropriate_Content\",\n HARASSMENT_OR_BULLYING = \"Harassment_or_Bullying\",\n HATE_SPEECH = \"Hate_Speech\",\n SPAM_OR_SCAM = \"Spam_or_Scam\",\n VIOLENCE_OR_DANGEROUS_BEHAVIOR = \"Violence_or_Dangerous_Behavior\",\n OTHER = \"Other\",\n}\n\nexport enum EnumChatType {\n GROUP = \"group\",\n PRIVATE = \"private\",\n RELATION = \"relation\",\n}\n\nexport enum EnumPaymentMethod {\n CASH = \"cash\",\n EFTPOS = \"eftpos\",\n BANK_TRANSFER = \"bank_transfer\",\n PAYPAL = \"paypal\",\n STRIPE = \"stripe\",\n}\n\nexport enum EnumFoodFlavor {\n SALTY = \"Salty\",\n SAVOURY = \"Savoury\",\n SPICY = \"Spicy\",\n SWEET = \"Sweet\",\n OTHER = \"Not_Applicable\",\n}\n\nexport enum EnumFoodType {\n ADDITIVE_FREE = \"Additive_Free\",\n AIR_FRIED = \"Air_Fried\",\n ALLERGEN_FRIENDLY = \"Allergen_Friendly\",\n ATHLETE_FRIENDLY = \"Athlete_Friendly\",\n BAKED = \"Baked\",\n DAIRY_FREE = \"Dairy_Free\",\n DIABETIC_FRIENDLY = \"Diabetic_Friendly\",\n EGG_FREE = \"Egg_Free\",\n FRESH = \"Fresh\",\n GLUTEN_FREE = \"Gluten_Free\",\n GRILLED = \"Grilled\",\n HALAL = \"Halal\",\n HEART_HEALTHY = \"Heart_Healthy\",\n HIGH_FIBER = \"High_Fiber\",\n HIGH_PROTEIN = \"High_Protein\",\n KETO = \"Keto\",\n KOSHER = \"Kosher\",\n LACTOSE_FREE = \"Lactose_Free\",\n LOW_CALORIE = \"Low_Calorie\",\n LOW_CARB = \"Low_Carb\",\n LOW_FAT = \"Low_Fat\",\n LOW_SODIUM = \"Low_Sodium\",\n NO_ADDED_SUGAR = \"No_Added_Sugar\",\n NO_PRESERVATIVES = \"No_Preservatives\",\n NON_GMO = \"Non_GMO\",\n NUT_FREE = \"Nut_Free\",\n ORGANIC = \"Organic\",\n PALEO = \"Paleo\",\n PLANT_BASED = \"Plant_Based\",\n RAW = \"Raw\",\n SMOKED = \"Smoked\",\n SOY_FREE = \"Soy_Free\",\n SUGAR_FREE = \"Sugar_Free\",\n VEGAN = \"Vegan\",\n VEGETARIAN = \"Vegetarian\",\n}\n\nexport enum EnumResourceType {\n EVENT = \"event\",\n VENDOR = \"vendor\",\n PARTNER = \"partner\",\n}\n\nexport enum EnumEventType {\n MARKET = \"Market\",\n EXPO = \"Expo\",\n FAIR = \"Fair\",\n FESTIVAL = \"Festival\",\n}\n\nexport enum EnumVendorType {\n STALLHOLDER = \"Stallholder\",\n SHOP = \"Shop\",\n}\n\nexport enum EnumPartnerType {\n CHARITY_PARTNER = \"Charity_Partner\",\n MEDIA_PARTNER = \"Media_Partner\",\n SUPPORTING_PARTNER = \"Supporting_Partner\",\n}\n\nexport enum EnumOSPlatform {\n ANDROID = \"android\",\n IOS = \"ios\",\n WEB = \"web\",\n}\n\nexport enum EnumRelationResource {\n EVENT_INVITE_VENDOR = \"event_invite_vendor\",\n VENDOR_APPLICATION_TO_EVENT = \"vendor_application_to_event\",\n}\n\nexport enum EnumNotificationResourceType {\n ADDED_AS_ASSOCIATE_EVENT = \"added_as_associate_event\",\n ADDED_AS_ASSOCIATE_PARTNER = \"added_as_associate_partner\",\n ADDED_AS_ASSOCIATE_VENDOR = \"added_as_associate_vendor\",\n APPROVED_EVENT = \"approved_event\",\n APPROVED_PARTNER = \"approved_partner\",\n APPROVED_VENDOR = \"approved_vendor\",\n CREATED_EVENT = \"created_event\",\n CREATED_PARTNER = \"created_partner\",\n CREATED_VENDOR = \"created_vendor\",\n DEACTIVATED_EVENT = \"deactivated_event\",\n DEACTIVATED_PARTNER = \"deactivated_partner\",\n DEACTIVATED_VENDOR = \"deactivated_vendor\",\n DECLINED_EVENT = \"declined_event\",\n DECLINED_PARTNER = \"declined_partner\",\n DECLINED_VENDOR = \"declined_vendor\",\n EVENT_INVITE_VENDOR = EnumRelationResource.EVENT_INVITE_VENDOR,\n EVENT_STARTING_SOON = \"event_starting_soon\",\n EXPIRATION_REMINDER_EVENT = \"expiration_reminder_event\",\n EXPIRATION_REMINDER_PARTNER = \"expiration_reminder_partner\",\n EXPIRATION_REMINDER_VENDOR = \"expiration_reminder_vendor\",\n NEW_CHAT_MESSAGE = \"new_chat_message\",\n SYSTEM_ALERT = \"system_alert\",\n VENDOR_APPLICATION_TO_EVENT = EnumRelationResource.VENDOR_APPLICATION_TO_EVENT,\n}\n\nexport enum EnumNotificationType {\n EVENT = EnumResourceType.EVENT,\n VENDOR = EnumResourceType.VENDOR,\n RELATION = \"relation\",\n CHAT = \"chat\",\n SYSTEM = \"system\",\n}\n\nexport enum EnumRegions {\n All = \"All Regions\",\n Auckland = \"Auckland\",\n BayOfPlentyGisborne = \"Bay of Plenty & Gisborne\",\n CanterburyWestCoast = \"Canterbury & West Coast\",\n HawkesBay = \"Hawke's Bay\",\n ManawatuWanganui = \"Manawatu-Wanganui\",\n MarlboroughNelsonTasman = \"Marlborough & Nelson & Tasman\",\n Northland = \"Northland\",\n Otago = \"Otago\",\n Southland = \"Southland\",\n Taranaki = \"Taranaki\",\n Waikato = \"Waikato\",\n Wellington = \"Wellington\",\n}\n\nexport enum ImageTypeEnum {\n AVATAR = \"avatar\",\n COVER = \"cover\",\n IMAGE = \"image\",\n LOGO = \"logo\",\n}\n\nexport enum EnumUserLicence {\n PRO_EVENT = \"pro_event\",\n PRO_PLUS_EVENT = \"pro_plus_event\",\n PRO_PLUS_VENDOR = \"pro_plus_vendor\",\n PRO_VENDOR = \"pro_vendor\",\n STANDARD_EVENT = \"standard_event\",\n STANDARD_VENDOR = \"standard_vendor\",\n STANDARD_PARTNER = \"standard_partner\",\n}\n\nexport enum EnumUserRole {\n ADMIN = \"admin\",\n CUSTOMER = \"customer\",\n MARKETING = \"marketing\",\n MODERATOR = \"moderator\",\n SUPPORT = \"support\",\n}\n\nexport enum EnumSocialMedia {\n FACEBOOK = \"facebook\",\n INSTAGRAM = \"instagram\",\n TIKTOK = \"tiktok\",\n TWITTER = \"twitter\",\n WEBSITE = \"website\",\n YOUTUBE = \"youtube\",\n}\n\nexport enum EnumEventDateStatus {\n STARTING_SOON = \"Starting_Soon\",\n STARTED = \"Started\",\n TODAY = \"Today\",\n TOMORROW = \"Tomorrow\",\n THIS_WEEK = \"This_Week\",\n NEXT_WEEK = \"Next_Week\",\n UPCOMING = \"Upcoming\",\n ENDED = \"Ended\",\n RE_SCHEDULED = \"Rescheduled\",\n CANCELED = \"Canceled\",\n}\n\nexport enum EnumSubscriptionStatus {\n ACTIVE = \"active\",\n INACTIVE = \"inactive\",\n CANCELLED = \"cancelled\",\n NO_SUBSCRIPTION = \"no_subscription\",\n PAST_DUE = \"past_due\",\n TRIALING = \"trialing\",\n}\n\nexport enum EnumBillingPeriod {\n MONTHLY_CANCEL_ANYTIME = \"monthly_cancel_anytime\",\n YEARLY_ANNUAL_BILLED = \"yearly_annual_billed\",\n YEARLY_MONTHLY_BILLED = \"yearly_monthly_billed\",\n}\n\nexport enum EnumGameType {\n DAILY_CLUE = \"daily_clue\",\n DAILY_REWARD = \"daily_reward\",\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,+BAA8B;AAC9B,2BAA0B;AAC1B,sBAAqB;AACrB,iBAAgB;;;ACJT,IAAK,mBAAL,kBAAKA,sBAAL;AACL,EAAAA,kBAAA,cAAW;AACX,EAAAA,kBAAA,eAAY;AACZ,EAAAA,kBAAA,aAAU;AACV,EAAAA,kBAAA,eAAY;AACZ,EAAAA,kBAAA,aAAU;AACV,EAAAA,kBAAA,cAAW;AACX,EAAAA,kBAAA,iBAAc;AAPJ,SAAAA;AAAA,GAAA;AAyBL,IAAK,oBAAL,kBAAKC,uBAAL;AACL,EAAAA,mBAAA,UAAO;AACP,EAAAA,mBAAA,YAAS;AACT,EAAAA,mBAAA,mBAAgB;AAChB,EAAAA,mBAAA,YAAS;AACT,EAAAA,mBAAA,YAAS;AALC,SAAAA;AAAA,GAAA;AA2HL,IAAK,cAAL,kBAAKC,iBAAL;AACL,EAAAA,aAAA,SAAM;AACN,EAAAA,aAAA,cAAW;AACX,EAAAA,aAAA,yBAAsB;AACtB,EAAAA,aAAA,yBAAsB;AACtB,EAAAA,aAAA,eAAY;AACZ,EAAAA,aAAA,sBAAmB;AACnB,EAAAA,aAAA,6BAA0B;AAC1B,EAAAA,aAAA,eAAY;AACZ,EAAAA,aAAA,WAAQ;AACR,EAAAA,aAAA,eAAY;AACZ,EAAAA,aAAA,cAAW;AACX,EAAAA,aAAA,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EAC9B,sCAA+B,GAAG;AAAA,EAClC,wCAAgC,GAAG;AAAA,EACnC,sCAA+B,GAAG;AAAA,EAClC,wCAAgC,GAAG;AAAA,EACnC,0CAAiC,GAAG;AACtC;AAEO,IAAM,sBAAyC;AAAA,EACpD;AAAA,IACE,MAAM;AAAA,IACN;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN;AAAA,EACF;AACF;AAEO,IAAM,UAAU;AAChB,IAAM,cACX;","names":["EnumInviteStatus","EnumPaymentMethod","EnumRegions","dayjs","customParseFormat","utc","timezone","isSameOrAfter"]}
|
|
1
|
+
{"version":3,"sources":["../../src/utils/index.ts","../../src/enums/index.ts"],"sourcesContent":["import dayjs from \"dayjs\";\nimport customParseFormat from \"dayjs/plugin/customParseFormat.js\";\nimport isSameOrAfter from \"dayjs/plugin/isSameOrAfter.js\";\nimport timezone from \"dayjs/plugin/timezone.js\";\nimport utc from \"dayjs/plugin/utc.js\";\n\nimport {\n EnumInviteStatus,\n EnumPaymentMethod,\n EnumRegions,\n EnumSocialMedia,\n EnumUserLicence,\n} from \"../enums\";\nimport { OptionItem, SocialMediaType } from \"../types/global\";\n\nexport const dateFormat = \"DD-MM-YYYY\";\nexport const timeFormat = \"HH:mm\";\n\n// Enable custom format parsing\ndayjs.extend(customParseFormat);\ndayjs.extend(utc);\ndayjs.extend(timezone);\ndayjs.extend(isSameOrAfter);\n\nconst NZ_TZ = \"Pacific/Auckland\";\n\nexport function toNZTime(date: Date | string) {\n return dayjs(date).tz(NZ_TZ).format();\n}\n\ntype DateFormat = \"date\" | \"time\" | \"datetime\";\n\n/**\n * Format a date string to a more readable format.\n * @param dateStr - the date string\n * @param timeStr - optional time string\n * @param display - 'date' | 'time' | 'datetime'\n * @returns formatted string based on display option\n */\nexport const formatDate = (\n dateStr: string,\n display: DateFormat = \"datetime\",\n timeStr?: string,\n) => {\n // Combine date and time into a single string if time is provided\n const dateTimeStr = timeStr ? `${dateStr} ${timeStr}` : dateStr;\n\n // Parse with formats\n const dateTime = timeStr\n ? dayjs(dateTimeStr, `${dateFormat} ${timeFormat}`)\n : dayjs(dateStr, dateFormat);\n\n // Format parts\n const formattedDate = dateTime.format(\"dddd, D MMMM, YYYY\");\n const formattedTime = dateTime.format(\"h:mm a\");\n\n // Return based on display option\n switch (display) {\n case \"date\":\n return formattedDate;\n case \"time\":\n return formattedTime;\n case \"datetime\":\n return `${formattedDate} at ${formattedTime}`;\n default:\n return formattedDate;\n }\n};\n\nexport const getCurrentAndFutureDates = <\n T extends { startDate: string; startTime: string },\n>(\n dates: T[],\n): T[] => {\n const now = dayjs(); // current date and time\n\n return dates.filter((dateObj) => {\n const dateTime = dayjs(\n `${dateObj.startDate} ${dateObj.startTime}`,\n `${dateFormat} ${timeFormat}`,\n );\n return dateTime.isSameOrAfter(now);\n });\n};\n\nexport const isFutureDatesBeforeThreshold = (\n date: {\n startDate: string;\n startTime: string;\n },\n minHoursFromNow: number,\n): boolean => {\n const threshold = minHoursFromNow\n ? dayjs().add(minHoursFromNow, \"hour\")\n : dayjs().startOf(\"day\");\n\n const dateTime = dayjs(\n `${date.startDate} ${date.startTime}`,\n `${dateFormat} ${timeFormat}`,\n );\n\n return dateTime.isSameOrAfter(threshold);\n};\n\nexport const formatTimestamp = (timestamp: string) => {\n const formattedDate = dayjs(timestamp)\n .tz(\"Pacific/Auckland\")\n .format(dateFormat);\n\n const formattedTime = dayjs(timestamp)\n .tz(\"Pacific/Auckland\")\n .format(timeFormat);\n\n return formatDate(formattedDate, \"date\");\n};\n\nconst isIsoDateString = (value: unknown): value is string => {\n return typeof value === \"string\" && !isNaN(Date.parse(value));\n};\n\nexport const removeTypename = (obj: any): any => {\n // Preserve Date objects\n if (obj instanceof Date) {\n return obj;\n }\n\n // Preserve File objects (for apollo-upload-client)\n if (obj instanceof File) {\n return obj;\n }\n\n // Preserve ISO date strings\n if (isIsoDateString(obj)) {\n return obj;\n }\n\n // Handle arrays\n if (Array.isArray(obj)) {\n return obj.map(removeTypename);\n }\n\n // Handle plain objects only\n if (obj !== null && typeof obj === \"object\") {\n const { __typename, ...cleanedObj } = obj;\n\n return Object.keys(cleanedObj).reduce((acc: any, key) => {\n acc[key] = removeTypename(cleanedObj[key]);\n return acc;\n }, {});\n }\n\n // Primitives\n return obj;\n};\n\n/**\n * Truncate text to a specified length and append ellipsis if necessary.\n * @param text\n * @param maxLength\n * @returns\n */\nexport const truncateText = (text: string, maxLength: number = 30): string => {\n return text.length > maxLength ? text.substring(0, maxLength) + \"...\" : text;\n};\n\n/**\n * Convert an array of strings to an array of objects with label and value properties.\n * @param items - The array of strings to convert.\n * @returns - The converted array of objects.\n */\nexport const mapArrayToOptions = (items: string[]): OptionItem[] =>\n items.map((item) => ({\n label: item,\n value: item,\n }));\n\nexport const capitalizeFirstLetter = (str: string): string => {\n return str\n .split(\" \")\n .map((word) => word.charAt(0).toUpperCase() + word.slice(1).toLowerCase())\n .join(\" \");\n};\n\nexport const statusOptions = [\n ...Object.values(EnumInviteStatus)\n .map((status) => ({\n label: status,\n value: status,\n }))\n .sort((a, b) => a.label.localeCompare(b.label)), // Sort the options alphabetically\n];\n\n/**\n * Sort an array of date strings by their proximity to the current date.\n * @param dates - The array of date strings to sort.\n * @returns - The sorted array of date strings.\n */\nexport function sortDatesChronologically<\n T extends { startDate: string; startTime: string },\n>(dates: T[]): T[] {\n if (!dates || !dates.length) {\n return [];\n }\n\n return [...dates].sort((a, b) => {\n const dateTimeFormat = `${dateFormat} ${timeFormat}`;\n const dateA = dayjs(`${a.startDate} ${a.startTime}`, dateTimeFormat);\n const dateB = dayjs(`${b.startDate} ${b.startTime}`, dateTimeFormat);\n return dateA.valueOf() - dateB.valueOf(); // chronological order\n });\n}\n\nexport const availableRegionTypes = Object.values(EnumRegions);\nexport const availableRegionOptions: OptionItem[] =\n mapArrayToOptions(availableRegionTypes);\n\nexport const paymentMethodOptions: OptionItem[] = mapArrayToOptions(\n Object.values(EnumPaymentMethod),\n);\n\nexport function normalizeUrl(url: string): string {\n if (!url.startsWith(\"http://\") && !url.startsWith(\"https://\")) {\n return `https://${url}`;\n }\n return url;\n}\n\nexport const licenseNiceNames: Record<EnumUserLicence, string> = {\n [EnumUserLicence.PRO_EVENT]: \"Pro Event\",\n [EnumUserLicence.PRO_VENDOR]: \"Pro Stallholder\",\n [EnumUserLicence.STANDARD_EVENT]: \"Standard Event\",\n [EnumUserLicence.STANDARD_VENDOR]: \"Standard Stallholder\",\n [EnumUserLicence.PRO_PLUS_EVENT]: \"Pro+Ads Event\",\n [EnumUserLicence.PRO_PLUS_VENDOR]: \"Pro+Ads Stallholder\",\n [EnumUserLicence.STANDARD_PARTNER]: \"Partner\",\n};\n\nexport const cluemartSocialMedia: SocialMediaType[] = [\n {\n link: \"https://www.facebook.com/ClueMartApp\",\n name: EnumSocialMedia.FACEBOOK,\n },\n {\n link: \"https://www.instagram.com/cluemart_app\",\n name: EnumSocialMedia.INSTAGRAM,\n },\n {\n link: \"https://www.tiktok.com/@cluemart\",\n name: EnumSocialMedia.TIKTOK,\n },\n {\n link: \"https://www.youtube.com/@ClueMart-App-NZ\",\n name: EnumSocialMedia.YOUTUBE,\n },\n];\n\nexport const IOS_URL = \"https://apps.apple.com/nz/app/cluemart/id6747251008\";\nexport const ANDROID_URL =\n \"https://play.google.com/store/apps/details?id=com.timardex.cluemart\";\n","export enum EnumInviteStatus {\n ACCEPTED = \"Accepted\",\n COMPLETED = \"Completed\",\n EXPIRED = \"Expired\",\n NO_STATUS = \"No_Status\",\n PENDING = \"Pending\",\n REJECTED = \"Rejected\",\n UNAVAILABLE = \"Unavailable\",\n}\n\nexport enum EnumChatReportReason {\n INAPPROPRIATE_CONTENT = \"Inappropriate_Content\",\n HARASSMENT_OR_BULLYING = \"Harassment_or_Bullying\",\n HATE_SPEECH = \"Hate_Speech\",\n SPAM_OR_SCAM = \"Spam_or_Scam\",\n VIOLENCE_OR_DANGEROUS_BEHAVIOR = \"Violence_or_Dangerous_Behavior\",\n OTHER = \"Other\",\n}\n\nexport enum EnumChatType {\n GROUP = \"group\",\n PRIVATE = \"private\",\n RELATION = \"relation\",\n}\n\nexport enum EnumPaymentMethod {\n CASH = \"cash\",\n EFTPOS = \"eftpos\",\n BANK_TRANSFER = \"bank_transfer\",\n PAYPAL = \"paypal\",\n STRIPE = \"stripe\",\n}\n\nexport enum EnumFoodFlavor {\n SALTY = \"Salty\",\n SAVOURY = \"Savoury\",\n SPICY = \"Spicy\",\n SWEET = \"Sweet\",\n OTHER = \"Not_Applicable\",\n}\n\nexport enum EnumFoodType {\n ADDITIVE_FREE = \"Additive_Free\",\n AIR_FRIED = \"Air_Fried\",\n ALLERGEN_FRIENDLY = \"Allergen_Friendly\",\n ATHLETE_FRIENDLY = \"Athlete_Friendly\",\n BAKED = \"Baked\",\n DAIRY_FREE = \"Dairy_Free\",\n DIABETIC_FRIENDLY = \"Diabetic_Friendly\",\n EGG_FREE = \"Egg_Free\",\n FRESH = \"Fresh\",\n GLUTEN_FREE = \"Gluten_Free\",\n GRILLED = \"Grilled\",\n HALAL = \"Halal\",\n HEART_HEALTHY = \"Heart_Healthy\",\n HIGH_FIBER = \"High_Fiber\",\n HIGH_PROTEIN = \"High_Protein\",\n KETO = \"Keto\",\n KOSHER = \"Kosher\",\n LACTOSE_FREE = \"Lactose_Free\",\n LOW_CALORIE = \"Low_Calorie\",\n LOW_CARB = \"Low_Carb\",\n LOW_FAT = \"Low_Fat\",\n LOW_SODIUM = \"Low_Sodium\",\n NO_ADDED_SUGAR = \"No_Added_Sugar\",\n NO_PRESERVATIVES = \"No_Preservatives\",\n NON_GMO = \"Non_GMO\",\n NUT_FREE = \"Nut_Free\",\n ORGANIC = \"Organic\",\n PALEO = \"Paleo\",\n PLANT_BASED = \"Plant_Based\",\n RAW = \"Raw\",\n SMOKED = \"Smoked\",\n SOY_FREE = \"Soy_Free\",\n SUGAR_FREE = \"Sugar_Free\",\n VEGAN = \"Vegan\",\n VEGETARIAN = \"Vegetarian\",\n}\n\nexport enum EnumResourceType {\n EVENT = \"event\",\n VENDOR = \"vendor\",\n PARTNER = \"partner\",\n}\n\nexport enum EnumEventType {\n MARKET = \"Market\",\n EXPO = \"Expo\",\n FAIR = \"Fair\",\n FESTIVAL = \"Festival\",\n}\n\nexport enum EnumVendorType {\n STALLHOLDER = \"Stallholder\",\n SHOP = \"Shop\",\n}\n\nexport enum EnumPartnerType {\n CHARITY_PARTNER = \"Charity_Partner\",\n MEDIA_PARTNER = \"Media_Partner\",\n SUPPORTING_PARTNER = \"Supporting_Partner\",\n}\n\nexport enum EnumOSPlatform {\n ANDROID = \"android\",\n IOS = \"ios\",\n WEB = \"web\",\n}\n\nexport enum EnumRelationResource {\n EVENT_INVITE_VENDOR = \"event_invite_vendor\",\n VENDOR_APPLICATION_TO_EVENT = \"vendor_application_to_event\",\n}\n\nexport enum EnumNotificationResourceType {\n ADDED_AS_ASSOCIATE_EVENT = \"added_as_associate_event\",\n ADDED_AS_ASSOCIATE_PARTNER = \"added_as_associate_partner\",\n ADDED_AS_ASSOCIATE_VENDOR = \"added_as_associate_vendor\",\n APPROVED_EVENT = \"approved_event\",\n APPROVED_PARTNER = \"approved_partner\",\n APPROVED_VENDOR = \"approved_vendor\",\n CREATED_EVENT = \"created_event\",\n CREATED_PARTNER = \"created_partner\",\n CREATED_VENDOR = \"created_vendor\",\n DEACTIVATED_EVENT = \"deactivated_event\",\n DEACTIVATED_PARTNER = \"deactivated_partner\",\n DEACTIVATED_VENDOR = \"deactivated_vendor\",\n DECLINED_EVENT = \"declined_event\",\n DECLINED_PARTNER = \"declined_partner\",\n DECLINED_VENDOR = \"declined_vendor\",\n EVENT_INVITE_VENDOR = EnumRelationResource.EVENT_INVITE_VENDOR,\n EVENT_STARTING_SOON = \"event_starting_soon\",\n EXPIRATION_REMINDER_EVENT = \"expiration_reminder_event\",\n EXPIRATION_REMINDER_PARTNER = \"expiration_reminder_partner\",\n EXPIRATION_REMINDER_VENDOR = \"expiration_reminder_vendor\",\n NEW_CHAT_MESSAGE = \"new_chat_message\",\n SYSTEM_ALERT = \"system_alert\",\n VENDOR_APPLICATION_TO_EVENT = EnumRelationResource.VENDOR_APPLICATION_TO_EVENT,\n}\n\nexport enum EnumNotificationType {\n EVENT = EnumResourceType.EVENT,\n VENDOR = EnumResourceType.VENDOR,\n RELATION = \"relation\",\n CHAT = \"chat\",\n SYSTEM = \"system\",\n}\n\nexport enum EnumRegions {\n All = \"All Regions\",\n Auckland = \"Auckland\",\n BayOfPlentyGisborne = \"Bay of Plenty & Gisborne\",\n CanterburyWestCoast = \"Canterbury & West Coast\",\n HawkesBay = \"Hawke's Bay\",\n ManawatuWanganui = \"Manawatu-Wanganui\",\n MarlboroughNelsonTasman = \"Marlborough & Nelson & Tasman\",\n Northland = \"Northland\",\n Otago = \"Otago\",\n Southland = \"Southland\",\n Taranaki = \"Taranaki\",\n Waikato = \"Waikato\",\n Wellington = \"Wellington\",\n}\n\nexport enum ImageTypeEnum {\n AVATAR = \"avatar\",\n COVER = \"cover\",\n IMAGE = \"image\",\n LOGO = \"logo\",\n}\n\nexport enum EnumUserLicence {\n PRO_EVENT = \"pro_event\",\n PRO_PLUS_EVENT = \"pro_plus_event\",\n PRO_PLUS_VENDOR = \"pro_plus_vendor\",\n PRO_VENDOR = \"pro_vendor\",\n STANDARD_EVENT = \"standard_event\",\n STANDARD_VENDOR = \"standard_vendor\",\n STANDARD_PARTNER = \"standard_partner\",\n}\n\nexport enum EnumUserRole {\n ADMIN = \"admin\",\n CUSTOMER = \"customer\",\n MARKETING = \"marketing\",\n MODERATOR = \"moderator\",\n SUPPORT = \"support\",\n}\n\nexport enum EnumSocialMedia {\n FACEBOOK = \"facebook\",\n INSTAGRAM = \"instagram\",\n TIKTOK = \"tiktok\",\n TWITTER = \"twitter\",\n WEBSITE = \"website\",\n YOUTUBE = \"youtube\",\n}\n\nexport enum EnumEventDateStatus {\n STARTING_SOON = \"Starting_Soon\",\n STARTED = \"Started\",\n TODAY = \"Today\",\n TOMORROW = \"Tomorrow\",\n THIS_WEEK = \"This_Week\",\n NEXT_WEEK = \"Next_Week\",\n UPCOMING = \"Upcoming\",\n ENDED = \"Ended\",\n RE_SCHEDULED = \"Rescheduled\",\n CANCELED = \"Canceled\",\n}\n\nexport enum EnumSubscriptionStatus {\n ACTIVE = \"active\",\n INACTIVE = \"inactive\",\n CANCELLED = \"cancelled\",\n NO_SUBSCRIPTION = \"no_subscription\",\n PAST_DUE = \"past_due\",\n TRIALING = \"trialing\",\n}\n\nexport enum EnumBillingPeriod {\n MONTHLY_CANCEL_ANYTIME = \"monthly_cancel_anytime\",\n YEARLY_ANNUAL_BILLED = \"yearly_annual_billed\",\n YEARLY_MONTHLY_BILLED = \"yearly_monthly_billed\",\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,mBAAkB;AAClB,+BAA8B;AAC9B,2BAA0B;AAC1B,sBAAqB;AACrB,iBAAgB;;;ACJT,IAAK,mBAAL,kBAAKA,sBAAL;AACL,EAAAA,kBAAA,cAAW;AACX,EAAAA,kBAAA,eAAY;AACZ,EAAAA,kBAAA,aAAU;AACV,EAAAA,kBAAA,eAAY;AACZ,EAAAA,kBAAA,aAAU;AACV,EAAAA,kBAAA,cAAW;AACX,EAAAA,kBAAA,iBAAc;AAPJ,SAAAA;AAAA,GAAA;AAyBL,IAAK,oBAAL,kBAAKC,uBAAL;AACL,EAAAA,mBAAA,UAAO;AACP,EAAAA,mBAAA,YAAS;AACT,EAAAA,mBAAA,mBAAgB;AAChB,EAAAA,mBAAA,YAAS;AACT,EAAAA,mBAAA,YAAS;AALC,SAAAA;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AuB,OAAO,OAAO,WAAW;AACtD,IAAM,yBACX,kBAAkB,oBAAoB;AAEjC,IAAM,uBAAqC;AAAA,EAChD,OAAO,OAAO,iBAAiB;AACjC;AAEO,SAAS,aAAa,KAAqB;AAChD,MAAI,CAAC,IAAI,WAAW,SAAS,KAAK,CAAC,IAAI,WAAW,UAAU,GAAG;AAC7D,WAAO,WAAW,GAAG;AAAA,EACvB;AACA,SAAO;AACT;AAEO,IAAM,mBAAoD;AAAA,EAC/D,4BAA0B,GAAG;AAAA,EAC7B,8BAA2B,GAAG;AAAA,EAC9B,sCAA+B,GAAG;AAAA,EAClC,wCAAgC,GAAG;AAAA,EACnC,sCAA+B,GAAG;AAAA,EAClC,wCAAgC,GAAG;AAAA,EACnC,0CAAiC,GAAG;AACtC;AAEO,IAAM,sBAAyC;AAAA,EACpD;AAAA,IACE,MAAM;AAAA,IACN;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN;AAAA,EACF;AAAA,EACA;AAAA,IACE,MAAM;AAAA,IACN;AAAA,EACF;AACF;AAEO,IAAM,UAAU;AAChB,IAAM,cACX;","names":["EnumInviteStatus","EnumPaymentMethod","EnumRegions","dayjs","customParseFormat","utc","timezone","isSameOrAfter"]}
|
package/dist/utils/index.mjs
CHANGED
package/package.json
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/types/auth.ts","../src/types/ad.ts","../src/types/resourceActivities.ts","../src/types/post.ts"],"sourcesContent":["import { CreateFormData, EnumOSPlatform, TermsAgreement } from \"src\";\n\nexport enum EnumVerificationType {\n REGISTER = \"register\",\n RESET_PASSWORD = \"resetPassword\",\n}\n\nexport type LoginFormData = {\n email: string;\n isAdminPage?: boolean;\n password: string;\n platform?: EnumOSPlatform;\n};\n\nexport type CreateLoginFormData = CreateFormData<LoginFormData>;\n\nexport type RegisterFormData = {\n email: string;\n firstName: string;\n lastName: string;\n password: string;\n platform?: EnumOSPlatform;\n preferredRegion: string;\n promoCode?: string | null;\n termsAgreement?: TermsAgreement | null;\n};\n\nexport type CreateRegisterFormData = CreateFormData<RegisterFormData>;\n\nexport type RequestPasswordResetFormData = {\n email: string;\n};\n\nexport type CreateRequestPasswordResetFormData =\n CreateFormData<RequestPasswordResetFormData>;\n\nexport type ResetPasswordFormData = {\n confirmPassword: string;\n email: string;\n password: string;\n};\n\nexport type CreateResetPasswordFormData = CreateFormData<ResetPasswordFormData>;\n\nexport type ValidateVerificationTokenFormData = {\n email: string;\n verificationToken: string;\n verificationType?: EnumVerificationType;\n};\n\nexport type CreateValidateVerificationTokenFormData =\n CreateFormData<ValidateVerificationTokenFormData>;\n","import { EnumResourceType } from \"src/enums\";\n\nimport { CreateFormData, SocialMediaType } from \"./global\";\n\nexport enum EnumAdShowOn {\n EVENTS_PAGE = \"Events_page\",\n FRONT_PAGE = \"Front_page\",\n PARTNERS_PAGE = \"Partners_page\",\n VENDORS_PAGE = \"Vendors_page\",\n}\n\nexport enum EnumAdStatus {\n ACTIVE = \"Active\",\n PAUSED = \"Paused\",\n EXPIRED = \"Expired\",\n}\n\nexport enum EnumAdType {\n SPONSORED = \"Sponsored\",\n FREE = \"Free\",\n}\n\nexport enum EnumAdStyle {\n BLOOM = \"Bloom\",\n RISE = \"Rise\",\n}\n\nexport type AdResource = {\n adDescription: string | null;\n adImage: string | null;\n adStyle: EnumAdStyle | null;\n adTitle: string | null;\n adType: EnumAdType | null;\n resourceId: string | null;\n resourceName: string | null;\n resourceRegion: string | null;\n resourceType: EnumResourceType | null;\n};\n\nexport interface AdFormData {\n active: boolean;\n end: Date; // ISO date string\n resource: AdResource;\n showOn: EnumAdShowOn[];\n start?: Date; // ISO date string\n status: EnumAdStatus;\n targetRegion: string[];\n}\n\nexport type CreateAdFormData = CreateFormData<AdFormData>;\n\nexport interface AdType extends AdFormData {\n _id: string;\n clicks?: number; // How many times the ad was clicked\n createdAt: Date;\n impressions?: number; // How often the ad was seen\n start: Date; // ISO date string\n updatedAt: Date | null;\n}\n","import {\n EnumEventDateStatus,\n EnumOSPlatform,\n EnumResourceType,\n} from \"src/enums\";\n\nimport { LocationGeoType } from \"./global\";\n\nexport enum EnumActivity {\n FAVORITE = \"FAVORITE\",\n GOING = \"GOING\",\n INTERESTED = \"INTERESTED\",\n PRESENT = \"PRESENT\",\n VIEW = \"VIEW\",\n}\n\nexport type ResourceActivityEntry = {\n activityType: EnumActivity;\n location: LocationGeoType | null;\n dateStatus?: EnumEventDateStatus | null;\n startDate?: string | null;\n startTime?: string | null;\n timestamp: Date;\n userAgent: EnumOSPlatform;\n userId?: string | null;\n};\n\nexport type ResourceActivityType = {\n _id: string;\n resourceType: EnumResourceType;\n resourceId: string;\n activity: ResourceActivityEntry[];\n};\n\nexport type ResourceActivityInputType = {\n resourceId: string;\n resourceType: EnumResourceType;\n activity: Omit<ResourceActivityEntry, \"timestamp\">;\n};\n","import { EnumGameType, EnumResourceType } from \"src/enums\";\n\nimport { CreateFormData, ResourceImageType } from \"./global\";\n\nexport enum EnumPostType {\n DAILY_MEETS = \"daily_meets\",\n DAILY_TIPS = \"daily_tips\",\n DAILY_GAMES = \"daily_games\",\n}\n\nexport enum EnumPostContentType {\n GAME = \"game\",\n IMAGE = \"image\",\n LIST = \"list\",\n TEXTAREA = \"textarea\",\n VIDEO = \"video\",\n}\n\nexport type PostFileInput = {\n source: File;\n title?: string;\n};\n\nexport type PostContentTextarea = {\n textarea: {\n title?: string;\n data: string;\n };\n};\n\nexport type PostContentImage = {\n images: ResourceImageType[] | null;\n imagesUpload?: PostFileInput[] | null;\n};\n\nexport type PostContentVideo = {\n video: {\n source: string;\n title?: string;\n };\n};\n\nexport type PostContentList = {\n list: {\n title?: string;\n items: {\n text: string;\n }[];\n };\n};\n\nexport type PostContentGame = {\n game: {\n title: string;\n gameType: EnumGameType;\n gameInfo: {\n dailyClue?: string | null; // this is what needs to be found in the daily clue game, like CLUEMART\n };\n gameEndDate: string; // \"YYYY-MM-DD\" This is the date when the game ends, after this date the game content will not be shown in the post or it will be inactive.\n };\n};\n\nexport type PostContentData =\n | PostContentGame\n | PostContentTextarea\n | PostContentImage\n | PostContentVideo\n | PostContentList;\n\nexport type PostContentFormData = {\n contentData?: PostContentData | null;\n contentOrder?: number | null;\n contentType?: EnumPostContentType | null;\n};\n\nexport interface PostFormData {\n active: boolean;\n caption: string;\n content: PostContentFormData[];\n cover?: ResourceImageType | null;\n coverUpload?: PostFileInput | null;\n postType: EnumPostType;\n resource?: {\n resourceId: string;\n resourceType: EnumResourceType;\n } | null;\n tags?: string[] | null;\n title: string;\n}\n\nexport type CreatePostFormData = CreateFormData<PostFormData>;\n\nexport type PostContentType = Omit<PostContentFormData, \"contentData\"> & {\n contentData: Omit<PostContentData, \"imagesUpload\">;\n};\n\nexport type PostType = Omit<PostFormData, \"content\" | \"coverUpload\"> & {\n _id: string;\n content: PostContentType[];\n createdAt: Date;\n deletedAt: Date | null;\n updatedAt: Date | null;\n};\n"],"mappings":";AAEO,IAAK,uBAAL,kBAAKA,0BAAL;AACL,EAAAA,sBAAA,cAAW;AACX,EAAAA,sBAAA,oBAAiB;AAFP,SAAAA;AAAA,GAAA;;;ACEL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,iBAAc;AACd,EAAAA,cAAA,gBAAa;AACb,EAAAA,cAAA,mBAAgB;AAChB,EAAAA,cAAA,kBAAe;AAJL,SAAAA;AAAA,GAAA;AAOL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,YAAS;AACT,EAAAA,cAAA,aAAU;AAHA,SAAAA;AAAA,GAAA;AAML,IAAK,aAAL,kBAAKC,gBAAL;AACL,EAAAA,YAAA,eAAY;AACZ,EAAAA,YAAA,UAAO;AAFG,SAAAA;AAAA,GAAA;AAKL,IAAK,cAAL,kBAAKC,iBAAL;AACL,EAAAA,aAAA,WAAQ;AACR,EAAAA,aAAA,UAAO;AAFG,SAAAA;AAAA,GAAA;;;ACdL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,cAAW;AACX,EAAAA,cAAA,WAAQ;AACR,EAAAA,cAAA,gBAAa;AACb,EAAAA,cAAA,aAAU;AACV,EAAAA,cAAA,UAAO;AALG,SAAAA;AAAA,GAAA;;;ACJL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,iBAAc;AACd,EAAAA,cAAA,gBAAa;AACb,EAAAA,cAAA,iBAAc;AAHJ,SAAAA;AAAA,GAAA;AAML,IAAK,sBAAL,kBAAKC,yBAAL;AACL,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,WAAQ;AACR,EAAAA,qBAAA,UAAO;AACP,EAAAA,qBAAA,cAAW;AACX,EAAAA,qBAAA,WAAQ;AALE,SAAAA;AAAA,GAAA;","names":["EnumVerificationType","EnumAdShowOn","EnumAdStatus","EnumAdType","EnumAdStyle","EnumActivity","EnumPostType","EnumPostContentType"]}
|