@7365admin1/core 3.32.2-staging.5 → 3.32.2-staging.7
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +1 -0
- package/dist/index.js +18 -1
- package/dist/index.js.map +1 -1
- package/dist/index.mjs +18 -1
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.d.ts
CHANGED
|
@@ -7296,6 +7296,7 @@ declare function usePostFavoriteRepo(): {
|
|
|
7296
7296
|
getById: (_id: string | ObjectId) => Promise<mongodb.WithId<TPostFavorite>>;
|
|
7297
7297
|
getByPostId: (postId: string | ObjectId) => Promise<mongodb.WithId<TPostFavorite>>;
|
|
7298
7298
|
updateById: (_id: string | ObjectId, userId: string | ObjectId, session?: any) => Promise<"removed" | "added">;
|
|
7299
|
+
createIndexes: () => Promise<string>;
|
|
7299
7300
|
};
|
|
7300
7301
|
|
|
7301
7302
|
declare function usePostFavoriteService(): {
|
package/dist/index.js
CHANGED
|
@@ -9207,6 +9207,7 @@ var MAILER_TRANSPORT_PORT = Number(process.env.MAILER_TRANSPORT_PORT) ?? 465;
|
|
|
9207
9207
|
var MAILER_TRANSPORT_SECURE = process.env.MAILER_TRANSPORT_SECURE === "true";
|
|
9208
9208
|
var MAILER_EMAIL = process.env.MAILER_EMAIL ?? "default@gmail.com";
|
|
9209
9209
|
var MAILER_PASSWORD = process.env.MAILER_PASSWORD ?? "password";
|
|
9210
|
+
var MAILER_FROM_EMAIL = process.env.MAILER_FROM_EMAIL || void 0;
|
|
9210
9211
|
var ACCESS_TOKEN_SECRET = process.env.ACCESS_TOKEN_SECRET ?? "access_token_secret";
|
|
9211
9212
|
var REFRESH_TOKEN_SECRET = process.env.REFRESH_TOKEN_SECRET ?? "refresh_token_secret";
|
|
9212
9213
|
var ACCESS_TOKEN_EXPIRY = process.env.ACCESS_TOKEN_EXPIRY ?? "15s";
|
|
@@ -12360,6 +12361,7 @@ function useVerificationService() {
|
|
|
12360
12361
|
port: MAILER_TRANSPORT_PORT,
|
|
12361
12362
|
secure: MAILER_TRANSPORT_SECURE,
|
|
12362
12363
|
email: MAILER_EMAIL,
|
|
12364
|
+
from: MAILER_FROM_EMAIL,
|
|
12363
12365
|
password: MAILER_PASSWORD
|
|
12364
12366
|
};
|
|
12365
12367
|
const mailer = new import_node_server_utils21.useMailer(MailerConfig);
|
|
@@ -34923,6 +34925,7 @@ function useVisitorTransactionService() {
|
|
|
34923
34925
|
port: MAILER_TRANSPORT_PORT,
|
|
34924
34926
|
secure: MAILER_TRANSPORT_SECURE,
|
|
34925
34927
|
email: MAILER_EMAIL,
|
|
34928
|
+
from: MAILER_FROM_EMAIL,
|
|
34926
34929
|
password: MAILER_PASSWORD
|
|
34927
34930
|
};
|
|
34928
34931
|
const mailer = new import_node_server_utils107.useMailer(MailerConfig);
|
|
@@ -36411,6 +36414,7 @@ function usePersonService() {
|
|
|
36411
36414
|
port: MAILER_TRANSPORT_PORT,
|
|
36412
36415
|
secure: MAILER_TRANSPORT_SECURE,
|
|
36413
36416
|
email: MAILER_EMAIL,
|
|
36417
|
+
from: MAILER_FROM_EMAIL,
|
|
36414
36418
|
password: MAILER_PASSWORD
|
|
36415
36419
|
};
|
|
36416
36420
|
const mailer = new import_node_server_utils112.useMailer(MailerConfig);
|
|
@@ -64139,6 +64143,7 @@ function sendEmailWithAttachmentsTo({
|
|
|
64139
64143
|
port: MAILER_TRANSPORT_PORT,
|
|
64140
64144
|
secure: MAILER_TRANSPORT_SECURE,
|
|
64141
64145
|
email: MAILER_EMAIL,
|
|
64146
|
+
from: MAILER_FROM_EMAIL,
|
|
64142
64147
|
password: MAILER_PASSWORD
|
|
64143
64148
|
};
|
|
64144
64149
|
const mailer = new import_node_server_utils221.useMailer(MailerConfig);
|
|
@@ -64892,6 +64897,7 @@ function useVerificationServiceV2() {
|
|
|
64892
64897
|
port: MAILER_TRANSPORT_PORT,
|
|
64893
64898
|
secure: MAILER_TRANSPORT_SECURE,
|
|
64894
64899
|
email: MAILER_EMAIL,
|
|
64900
|
+
from: MAILER_FROM_EMAIL,
|
|
64895
64901
|
password: MAILER_PASSWORD
|
|
64896
64902
|
};
|
|
64897
64903
|
const mailer = new import_node_server_utils227.useMailer(MailerConfig);
|
|
@@ -67502,6 +67508,16 @@ function usePostFavoriteRepo() {
|
|
|
67502
67508
|
}
|
|
67503
67509
|
const FAVORITE_COLLECTION = "post-favorites";
|
|
67504
67510
|
const collection = db.collection(FAVORITE_COLLECTION);
|
|
67511
|
+
async function createIndexes() {
|
|
67512
|
+
try {
|
|
67513
|
+
await collection.createIndexes([{ key: { postId: 1 }, unique: true }]);
|
|
67514
|
+
return `Successfully created indexes for ${FAVORITE_COLLECTION}.`;
|
|
67515
|
+
} catch (error) {
|
|
67516
|
+
throw new import_node_server_utils238.InternalServerError(
|
|
67517
|
+
"Failed to create indexes on post-favorites."
|
|
67518
|
+
);
|
|
67519
|
+
}
|
|
67520
|
+
}
|
|
67505
67521
|
async function addFavorite(value, session) {
|
|
67506
67522
|
try {
|
|
67507
67523
|
const doc = MPostFavorite(value);
|
|
@@ -67570,7 +67586,8 @@ function usePostFavoriteRepo() {
|
|
|
67570
67586
|
addFavorite,
|
|
67571
67587
|
getById,
|
|
67572
67588
|
getByPostId,
|
|
67573
|
-
updateById
|
|
67589
|
+
updateById,
|
|
67590
|
+
createIndexes
|
|
67574
67591
|
};
|
|
67575
67592
|
}
|
|
67576
67593
|
|