@amohamud23/notihub 1.0.72 → 1.0.74

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.js CHANGED
@@ -1,19 +1,3 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
1
  // export * from "./types";
18
- __exportStar(require("./util/index"), exports);
19
- __exportStar(require("./models/index"), exports);
2
+ export * from "./util/index";
3
+ export * from "./models/index";
@@ -1,12 +1,7 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const mongoose_1 = require("mongoose");
7
- const CustomerMinifiedSchema_1 = __importDefault(require("./schemas/CustomerMinifiedSchema"));
1
+ import { Schema, model } from "mongoose";
2
+ import CustomerMinifiedSchema from "./schemas/CustomerMinifiedSchema";
8
3
  // 2. Create a Schema corresponding to the document interface.
9
- const customerMinifiedSchema = new mongoose_1.Schema(CustomerMinifiedSchema_1.default, { timestamps: true });
4
+ const customerMinifiedSchema = new Schema(CustomerMinifiedSchema, { timestamps: true });
10
5
  // 3. Create a Model.
11
- const CustomerMinified = (0, mongoose_1.model)("CustomerMinified", customerMinifiedSchema);
12
- exports.default = CustomerMinified;
6
+ const CustomerMinified = model("CustomerMinified", customerMinifiedSchema);
7
+ export default CustomerMinified;
@@ -1,14 +1,9 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const mongoose_1 = require("mongoose");
7
- const CustomerSchema_1 = __importDefault(require("./schemas/CustomerSchema"));
1
+ import { Schema, model } from "mongoose";
2
+ import CustomerSchema from "./schemas/CustomerSchema";
8
3
  // 2. Create a Schema corresponding to the document interface.
