@timardex/cluemart-shared 1.2.28 → 1.2.30
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-ZnPU3uan.d.ts → ad-C02AZIGy.d.ts} +1 -1
- package/dist/{ad-C-0i99zR.d.mts → ad-CTWMmc7b.d.mts} +1 -1
- package/dist/{auth-Ddkaba1k.d.mts → auth-YsJJnj12.d.mts} +1 -1
- package/dist/{auth-BRY-YJss.d.ts → auth-o_ns6gLk.d.ts} +1 -1
- package/dist/chunk-BO3HICLR.mjs +24 -0
- package/dist/chunk-BO3HICLR.mjs.map +1 -0
- package/dist/chunk-O6LVIQFK.mjs +66 -0
- package/dist/chunk-O6LVIQFK.mjs.map +1 -0
- package/dist/formFields/index.d.mts +1 -1
- package/dist/formFields/index.d.ts +1 -1
- package/dist/{global-IDogsFQv.d.ts → global-4lS-fh61.d.ts} +37 -4
- package/dist/{global-DlaX2SCk.d.mts → global-_ZHkOcnR.d.mts} +37 -4
- package/dist/graphql/index.d.mts +2 -2
- package/dist/graphql/index.d.ts +2 -2
- package/dist/hooks/index.d.mts +3 -3
- package/dist/hooks/index.d.ts +3 -3
- package/dist/hooks/index.mjs +5 -5
- package/dist/index.cjs +1157 -26
- package/dist/index.cjs.map +1 -1
- package/dist/index.d.mts +468 -1
- package/dist/index.d.ts +468 -1
- package/dist/index.mjs +1130 -26
- package/dist/index.mjs.map +1 -1
- package/dist/mongoose/index.cjs +1097 -0
- package/dist/mongoose/index.cjs.map +1 -0
- package/dist/mongoose/index.d.mts +422 -0
- package/dist/mongoose/index.d.ts +422 -0
- package/dist/mongoose/index.mjs +874 -0
- package/dist/mongoose/index.mjs.map +1 -0
- package/dist/service/index.cjs +334 -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.d.mts +3 -3
- package/dist/types/index.d.ts +3 -3
- package/dist/types/index.mjs +4 -19
- package/dist/types/index.mjs.map +1 -1
- package/dist/utils/index.d.mts +1 -1
- package/dist/utils/index.d.ts +1 -1
- package/package.json +1 -1
|
@@ -0,0 +1,214 @@
|
|
|
1
|
+
import {
|
|
2
|
+
NotificationModel,
|
|
3
|
+
PushTokenModel
|
|
4
|
+
} from "../chunk-O6LVIQFK.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 NotificationModel.find({
|
|
54
|
+
userId
|
|
55
|
+
}).sort({ createdAt: -1 });
|
|
56
|
+
const [total, unread] = await Promise.all([
|
|
57
|
+
NotificationModel.countDocuments({ userId }),
|
|
58
|
+
NotificationModel.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 NotificationModel.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 PushTokenModel.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 {\n SchemaCreateBulkNotificationInput,\n SchemaNotificationType,\n NotificationModel,\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;;;ADlBA,SAAS,OAAO,cAAc;AAMvB,IAAM,oBAAoB,YAAY;AAC3C,MAAI;AAEF,UAAM,WAAW,QAAQ,IAAI,cACzB,QAAQ,IAAI;AAAA;AAAA,MAEZ,iBAAiB,QAAQ,IAAI,OAAO,IAAI,QAAQ,IAAI,WAAW,IAAI,QAAQ,IAAI,OAAO,qDAAqD,QAAQ,IAAI,QAAQ;AAAA;AAEnK,UAAM,SAAS,QAAQ,QAAQ;AAE/B,U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3C;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.d.mts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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 { d as AdFormData, A as AdType, e as CreateAdFormData, c as CreateTestersFormData, C as CreateUserFormData, h as EnumAdShowOn, E as EnumAdStatus, j as EnumAdStyle, i as EnumAdType, T as TesterType, b as TestersFormData, g as UserActivity, f as UserActivityEvent, a as UserFormData, U as UserType } from '../ad-
|
|
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-YsJJnj12.mjs';
|
|
3
|
+
export { a5 as AuthUser, X as BaseResourceType, B as BaseResourceTypeFormData, C as Category, Q as ChatMessageInput, U as ChatMessageType, b as ChatType, a9 as CreateBulkNotificationInput, m as CreateEventFormData, o as CreateEventInfoFormData, a3 as CreateFormData, i as CreateVendorFormData, k as CreateVendorInfoFormData, Y as DateTimeType, a7 as DateTimeWithPriceType, D as DeviceInfo, a4 as EnumPubSubEvents, l as EventFormData, n as EventInfoFormData, c as EventInfoType, E as EventType, a as FormDateField, F as FormField, _ as GeocodeLocation, J as GraphQLContext, a2 as ImageObjectType, L as LocationType, $ as MapMultiLocation, d as NotificationCount, K as NotificationDataType, N as NotificationType, W as Nullable, q as ObjectId, O as OptionItem, p as OwnerType, M as ParticipantType, P as PartnerType, a8 as PaymentInfoType, u as PosterUsageType, Z 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, a1 as Subcategory, a0 as SubcategoryItems, a6 as SubscriptionPayload, T as TermsAgreement, ac as VendorAttributes, h as VendorFormData, j as VendorInfoFormData, g as VendorInfoType, aa as VendorLocation, ab as VendorMenuType, V as VendorType } from '../global-_ZHkOcnR.mjs';
|
|
4
|
+
export { d as AdFormData, A as AdType, e as CreateAdFormData, c as CreateTestersFormData, C as CreateUserFormData, h as EnumAdShowOn, E as EnumAdStatus, j as EnumAdStyle, i as EnumAdType, T as TesterType, b as TestersFormData, g as UserActivity, f as UserActivityEvent, a as UserFormData, U as UserType } from '../ad-CTWMmc7b.mjs';
|
|
5
5
|
export { E as EnumActivity, a as ResourceActivityEntry, b as ResourceActivityInputType, R as ResourceActivityType } from '../resourceActivities-BIjtlOGp.mjs';
|
|
6
6
|
import 'mongoose';
|
|
7
7
|
import 'react-hook-form';
|
package/dist/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
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 { d as AdFormData, A as AdType, e as CreateAdFormData, c as CreateTestersFormData, C as CreateUserFormData, h as EnumAdShowOn, E as EnumAdStatus, j as EnumAdStyle, i as EnumAdType, T as TesterType, b as TestersFormData, g as UserActivity, f as UserActivityEvent, a as UserFormData, U as UserType } from '../ad-
|
|
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-o_ns6gLk.js';
|
|
3
|
+
export { a5 as AuthUser, X as BaseResourceType, B as BaseResourceTypeFormData, C as Category, Q as ChatMessageInput, U as ChatMessageType, b as ChatType, a9 as CreateBulkNotificationInput, m as CreateEventFormData, o as CreateEventInfoFormData, a3 as CreateFormData, i as CreateVendorFormData, k as CreateVendorInfoFormData, Y as DateTimeType, a7 as DateTimeWithPriceType, D as DeviceInfo, a4 as EnumPubSubEvents, l as EventFormData, n as EventInfoFormData, c as EventInfoType, E as EventType, a as FormDateField, F as FormField, _ as GeocodeLocation, J as GraphQLContext, a2 as ImageObjectType, L as LocationType, $ as MapMultiLocation, d as NotificationCount, K as NotificationDataType, N as NotificationType, W as Nullable, q as ObjectId, O as OptionItem, p as OwnerType, M as ParticipantType, P as PartnerType, a8 as PaymentInfoType, u as PosterUsageType, Z 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, a1 as Subcategory, a0 as SubcategoryItems, a6 as SubscriptionPayload, T as TermsAgreement, ac as VendorAttributes, h as VendorFormData, j as VendorInfoFormData, g as VendorInfoType, aa as VendorLocation, ab as VendorMenuType, V as VendorType } from '../global-4lS-fh61.js';
|
|
4
|
+
export { d as AdFormData, A as AdType, e as CreateAdFormData, c as CreateTestersFormData, C as CreateUserFormData, h as EnumAdShowOn, E as EnumAdStatus, j as EnumAdStyle, i as EnumAdType, T as TesterType, b as TestersFormData, g as UserActivity, f as UserActivityEvent, a as UserFormData, U as UserType } from '../ad-C02AZIGy.js';
|
|
5
5
|
export { E as EnumActivity, a as ResourceActivityEntry, b as ResourceActivityInputType, R as ResourceActivityType } from '../resourceActivities-B4roVKtQ.js';
|
|
6
6
|
import 'mongoose';
|
|
7
7
|
import 'react-hook-form';
|
package/dist/types/index.mjs
CHANGED
|
@@ -1,28 +1,13 @@
|
|
|
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/global.ts
|
|
9
|
-
var EnumPubSubEvents = /* @__PURE__ */ ((EnumPubSubEvents2) => {
|
|
10
|
-
EnumPubSubEvents2["GET_CHAT_MESSAGE"] = "GET_CHAT_MESSAGE";
|
|
11
|
-
EnumPubSubEvents2["GET_NOTIFICATIONS"] = "GET_NOTIFICATIONS";
|
|
12
|
-
EnumPubSubEvents2["GET_NOTIFICATIONS_COUNT"] = "GET_NOTIFICATIONS_COUNT";
|
|
13
|
-
EnumPubSubEvents2["USER_TYPING"] = "USER_TYPING";
|
|
14
|
-
return EnumPubSubEvents2;
|
|
15
|
-
})(EnumPubSubEvents || {});
|
|
16
|
-
|
|
17
|
-
// src/types/resourceActivities.ts
|
|
18
|
-
var EnumActivity = /* @__PURE__ */ ((EnumActivity2) => {
|
|
19
|
-
EnumActivity2["FAVORITE"] = "FAVORITE";
|
|
20
|
-
EnumActivity2["GOING"] = "GOING";
|
|
21
|
-
EnumActivity2["INTERESTED"] = "INTERESTED";
|
|
22
|
-
EnumActivity2["PRESENT"] = "PRESENT";
|
|
23
|
-
EnumActivity2["VIEW"] = "VIEW";
|
|
24
|
-
return EnumActivity2;
|
|
25
|
-
})(EnumActivity || {});
|
|
26
11
|
export {
|
|
27
12
|
EnumActivity,
|
|
28
13
|
EnumAdShowOn,
|
package/dist/types/index.mjs.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":[
|
|
1
|
+
{"version":3,"sources":[],"sourcesContent":[],"mappings":"","names":[]}
|
package/dist/utils/index.d.mts
CHANGED
package/dist/utils/index.d.ts
CHANGED