@amohamud23/notihub 1.0.31 → 1.0.33
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 +10 -38
- package/dist/index.js +23 -4
- package/dist/lib/{db → models}/CustomerMinifiedModel.d.ts +8 -34
- package/dist/lib/{db → models}/CustomerModel.d.ts +0 -1
- package/dist/lib/{db → models}/NotiHubStatsHistoryModel.d.ts +0 -1
- package/dist/lib/{db → models}/NotiHubStatsModel.d.ts +0 -1
- package/dist/lib/{db → models}/NotiTypeModel.d.ts +0 -1
- package/dist/lib/{db → models}/NotificationModel.d.ts +0 -1
- package/dist/lib/{db → models}/NotificationStatsModel.d.ts +0 -1
- package/dist/lib/{db → models}/SubscriptionModel.d.ts +0 -1
- package/dist/lib/{db → models}/UserModel.d.ts +0 -1
- package/dist/lib/models/index.d.ts +77 -0
- package/index.ts +22 -40
- package/lib/{db → models}/CustomerMinifiedModel.ts +3 -1
- package/lib/{db → models}/CustomerModel.ts +0 -1
- package/lib/{db → models}/NotiHubStatsHistoryModel.ts +0 -1
- package/lib/{db → models}/NotiHubStatsModel.ts +0 -1
- package/lib/{db → models}/NotiTypeModel.ts +0 -1
- package/lib/{db → models}/NotificationModel.ts +0 -1
- package/lib/{db → models}/NotificationStatsModel.ts +0 -1
- package/lib/{db → models}/SubscriptionModel.ts +0 -1
- package/lib/{db → models}/UserModel.ts +0 -1
- package/package.json +2 -2
- package/types/index.d.ts +21 -26
- package/dist/lib/db/index.d.ts +0 -103
- /package/dist/lib/{db → models}/CustomerMinifiedModel.js +0 -0
- /package/dist/lib/{db → models}/CustomerModel.js +0 -0
- /package/dist/lib/{db → models}/NotiHubStatsHistoryModel.js +0 -0
- /package/dist/lib/{db → models}/NotiHubStatsModel.js +0 -0
- /package/dist/lib/{db → models}/NotiTypeModel.js +0 -0
- /package/dist/lib/{db → models}/NotificationModel.js +0 -0
- /package/dist/lib/{db → models}/NotificationStatsModel.js +0 -0
- /package/dist/lib/{db → models}/SubscriptionModel.js +0 -0
- /package/dist/lib/{db → models}/UserModel.js +0 -0
- /package/dist/lib/{db → models}/index.js +0 -0
- /package/dist/lib/{db → models}/schemas/CustomerMinifiedSchema.d.ts +0 -0
- /package/dist/lib/{db → models}/schemas/CustomerMinifiedSchema.js +0 -0
- /package/dist/lib/{db → models}/schemas/CustomerSchema.d.ts +0 -0
- /package/dist/lib/{db → models}/schemas/CustomerSchema.js +0 -0
- /package/dist/lib/{db → models}/schemas/NotiTypeSchema.d.ts +0 -0
- /package/dist/lib/{db → models}/schemas/NotiTypeSchema.js +0 -0
- /package/dist/lib/{db → models}/schemas/NotificationSchema.d.ts +0 -0
- /package/dist/lib/{db → models}/schemas/NotificationSchema.js +0 -0
- /package/dist/lib/{db → models}/schemas/NotificationStatsHistorySchema.d.ts +0 -0
- /package/dist/lib/{db → models}/schemas/NotificationStatsHistorySchema.js +0 -0
- /package/dist/lib/{db → models}/schemas/NotificationStatsSchema.d.ts +0 -0
- /package/dist/lib/{db → models}/schemas/NotificationStatsSchema.js +0 -0
- /package/dist/lib/{db → models}/schemas/SubscriptionSchema.d.ts +0 -0
- /package/dist/lib/{db → models}/schemas/SubscriptionSchema.js +0 -0
- /package/dist/lib/{db → models}/schemas/UserSchema.d.ts +0 -0
- /package/dist/lib/{db → models}/schemas/UserSchema.js +0 -0
- /package/lib/{db → models}/index.ts +0 -0
- /package/lib/{db → models}/schemas/CustomerMinifiedSchema.ts +0 -0
- /package/lib/{db → models}/schemas/CustomerSchema.ts +0 -0
- /package/lib/{db → models}/schemas/NotiTypeSchema.ts +0 -0
- /package/lib/{db → models}/schemas/NotificationSchema.ts +0 -0
- /package/lib/{db → models}/schemas/NotificationStatsHistorySchema.ts +0 -0
- /package/lib/{db → models}/schemas/NotificationStatsSchema.ts +0 -0
- /package/lib/{db → models}/schemas/SubscriptionSchema.ts +0 -0
- /package/lib/{db → models}/schemas/UserSchema.ts +0 -0
package/dist/index.d.ts
CHANGED
|
@@ -24,13 +24,12 @@
|
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
26
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
-
|
|
28
|
-
export declare const dateUtil: {
|
|
27
|
+
export declare const DateUtil: {
|
|
29
28
|
addMonths: (date: Date, months: number) => Date;
|
|
30
29
|
getDate: (dateStr: string) => string;
|
|
31
30
|
getDateFormat: (dateStr: string) => string;
|
|
32
31
|
};
|
|
33
|
-
export declare const
|
|
32
|
+
export declare const DB: {
|
|
34
33
|
UserModel: import("mongoose").Model<INotiHubUser, {}, {}, {}, import("mongoose").Document<unknown, {}, INotiHubUser> & INotiHubUser & Required<{
|
|
35
34
|
_id: string;
|
|
36
35
|
}> & {
|
|
@@ -66,44 +65,17 @@ export declare const schemas: {
|
|
|
66
65
|
}> & {
|
|
67
66
|
__v?: number | undefined;
|
|
68
67
|
}, any>;
|
|
69
|
-
CustomerMinified: import("mongoose").Model<{
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
name: string;
|
|
76
|
-
id: Buffer;
|
|
77
|
-
username: string;
|
|
78
|
-
img?: any;
|
|
68
|
+
CustomerMinified: import("mongoose").Model<INotiHubCustomerMinified, {}, {}, {}, import("mongoose").Document<unknown, {}, INotiHubCustomerMinified> & INotiHubCustomerMinified & Required<{
|
|
69
|
+
_id: string;
|
|
70
|
+
}> & {
|
|
71
|
+
__v?: number | undefined;
|
|
72
|
+
}, import("mongoose").Schema<INotiHubCustomerMinified, import("mongoose").Model<INotiHubCustomerMinified, any, any, any, import("mongoose").Document<unknown, any, INotiHubCustomerMinified> & INotiHubCustomerMinified & Required<{
|
|
73
|
+
_id: string;
|
|
79
74
|
}> & {
|
|
80
|
-
name: string;
|
|
81
|
-
id: Buffer;
|
|
82
|
-
username: string;
|
|
83
|
-
img?: any;
|
|
84
|
-
} & {
|
|
85
|
-
_id: import("mongoose").Types.ObjectId;
|
|
86
|
-
} & {
|
|
87
75
|
__v?: number | undefined;
|
|
88
|
-
}, import("mongoose").
|
|
89
|
-
|
|
90
|
-
id: Buffer;
|
|
91
|
-
username: string;
|
|
92
|
-
img?: any;
|
|
93
|
-
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
94
|
-
name: string;
|
|
95
|
-
id: Buffer;
|
|
96
|
-
username: string;
|
|
97
|
-
img?: any;
|
|
98
|
-
}>> & import("mongoose").FlatRecord<{
|
|
99
|
-
name: string;
|
|
100
|
-
id: Buffer;
|
|
101
|
-
username: string;
|
|
102
|
-
img?: any;
|
|
76
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, INotiHubCustomerMinified, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<INotiHubCustomerMinified>> & import("mongoose").FlatRecord<INotiHubCustomerMinified> & Required<{
|
|
77
|
+
_id: string;
|
|
103
78
|
}> & {
|
|
104
|
-
_id: import("mongoose").Types.ObjectId;
|
|
105
|
-
} & {
|
|
106
79
|
__v?: number | undefined;
|
|
107
80
|
}>>;
|
|
108
81
|
};
|
|
109
|
-
export { type INotiHubCustomer, type IUserSubscription, type IUserSubscribeNotifier, type ICreateCustomerRequestBody, type INotiHubStats, type INotiTypeStats, type INotiHubUserView, type INotiType, type INotiHubUser, type INotiHubSubscription, type INotiHubStatsHistory, type INotiHubNotificationStats, type INotiHubNotification, type INotiHubImage, type INotiHubCustomerMinified, type ICreateNotiRequestBody, };
|
package/dist/index.js
CHANGED
|
@@ -3,9 +3,28 @@ var __importDefault = (this && this.__importDefault) || function (mod) {
|
|
|
3
3
|
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
4
4
|
};
|
|
5
5
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
6
|
-
exports.
|
|
6
|
+
exports.DB = exports.DateUtil = void 0;
|
|
7
7
|
const DateUtil_1 = __importDefault(require("./lib/util/DateUtil"));
|
|
8
|
-
const index_1 = __importDefault(require("./lib/
|
|
8
|
+
const index_1 = __importDefault(require("./lib/models/index"));
|
|
9
|
+
// import {
|
|
10
|
+
// INotiHubCustomer,
|
|
11
|
+
// IUserSubscription,
|
|
12
|
+
// IUserSubscribeNotifier,
|
|
13
|
+
// INotiTypeStats,
|
|
14
|
+
// INotiHubUserView,
|
|
15
|
+
// INotiType,
|
|
16
|
+
// INotiHubUser,
|
|
17
|
+
// INotiHubSubscription,
|
|
18
|
+
// INotiHubStatsHistory,
|
|
19
|
+
// INotiHubStats,
|
|
20
|
+
// INotiHubNotificationStats,
|
|
21
|
+
// INotiHubNotification,
|
|
22
|
+
// INotiHubImage,
|
|
23
|
+
// INotiHubCustomerMinified,
|
|
24
|
+
// ICreateNotiRequestBody,
|
|
25
|
+
// ICreateCustomerRequestBody,
|
|
26
|
+
// } from "./index";
|
|
9
27
|
// ---------NotiHub Utils ---------------------------------------------------------------
|
|
10
|
-
exports.
|
|
11
|
-
exports.
|
|
28
|
+
exports.DateUtil = DateUtil_1.default;
|
|
29
|
+
exports.DB = index_1.default;
|
|
30
|
+
// ---------NotiHub Types ---------------------------------------------------------------
|
|
@@ -24,43 +24,17 @@
|
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
26
26
|
import { Schema } from "mongoose";
|
|
27
|
-
declare const CustomerMinified: import("mongoose").Model<{
|
|
28
|
-
|
|
29
|
-
id: Buffer;
|
|
30
|
-
username: string;
|
|
31
|
-
img?: any;
|
|
32
|
-
}, {}, {}, {}, import("mongoose").Document<unknown, {}, {
|
|
33
|
-
name: string;
|
|
34
|
-
id: Buffer;
|
|
35
|
-
username: string;
|
|
36
|
-
img?: any;
|
|
27
|
+
declare const CustomerMinified: import("mongoose").Model<INotiHubCustomerMinified, {}, {}, {}, import("mongoose").Document<unknown, {}, INotiHubCustomerMinified> & INotiHubCustomerMinified & Required<{
|
|
28
|
+
_id: string;
|
|
37
29
|
}> & {
|
|
38
|
-
name: string;
|
|
39
|
-
id: Buffer;
|
|
40
|
-
username: string;
|
|
41
|
-
img?: any;
|
|
42
|
-
} & {
|
|
43
|
-
_id: import("mongoose").Types.ObjectId;
|
|
44
|
-
} & {
|
|
45
30
|
__v?: number | undefined;
|
|
46
|
-
}, Schema<
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
name: string;
|
|
53
|
-
id: Buffer;
|
|
54
|
-
username: string;
|
|
55
|
-
img?: any;
|
|
56
|
-
}>> & import("mongoose").FlatRecord<{
|
|
57
|
-
name: string;
|
|
58
|
-
id: Buffer;
|
|
59
|
-
username: string;
|
|
60
|
-
img?: any;
|
|
31
|
+
}, Schema<INotiHubCustomerMinified, import("mongoose").Model<INotiHubCustomerMinified, any, any, any, import("mongoose").Document<unknown, any, INotiHubCustomerMinified> & INotiHubCustomerMinified & Required<{
|
|
32
|
+
_id: string;
|
|
33
|
+
}> & {
|
|
34
|
+
__v?: number | undefined;
|
|
35
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, INotiHubCustomerMinified, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<INotiHubCustomerMinified>> & import("mongoose").FlatRecord<INotiHubCustomerMinified> & Required<{
|
|
36
|
+
_id: string;
|
|
61
37
|
}> & {
|
|
62
|
-
_id: import("mongoose").Types.ObjectId;
|
|
63
|
-
} & {
|
|
64
38
|
__v?: number | undefined;
|
|
65
39
|
}>>;
|
|
66
40
|
export default CustomerMinified;
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
26
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
-
import { INotiHubCustomer } from "../../types";
|
|
28
27
|
declare const Customer: import("mongoose").Model<INotiHubCustomer, {}, {}, {}, import("mongoose").Document<unknown, {}, INotiHubCustomer> & INotiHubCustomer & Required<{
|
|
29
28
|
_id: string;
|
|
30
29
|
}> & {
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
26
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
-
import { INotiHubStatsHistory } from "../../types";
|
|
28
27
|
declare const NotiHubStatsHistory: import("mongoose").Model<INotiHubStatsHistory, {}, {}, {}, import("mongoose").Document<unknown, {}, INotiHubStatsHistory> & INotiHubStatsHistory & {
|
|
29
28
|
_id: import("mongoose").Types.ObjectId;
|
|
30
29
|
} & {
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
26
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
-
import { INotiHubStats } from "../../types";
|
|
28
27
|
declare const EntityNotiHubStats: import("mongoose").Model<INotiHubStats, {}, {}, {}, import("mongoose").Document<unknown, {}, INotiHubStats> & INotiHubStats & {
|
|
29
28
|
_id: import("mongoose").Types.ObjectId;
|
|
30
29
|
} & {
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
26
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
-
import { INotiType } from "../../types";
|
|
28
27
|
declare const NotiTypeModel: import("mongoose").Model<INotiType, {}, {}, {}, import("mongoose").Document<unknown, {}, INotiType> & INotiType & Required<{
|
|
29
28
|
_id: string;
|
|
30
29
|
}> & {
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
26
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
-
import { INotiHubNotification } from "../../types";
|
|
28
27
|
declare const NotificationModel: import("mongoose").Model<INotiHubNotification, {}, {}, {}, import("mongoose").Document<unknown, {}, INotiHubNotification> & INotiHubNotification & Required<{
|
|
29
28
|
_id: string;
|
|
30
29
|
}> & {
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
26
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
-
import { INotiHubNotificationStats } from "../../types";
|
|
28
27
|
declare const NotificationStatsModel: import("mongoose").Model<INotiHubNotificationStats, {}, {}, {}, import("mongoose").Document<unknown, {}, INotiHubNotificationStats> & INotiHubNotificationStats & Required<{
|
|
29
28
|
_id: string;
|
|
30
29
|
}> & {
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
/// <reference types="mongoose/types/inferschematype" />
|
|
25
25
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
26
26
|
import mongoose from "mongoose";
|
|
27
|
-
import { INotiHubSubscription } from "../../types";
|
|
28
27
|
declare const Subscription: mongoose.Model<INotiHubSubscription, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubSubscription> & INotiHubSubscription & Required<{
|
|
29
28
|
_id: string;
|
|
30
29
|
}> & {
|
|
@@ -24,7 +24,6 @@
|
|
|
24
24
|
/// <reference types="mongoose" />
|
|
25
25
|
/// <reference types="mongoose/types/inferschematype" />
|
|
26
26
|
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
-
import { INotiHubUser } from "../../types";
|
|
28
27
|
declare const UserModel: import("mongoose").Model<INotiHubUser, {}, {}, {}, import("mongoose").Document<unknown, {}, INotiHubUser> & INotiHubUser & Required<{
|
|
29
28
|
_id: string;
|
|
30
29
|
}> & {
|
|
@@ -0,0 +1,77 @@
|
|
|
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" />
|
|
25
|
+
/// <reference types="mongoose/types/inferschematype" />
|
|
26
|
+
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
+
declare const _default: {
|
|
28
|
+
UserModel: import("mongoose").Model<INotiHubUser, {}, {}, {}, import("mongoose").Document<unknown, {}, INotiHubUser> & INotiHubUser & Required<{
|
|
29
|
+
_id: string;
|
|
30
|
+
}> & {
|
|
31
|
+
__v?: number | undefined;
|
|
32
|
+
}, any>;
|
|
33
|
+
Subscription: import("mongoose").Model<INotiHubSubscription, {}, {}, {}, import("mongoose").Document<unknown, {}, INotiHubSubscription> & INotiHubSubscription & Required<{
|
|
34
|
+
_id: string;
|
|
35
|
+
}> & {
|
|
36
|
+
__v?: number | undefined;
|
|
37
|
+
}, any>;
|
|
38
|
+
NotiTypeModel: import("mongoose").Model<INotiType, {}, {}, {}, import("mongoose").Document<unknown, {}, INotiType> & INotiType & Required<{
|
|
39
|
+
_id: string;
|
|
40
|
+
}> & {
|
|
41
|
+
__v?: number | undefined;
|
|
42
|
+
}, any>;
|
|
43
|
+
NotificationStatsModel: import("mongoose").Model<INotiHubNotificationStats, {}, {}, {}, import("mongoose").Document<unknown, {}, INotiHubNotificationStats> & INotiHubNotificationStats & Required<{
|
|
44
|
+
_id: string;
|
|
45
|
+
}> & {
|
|
46
|
+
__v?: number | undefined;
|
|
47
|
+
}, any>;
|
|
48
|
+
NotiHubStatsHistory: import("mongoose").Model<INotiHubStatsHistory, {}, {}, {}, import("mongoose").Document<unknown, {}, INotiHubStatsHistory> & INotiHubStatsHistory & {
|
|
49
|
+
_id: import("mongoose").Types.ObjectId;
|
|
50
|
+
} & {
|
|
51
|
+
__v?: number | undefined;
|
|
52
|
+
}, any>;
|
|
53
|
+
NotificationModel: import("mongoose").Model<INotiHubNotification, {}, {}, {}, import("mongoose").Document<unknown, {}, INotiHubNotification> & INotiHubNotification & Required<{
|
|
54
|
+
_id: string;
|
|
55
|
+
}> & {
|
|
56
|
+
__v?: number | undefined;
|
|
57
|
+
}, any>;
|
|
58
|
+
Customer: import("mongoose").Model<INotiHubCustomer, {}, {}, {}, import("mongoose").Document<unknown, {}, INotiHubCustomer> & INotiHubCustomer & Required<{
|
|
59
|
+
_id: string;
|
|
60
|
+
}> & {
|
|
61
|
+
__v?: number | undefined;
|
|
62
|
+
}, any>;
|
|
63
|
+
CustomerMinified: import("mongoose").Model<INotiHubCustomerMinified, {}, {}, {}, import("mongoose").Document<unknown, {}, INotiHubCustomerMinified> & INotiHubCustomerMinified & Required<{
|
|
64
|
+
_id: string;
|
|
65
|
+
}> & {
|
|
66
|
+
__v?: number | undefined;
|
|
67
|
+
}, import("mongoose").Schema<INotiHubCustomerMinified, import("mongoose").Model<INotiHubCustomerMinified, any, any, any, import("mongoose").Document<unknown, any, INotiHubCustomerMinified> & INotiHubCustomerMinified & Required<{
|
|
68
|
+
_id: string;
|
|
69
|
+
}> & {
|
|
70
|
+
__v?: number | undefined;
|
|
71
|
+
}, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, INotiHubCustomerMinified, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<INotiHubCustomerMinified>> & import("mongoose").FlatRecord<INotiHubCustomerMinified> & Required<{
|
|
72
|
+
_id: string;
|
|
73
|
+
}> & {
|
|
74
|
+
__v?: number | undefined;
|
|
75
|
+
}>>;
|
|
76
|
+
};
|
|
77
|
+
export default _default;
|
package/index.ts
CHANGED
|
@@ -1,44 +1,26 @@
|
|
|
1
|
-
import
|
|
2
|
-
import Schemas from "./lib/
|
|
3
|
-
import {
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
} from "./
|
|
1
|
+
import dateUtil from "./lib/util/DateUtil";
|
|
2
|
+
import Schemas from "./lib/models/index";
|
|
3
|
+
// import {
|
|
4
|
+
// INotiHubCustomer,
|
|
5
|
+
// IUserSubscription,
|
|
6
|
+
// IUserSubscribeNotifier,
|
|
7
|
+
// INotiTypeStats,
|
|
8
|
+
// INotiHubUserView,
|
|
9
|
+
// INotiType,
|
|
10
|
+
// INotiHubUser,
|
|
11
|
+
// INotiHubSubscription,
|
|
12
|
+
// INotiHubStatsHistory,
|
|
13
|
+
// INotiHubStats,
|
|
14
|
+
// INotiHubNotificationStats,
|
|
15
|
+
// INotiHubNotification,
|
|
16
|
+
// INotiHubImage,
|
|
17
|
+
// INotiHubCustomerMinified,
|
|
18
|
+
// ICreateNotiRequestBody,
|
|
19
|
+
// ICreateCustomerRequestBody,
|
|
20
|
+
// } from "./index";
|
|
21
21
|
|
|
22
22
|
// ---------NotiHub Utils ---------------------------------------------------------------
|
|
23
|
-
export const
|
|
24
|
-
export const
|
|
23
|
+
export const DateUtil = dateUtil;
|
|
24
|
+
export const DB = Schemas;
|
|
25
25
|
|
|
26
26
|
// ---------NotiHub Types ---------------------------------------------------------------
|
|
27
|
-
export {
|
|
28
|
-
type INotiHubCustomer,
|
|
29
|
-
type IUserSubscription,
|
|
30
|
-
type IUserSubscribeNotifier,
|
|
31
|
-
type ICreateCustomerRequestBody,
|
|
32
|
-
type INotiHubStats,
|
|
33
|
-
type INotiTypeStats,
|
|
34
|
-
type INotiHubUserView,
|
|
35
|
-
type INotiType,
|
|
36
|
-
type INotiHubUser,
|
|
37
|
-
type INotiHubSubscription,
|
|
38
|
-
type INotiHubStatsHistory,
|
|
39
|
-
type INotiHubNotificationStats,
|
|
40
|
-
type INotiHubNotification,
|
|
41
|
-
type INotiHubImage,
|
|
42
|
-
type INotiHubCustomerMinified,
|
|
43
|
-
type ICreateNotiRequestBody,
|
|
44
|
-
};
|
|
@@ -2,7 +2,9 @@ import { Schema, model } from "mongoose";
|
|
|
2
2
|
import CustomerMinifiedSchema from "./schemas/CustomerMinifiedSchema";
|
|
3
3
|
|
|
4
4
|
// 2. Create a Schema corresponding to the document interface.
|
|
5
|
-
const customerMinifiedSchema = new Schema(
|
|
5
|
+
const customerMinifiedSchema = new Schema<INotiHubCustomerMinified>(
|
|
6
|
+
CustomerMinifiedSchema
|
|
7
|
+
);
|
|
6
8
|
|
|
7
9
|
// 3. Create a Model.
|
|
8
10
|
const CustomerMinified = model("CustomerMinified", customerMinifiedSchema);
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import { Schema, model } from "mongoose";
|
|
2
2
|
import CustomerMinifiedSchema from "./schemas/CustomerMinifiedSchema";
|
|
3
3
|
import CustomerSchema from "./schemas/CustomerSchema";
|
|
4
|
-
import { INotiHubCustomer } from "../../types";
|
|
5
4
|
|
|
6
5
|
// 2. Create a Schema corresponding to the document interface.
|
|
7
6
|
const customerSchema = new Schema<INotiHubCustomer>(CustomerSchema);
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Schema, model } from "mongoose";
|
|
2
2
|
import NotihubStatsHistorySchema from "./schemas/NotificationStatsHistorySchema";
|
|
3
|
-
import { INotiHubStatsHistory } from "../../types";
|
|
4
3
|
|
|
5
4
|
// 2. Create a Schema corresponding to the document interface.
|
|
6
5
|
const notihubStatsHistorySchema = new Schema<INotiHubStatsHistory>(
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Schema, model } from "mongoose";
|
|
2
2
|
import CustomerSchema from "./schemas/CustomerSchema";
|
|
3
|
-
import { INotiHubStats } from "../../types";
|
|
4
3
|
|
|
5
4
|
// 2. Create a Schema corresponding to the document interface.
|
|
6
5
|
const entityNotiHubStatsSchema = new Schema<INotiHubStats>(
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Schema, model, ObjectId } from "mongoose";
|
|
2
2
|
import CustomerSchema from "./schemas/CustomerSchema";
|
|
3
|
-
import { INotiHubNotification } from "../../types";
|
|
4
3
|
|
|
5
4
|
// 2. Create a Schema corresponding to the document interface.
|
|
6
5
|
const notificationSchema = new Schema<INotiHubNotification>(
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Schema, model } from "mongoose";
|
|
2
2
|
import NotificationSchema from "./schemas/NotificationSchema";
|
|
3
|
-
import { INotiHubNotificationStats } from "../../types";
|
|
4
3
|
|
|
5
4
|
// 2. Create a Schema corresponding to the document interface.
|
|
6
5
|
const notificationSchema = new Schema<INotiHubNotificationStats>(
|
|
@@ -1,7 +1,6 @@
|
|
|
1
1
|
import mongoose, { Document, Schema, Types, model } from "mongoose";
|
|
2
2
|
|
|
3
3
|
import SubscriptionSchema from "./schemas/SubscriptionSchema";
|
|
4
|
-
import { INotiHubSubscription } from "../../types";
|
|
5
4
|
|
|
6
5
|
// 2. Create a Schema corresponding to the document interface.
|
|
7
6
|
const subscriptionSchema = new Schema<INotiHubSubscription>(
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { Schema, model } from "mongoose";
|
|
2
2
|
import UserSchema from "./schemas/UserSchema";
|
|
3
|
-
import { INotiHubUser } from "../../types";
|
|
4
3
|
|
|
5
4
|
// 2. Create a Schema corresponding to the document interface.
|
|
6
5
|
const userSchema = new Schema<INotiHubUser>(UserSchema, { timestamps: true });
|
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amohamud23/notihub",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.33",
|
|
4
4
|
"description": "Notihub Package",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
|
-
"types": "dist/index.d.ts",
|
|
6
|
+
"types": "dist/types/index.d.ts",
|
|
7
7
|
"scripts": {
|
|
8
8
|
"build": "npx tsc",
|
|
9
9
|
"test": "echo \"Error: no test specified\" && exit 1"
|
package/types/index.d.ts
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
// ----------------- Request Types ---------------------
|
|
2
|
-
|
|
2
|
+
interface CreateNotiRequestBody {
|
|
3
3
|
subscriptionId: string;
|
|
4
4
|
userId: string;
|
|
5
5
|
title: string;
|
|
@@ -7,28 +7,28 @@ export interface CreateNotiRequestBody {
|
|
|
7
7
|
type: string;
|
|
8
8
|
}
|
|
9
9
|
|
|
10
|
-
|
|
10
|
+
interface CreateSubscriptionRequestBody {
|
|
11
11
|
subscriptionId: string;
|
|
12
12
|
type: string;
|
|
13
13
|
}
|
|
14
14
|
|
|
15
|
-
|
|
15
|
+
interface CreateUserRequestBody {
|
|
16
16
|
name: string;
|
|
17
17
|
email: string;
|
|
18
18
|
token: string;
|
|
19
19
|
}
|
|
20
20
|
|
|
21
|
-
|
|
21
|
+
interface ICreateCustomerRequestBody {
|
|
22
22
|
email: string;
|
|
23
23
|
username: string;
|
|
24
24
|
name: string;
|
|
25
25
|
}
|
|
26
26
|
|
|
27
|
-
|
|
27
|
+
interface ICreateNotiRequestBody {}
|
|
28
28
|
|
|
29
29
|
// ----------------- NotiHub Types ---------------------
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
interface INotiHubCustomerMinified {
|
|
32
32
|
_id: string;
|
|
33
33
|
name: string;
|
|
34
34
|
img: INotiHubImage;
|
|
@@ -36,7 +36,7 @@ export interface INotiHubCustomerMinified {
|
|
|
36
36
|
createdAt: string;
|
|
37
37
|
updatedAt: string;
|
|
38
38
|
}
|
|
39
|
-
|
|
39
|
+
interface INotiHubCustomer {
|
|
40
40
|
_id: string;
|
|
41
41
|
name: string;
|
|
42
42
|
email: string;
|
|
@@ -48,7 +48,7 @@ export interface INotiHubCustomer {
|
|
|
48
48
|
updatedAt: string;
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
interface INotiHubNotification {
|
|
52
52
|
_id?: string;
|
|
53
53
|
title: string;
|
|
54
54
|
message: string;
|
|
@@ -59,14 +59,13 @@ export interface INotiHubNotification {
|
|
|
59
59
|
createdAt: string;
|
|
60
60
|
updatedAt: string;
|
|
61
61
|
}
|
|
62
|
-
|
|
63
|
-
export interface INotiHubNotificationStats {
|
|
62
|
+
interface INotiHubNotificationStats {
|
|
64
63
|
_id?: string;
|
|
65
64
|
notification: INotiHubNotification;
|
|
66
65
|
views: number;
|
|
67
66
|
}
|
|
68
67
|
|
|
69
|
-
|
|
68
|
+
interface INotiHubSubscription {
|
|
70
69
|
_id?: string;
|
|
71
70
|
subscriptionId: string;
|
|
72
71
|
entity: INotiHubCustomer;
|
|
@@ -76,7 +75,7 @@ export interface INotiHubSubscription {
|
|
|
76
75
|
updatedAt: string;
|
|
77
76
|
}
|
|
78
77
|
|
|
79
|
-
|
|
78
|
+
interface INotiHubUser {
|
|
80
79
|
_id?: string;
|
|
81
80
|
pushToken: string;
|
|
82
81
|
name: string;
|
|
@@ -85,12 +84,12 @@ export interface INotiHubUser {
|
|
|
85
84
|
events: number;
|
|
86
85
|
}
|
|
87
86
|
|
|
88
|
-
|
|
87
|
+
interface INotiHubImage {
|
|
89
88
|
bucket: string;
|
|
90
89
|
key: string;
|
|
91
90
|
}
|
|
92
91
|
|
|
93
|
-
|
|
92
|
+
interface INotiHubStats {
|
|
94
93
|
entityRef: string;
|
|
95
94
|
entity: INotiHubCustomer;
|
|
96
95
|
subscription: number;
|
|
@@ -98,7 +97,7 @@ export interface INotiHubStats {
|
|
|
98
97
|
views: number;
|
|
99
98
|
}
|
|
100
99
|
|
|
101
|
-
|
|
100
|
+
interface INotiHubStatsHistory {
|
|
102
101
|
entityId: string;
|
|
103
102
|
type: "MONTH" | "YEAR";
|
|
104
103
|
subscription: number;
|
|
@@ -106,21 +105,21 @@ export interface INotiHubStatsHistory {
|
|
|
106
105
|
views: number;
|
|
107
106
|
}
|
|
108
107
|
|
|
109
|
-
|
|
108
|
+
interface INotiType {
|
|
110
109
|
_id?: string;
|
|
111
110
|
type: string;
|
|
112
111
|
entity: string;
|
|
113
112
|
createdAt: string;
|
|
114
113
|
}
|
|
115
114
|
|
|
116
|
-
|
|
115
|
+
interface INotiTypeStats {
|
|
117
116
|
_id?: string;
|
|
118
117
|
notiTypeId: string;
|
|
119
118
|
subscribed: number;
|
|
120
119
|
createdAt: string;
|
|
121
120
|
}
|
|
122
121
|
|
|
123
|
-
|
|
122
|
+
interface INotiHubUser {
|
|
124
123
|
_id?: string;
|
|
125
124
|
pushToken: string;
|
|
126
125
|
name: string;
|
|
@@ -129,7 +128,7 @@ export interface INotiHubUser {
|
|
|
129
128
|
events: number;
|
|
130
129
|
}
|
|
131
130
|
|
|
132
|
-
|
|
131
|
+
interface IUserSubscription {
|
|
133
132
|
user: INotiHubUser;
|
|
134
133
|
entity: INotiHubCustomer;
|
|
135
134
|
subscriptionId: string;
|
|
@@ -138,7 +137,7 @@ export interface IUserSubscription {
|
|
|
138
137
|
updatedAt: string;
|
|
139
138
|
}
|
|
140
139
|
|
|
141
|
-
|
|
140
|
+
interface IUserSubscribeNotifier {
|
|
142
141
|
user: INotiHubUser;
|
|
143
142
|
entity: INotiHubCustomer;
|
|
144
143
|
type: INotiType;
|
|
@@ -146,14 +145,14 @@ export interface IUserSubscribeNotifier {
|
|
|
146
145
|
updatedAt: string;
|
|
147
146
|
}
|
|
148
147
|
|
|
149
|
-
|
|
148
|
+
interface INotiHubUserView {
|
|
150
149
|
userId: string;
|
|
151
150
|
entityId: string;
|
|
152
151
|
notificationId;
|
|
153
152
|
createdAt: string;
|
|
154
153
|
}
|
|
155
154
|
|
|
156
|
-
|
|
155
|
+
interface NotiHubTypes {
|
|
157
156
|
INotiHubUserView: INotiHubUserView;
|
|
158
157
|
IUserSubscribeNotifier: IUserSubscribeNotifier;
|
|
159
158
|
IUserSubscription: IUserSubscription;
|
|
@@ -166,7 +165,3 @@ export interface NotiHubTypes {
|
|
|
166
165
|
INotiHubCustomer: INotiHubCustomer;
|
|
167
166
|
INotiHubCustomerMinified: INotiHubCustomerMinified;
|
|
168
167
|
}
|
|
169
|
-
|
|
170
|
-
declare const notihub: NotiHubTypes;
|
|
171
|
-
|
|
172
|
-
export default notihub;
|
package/dist/lib/db/index.d.ts
DELETED
|
@@ -1,103 +0,0 @@
|
|
|
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" />
|
|
25
|
-
/// <reference types="mongoose/types/inferschematype" />
|
|
26
|
-
/// <reference types="mongoose/types/inferrawdoctype" />
|
|
27
|
-
declare const _default: {
|
|
28
|
-
UserModel: import("mongoose").Model<import("../..").INotiHubUser, {}, {}, {}, import("mongoose").Document<unknown, {}, import("../..").INotiHubUser> & import("../..").INotiHubUser & Required<{
|
|
29
|
-
_id: string;
|
|
30
|
-
}> & {
|
|
31
|
-
__v?: number | undefined;
|
|
32
|
-
}, any>;
|
|
33
|
-
Subscription: import("mongoose").Model<import("../..").INotiHubSubscription, {}, {}, {}, import("mongoose").Document<unknown, {}, import("../..").INotiHubSubscription> & import("../..").INotiHubSubscription & Required<{
|
|
34
|
-
_id: string;
|
|
35
|
-
}> & {
|
|
36
|
-
__v?: number | undefined;
|
|
37
|
-
}, any>;
|
|
38
|
-
NotiTypeModel: import("mongoose").Model<import("../..").INotiType, {}, {}, {}, import("mongoose").Document<unknown, {}, import("../..").INotiType> & import("../..").INotiType & Required<{
|
|
39
|
-
_id: string;
|
|
40
|
-
}> & {
|
|
41
|
-
__v?: number | undefined;
|
|
42
|
-
}, any>;
|
|
43
|
-
NotificationStatsModel: import("mongoose").Model<import("../..").INotiHubNotificationStats, {}, {}, {}, import("mongoose").Document<unknown, {}, import("../..").INotiHubNotificationStats> & import("../..").INotiHubNotificationStats & Required<{
|
|
44
|
-
_id: string;
|
|
45
|
-
}> & {
|
|
46
|
-
__v?: number | undefined;
|
|
47
|
-
}, any>;
|
|
48
|
-
NotiHubStatsHistory: import("mongoose").Model<import("../..").INotiHubStatsHistory, {}, {}, {}, import("mongoose").Document<unknown, {}, import("../..").INotiHubStatsHistory> & import("../..").INotiHubStatsHistory & {
|
|
49
|
-
_id: import("mongoose").Types.ObjectId;
|
|
50
|
-
} & {
|
|
51
|
-
__v?: number | undefined;
|
|
52
|
-
}, any>;
|
|
53
|
-
NotificationModel: import("mongoose").Model<import("../..").INotiHubNotification, {}, {}, {}, import("mongoose").Document<unknown, {}, import("../..").INotiHubNotification> & import("../..").INotiHubNotification & Required<{
|
|
54
|
-
_id: string;
|
|
55
|
-
}> & {
|
|
56
|
-
__v?: number | undefined;
|
|
57
|
-
}, any>;
|
|
58
|
-
Customer: import("mongoose").Model<import("../..").INotiHubCustomer, {}, {}, {}, import("mongoose").Document<unknown, {}, import("../..").INotiHubCustomer> & import("../..").INotiHubCustomer & Required<{
|
|
59
|
-
_id: string;
|
|
60
|
-
}> & {
|
|
61
|
-
__v?: number | undefined;
|
|
62
|
-
}, any>;
|
|
63
|
-
CustomerMinified: import("mongoose").Model<{
|
|
64
|
-
name: string;
|
|
65
|
-
id: Buffer;
|
|
66
|
-
username: string;
|
|
67
|
-
img?: any;
|
|
68
|
-
}, {}, {}, {}, import("mongoose").Document<unknown, {}, {
|
|
69
|
-
name: string;
|
|
70
|
-
id: Buffer;
|
|
71
|
-
username: string;
|
|
72
|
-
img?: any;
|
|
73
|
-
}> & {
|
|
74
|
-
name: string;
|
|
75
|
-
id: Buffer;
|
|
76
|
-
username: string;
|
|
77
|
-
img?: any;
|
|
78
|
-
} & {
|
|
79
|
-
_id: import("mongoose").Types.ObjectId;
|
|
80
|
-
} & {
|
|
81
|
-
__v?: number | undefined;
|
|
82
|
-
}, import("mongoose").Schema<any, import("mongoose").Model<any, any, any, any, any, any>, {}, {}, {}, {}, import("mongoose").DefaultSchemaOptions, {
|
|
83
|
-
name: string;
|
|
84
|
-
id: Buffer;
|
|
85
|
-
username: string;
|
|
86
|
-
img?: any;
|
|
87
|
-
}, import("mongoose").Document<unknown, {}, import("mongoose").FlatRecord<{
|
|
88
|
-
name: string;
|
|
89
|
-
id: Buffer;
|
|
90
|
-
username: string;
|
|
91
|
-
img?: any;
|
|
92
|
-
}>> & import("mongoose").FlatRecord<{
|
|
93
|
-
name: string;
|
|
94
|
-
id: Buffer;
|
|
95
|
-
username: string;
|
|
96
|
-
img?: any;
|
|
97
|
-
}> & {
|
|
98
|
-
_id: import("mongoose").Types.ObjectId;
|
|
99
|
-
} & {
|
|
100
|
-
__v?: number | undefined;
|
|
101
|
-
}>>;
|
|
102
|
-
};
|
|
103
|
-
export default _default;
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|
|
File without changes
|