9
- const customerSchema = new mongoose_1.Schema(CustomerSchema_1.default, {
4
+ const customerSchema = new Schema(CustomerSchema, {
10
5
  timestamps: true,
11
6
  });
12
7
  // 3. Create a Model.
13
- const Customer = (0, mongoose_1.model)("Customer", customerSchema);
14
- exports.default = Customer;
8
+ const Customer = model("Customer", customerSchema);
9
+ export default Customer;
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  const getDate = (dateStr) => {
4
2
  const date = new Date(dateStr); // Convert seconds to milliseconds
5
3
  const year = date.getFullYear();
@@ -53,4 +51,4 @@ const addMonths = (date, months) => {
53
51
  date.setMonth(date.getMonth() + months);
54
52
  return date;
55
53
  };
56
- exports.default = { getDate, getDateFormat, addMonths };
54
+ export default { getDate, getDateFormat, addMonths };
@@ -1,14 +1,9 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const mongoose_1 = require("mongoose");
7
- const NotificationStatsHistorySchema_1 = __importDefault(require("./schemas/NotificationStatsHistorySchema"));
1
+ import { Schema, model } from "mongoose";
2
+ import NotihubStatsHistorySchema from "./schemas/NotificationStatsHistorySchema";
8
3
  // 2. Create a Schema corresponding to the document interface.
9
- const notihubStatsHistorySchema = new mongoose_1.Schema(NotificationStatsHistorySchema_1.default, {
4
+ const notihubStatsHistorySchema = new Schema(NotihubStatsHistorySchema, {
10
5
  timestamps: true,
11
6
  });
12
7
  // 3. Create a Model.
13
- const NotiHubStatsHistory = (0, mongoose_1.model)("INotiHubStatsHistories", notihubStatsHistorySchema);
14
- exports.default = NotiHubStatsHistory;
8
+ const NotiHubStatsHistory = model("INotiHubStatsHistories", notihubStatsHistorySchema);
9
+ export default NotiHubStatsHistory;
@@ -1,17 +1,12 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const mongoose_1 = require("mongoose");
7
- const CustomerSchema_1 = __importDefault(require("./schemas/CustomerSchema"));
1
+ import { Schema, model } from "mongoose";
2
+ import CustomerSchema from "./schemas/CustomerSchema";
8
3
  // 2. Create a Schema corresponding to the document interface.
9
- const entityNotiHubStatsSchema = new mongoose_1.Schema({
10
- entity: CustomerSchema_1.default,
4
+ const entityNotiHubStatsSchema = new Schema({
5
+ entity: CustomerSchema,
11
6
  notifications: { type: Number, default: 0 },
12
7
  subscription: { type: Number, default: 0 },
13
8
  views: { type: Number, default: 0 },
14
9
  }, { timestamps: true });
15
10
  // 3. Create a Model.
16
- const EntityNotiHubStats = (0, mongoose_1.model)("EntityNotiHubStats", entityNotiHubStatsSchema);
17
- exports.default = EntityNotiHubStats;
11
+ const EntityNotiHubStats = model("EntityNotiHubStats", entityNotiHubStatsSchema);
12
+ export default EntityNotiHubStats;
@@ -1,14 +1,9 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const mongoose_1 = require("mongoose");
7
- const NotiTypeSchema_1 = __importDefault(require("./schemas/NotiTypeSchema"));
1
+ import { Schema, model } from "mongoose";
2
+ import NotiTypeSchema from "./schemas/NotiTypeSchema";
8
3
  // 2. Create a Schema corresponding to the document interface.
9
- const notiTypeSchema = new mongoose_1.Schema(NotiTypeSchema_1.default, {
4
+ const notiTypeSchema = new Schema(NotiTypeSchema, {
10
5
  timestamps: true,
11
6
  });
12
7
  // 3. Create a Model.
13
- const NotiTypeModel = (0, mongoose_1.model)("NotiTypes", notiTypeSchema);
14
- exports.default = NotiTypeModel;
8
+ const NotiTypeModel = model("NotiTypes", notiTypeSchema);
9
+ export default NotiTypeModel;
@@ -1,19 +1,14 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const mongoose_1 = require("mongoose");
7
- const CustomerSchema_1 = __importDefault(require("./schemas/CustomerSchema"));
1
+ import { Schema, model } from "mongoose";
2
+ import CustomerSchema from "./schemas/CustomerSchema";
8
3
  // 2. Create a Schema corresponding to the document interface.
9
- const notificationSchema = new mongoose_1.Schema({
4
+ const notificationSchema = new Schema({
10
5
  title: { type: String, required: true },
11
6
  message: { type: String, required: true },
12
7
  type: { type: String, required: true },
13
8
  body: { type: String },
14
9
  entityId: { type: String, required: true },
15
- entityMinified: CustomerSchema_1.default,
10
+ entityMinified: CustomerSchema,
16
11
  }, { timestamps: true });
17
12
  // 3. Create a Model.
18
- const NotificationModel = (0, mongoose_1.model)("Notification", notificationSchema);
19
- exports.default = NotificationModel;
13
+ const NotificationModel = model("Notification", notificationSchema);
14
+ export default NotificationModel;
@@ -1,15 +1,10 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const mongoose_1 = require("mongoose");
7
- const NotificationSchema_1 = __importDefault(require("./schemas/NotificationSchema"));
1
+ import { Schema, model } from "mongoose";
2
+ import NotificationSchema from "./schemas/NotificationSchema";
8
3
  // 2. Create a Schema corresponding to the document interface.
9
- const notificationSchema = new mongoose_1.Schema({
10
- notification: NotificationSchema_1.default,
4
+ const notificationSchema = new Schema({
5
+ notification: NotificationSchema,
11
6
  views: { type: Number, default: 0 },
12
7
  }, { timestamps: true });
13
8
  // 3. Create a Model.
14
- const NotificationStatsModel = (0, mongoose_1.model)("NotificationStats", notificationSchema);
15
- exports.default = NotificationStatsModel;
9
+ const NotificationStatsModel = model("NotificationStats", notificationSchema);
10
+ export default NotificationStatsModel;
@@ -1,14 +1,9 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const mongoose_1 = require("mongoose");
7
- const SubscriptionSchema_1 = __importDefault(require("./schemas/SubscriptionSchema"));
1
+ import { Schema, model } from "mongoose";
2
+ import SubscriptionSchema from "./schemas/SubscriptionSchema";
8
3
  // 2. Create a Schema corresponding to the document interface.
9
- const subscriptionSchema = new mongoose_1.Schema(SubscriptionSchema_1.default, {
4
+ const subscriptionSchema = new Schema(SubscriptionSchema, {
10
5
  timestamps: true,
11
6
  });
12
7
  // 3. Create a Model.
13
- const Subscription = (0, mongoose_1.model)("Subscriptions", subscriptionSchema);
14
- exports.default = Subscription;
8
+ const Subscription = model("Subscriptions", subscriptionSchema);
9
+ export default Subscription;
@@ -1,14 +1,9 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const mongoose_1 = require("mongoose");
7
- const SubscriptionTypeSchema_1 = __importDefault(require("./schemas/SubscriptionTypeSchema"));
1
+ import { Schema, model } from "mongoose";
2
+ import SubscriptionSchema from "./schemas/SubscriptionTypeSchema";
8
3
  // 2. Create a Schema corresponding to the document interface.
9
- const subscriptionSchema = new mongoose_1.Schema(SubscriptionTypeSchema_1.default, {
4
+ const subscriptionSchema = new Schema(SubscriptionSchema, {
10
5
  timestamps: true,
11
6
  });
12
7
  // 3. Create a Model.
13
- const SubscriptionType = (0, mongoose_1.model)("SubscriptionTypes", subscriptionSchema);
14
- exports.default = SubscriptionType;
8
+ const SubscriptionType = model("SubscriptionTypes", subscriptionSchema);
9
+ export default SubscriptionType;
@@ -1,12 +1,7 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const mongoose_1 = require("mongoose");
7
- const UserSchema_1 = __importDefault(require("./schemas/UserSchema"));
1
+ import { Schema, model } from "mongoose";
2
+ import UserSchema from "./schemas/UserSchema";
8
3
  // 2. Create a Schema corresponding to the document interface.
9
- const userSchema = new mongoose_1.Schema(UserSchema_1.default, { timestamps: true });
4
+ const userSchema = new Schema(UserSchema, { timestamps: true });
10
5
  // 3. Create a Model.
11
- const UserModel = (0, mongoose_1.model)("User", userSchema);
12
- exports.default = UserModel;
6
+ const UserModel = model("User", userSchema);
7
+ export default UserModel;
@@ -1,27 +1,22 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const UserModel_1 = __importDefault(require("./UserModel"));
7
- const SubscriptionModel_1 = __importDefault(require("./SubscriptionModel"));
8
- const NotiTypeModel_1 = __importDefault(require("./NotiTypeModel"));
9
- const NotiHubStatsHistoryModel_1 = __importDefault(require("./NotiHubStatsHistoryModel"));
10
- const NotificationStatsModel_1 = __importDefault(require("./NotificationStatsModel"));
11
- const NotificationModel_1 = __importDefault(require("./NotificationModel"));
12
- const CustomerModel_1 = __importDefault(require("./CustomerModel"));
13
- const CustomerMinifiedModel_1 = __importDefault(require("./CustomerMinifiedModel"));
14
- const SubscriptionTypeModel_1 = __importDefault(require("./SubscriptionTypeModel"));
15
- const Functions_1 = __importDefault(require("./Functions"));
16
- exports.default = {
17
- UserModel: UserModel_1.default,
18
- Subscription: SubscriptionModel_1.default,
19
- SubscriptionType: SubscriptionTypeModel_1.default,
20
- NotiTypeModel: NotiTypeModel_1.default,
21
- NotificationStatsModel: NotificationStatsModel_1.default,
22
- NotiHubStatsHistory: NotiHubStatsHistoryModel_1.default,
23
- NotificationModel: NotificationModel_1.default,
24
- Customer: CustomerModel_1.default,
25
- CustomerMinified: CustomerMinifiedModel_1.default,
26
- Functions: Functions_1.default,
1
+ import UserModel from "./UserModel";
2
+ import Subscription from "./SubscriptionModel";
3
+ import NotiTypeModel from "./NotiTypeModel";
4
+ import NotiHubStatsHistory from "./NotiHubStatsHistoryModel";
5
+ import NotificationStatsModel from "./NotificationStatsModel";
6
+ import NotificationModel from "./NotificationModel";
7
+ import Customer from "./CustomerModel";
8
+ import CustomerMinified from "./CustomerMinifiedModel";
9
+ import SubscriptionType from "./SubscriptionTypeModel";
10
+ import Functions from "./Functions";
11
+ export default {
12
+ UserModel,
13
+ Subscription,
14
+ SubscriptionType,
15
+ NotiTypeModel,
16
+ NotificationStatsModel,
17
+ NotiHubStatsHistory,
18
+ NotificationModel,
19
+ Customer,
20
+ CustomerMinified,
21
+ Functions,
27
22
  };
@@ -1,9 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const mongoose_1 = require("mongoose");
1
+ import { Schema } from "mongoose";
4
2
  // 2. Create a Schema corresponding to the document interface.
5
3
  const CustomerMinifiedSchema = {
6
- id: { type: mongoose_1.Schema.Types.UUID, default: true },
4
+ id: { type: Schema.Types.UUID, default: true },
7
5
  username: { type: String, required: true },
8
6
  img: {
9
7
  bucket: { type: String, required: true },
@@ -11,4 +9,4 @@ const CustomerMinifiedSchema = {
11
9
  },
12
10
  name: { type: String, required: true },
13
11
  };
14
- exports.default = CustomerMinifiedSchema;
12
+ export default CustomerMinifiedSchema;
@@ -1,17 +1,12 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const mongoose_1 = require("mongoose");
7
- const CustomerMinifiedSchema_1 = __importDefault(require("./CustomerMinifiedSchema"));
1
+ import { Schema } from "mongoose";
2
+ import CustomerMinifiedSchema from "./CustomerMinifiedSchema";
8
3
  // 2. Create a Schema corresponding to the document interface.
9
4
  const CustomerSchema = {
10
- id: { type: mongoose_1.Schema.Types.UUID, default: true },
11
- minified: CustomerMinifiedSchema_1.default,
5
+ id: { type: Schema.Types.UUID, default: true },
6
+ minified: CustomerMinifiedSchema,
12
7
  paid: { type: Boolean, default: false },
13
8
  email: { type: String, required: true },
14
9
  verified: { type: Boolean, default: false },
15
10
  confirmed: { type: Boolean, default: false },
16
11
  };
17
- exports.default = CustomerSchema;
12
+ export default CustomerSchema;
@@ -1,14 +1,9 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const mongoose_1 = require("mongoose");
7
- const CustomerSchema_1 = __importDefault(require("./CustomerSchema"));
1
+ import { Schema } from "mongoose";
2
+ import CustomerSchema from "./CustomerSchema";
8
3
  // 2. Create a Schema corresponding to the document interface.
9
4
  const NotiTypeSchema = {
10
- id: { type: mongoose_1.Schema.Types.UUID, default: true },
11
- entity: CustomerSchema_1.default,
5
+ id: { type: Schema.Types.UUID, default: true },
6
+ entity: CustomerSchema,
12
7
  type: { type: String, required: true },
13
8
  };
14
- exports.default = NotiTypeSchema;
9
+ export default NotiTypeSchema;
@@ -1,18 +1,13 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const mongoose_1 = require("mongoose");
7
- const CustomerMinifiedSchema_1 = __importDefault(require("./CustomerMinifiedSchema"));
1
+ import { Schema } from "mongoose";
2
+ import CustomerMinifiedSchema from "./CustomerMinifiedSchema";
8
3
  // 2. Create a Schema corresponding to the document interface.
9
4
  const NotificationSchema = {
10
- id: { type: mongoose_1.Schema.Types.UUID, default: true },
5
+ id: { type: Schema.Types.UUID, default: true },
11
6
  title: { type: String, required: true },
12
7
  message: { type: String, required: true },
13
8
  type: { type: String, required: true },
14
9
  body: { type: String },
15
10
  entityId: { type: String, required: true },
16
- entityMinified: CustomerMinifiedSchema_1.default,
11
+ entityMinified: CustomerMinifiedSchema,
17
12
  };
18
- exports.default = NotificationSchema;
13
+ export default NotificationSchema;
@@ -1,12 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const mongoose_1 = require("mongoose");
1
+ import { Schema } from "mongoose";
4
2
  const NotihubStatsHistorySchema = {
5
- id: { type: mongoose_1.Schema.Types.UUID, default: true },
3
+ id: { type: Schema.Types.UUID, default: true },
6
4
  entityId: { type: String, required: true },
7
5
  notifications: { type: Number, required: true },
8
6
  subscription: { type: Number, required: true },
9
7
  views: { type: Number, required: true },
10
8
  type: { type: String, required: true },
11
9
  };
12
- exports.default = NotihubStatsHistorySchema;
10
+ export default NotihubStatsHistorySchema;
@@ -1,13 +1,82 @@
1
- declare const NotificationSchema: {
1
+ /// <reference types="mongoose/types/aggregate" />
2
+ /// <reference types="mongoose/types/callback" />
3
+ /// <reference types="mongoose/types/collection" />
4
+ /// <reference types="mongoose/types/connection" />
5
+ /// <reference types="mongoose/types/cursor" />
6
+ /// <reference types="mongoose/types/document" />
7
+ /// <reference types="mongoose/types/error" />
8
+ /// <reference types="mongoose/types/expressions" />
9
+ /// <reference types="mongoose/types/helpers" />
10
+ /// <reference types="mongoose/types/middlewares" />
11
+ /// <reference types="mongoose/types/indexes" />
12
+ /// <reference types="mongoose/types/models" />
13
+ /// <reference types="mongoose/types/mongooseoptions" />
14
+ /// <reference types="mongoose/types/pipelinestage" />
15
+ /// <reference types="mongoose/types/populate" />
16
+ /// <reference types="mongoose/types/query" />
17
+ /// <reference types="mongoose/types/schemaoptions" />
18
+ /// <reference types="mongoose/types/schematypes" />
19
+ /// <reference types="mongoose/types/session" />
20
+ /// <reference types="mongoose/types/types" />
21
+ /// <reference types="mongoose/types/utility" />
22
+ /// <reference types="mongoose/types/validation" />
23
+ /// <reference types="mongoose/types/virtuals" />
24
+ /// <reference types="mongoose/types/inferschematype" />
25
+ /// <reference types="mongoose/types/inferrawdoctype" />
26
+ import { Schema } from "mongoose";
27
+ declare const NotificationStatsSchema: {
2
28
  notification: {
3
- new (title: string, options?: NotificationOptions | undefined): Notification;
4
- prototype: Notification;
5
- readonly permission: NotificationPermission;
6
- requestPermission(deprecatedCallback?: NotificationPermissionCallback | undefined): Promise<NotificationPermission>;
29
+ id: {
30
+ type: typeof Schema.Types.UUID;
31
+ default: boolean;
32
+ };
33
+ title: {
34
+ type: StringConstructor;
35
+ required: boolean;
36
+ };
37
+ message: {
38
+ type: StringConstructor;
39
+ required: boolean;
40
+ };
41
+ type: {
42
+ type: StringConstructor;
43
+ required: boolean;
44
+ };
45
+ body: {
46
+ type: StringConstructor;
47
+ };
48
+ entityId: {
49
+ type: StringConstructor;
50
+ required: boolean;
51
+ };
52
+ entityMinified: {
53
+ id: {
54
+ type: typeof Schema.Types.UUID;
55
+ default: boolean;
56
+ };
57
+ username: {
58
+ type: StringConstructor;
59
+ required: boolean;
60
+ };
61
+ img: {
62
+ bucket: {
63
+ type: StringConstructor;
64
+ required: boolean;
65
+ };
66
+ key: {
67
+ type: StringConstructor;
68
+ required: boolean;
69
+ };
70
+ };
71
+ name: {
72
+ type: StringConstructor;
73
+ required: boolean;
74
+ };
75
+ };
7
76
  };
8
77
  views: {
9
78
  type: NumberConstructor;
10
79
  default: number;
11
80
  };
12
81
  };
13
- export default NotificationSchema;
82
+ export default NotificationStatsSchema;
@@ -1,8 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ import NotificationSchema from "./NotificationSchema";
3
2
  // 2. Create a Schema corresponding to the document interface.
4
- const NotificationSchema = {
5
- notification: Notification,
3
+ const NotificationStatsSchema = {
4
+ notification: NotificationSchema,
6
5
  views: { type: Number, default: 0 },
7
6
  };
8
- exports.default = NotificationSchema;
7
+ export default NotificationStatsSchema;
@@ -1,16 +1,11 @@
1
- "use strict";
2
- var __importDefault = (this && this.__importDefault) || function (mod) {
3
- return (mod && mod.__esModule) ? mod : { "default": mod };
4
- };
5
- Object.defineProperty(exports, "__esModule", { value: true });
6
- const mongoose_1 = require("mongoose");
7
- const CustomerSchema_1 = __importDefault(require("./CustomerSchema"));
8
- const UserSchema_1 = __importDefault(require("./UserSchema"));
1
+ import { Schema } from "mongoose";
2
+ import CustomerSchema from "./CustomerSchema";
3
+ import UserSchema from "./UserSchema";
9
4
  // 2. Create a Schema corresponding to the document interface.
10
5
  const SubscriptionSchema = {
11
- id: { type: mongoose_1.Schema.Types.UUID, default: true },
6
+ id: { type: Schema.Types.UUID, default: true },
12
7
  subscriptionId: { type: String, required: true },
13
- user: UserSchema_1.default,
14
- entity: CustomerSchema_1.default,
8
+ user: UserSchema,
9
+ entity: CustomerSchema,
15
10
  };
16
- exports.default = SubscriptionSchema;
11
+ export default SubscriptionSchema;
@@ -1,8 +1,6 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  const SubscriptionSchema = {
4
2
  userId: { type: String, required: true },
5
3
  entityId: { type: String, required: true },
6
4
  notiTypeId: { type: String, required: true },
7
5
  };
8
- exports.default = SubscriptionSchema;
6
+ export default SubscriptionSchema;
@@ -1,11 +1,9 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- const mongoose_1 = require("mongoose");
1
+ import { Schema } from "mongoose";
4
2
  const UserSchema = {
5
- id: { type: mongoose_1.Schema.Types.UUID, default: true },
3
+ id: { type: Schema.Types.UUID, default: true },
6
4
  name: { type: String, required: true },
7
5
  email: { type: String, required: true },
8
6
  pushToken: { type: String, required: true },
9
7
  signedIn: { type: Boolean, required: true, default: false },
10
8
  };
11
- exports.default = UserSchema;
9
+ export default UserSchema;
package/dist/types.js CHANGED
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
@@ -1,5 +1,3 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
1
  function getDate(dateStr) {
4
2
  const date = new Date(dateStr); // Convert seconds to milliseconds
5
3
  const year = date.getFullYear();
@@ -53,4 +51,4 @@ function addMonths({ date, months }) {
53
51
  date.setMonth(date.getMonth() + months);
54
52
  return date;
55
53
  }
56
- exports.default = { getDate, getDateFormat, addMonths };
54
+ export default { getDate, getDateFormat, addMonths };
@@ -1,2 +1 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
1
+ export {};
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amohamud23/notihub",
3
- "version": "1.0.72",
3
+ "version": "1.0.74",
4
4
  "description": "Notihub Package",
5
5
  "main": "./dist/index.js",
6
6
  "module": "./dist/index.mjs",