@eeplatform/core 1.4.1 → 1.4.3

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.mjs CHANGED
@@ -11382,6 +11382,24 @@ function useVerificationRepo() {
11382
11382
  });
11383
11383
  });
11384
11384
  }
11385
+ async function createIndexes() {
11386
+ try {
11387
+ await collection.createIndexes([
11388
+ { key: { email: 1 } },
11389
+ { key: { type: 1 } },
11390
+ { key: { status: 1 } },
11391
+ { key: { "metadata.org": 1 } },
11392
+ { key: { email: "text" } },
11393
+ {
11394
+ key: { expiredAt: 1 },
11395
+ expireAfterSeconds: 0,
11396
+ name: "ttl_expiredAt_index"
11397
+ }
11398
+ ]);
11399
+ } catch (error) {
11400
+ throw new InternalServerError("Failed to create indexes.");
11401
+ }
11402
+ }
11385
11403
  async function createIndex() {
11386
11404
  try {
11387
11405
  await collection.createIndex([
@@ -11604,9 +11622,7 @@ function useVerificationRepo() {
11604
11622
  }
11605
11623
  }
11606
11624
  return {
11607
- createIndex,
11608
- createTextIndex,
11609
- createUniqueIndex,
11625
+ createIndexes,
11610
11626
  add,
11611
11627
  getVerifications,
11612
11628
  getById,
@@ -12784,7 +12800,7 @@ function useVerificationService() {
12784
12800
  to: email,
12785
12801
  subject: "Member Invite",
12786
12802
  html: emailContent2,
12787
- from: metadata.orgName || "GoWeekDays"
12803
+ from: "EEPlatform"
12788
12804
  }).catch((error) => {
12789
12805
  logger4.log({
12790
12806
  level: "error",
@@ -12806,7 +12822,7 @@ function useVerificationService() {
12806
12822
  to: email,
12807
12823
  subject: "User Invite",
12808
12824
  html: emailContent,
12809
- from: "GoWeekDays"
12825
+ from: "EEPlatform"
12810
12826
  }).catch((error) => {
12811
12827
  logger4.log({
12812
12828
  level: "error",
@@ -13017,7 +13033,7 @@ function useVerificationService() {
13017
13033
  type: "user-sign-up",
13018
13034
  email,
13019
13035
  metadata,
13020
- expireAt: new Date((/* @__PURE__ */ new Date()).getTime() + 5 * 60 * 1e3).toISOString(),
13036
+ expireAt: new Date((/* @__PURE__ */ new Date()).getTime() + 5 * 60 * 1e3),
13021
13037
  // 5mins from now
13022
13038
  createdAt: (/* @__PURE__ */ new Date()).toISOString()
13023
13039
  };
@@ -27782,7 +27798,7 @@ import Joi34 from "joi";
27782
27798
  // src/services/building.service.ts
27783
27799
  import {
27784
27800
  BadRequestError as BadRequestError62,
27785
- NotFoundError as NotFoundError10,
27801
+ NotFoundError as NotFoundError9,
27786
27802
  useAtlas as useAtlas33
27787
27803
  } from "@eeplatform/nodejs-utils";
27788
27804
  function useBuildingService() {
@@ -27798,7 +27814,7 @@ function useBuildingService() {
27798
27814
  try {
27799
27815
  const building = await _getById(id);
27800
27816
  if (!building) {
27801
- throw new NotFoundError10("Building not found.");
27817
+ throw new NotFoundError9("Building not found.");
27802
27818
  }
27803
27819
  if (data.levels < building.levels) {
27804
27820
  const unit = await getByBuildingLevel(id, building.levels);
@@ -29123,7 +29139,7 @@ import Joi39 from "joi";
29123
29139
  // src/services/stock-card.service.ts
29124
29140
  import {
29125
29141
  BadRequestError as BadRequestError70,
29126
- NotFoundError as NotFoundError11,
29142
+ NotFoundError as NotFoundError10,
29127
29143
  useAtlas as useAtlas37
29128
29144
  } from "@eeplatform/nodejs-utils";
29129
29145
  function useStockCardService() {
@@ -29138,7 +29154,7 @@ function useStockCardService() {
29138
29154
  try {
29139
29155
  const asset = await _getAssetById(data.item);
29140
29156
  if (!asset) {
29141
- throw new NotFoundError11("Asset not found.");
29157
+ throw new NotFoundError10("Asset not found.");
29142
29158
  }
29143
29159
  data.balance = (asset.qty ?? 0) + data.qty;
29144
29160
  await _add(data, session);