@timardex/cluemart-shared 1.2.27 → 1.2.29
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/ad-Crq-z5Wt.d.mts +69 -0
- package/dist/ad-DHetF-th.d.ts +69 -0
- package/dist/{auth-BVGs-5Vm.d.mts → auth-Ci6Uskch.d.mts} +1 -1
- package/dist/{auth-BhUIvvZ2.d.ts → auth-CzEdRDf1.d.ts} +1 -1
- package/dist/chunk-BO3HICLR.mjs +24 -0
- package/dist/chunk-BO3HICLR.mjs.map +1 -0
- package/dist/chunk-CQ7TCXMI.mjs +68 -0
- package/dist/chunk-CQ7TCXMI.mjs.map +1 -0
- package/dist/formFields/index.d.mts +2 -1
- package/dist/formFields/index.d.ts +2 -1
- package/dist/{global-BA84KF8J.d.ts → global-2Jk7sRkL.d.ts} +128 -2
- package/dist/{global-BEqzo5Z2.d.mts → global-DWuTxnJ8.d.mts} +128 -2
- package/dist/graphql/index.d.mts +5 -3
- package/dist/graphql/index.d.ts +5 -3
- package/dist/hooks/index.d.mts +5 -3
- package/dist/hooks/index.d.ts +5 -3
- package/dist/hooks/index.mjs +5 -5
- package/dist/index.cjs +1132 -17
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +695 -300
- package/dist/index.d.ts +695 -300
- package/dist/index.mjs +1117 -17
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +1068 -0
- package/dist/mongoose/index.cjs.map +1 -0
- package/dist/mongoose/index.d.mts +318 -0
- package/dist/mongoose/index.d.ts +318 -0
- package/dist/mongoose/index.mjs +855 -0
- package/dist/mongoose/index.mjs.map +1 -0
- package/dist/resourceActivities-B4roVKtQ.d.ts +34 -0
- package/dist/resourceActivities-BIjtlOGp.d.mts +34 -0
- package/dist/service/index.cjs +336 -0
- package/dist/service/index.cjs.map +1 -0
- package/dist/service/index.d.mts +27 -0
- package/dist/service/index.d.ts +27 -0
- package/dist/service/index.mjs +214 -0
- package/dist/service/index.mjs.map +1 -0
- package/dist/types/index.cjs +13 -2
- package/dist/types/index.cjs.map +1 -1
- package/dist/types/index.d.mts +6 -4
- package/dist/types/index.d.ts +6 -4
- package/dist/types/index.mjs +6 -11
- package/dist/types/index.mjs.map +1 -1
- package/dist/user-DbEEY7fv.d.ts +64 -0
- package/dist/user-OPY5EOqR.d.mts +64 -0
- package/dist/utils/index.d.mts +2 -1
- package/dist/utils/index.d.ts +2 -1
- package/package.json +13 -1
- package/dist/ad-Bv5fLkN0.d.mts +0 -129
- package/dist/ad-DDPNpx02.d.ts +0 -129
- package/dist/resourceActivities-DWC-Btmf.d.ts +0 -96
- package/dist/resourceActivities-DoLx4lPo.d.mts +0 -96
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import {
|
|
2
|
+
Notification_default,
|
|
3
|
+
PushToken_default
|
|
4
|
+
} from "../chunk-CQ7TCXMI.mjs";
|
|
5
|
+
import "../chunk-BO3HICLR.mjs";
|
|
6
|
+
import "../chunk-XXZPSRMS.mjs";
|
|
7
|
+
import "../chunk-NNS747QT.mjs";
|
|
8
|
+
|
|
9
|
+
// src/service/database.ts
|
|
10
|
+
import mongoose from "mongoose";
|
|
11
|
+
|
|
12
|
+
// src/service/timezonePlugin.ts
|
|
13
|
+
import dayjs from "dayjs";
|
|
14
|
+
import timezone from "dayjs/plugin/timezone";
|
|
15
|
+
import utc from "dayjs/plugin/utc";
|
|
16
|
+
dayjs.extend(utc);
|
|
17
|
+
dayjs.extend(timezone);
|
|
18
|
+
function timezonePlugin(schema) {
|
|
19
|
+
if (!schema.get("timestamps")) return;
|
|
20
|
+
const transform = (_doc, ret) => {
|
|
21
|
+
if (ret.createdAt)
|
|
22
|
+
ret.createdAt = dayjs(ret.createdAt).tz("Pacific/Auckland").format();
|
|
23
|
+
if (ret.updatedAt)
|
|
24
|
+
ret.updatedAt = dayjs(ret.updatedAt).tz("Pacific/Auckland").format();
|
|
25
|
+
return ret;
|
|
26
|
+
};
|
|
27
|
+
schema.set("toJSON", { transform });
|
|
28
|
+
schema.set("toObject", { transform });
|
|
29
|
+
}
|
|
30
|
+
|
|
31
|
+
// src/service/database.ts
|
|
32
|
+
mongoose.plugin(timezonePlugin);
|
|
33
|
+
var connectToDatabase = async () => {
|
|
34
|
+
try {
|
|
35
|
+
const mongoUri = process.env.MONGODB_URI ? process.env.MONGODB_URI : (
|
|
36
|
+
// Fallback to MongoDB Atlas connection string
|
|
37
|
+
`mongodb+srv://${process.env.DB_USER}:${process.env.DB_PASSWORD}@${process.env.DB_NAME}.mongodb.net/?retryWrites=true&w=majority&appName=${process.env.APP_NAME}`
|
|
38
|
+
);
|
|
39
|
+
await mongoose.connect(mongoUri);
|
|
40
|
+
const connectionType = process.env.MONGODB_URI ? "Local MongoDB" : "MongoDB Atlas";
|
|
41
|
+
console.log(
|
|
42
|
+
`${connectionType} connected from server/src/service/database.ts`
|
|
43
|
+
);
|
|
44
|
+
} catch (err) {
|
|
45
|
+
console.error("Error connecting to MongoDB:", err);
|
|
46
|
+
throw err;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
|
|
50
|
+
// src/service/notificationService.ts
|
|
51
|
+
async function publishNotificationEvents(userId, context) {
|
|
52
|
+
try {
|
|
53
|
+
const userNotifications = await Notification_default.find({
|
|
54
|
+
userId
|
|
55
|
+
}).sort({ createdAt: -1 });
|
|
56
|
+
const [total, unread] = await Promise.all([
|
|
57
|
+
Notification_default.countDocuments({ userId }),
|
|
58
|
+
Notification_default.countDocuments({ isRead: false, userId })
|
|
59
|
+
]);
|
|
60
|
+
context.pubsub.publish("GET_NOTIFICATIONS" /* GET_NOTIFICATIONS */, {
|
|
61
|
+
getNotifications: userNotifications,
|
|
62
|
+
getNotificationsUserId: userId
|
|
63
|
+
});
|
|
64
|
+
context.pubsub.publish("GET_NOTIFICATIONS_COUNT" /* GET_NOTIFICATIONS_COUNT */, {
|
|
65
|
+
getNotificationsCount: { total, unread, userId }
|
|
66
|
+
});
|
|
67
|
+
console.log(`Published notification events for user: ${String(userId)}`);
|
|
68
|
+
} catch (error) {
|
|
69
|
+
console.error(
|
|
70
|
+
`Failed to publish notification events for user ${String(userId)}:`,
|
|
71
|
+
error
|
|
72
|
+
);
|
|
73
|
+
}
|
|
74
|
+
}
|
|
75
|
+
async function createNotifications(payload, context) {
|
|
76
|
+
const { data, message, title, type, userIds } = payload;
|
|
77
|
+
try {
|
|
78
|
+
const notifications = userIds.map((userId) => ({
|
|
79
|
+
data,
|
|
80
|
+
isRead: false,
|
|
81
|
+
message,
|
|
82
|
+
title,
|
|
83
|
+
type,
|
|
84
|
+
userId
|
|
85
|
+
}));
|
|
86
|
+
const savedNotifications = await Notification_default.insertMany(notifications);
|
|
87
|
+
console.log(
|
|
88
|
+
`Created ${savedNotifications.length} notifications for ${userIds.length} users`
|
|
89
|
+
);
|
|
90
|
+
const uniqueUserIds = [...new Set(userIds)];
|
|
91
|
+
for (const userId of uniqueUserIds) {
|
|
92
|
+
await publishNotificationEvents(userId, context);
|
|
93
|
+
}
|
|
94
|
+
return savedNotifications;
|
|
95
|
+
} catch (error) {
|
|
96
|
+
console.error("Failed to create notifications:", error);
|
|
97
|
+
return [];
|
|
98
|
+
}
|
|
99
|
+
}
|
|
100
|
+
|
|
101
|
+
// src/service/sendPushNotification.ts
|
|
102
|
+
import { Expo } from "expo-server-sdk";
|
|
103
|
+
var expo = new Expo();
|
|
104
|
+
function extractTokensFromMessage(message) {
|
|
105
|
+
return Array.isArray(message.to) ? message.to : [message.to];
|
|
106
|
+
}
|
|
107
|
+
function createPushMessages({
|
|
108
|
+
tokens,
|
|
109
|
+
message,
|
|
110
|
+
title,
|
|
111
|
+
data
|
|
112
|
+
}) {
|
|
113
|
+
const messages = [];
|
|
114
|
+
const invalidTokens = [];
|
|
115
|
+
for (const token of tokens) {
|
|
116
|
+
if (!Expo.isExpoPushToken(token)) {
|
|
117
|
+
invalidTokens.push(token);
|
|
118
|
+
continue;
|
|
119
|
+
}
|
|
120
|
+
messages.push({
|
|
121
|
+
body: message,
|
|
122
|
+
data: { ...data },
|
|
123
|
+
sound: "default",
|
|
124
|
+
title,
|
|
125
|
+
to: token
|
|
126
|
+
});
|
|
127
|
+
}
|
|
128
|
+
return { invalidTokens, messages };
|
|
129
|
+
}
|
|
130
|
+
function processChunkResults(tickets, chunk) {
|
|
131
|
+
let successCount = 0;
|
|
132
|
+
const failedTokens = [];
|
|
133
|
+
for (const [ticketIndex, ticket] of tickets.entries()) {
|
|
134
|
+
if (ticket.status === "error") {
|
|
135
|
+
const message = chunk[ticketIndex];
|
|
136
|
+
if (message) {
|
|
137
|
+
const tokens = extractTokensFromMessage(message);
|
|
138
|
+
if (ticket.details?.error === "DeviceNotRegistered") {
|
|
139
|
+
failedTokens.push(...tokens);
|
|
140
|
+
}
|
|
141
|
+
console.log("Push notification error", {
|
|
142
|
+
error: ticket.details?.error,
|
|
143
|
+
tokens
|
|
144
|
+
});
|
|
145
|
+
}
|
|
146
|
+
} else {
|
|
147
|
+
successCount++;
|
|
148
|
+
}
|
|
149
|
+
}
|
|
150
|
+
return { failedTokens, successCount };
|
|
151
|
+
}
|
|
152
|
+
async function sendChunk(chunk, chunkIndex) {
|
|
153
|
+
try {
|
|
154
|
+
const tickets = await expo.sendPushNotificationsAsync(chunk);
|
|
155
|
+
const { successCount, failedTokens } = processChunkResults(tickets, chunk);
|
|
156
|
+
console.log(
|
|
157
|
+
`Chunk ${chunkIndex + 1}: Sent ${successCount}/${chunk.length} notifications successfully`
|
|
158
|
+
);
|
|
159
|
+
return { failedTokens, successCount };
|
|
160
|
+
} catch (error) {
|
|
161
|
+
console.log("Error sending Expo push notification chunk", {
|
|
162
|
+
chunkIndex,
|
|
163
|
+
chunkSize: chunk.length,
|
|
164
|
+
error: error instanceof Error ? error.message : String(error)
|
|
165
|
+
});
|
|
166
|
+
return { failedTokens: [], successCount: 0 };
|
|
167
|
+
}
|
|
168
|
+
}
|
|
169
|
+
async function sendPushNotification({
|
|
170
|
+
data,
|
|
171
|
+
message,
|
|
172
|
+
title,
|
|
173
|
+
userIds
|
|
174
|
+
}) {
|
|
175
|
+
const pushTokens = await PushToken_default.find({ userId: { $in: userIds } });
|
|
176
|
+
const expoTokens = pushTokens.map((token) => token.token);
|
|
177
|
+
const { messages, invalidTokens } = createPushMessages({
|
|
178
|
+
data,
|
|
179
|
+
message,
|
|
180
|
+
title,
|
|
181
|
+
tokens: expoTokens
|
|
182
|
+
});
|
|
183
|
+
if (invalidTokens.length > 0) {
|
|
184
|
+
console.log(`Found ${invalidTokens.length} invalid push tokens`);
|
|
185
|
+
}
|
|
186
|
+
if (messages.length === 0) {
|
|
187
|
+
console.log("No valid messages to send after filtering tokens");
|
|
188
|
+
return;
|
|
189
|
+
}
|
|
190
|
+
const chunks = expo.chunkPushNotifications(messages);
|
|
191
|
+
let totalSuccessCount = 0;
|
|
192
|
+
const allFailedTokens = [];
|
|
193
|
+
for (const [chunkIndex, chunk] of chunks.entries()) {
|
|
194
|
+
const { successCount, failedTokens } = await sendChunk(
|
|
195
|
+
chunk,
|
|
196
|
+
chunkIndex + 1
|
|
197
|
+
);
|
|
198
|
+
totalSuccessCount += successCount;
|
|
199
|
+
allFailedTokens.push(...failedTokens);
|
|
200
|
+
}
|
|
201
|
+
console.log(
|
|
202
|
+
`Sent push notification to ${totalSuccessCount}/${messages.length} tokens across ${chunks.length} chunks`
|
|
203
|
+
);
|
|
204
|
+
if (allFailedTokens.length > 0) {
|
|
205
|
+
console.log(`Found ${allFailedTokens.length} failed push tokens`);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
export {
|
|
209
|
+
connectToDatabase,
|
|
210
|
+
createNotifications,
|
|
211
|
+
publishNotificationEvents,
|
|
212
|
+
sendPushNotification
|
|
213
|
+
};
|
|
214
|
+
//# sourceMappingURL=index.mjs.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../../src/service/database.ts","../../src/service/timezonePlugin.ts","../../src/service/notificationService.ts","../../src/service/sendPushNotification.ts"],"sourcesContent":["import mongoose from \"mongoose\";\n\nimport { timezonePlugin } from \"./timezonePlugin\";\n\nmongoose.plugin(timezonePlugin); // applies to all schemas\n\n/**\n * Connect to MongoDB using Mongoose.\n * Supports both local MongoDB (via MONGODB_URI) and MongoDB Atlas (via individual env vars).\n */\nexport const connectToDatabase = async () => {\n try {\n // Check if MONGODB_URI is provided (for local Docker MongoDB)\n const mongoUri = process.env.MONGODB_URI\n ? process.env.MONGODB_URI\n : // Fallback to MongoDB Atlas connection string\n `mongodb+srv://${process.env.DB_USER}:${process.env.DB_PASSWORD}@${process.env.DB_NAME}.mongodb.net/?retryWrites=true&w=majority&appName=${process.env.APP_NAME}`;\n\n await mongoose.connect(mongoUri);\n\n const connectionType = process.env.MONGODB_URI\n ? \"Local MongoDB\"\n : \"MongoDB Atlas\";\n console.log(\n `${connectionType} connected from server/src/service/database.ts`,\n );\n } catch (err) {\n console.error(\"Error connecting to MongoDB:\", err);\n throw err; // You can throw the error if you want to stop the server in case of connection failure\n }\n};\n","// src/mongo/plugins/timezonePlugin.ts\nimport dayjs from \"dayjs\";\nimport timezone from \"dayjs/plugin/timezone\";\nimport utc from \"dayjs/plugin/utc\";\nimport { Schema } from \"mongoose\";\n\ndayjs.extend(utc);\ndayjs.extend(timezone);\n\nexport function timezonePlugin(schema: Schema) {\n if (!schema.get(\"timestamps\")) return;\n\n const transform = (_doc: any, ret: any) => {\n if (ret.createdAt)\n ret.createdAt = dayjs(ret.createdAt).tz(\"Pacific/Auckland\").format(); // ISO with +13:00 or +12:00 offset\n if (ret.updatedAt)\n ret.updatedAt = dayjs(ret.updatedAt).tz(\"Pacific/Auckland\").format();\n return ret;\n };\n\n schema.set(\"toJSON\", { transform });\n schema.set(\"toObject\", { transform });\n}\n","import NotificationModel, {\n SchemaCreateBulkNotificationInput,\n SchemaNotificationType,\n} from \"src/mongoose/Notification\";\nimport { EnumPubSubEvents, GraphQLContext, ObjectId } from \"src/types\";\n\n// Helper function to publish notification subscription events\nexport async function publishNotificationEvents(\n userId: ObjectId,\n context: GraphQLContext,\n) {\n try {\n // Get user's notifications for the subscription\n const userNotifications = await NotificationModel.find({\n userId,\n }).sort({ createdAt: -1 });\n\n // Get notification count\n const [total, unread] = await Promise.all([\n NotificationModel.countDocuments({ userId }),\n NotificationModel.countDocuments({ isRead: false, userId }),\n ]);\n\n // Publish both events\n context.pubsub.publish(EnumPubSubEvents.GET_NOTIFICATIONS, {\n getNotifications: userNotifications,\n getNotificationsUserId: userId,\n });\n\n context.pubsub.publish(EnumPubSubEvents.GET_NOTIFICATIONS_COUNT, {\n getNotificationsCount: { total, unread, userId },\n });\n\n console.log(`Published notification events for user: ${String(userId)}`);\n } catch (error) {\n console.error(\n `Failed to publish notification events for user ${String(userId)}:`,\n error,\n );\n }\n}\n\n/**\n * Create notifications in the database for multiple users\n * This is typically called when sending push notifications\n */\nexport async function createNotifications(\n payload: SchemaCreateBulkNotificationInput,\n context: GraphQLContext,\n): Promise<SchemaNotificationType[]> {\n const { data, message, title, type, userIds } = payload;\n try {\n const notifications = userIds.map((userId) => ({\n data,\n isRead: false,\n message,\n title,\n type,\n userId,\n }));\n\n // Save notifications to database\n const savedNotifications =\n await NotificationModel.insertMany(notifications);\n console.log(\n `Created ${savedNotifications.length} notifications for ${userIds.length} users`,\n );\n\n const uniqueUserIds = [...new Set(userIds)];\n for (const userId of uniqueUserIds) {\n await publishNotificationEvents(userId, context);\n }\n\n return savedNotifications;\n } catch (error) {\n console.error(\"Failed to create notifications:\", error);\n return [];\n //throw new Error(`Failed to create notifications: ${error}`);\n }\n}\n","import { Expo, ExpoPushMessage, ExpoPushTicket } from \"expo-server-sdk\";\n\nimport PushTokenModel from \"src/mongoose/PushToken\";\nimport { NotificationDataType, ObjectId } from \"src/types\";\n\nconst expo = new Expo();\n\n/**\n * Safely extract tokens from ExpoPushMessage handling both string and array cases\n */\nfunction extractTokensFromMessage(message: ExpoPushMessage): string[] {\n return Array.isArray(message.to) ? message.to : [message.to];\n}\n\ninterface CreatePushMessagesOptions {\n tokens: string[];\n message: string;\n title: string;\n data: NotificationDataType;\n}\n\n/**\n * Create push messages from valid tokens\n */\nfunction createPushMessages({\n tokens,\n message,\n title,\n data,\n}: CreatePushMessagesOptions): {\n messages: ExpoPushMessage[];\n invalidTokens: string[];\n} {\n const messages: ExpoPushMessage[] = [];\n const invalidTokens: string[] = [];\n\n for (const token of tokens) {\n if (!Expo.isExpoPushToken(token)) {\n invalidTokens.push(token);\n continue;\n }\n\n messages.push({\n body: message,\n data: { ...data },\n sound: \"default\",\n title,\n to: token,\n });\n }\n\n return { invalidTokens, messages };\n}\n\n/**\n * Process chunk results and extract failed tokens\n */\nfunction processChunkResults(\n tickets: ExpoPushTicket[],\n chunk: ExpoPushMessage[],\n): { successCount: number; failedTokens: string[] } {\n let successCount = 0;\n const failedTokens: string[] = [];\n\n for (const [ticketIndex, ticket] of tickets.entries()) {\n if (ticket.status === \"error\") {\n const message = chunk[ticketIndex];\n if (message) {\n const tokens = extractTokensFromMessage(message);\n if (ticket.details?.error === \"DeviceNotRegistered\") {\n failedTokens.push(...tokens);\n }\n console.log(\"Push notification error\", {\n error: ticket.details?.error,\n tokens,\n });\n }\n } else {\n successCount++;\n }\n }\n\n return { failedTokens, successCount };\n}\n\n/**\n * Send a single chunk of push notifications\n */\nasync function sendChunk(\n chunk: ExpoPushMessage[],\n chunkIndex: number,\n): Promise<{ successCount: number; failedTokens: string[] }> {\n try {\n const tickets = await expo.sendPushNotificationsAsync(chunk);\n const { successCount, failedTokens } = processChunkResults(tickets, chunk);\n\n console.log(\n `Chunk ${chunkIndex + 1}: Sent ${successCount}/${chunk.length} notifications successfully`,\n );\n\n return { failedTokens, successCount };\n } catch (error) {\n console.log(\"Error sending Expo push notification chunk\", {\n chunkIndex,\n chunkSize: chunk.length,\n error: error instanceof Error ? error.message : String(error),\n });\n return { failedTokens: [], successCount: 0 };\n }\n}\n\ninterface SendPushNotificationOptions {\n data: NotificationDataType;\n message: string;\n title: string;\n userIds: ObjectId[];\n}\n\nexport async function sendPushNotification({\n data,\n message,\n title,\n userIds,\n}: SendPushNotificationOptions) {\n const pushTokens = await PushTokenModel.find({ userId: { $in: userIds } });\n const expoTokens = pushTokens.map((token) => token.token);\n\n const { messages, invalidTokens } = createPushMessages({\n data,\n message,\n title,\n tokens: expoTokens,\n });\n\n // Log invalid tokens\n if (invalidTokens.length > 0) {\n console.log(`Found ${invalidTokens.length} invalid push tokens`);\n }\n\n if (messages.length === 0) {\n console.log(\"No valid messages to send after filtering tokens\");\n return;\n }\n\n // Send notifications in chunks\n const chunks = expo.chunkPushNotifications(messages);\n let totalSuccessCount = 0;\n const allFailedTokens: string[] = [];\n\n for (const [chunkIndex, chunk] of chunks.entries()) {\n const { successCount, failedTokens } = await sendChunk(\n chunk,\n chunkIndex + 1,\n );\n totalSuccessCount += successCount;\n allFailedTokens.push(...failedTokens);\n }\n\n // Log final results\n console.log(\n `Sent push notification to ${totalSuccessCount}/${messages.length} tokens across ${chunks.length} chunks`,\n );\n\n if (allFailedTokens.length > 0) {\n console.log(`Found ${allFailedTokens.length} failed push tokens`);\n }\n}\n"],"mappings":";;;;;;;;;AAAA,OAAO,cAAc;;;ACCrB,OAAO,WAAW;AAClB,OAAO,cAAc;AACrB,OAAO,SAAS;AAGhB,MAAM,OAAO,GAAG;AAChB,MAAM,OAAO,QAAQ;AAEd,SAAS,eAAe,QAAgB;AAC7C,MAAI,CAAC,OAAO,IAAI,YAAY,EAAG;AAE/B,QAAM,YAAY,CAAC,MAAW,QAAa;AACzC,QAAI,IAAI;AACN,UAAI,YAAY,MAAM,IAAI,SAAS,EAAE,GAAG,kBAAkB,EAAE,OAAO;AACrE,QAAI,IAAI;AACN,UAAI,YAAY,MAAM,IAAI,SAAS,EAAE,GAAG,kBAAkB,EAAE,OAAO;AACrE,WAAO;AAAA,EACT;AAEA,SAAO,IAAI,UAAU,EAAE,UAAU,CAAC;AAClC,SAAO,IAAI,YAAY,EAAE,UAAU,CAAC;AACtC;;;AD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sBAAsB;AAAA,EACjE;AAEA,MAAI,SAAS,WAAW,GAAG;AACzB,YAAQ,IAAI,kDAAkD;AAC9D;AAAA,EACF;AAGA,QAAM,SAAS,KAAK,uBAAuB,QAAQ;AACnD,MAAI,oBAAoB;AACxB,QAAM,kBAA4B,CAAC;AAEnC,aAAW,CAAC,YAAY,KAAK,KAAK,OAAO,QAAQ,GAAG;AAClD,UAAM,EAAE,cAAc,aAAa,IAAI,MAAM;AAAA,MAC3C;AAAA,MACA,aAAa;AAAA,IACf;AACA,yBAAqB;AACrB,oBAAgB,KAAK,GAAG,YAAY;AAAA,EACtC;AAGA,UAAQ;AAAA,IACN,6BAA6B,iBAAiB,IAAI,SAAS,MAAM,kBAAkB,OAAO,MAAM;AAAA,EAClG;AAEA,MAAI,gBAAgB,SAAS,GAAG;AAC9B,YAAQ,IAAI,SAAS,gBAAgB,MAAM,qBAAqB;AAAA,EAClE;AACF;","names":[]}
|
package/dist/types/index.cjs
CHANGED
|
@@ -24,10 +24,20 @@ __export(types_exports, {
|
|
|
24
24
|
EnumAdShowOn: () => EnumAdShowOn,
|
|
25
25
|
EnumAdStatus: () => EnumAdStatus,
|
|
26
26
|
EnumAdStyle: () => EnumAdStyle,
|
|
27
|
-
EnumAdType: () => EnumAdType
|
|
27
|
+
EnumAdType: () => EnumAdType,
|
|
28
|
+
EnumPubSubEvents: () => EnumPubSubEvents
|
|
28
29
|
});
|
|
29
30
|
module.exports = __toCommonJS(types_exports);
|
|
30
31
|
|
|
32
|
+
// src/types/global.ts
|
|
33
|
+
var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
|
|
34
|
+
EnumPubSubEvents2["GET_CHAT_MESSAGE"] = "GET_CHAT_MESSAGE";
|
|
35
|
+
EnumPubSubEvents2["GET_NOTIFICATIONS"] = "GET_NOTIFICATIONS";
|
|
36
|
+
EnumPubSubEvents2["GET_NOTIFICATIONS_COUNT"] = "GET_NOTIFICATIONS_COUNT";
|
|
37
|
+
EnumPubSubEvents2["USER_TYPING"] = "USER_TYPING";
|
|
38
|
+
return EnumPubSubEvents2;
|
|
39
|
+
})(EnumPubSubEvents || {});
|
|
40
|
+
|
|
31
41
|
// src/types/ad.ts
|
|
32
42
|
var EnumAdShowOn = /* @__PURE__ */ ((EnumAdShowOn2) => {
|
|
33
43
|
EnumAdShowOn2["FRONT_PAGE"] = "Front_page";
|
|
@@ -67,6 +77,7 @@ var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
|
|
|
67
77
|
EnumAdShowOn,
|
|
68
78
|
EnumAdStatus,
|
|
69
79
|
EnumAdStyle,
|
|
70
|
-
EnumAdType
|
|
80
|
+
EnumAdType,
|
|
81
|
+
EnumPubSubEvents
|
|
71
82
|
});
|
|
72
83
|
//# sourceMappingURL=index.cjs.map
|
package/dist/types/index.cjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/types/index.ts","../../src/types/ad.ts","../../src/types/resourceActivities.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 \"./testers\";\nexport * from \"./user\";\nexport * from \"./ad\";\nexport * from \"./resourceActivities\";\n","import { EnumResourceType } from \"src/enums\";\n\nimport { CreateFormData, SocialMediaType } from \"./global\";\n\nexport enum EnumAdShowOn {\n FRONT_PAGE = \"Front_page\",\n EVENTS_PAGE = \"Events_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 interface AdFormData {\n active: boolean;\n adStyle: EnumAdStyle;\n adType: EnumAdType;\n clui?: string | null;\n end: Date; // ISO date string\n resourceCover: string;\n resourceDescription: string;\n resourceId: string;\n resourceLogo?: string | null;\n resourceName: string;\n resourceRegion: string;\n resourceType: EnumResourceType;\n showOn: EnumAdShowOn;\n socialMedia?: SocialMediaType[] | null;\n start?: Date; // ISO date string\n status: EnumAdStatus;\n targetRegion?: string | null;\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;\n}\n","import { EnumOSPlatform, EnumResourceType } from \"src/enums\";\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: {\n type: \"Point\";\n coordinates: number[]; // [longitude, latitude]\n } | 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: string;\n activity: Omit<ResourceActivityEntry, \"timestamp\">;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;
|
|
1
|
+
{"version":3,"sources":["../../src/types/index.ts","../../src/types/global.ts","../../src/types/ad.ts","../../src/types/resourceActivities.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 \"./testers\";\nexport * from \"./user\";\nexport * from \"./ad\";\nexport * from \"./resourceActivities\";\n","import mongoose from \"mongoose\";\nimport {\n Control,\n FieldErrors,\n FieldValues,\n UseFormHandleSubmit,\n UseFormReset,\n UseFormSetValue,\n UseFormWatch,\n} from \"react-hook-form\";\n\nimport { SchemaChatType } from \"src/mongoose/Chat\";\nimport { SchemaNotificationType } from \"src/mongoose/Notification\";\n\nimport { EnumResourceType, EnumSocialMedia, EnumUserLicence } from \"../enums\";\n\nimport { EventType } from \"./event\";\nimport { NotificationCount } from \"./notification\";\nimport { RelationDate } from \"./relation\";\nimport { VendorType } from \"./vendor\";\n\nexport type Nullable<T> = {\n [K in keyof T]: T[K] | null | undefined;\n};\n\nexport type DeviceInfo = {\n appBuildNumber: string;\n appId: string;\n appVersion: string;\n brand: string;\n deviceName: string;\n installationId: string;\n manufacturer: string;\n modelName: string;\n osName: string;\n osVersion: string;\n timestamp: string;\n};\n\nexport type TermsAgreement = DeviceInfo & {\n termVersion: string;\n};\n\nexport type ResourceContactDetailsType = {\n email?: string | null;\n landlinePhone?: string | null;\n mobilePhone?: string | null;\n};\n\nexport type ResourceImageType = {\n source: string;\n title: string;\n};\n\nexport type SocialMediaType = {\n name?: EnumSocialMedia;\n link?: string;\n};\n\nexport type PartnerType = {\n email: string;\n resourceId: string;\n resourceType: EnumResourceType;\n licence: EnumUserLicence;\n};\n\nexport type OwnerType = {\n email: string;\n userId: string;\n};\n\nexport interface BaseResourceTypeFormData {\n _id?: string;\n active: boolean;\n contactDetails?: ResourceContactDetailsType | null;\n cover: ResourceImageType;\n coverUpload?: ResourceImageType | null;\n description: string;\n images?: ResourceImageType[] | null;\n imagesUpload?: ResourceImageType[] | null;\n logo?: ResourceImageType | null;\n logoUpload?: ResourceImageType | null;\n name: string;\n owner?: OwnerType | null;\n partners?: PartnerType[] | null;\n promoCodes?: string[] | null;\n region: string;\n socialMedia?: SocialMediaType[] | null;\n termsAgreement?: TermsAgreement | null;\n}\n\nexport type PosterUsageType = {\n month: string;\n count: number;\n};\n\nexport type BaseResourceType = Omit<\n BaseResourceTypeFormData,\n \"_id\" | \"coverUpload\" | \"imagesUpload\" | \"logoUpload\" | \"owner\"\n> & {\n _id: string;\n adIds?: string[] | null;\n createdAt: string;\n deletedAt: string | null;\n owner: OwnerType;\n posterUsage?: PosterUsageType | null;\n relations:\n | {\n relationId: string | null;\n relationDates: RelationDate[] | null;\n }[]\n | null;\n updatedAt: string;\n};\n\nexport type LocationType = {\n city: string;\n coordinates: number[]; // [longitude, latitude]\n country: string;\n fullAddress: string;\n latitude: number;\n longitude: number;\n region: string;\n type: \"Point\"; // Mongoose GeoJSON type\n};\n\nexport type DateTimeType = {\n endDate: string;\n endTime: string;\n startDate: string;\n startTime: string;\n};\n\nexport type Region = {\n latitude: number;\n latitudeDelta: number;\n longitude: number;\n longitudeDelta: number;\n};\n\nexport type GeocodeLocation = Pick<LocationType, \"latitude\" | \"longitude\">;\n\nexport type MapMultiLocation = {\n dateTime: DateTimeType | null;\n location: LocationType | null;\n resourceId?: string;\n resourceName?: string;\n resourceType?: EnumResourceType;\n};\n\nexport interface FormField {\n disabled?: boolean;\n helperText?: string;\n isTextArea?: boolean;\n keyboardType?:\n | \"default\"\n | \"email-address\"\n | \"number-pad\"\n | \"url\"\n | \"decimal-pad\"\n | \"phone-pad\";\n name: string;\n placeholder: string;\n secureTextEntry?: boolean;\n}\n\nexport interface FormDateField {\n dateMode: \"date\" | \"time\";\n helperText?: string;\n name: \"endDate\" | \"endTime\" | \"startDate\" | \"startTime\";\n placeholder: string;\n}\n\nexport interface SubcategoryItems {\n id: string;\n name: string;\n description?: string | null;\n}\n\nexport interface Subcategory {\n id: string;\n name: string;\n items?: SubcategoryItems[] | null;\n}\n\nexport interface Category {\n color?: string | null;\n description?: string | null;\n id: string;\n name: string;\n subcategories: Subcategory[];\n}\n\nexport type OptionItem = {\n value: string;\n label: string;\n};\n\nexport type ImageObjectType = {\n uri: string;\n type: string;\n name: string;\n};\n\nexport interface ResourceConnectionsType {\n events: EventType[] | null;\n vendors: VendorType[] | null;\n}\n\nexport interface CreateFormData<T extends FieldValues> {\n control: Control<T, any>;\n fields: T;\n formState: { errors: FieldErrors<T> };\n handleSubmit: UseFormHandleSubmit<T, any>;\n reset: UseFormReset<T>;\n setValue: UseFormSetValue<T>;\n watch: UseFormWatch<T>;\n}\n\nexport type ObjectId = mongoose.Schema.Types.ObjectId;\n\nexport enum EnumPubSubEvents {\n GET_CHAT_MESSAGE = \"GET_CHAT_MESSAGE\",\n GET_NOTIFICATIONS = \"GET_NOTIFICATIONS\",\n GET_NOTIFICATIONS_COUNT = \"GET_NOTIFICATIONS_COUNT\",\n USER_TYPING = \"USER_TYPING\",\n}\n\nexport interface AuthUser {\n email: string;\n role: string;\n userId: ObjectId;\n}\n\nexport interface SubscriptionPayload {\n getChatMessage?: SchemaChatType;\n userTyping?: SchemaChatType; // NOT USED\n getNotifications?: SchemaNotificationType[];\n // Used only for filtering; not part of the GraphQL schema output\n getNotificationsUserId?: ObjectId;\n getNotificationsCount?: NotificationCount & { userId: ObjectId };\n}\n\nexport interface GraphQLContext {\n user: AuthUser | null;\n pubsub: {\n publish: (\n eventName: EnumPubSubEvents,\n payload: SubscriptionPayload,\n ) => void;\n subscribe: (eventName: EnumPubSubEvents) => AsyncIterable<any>;\n };\n request: Request;\n response: Response;\n}\n","import { EnumResourceType } from \"src/enums\";\n\nimport { CreateFormData, SocialMediaType } from \"./global\";\n\nexport enum EnumAdShowOn {\n FRONT_PAGE = \"Front_page\",\n EVENTS_PAGE = \"Events_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 interface AdFormData {\n active: boolean;\n adStyle: EnumAdStyle;\n adType: EnumAdType;\n clui?: string | null;\n end: Date; // ISO date string\n resourceCover: string;\n resourceDescription: string;\n resourceId: string;\n resourceLogo?: string | null;\n resourceName: string;\n resourceRegion: string;\n resourceType: EnumResourceType;\n showOn: EnumAdShowOn;\n socialMedia?: SocialMediaType[] | null;\n start?: Date; // ISO date string\n status: EnumAdStatus;\n targetRegion?: string | null;\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;\n}\n","import { EnumOSPlatform, EnumResourceType } from \"src/enums\";\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: {\n type: \"Point\";\n coordinates: number[]; // [longitude, latitude]\n } | 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: string;\n activity: Omit<ResourceActivityEntry, \"timestamp\">;\n};\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;;;AC6NO,IAAK,mBAAL,kBAAKA,sBAAL;AACL,EAAAA,kBAAA,sBAAmB;AACnB,EAAAA,kBAAA,uBAAoB;AACpB,EAAAA,kBAAA,6BAA0B;AAC1B,EAAAA,kBAAA,iBAAc;AAJJ,SAAAA;AAAA,GAAA;;;ACzNL,IAAK,eAAL,kBAAKC,kBAAL;AACL,EAAAA,cAAA,gBAAa;AACb,EAAAA,cAAA,iBAAc;AACd,EAAAA,cAAA,kBAAe;AAHL,SAAAA;AAAA,GAAA;AAML,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;;;ACnBL,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;","names":["EnumPubSubEvents","EnumAdShowOn","EnumAdStatus","EnumAdType","EnumAdStyle","EnumActivity"]}
|
package/dist/types/index.d.mts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { EnumResourceType } from '../enums/index.mjs';
|
|
2
|
-
export { e as ContactUsFormData, f as CreateContactUsFormData, C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, d as CreateResetPasswordFormData, c as CreateValidateVerificationTokenFormData, L as LoginFormData, R as RegisterFormData, g as RequestPasswordResetFormData, h as ResetPasswordFormData, V as ValidateVerificationTokenFormData } from '../auth-
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
2
|
+
export { e as ContactUsFormData, f as CreateContactUsFormData, C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, d as CreateResetPasswordFormData, c as CreateValidateVerificationTokenFormData, L as LoginFormData, R as RegisterFormData, g as RequestPasswordResetFormData, h as ResetPasswordFormData, V as ValidateVerificationTokenFormData } from '../auth-Ci6Uskch.mjs';
|
|
3
|
+
export { a3 as AuthUser, U as BaseResourceType, B as BaseResourceTypeFormData, C as Category, K as ChatMessageInput, M as ChatMessageType, b as ChatType, a7 as CreateBulkNotificationInput, m as CreateEventFormData, o as CreateEventInfoFormData, a1 as CreateFormData, i as CreateVendorFormData, k as CreateVendorInfoFormData, W as DateTimeType, a5 as DateTimeWithPriceType, D as DeviceInfo, a2 as EnumPubSubEvents, l as EventFormData, n as EventInfoFormData, c as EventInfoType, E as EventType, a as FormDateField, F as FormField, Y as GeocodeLocation, H as GraphQLContext, a0 as ImageObjectType, L as LocationType, Z as MapMultiLocation, d as NotificationCount, I as NotificationDataType, N as NotificationType, Q as Nullable, q as ObjectId, O as OptionItem, p as OwnerType, J as ParticipantType, P as PartnerType, a6 as PaymentInfoType, u as PosterUsageType, X as Region, v as RelationDate, e as RelationType, R as Requirement, f as ResourceConnectionsType, t as ResourceContactDetailsType, s as ResourceImageType, r as SocialMediaType, S as StallType, $ as Subcategory, _ as SubcategoryItems, a4 as SubscriptionPayload, T as TermsAgreement, aa as VendorAttributes, h as VendorFormData, j as VendorInfoFormData, g as VendorInfoType, a8 as VendorLocation, a9 as VendorMenuType, V as VendorType } from '../global-DWuTxnJ8.mjs';
|
|
4
|
+
export { b as AdFormData, A as AdType, c as CreateAdFormData, C as CreateTestersFormData, d as EnumAdShowOn, E as EnumAdStatus, f as EnumAdStyle, e as EnumAdType, T as TesterType, a as TestersFormData } from '../ad-Crq-z5Wt.mjs';
|
|
5
|
+
export { C as CreateUserFormData, c as UserActivity, b as UserActivityEvent, a as UserFormData, U as UserType } from '../user-OPY5EOqR.mjs';
|
|
6
|
+
export { E as EnumActivity, a as ResourceActivityEntry, b as ResourceActivityInputType, R as ResourceActivityType } from '../resourceActivities-BIjtlOGp.mjs';
|
|
7
|
+
import 'mongoose';
|
|
6
8
|
import 'react-hook-form';
|
|
7
9
|
|
|
8
10
|
interface AdminUpdateResourceType {
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,8 +1,10 @@
|
|
|
1
1
|
import { EnumResourceType } from '../enums/index.js';
|
|
2
|
-
export { e as ContactUsFormData, f as CreateContactUsFormData, C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, d as CreateResetPasswordFormData, c as CreateValidateVerificationTokenFormData, L as LoginFormData, R as RegisterFormData, g as RequestPasswordResetFormData, h as ResetPasswordFormData, V as ValidateVerificationTokenFormData } from '../auth-
|
|
3
|
-
export {
|
|
4
|
-
export {
|
|
5
|
-
export {
|
|
2
|
+
export { e as ContactUsFormData, f as CreateContactUsFormData, C as CreateLoginFormData, a as CreateRegisterFormData, b as CreateRequestPasswordResetFormData, d as CreateResetPasswordFormData, c as CreateValidateVerificationTokenFormData, L as LoginFormData, R as RegisterFormData, g as RequestPasswordResetFormData, h as ResetPasswordFormData, V as ValidateVerificationTokenFormData } from '../auth-CzEdRDf1.js';
|
|
3
|
+
export { a3 as AuthUser, U as BaseResourceType, B as BaseResourceTypeFormData, C as Category, K as ChatMessageInput, M as ChatMessageType, b as ChatType, a7 as CreateBulkNotificationInput, m as CreateEventFormData, o as CreateEventInfoFormData, a1 as CreateFormData, i as CreateVendorFormData, k as CreateVendorInfoFormData, W as DateTimeType, a5 as DateTimeWithPriceType, D as DeviceInfo, a2 as EnumPubSubEvents, l as EventFormData, n as EventInfoFormData, c as EventInfoType, E as EventType, a as FormDateField, F as FormField, Y as GeocodeLocation, H as GraphQLContext, a0 as ImageObjectType, L as LocationType, Z as MapMultiLocation, d as NotificationCount, I as NotificationDataType, N as NotificationType, Q as Nullable, q as ObjectId, O as OptionItem, p as OwnerType, J as ParticipantType, P as PartnerType, a6 as PaymentInfoType, u as PosterUsageType, X as Region, v as RelationDate, e as RelationType, R as Requirement, f as ResourceConnectionsType, t as ResourceContactDetailsType, s as ResourceImageType, r as SocialMediaType, S as StallType, $ as Subcategory, _ as SubcategoryItems, a4 as SubscriptionPayload, T as TermsAgreement, aa as VendorAttributes, h as VendorFormData, j as VendorInfoFormData, g as VendorInfoType, a8 as VendorLocation, a9 as VendorMenuType, V as VendorType } from '../global-2Jk7sRkL.js';
|
|
4
|
+
export { b as AdFormData, A as AdType, c as CreateAdFormData, C as CreateTestersFormData, d as EnumAdShowOn, E as EnumAdStatus, f as EnumAdStyle, e as EnumAdType, T as TesterType, a as TestersFormData } from '../ad-DHetF-th.js';
|
|
5
|
+
export { C as CreateUserFormData, c as UserActivity, b as UserActivityEvent, a as UserFormData, U as UserType } from '../user-DbEEY7fv.js';
|
|
6
|
+
export { E as EnumActivity, a as ResourceActivityEntry, b as ResourceActivityInputType, R as ResourceActivityType } from '../resourceActivities-B4roVKtQ.js';
|
|
7
|
+
import 'mongoose';
|
|
6
8
|
import 'react-hook-form';
|
|
7
9
|
|
|
8
10
|
interface AdminUpdateResourceType {
|
package/dist/types/index.mjs
CHANGED
|
@@ -1,24 +1,19 @@
|
|
|
1
|
+
import {
|
|
2
|
+
EnumActivity,
|
|
3
|
+
EnumPubSubEvents
|
|
4
|
+
} from "../chunk-BO3HICLR.mjs";
|
|
1
5
|
import {
|
|
2
6
|
EnumAdShowOn,
|
|
3
7
|
EnumAdStatus,
|
|
4
8
|
EnumAdStyle,
|
|
5
9
|
EnumAdType
|
|
6
10
|
} from "../chunk-XXZPSRMS.mjs";
|
|
7
|
-
|
|
8
|
-
// src/types/resourceActivities.ts
|
|
9
|
-
var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
|
|
10
|
-
EnumActivity2["FAVORITE"] = "FAVORITE";
|
|
11
|
-
EnumActivity2["GOING"] = "GOING";
|
|
12
|
-
EnumActivity2["INTERESTED"] = "INTERESTED";
|
|
13
|
-
EnumActivity2["PRESENT"] = "PRESENT";
|
|
14
|
-
EnumActivity2["VIEW"] = "VIEW";
|
|
15
|
-
return EnumActivity2;
|
|
16
|
-
})(EnumActivity || {});
|
|
17
11
|
export {
|
|
18
12
|
EnumActivity,
|
|
19
13
|
EnumAdShowOn,
|
|
20
14
|
EnumAdStatus,
|
|
21
15
|
EnumAdStyle,
|
|
22
|
-
EnumAdType
|
|
16
|
+
EnumAdType,
|
|
17
|
+
EnumPubSubEvents
|
|
23
18
|
};
|
|
24
19
|
//# sourceMappingURL=index.mjs.map
|
package/dist/types/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { EnumUserLicence, EnumOSPlatform, EnumUserRole } from './enums/index.js';
|
|
2
|
+
import { s as ResourceImageType, P as PartnerType, T as TermsAgreement, a1 as CreateFormData } from './global-2Jk7sRkL.js';
|
|
3
|
+
|
|
4
|
+
type UserFormData = {
|
|
5
|
+
_id?: string;
|
|
6
|
+
active: boolean;
|
|
7
|
+
avatar?: ResourceImageType | null;
|
|
8
|
+
avatarUpload?: ResourceImageType | null;
|
|
9
|
+
confirmPassword: string;
|
|
10
|
+
email: string;
|
|
11
|
+
firstName: string;
|
|
12
|
+
lastName: string;
|
|
13
|
+
password: string;
|
|
14
|
+
platform?: EnumOSPlatform;
|
|
15
|
+
preferredRegion: string;
|
|
16
|
+
role: EnumUserRole;
|
|
17
|
+
termsAgreement?: TermsAgreement | null;
|
|
18
|
+
};
|
|
19
|
+
type CreateUserFormData = CreateFormData<UserFormData>;
|
|
20
|
+
type UserActivityEvent = {
|
|
21
|
+
resourceId: string;
|
|
22
|
+
startDate: string;
|
|
23
|
+
startTime: string;
|
|
24
|
+
};
|
|
25
|
+
type UserActivity = {
|
|
26
|
+
favourites: {
|
|
27
|
+
events: string[];
|
|
28
|
+
vendors: string[];
|
|
29
|
+
};
|
|
30
|
+
going: {
|
|
31
|
+
events: UserActivityEvent[];
|
|
32
|
+
};
|
|
33
|
+
interested: {
|
|
34
|
+
events: UserActivityEvent[];
|
|
35
|
+
};
|
|
36
|
+
present: {
|
|
37
|
+
events: UserActivityEvent[];
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
interface UserType {
|
|
41
|
+
_id: string;
|
|
42
|
+
active: boolean;
|
|
43
|
+
avatar: ResourceImageType | null;
|
|
44
|
+
createdAt: string;
|
|
45
|
+
deletedAt: string | null;
|
|
46
|
+
email: string;
|
|
47
|
+
events: string[] | null;
|
|
48
|
+
firstName: string;
|
|
49
|
+
isTester: boolean;
|
|
50
|
+
lastName: string;
|
|
51
|
+
licences: EnumUserLicence[] | null;
|
|
52
|
+
partners?: PartnerType[] | null;
|
|
53
|
+
password: string;
|
|
54
|
+
platform: EnumOSPlatform | null;
|
|
55
|
+
preferredRegion: string;
|
|
56
|
+
refreshToken: string | null;
|
|
57
|
+
role: EnumUserRole;
|
|
58
|
+
termsAgreement?: TermsAgreement | null;
|
|
59
|
+
updatedAt: string;
|
|
60
|
+
userActivity: UserActivity | null;
|
|
61
|
+
vendor: string | null;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export type { CreateUserFormData as C, UserType as U, UserFormData as a, UserActivityEvent as b, UserActivity as c };
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import { EnumUserLicence, EnumOSPlatform, EnumUserRole } from './enums/index.mjs';
|
|
2
|
+
import { s as ResourceImageType, P as PartnerType, T as TermsAgreement, a1 as CreateFormData } from './global-DWuTxnJ8.mjs';
|
|
3
|
+
|
|
4
|
+
type UserFormData = {
|
|
5
|
+
_id?: string;
|
|
6
|
+
active: boolean;
|
|
7
|
+
avatar?: ResourceImageType | null;
|
|
8
|
+
avatarUpload?: ResourceImageType | null;
|
|
9
|
+
confirmPassword: string;
|
|
10
|
+
email: string;
|
|
11
|
+
firstName: string;
|
|
12
|
+
lastName: string;
|
|
13
|
+
password: string;
|
|
14
|
+
platform?: EnumOSPlatform;
|
|
15
|
+
preferredRegion: string;
|
|
16
|
+
role: EnumUserRole;
|
|
17
|
+
termsAgreement?: TermsAgreement | null;
|
|
18
|
+
};
|
|
19
|
+
type CreateUserFormData = CreateFormData<UserFormData>;
|
|
20
|
+
type UserActivityEvent = {
|
|
21
|
+
resourceId: string;
|
|
22
|
+
startDate: string;
|
|
23
|
+
startTime: string;
|
|
24
|
+
};
|
|
25
|
+
type UserActivity = {
|
|
26
|
+
favourites: {
|
|
27
|
+
events: string[];
|
|
28
|
+
vendors: string[];
|
|
29
|
+
};
|
|
30
|
+
going: {
|
|
31
|
+
events: UserActivityEvent[];
|
|
32
|
+
};
|
|
33
|
+
interested: {
|
|
34
|
+
events: UserActivityEvent[];
|
|
35
|
+
};
|
|
36
|
+
present: {
|
|
37
|
+
events: UserActivityEvent[];
|
|
38
|
+
};
|
|
39
|
+
};
|
|
40
|
+
interface UserType {
|
|
41
|
+
_id: string;
|
|
42
|
+
active: boolean;
|
|
43
|
+
avatar: ResourceImageType | null;
|
|
44
|
+
createdAt: string;
|
|
45
|
+
deletedAt: string | null;
|
|
46
|
+
email: string;
|
|
47
|
+
events: string[] | null;
|
|
48
|
+
firstName: string;
|
|
49
|
+
isTester: boolean;
|
|
50
|
+
lastName: string;
|
|
51
|
+
licences: EnumUserLicence[] | null;
|
|
52
|
+
partners?: PartnerType[] | null;
|
|
53
|
+
password: string;
|
|
54
|
+
platform: EnumOSPlatform | null;
|
|
55
|
+
preferredRegion: string;
|
|
56
|
+
refreshToken: string | null;
|
|
57
|
+
role: EnumUserRole;
|
|
58
|
+
termsAgreement?: TermsAgreement | null;
|
|
59
|
+
updatedAt: string;
|
|
60
|
+
userActivity: UserActivity | null;
|
|
61
|
+
vendor: string | null;
|
|
62
|
+
}
|
|
63
|
+
|
|
64
|
+
export type { CreateUserFormData as C, UserType as U, UserFormData as a, UserActivityEvent as b, UserActivity as c };
|
package/dist/utils/index.d.mts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EnumInviteStatus, EnumRegions } from '../enums/index.mjs';
|
|
2
|
-
import {
|
|
2
|
+
import { X as Region, O as OptionItem } from '../global-DWuTxnJ8.mjs';
|
|
3
|
+
import 'mongoose';
|
|
3
4
|
import 'react-hook-form';
|
|
4
5
|
|
|
5
6
|
declare const dateFormat = "DD-MM-YYYY";
|
package/dist/utils/index.d.ts
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { EnumInviteStatus, EnumRegions } from '../enums/index.js';
|
|
2
|
-
import {
|
|
2
|
+
import { X as Region, O as OptionItem } from '../global-2Jk7sRkL.js';
|
|
3
|
+
import 'mongoose';
|
|
3
4
|
import 'react-hook-form';
|
|
4
5
|
|
|
5
6
|
declare const dateFormat = "DD-MM-YYYY";
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@timardex/cluemart-shared",
|
|
3
|
-
"version": "1.2.
|
|
3
|
+
"version": "1.2.29",
|
|
4
4
|
"description": "",
|
|
5
5
|
"main": "dist/index.cjs",
|
|
6
6
|
"module": "dist/index.mjs",
|
|
@@ -50,6 +50,16 @@
|
|
|
50
50
|
"types": "./dist/theme/index.d.ts",
|
|
51
51
|
"import": "./dist/theme/index.mjs",
|
|
52
52
|
"require": "./dist/theme/index.cjs"
|
|
53
|
+
},
|
|
54
|
+
"./mongoose": {
|
|
55
|
+
"types": "./dist/mongoose/index.d.ts",
|
|
56
|
+
"import": "./dist/mongoose/index.mjs",
|
|
57
|
+
"require": "./dist/mongoose/index.cjs"
|
|
58
|
+
},
|
|
59
|
+
"./service": {
|
|
60
|
+
"types": "./dist/service/index.d.ts",
|
|
61
|
+
"import": "./dist/service/index.mjs",
|
|
62
|
+
"require": "./dist/service/index.cjs"
|
|
53
63
|
}
|
|
54
64
|
},
|
|
55
65
|
"scripts": {
|
|
@@ -85,6 +95,8 @@
|
|
|
85
95
|
"@apollo/client": "^3.14.0",
|
|
86
96
|
"@hookform/resolvers": "^4.1.1",
|
|
87
97
|
"dayjs": "^1.11.13",
|
|
98
|
+
"expo-server-sdk": "^4.0.0",
|
|
99
|
+
"mongoose": "^8.19.3",
|
|
88
100
|
"react": "^19.0.0",
|
|
89
101
|
"react-hook-form": "^7.54.2",
|
|
90
102
|
"yup": "^1.6.1"
|