@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 +2 -18
- package/dist/models/CustomerMinifiedModel.js +5 -10
- package/dist/models/CustomerModel.js +5 -10
- package/dist/models/Functions.js +1 -3
- package/dist/models/NotiHubStatsHistoryModel.js +5 -10
- package/dist/models/NotiHubStatsModel.js +6 -11
- package/dist/models/NotiTypeModel.js +5 -10
- package/dist/models/NotificationModel.js +6 -11
- package/dist/models/NotificationStatsModel.js +6 -11
- package/dist/models/SubscriptionModel.js +5 -10
- package/dist/models/SubscriptionTypeModel.js +5 -10
- package/dist/models/UserModel.js +5 -10
- package/dist/models/index.js +21 -26
- package/dist/models/schemas/CustomerMinifiedSchema.js +3 -5
- package/dist/models/schemas/CustomerSchema.js +5 -10
- package/dist/models/schemas/NotiTypeSchema.js +5 -10
- package/dist/models/schemas/NotificationSchema.js +5 -10
- package/dist/models/schemas/NotificationStatsHistorySchema.js +3 -5
- package/dist/models/schemas/NotificationStatsSchema.d.ts +75 -6
- package/dist/models/schemas/NotificationStatsSchema.js +4 -5
- package/dist/models/schemas/SubscriptionSchema.js +7 -12
- package/dist/models/schemas/SubscriptionTypeSchema.js +1 -3
- package/dist/models/schemas/UserSchema.js +3 -5
- package/dist/types.js +1 -2
- package/dist/util/index.js +1 -3
- package/dist/util/types.js +1 -2
- package/package.json +1 -1
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
|
-
|
|
19
|
-
|
|
2
|
+
export * from "./util/index";
|
|
3
|
+
export * from "./models/index";
|
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
|
4
|
+
const customerMinifiedSchema = new Schema(CustomerMinifiedSchema, { timestamps: true });
|
|
10
5
|
// 3. Create a Model.
|
|
11
|
-
const CustomerMinified =
|
|
12
|
-
|
|
6
|
+
const CustomerMinified = model("CustomerMinified", customerMinifiedSchema);
|
|
7
|
+
export default CustomerMinified;
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
|
4
|
+
const customerSchema = new Schema(CustomerSchema, {
|
|
10
5
|
timestamps: true,
|
|
11
6
|
});
|
|
12
7
|
// 3. Create a Model.
|
|
13
|
-
const Customer =
|
|
14
|
-
|
|
8
|
+
const Customer = model("Customer", customerSchema);
|
|
9
|
+
export default Customer;
|
package/dist/models/Functions.js
CHANGED
|
@@ -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
|
-
|
|
54
|
+
export default { getDate, getDateFormat, addMonths };
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
|
4
|
+
const notihubStatsHistorySchema = new Schema(NotihubStatsHistorySchema, {
|
|
10
5
|
timestamps: true,
|
|
11
6
|
});
|
|
12
7
|
// 3. Create a Model.
|
|
13
|
-
const NotiHubStatsHistory =
|
|
14
|
-
|
|
8
|
+
const NotiHubStatsHistory = model("INotiHubStatsHistories", notihubStatsHistorySchema);
|
|
9
|
+
export default NotiHubStatsHistory;
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
|
10
|
-
entity:
|
|
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 =
|
|
17
|
-
|
|
11
|
+
const EntityNotiHubStats = model("EntityNotiHubStats", entityNotiHubStatsSchema);
|
|
12
|
+
export default EntityNotiHubStats;
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
|
4
|
+
const notiTypeSchema = new Schema(NotiTypeSchema, {
|
|
10
5
|
timestamps: true,
|
|
11
6
|
});
|
|
12
7
|
// 3. Create a Model.
|
|
13
|
-
const NotiTypeModel =
|
|
14
|
-
|
|
8
|
+
const NotiTypeModel = model("NotiTypes", notiTypeSchema);
|
|
9
|
+
export default NotiTypeModel;
|
|
@@ -1,19 +1,14 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
|
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:
|
|
10
|
+
entityMinified: CustomerSchema,
|
|
16
11
|
}, { timestamps: true });
|
|
17
12
|
// 3. Create a Model.
|
|
18
|
-
const NotificationModel =
|
|
19
|
-
|
|
13
|
+
const NotificationModel = model("Notification", notificationSchema);
|
|
14
|
+
export default NotificationModel;
|
|
@@ -1,15 +1,10 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
|
10
|
-
notification:
|
|
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 =
|
|
15
|
-
|
|
9
|
+
const NotificationStatsModel = model("NotificationStats", notificationSchema);
|
|
10
|
+
export default NotificationStatsModel;
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
|
4
|
+
const subscriptionSchema = new Schema(SubscriptionSchema, {
|
|
10
5
|
timestamps: true,
|
|
11
6
|
});
|
|
12
7
|
// 3. Create a Model.
|
|
13
|
-
const Subscription =
|
|
14
|
-
|
|
8
|
+
const Subscription = model("Subscriptions", subscriptionSchema);
|
|
9
|
+
export default Subscription;
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
|
4
|
+
const subscriptionSchema = new Schema(SubscriptionSchema, {
|
|
10
5
|
timestamps: true,
|
|
11
6
|
});
|
|
12
7
|
// 3. Create a Model.
|
|
13
|
-
const SubscriptionType =
|
|
14
|
-
|
|
8
|
+
const SubscriptionType = model("SubscriptionTypes", subscriptionSchema);
|
|
9
|
+
export default SubscriptionType;
|
package/dist/models/UserModel.js
CHANGED
|
@@ -1,12 +1,7 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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
|
|
4
|
+
const userSchema = new Schema(UserSchema, { timestamps: true });
|
|
10
5
|
// 3. Create a Model.
|
|
11
|
-
const UserModel =
|
|
12
|
-
|
|
6
|
+
const UserModel = model("User", userSchema);
|
|
7
|
+
export default UserModel;
|
package/dist/models/index.js
CHANGED
|
@@ -1,27 +1,22 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
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
|
-
|
|
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:
|
|
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
|
-
|
|
12
|
+
export default CustomerMinifiedSchema;
|
|
@@ -1,17 +1,12 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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:
|
|
11
|
-
minified:
|
|
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
|
-
|
|
12
|
+
export default CustomerSchema;
|
|
@@ -1,14 +1,9 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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:
|
|
11
|
-
entity:
|
|
5
|
+
id: { type: Schema.Types.UUID, default: true },
|
|
6
|
+
entity: CustomerSchema,
|
|
12
7
|
type: { type: String, required: true },
|
|
13
8
|
};
|
|
14
|
-
|
|
9
|
+
export default NotiTypeSchema;
|
|
@@ -1,18 +1,13 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
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:
|
|
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:
|
|
11
|
+
entityMinified: CustomerMinifiedSchema,
|
|
17
12
|
};
|
|
18
|
-
|
|
13
|
+
export default NotificationSchema;
|
|
@@ -1,12 +1,10 @@
|
|
|
1
|
-
|
|
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:
|
|
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
|
-
|
|
10
|
+
export default NotihubStatsHistorySchema;
|
|
@@ -1,13 +1,82 @@
|
|
|
1
|
-
|
|
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
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
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
|
|
82
|
+
export default NotificationStatsSchema;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
|
|
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
|
|
5
|
-
notification:
|
|
3
|
+
const NotificationStatsSchema = {
|
|
4
|
+
notification: NotificationSchema,
|
|
6
5
|
views: { type: Number, default: 0 },
|
|
7
6
|
};
|
|
8
|
-
|
|
7
|
+
export default NotificationStatsSchema;
|
|
@@ -1,16 +1,11 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
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:
|
|
6
|
+
id: { type: Schema.Types.UUID, default: true },
|
|
12
7
|
subscriptionId: { type: String, required: true },
|
|
13
|
-
user:
|
|
14
|
-
entity:
|
|
8
|
+
user: UserSchema,
|
|
9
|
+
entity: CustomerSchema,
|
|
15
10
|
};
|
|
16
|
-
|
|
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
|
-
|
|
6
|
+
export default SubscriptionSchema;
|
|
@@ -1,11 +1,9 @@
|
|
|
1
|
-
|
|
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:
|
|
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
|
-
|
|
9
|
+
export default UserSchema;
|
package/dist/types.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|
package/dist/util/index.js
CHANGED
|
@@ -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
|
-
|
|
54
|
+
export default { getDate, getDateFormat, addMonths };
|
package/dist/util/types.js
CHANGED
|
@@ -1,2 +1 @@
|
|
|
1
|
-
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
1
|
+
export {};
|