@amohamud23/notihub 1.0.66 → 1.0.68
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.mts +142 -0
- package/dist/index.d.ts +142 -0
- package/dist/index.js +223 -0
- package/dist/index.mjs +204 -0
- package/package.json +4 -1
- package/src/index.ts +0 -4
- package/src/models/CustomerMinifiedModel.ts +0 -17
- package/src/models/CustomerModel.ts +0 -13
- package/src/models/NotiHubStatsHistoryModel.ts +0 -19
- package/src/models/NotiHubStatsModel.ts +0 -22
- package/src/models/NotiTypeModel.ts +0 -13
- package/src/models/NotificationModel.ts +0 -24
- package/src/models/NotificationStatsModel.ts +0 -20
- package/src/models/SubscriptionModel.ts +0 -20
- package/src/models/SubscriptionTypeModel.ts +0 -20
- package/src/models/UserModel.ts +0 -11
- package/src/models/index.ts +0 -21
- package/src/models/schemas/CustomerMinifiedSchema.ts +0 -14
- package/src/models/schemas/CustomerSchema.ts +0 -14
- package/src/models/schemas/NotiTypeSchema.ts +0 -11
- package/src/models/schemas/NotificationSchema.ts +0 -15
- package/src/models/schemas/NotificationStatsHistorySchema.ts +0 -12
- package/src/models/schemas/NotificationStatsSchema.ts +0 -9
- package/src/models/schemas/SubscriptionSchema.ts +0 -13
- package/src/models/schemas/SubscriptionTypeSchema.ts +0 -7
- package/src/models/schemas/UserSchema.ts +0 -11
- package/src/types.ts +0 -161
- package/src/util/DateUtil.ts +0 -60
- package/tsconfig.json +0 -111
- package/tsup.config.ts +0 -10
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
type CreateNotiRequestBody = {
|
|
2
|
+
subscriptionId: string;
|
|
3
|
+
userId: string;
|
|
4
|
+
title: string;
|
|
5
|
+
message: string;
|
|
6
|
+
type: string;
|
|
7
|
+
};
|
|
8
|
+
type CreateSubscriptionRequestBody = {
|
|
9
|
+
subscriptionId: string;
|
|
10
|
+
type: string;
|
|
11
|
+
};
|
|
12
|
+
type CreateUserRequestBody = {
|
|
13
|
+
name: string;
|
|
14
|
+
email: string;
|
|
15
|
+
token: string;
|
|
16
|
+
};
|
|
17
|
+
type ICreateCustomerRequestBody = {
|
|
18
|
+
email: string;
|
|
19
|
+
username: string;
|
|
20
|
+
name: string;
|
|
21
|
+
};
|
|
22
|
+
type ICreateNotiRequestBody = {};
|
|
23
|
+
type INotiHubCustomerMinified = {
|
|
24
|
+
_id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
img: INotiHubImage;
|
|
27
|
+
username: string;
|
|
28
|
+
createdAt: string;
|
|
29
|
+
updatedAt: string;
|
|
30
|
+
};
|
|
31
|
+
type INotiHubCustomer = {
|
|
32
|
+
_id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
email: string;
|
|
35
|
+
minified: INotiHubCustomerMinified;
|
|
36
|
+
verified: boolean;
|
|
37
|
+
paid: boolean;
|
|
38
|
+
confirmed: boolean;
|
|
39
|
+
createdAt: string;
|
|
40
|
+
updatedAt: string;
|
|
41
|
+
};
|
|
42
|
+
type INotiHubNotification = {
|
|
43
|
+
_id?: string;
|
|
44
|
+
title: string;
|
|
45
|
+
message: string;
|
|
46
|
+
type: string;
|
|
47
|
+
entityId: string;
|
|
48
|
+
entityMinified: INotiHubCustomerMinified;
|
|
49
|
+
body: string;
|
|
50
|
+
createdAt: string;
|
|
51
|
+
updatedAt: string;
|
|
52
|
+
};
|
|
53
|
+
type INotiHubNotificationStats = {
|
|
54
|
+
_id?: string;
|
|
55
|
+
notification: INotiHubNotification;
|
|
56
|
+
views: number;
|
|
57
|
+
};
|
|
58
|
+
type INotiHubUser = {
|
|
59
|
+
_id?: string;
|
|
60
|
+
pushToken: string;
|
|
61
|
+
name: string;
|
|
62
|
+
email: string;
|
|
63
|
+
subscriptions: number;
|
|
64
|
+
events: number;
|
|
65
|
+
};
|
|
66
|
+
type INotiHubImage = {
|
|
67
|
+
bucket: string;
|
|
68
|
+
key: string;
|
|
69
|
+
};
|
|
70
|
+
type INotiHubStats = {
|
|
71
|
+
entityRef: string;
|
|
72
|
+
entity: INotiHubCustomer;
|
|
73
|
+
subscription: number;
|
|
74
|
+
notifications: number;
|
|
75
|
+
views: number;
|
|
76
|
+
};
|
|
77
|
+
type INotiHubStatsHistory = {
|
|
78
|
+
entityId: string;
|
|
79
|
+
type: "MONTH" | "YEAR";
|
|
80
|
+
subscription: number;
|
|
81
|
+
notifications: number;
|
|
82
|
+
views: number;
|
|
83
|
+
};
|
|
84
|
+
type INotiType = {
|
|
85
|
+
_id?: string;
|
|
86
|
+
type: string;
|
|
87
|
+
entity: string;
|
|
88
|
+
createdAt: string;
|
|
89
|
+
updatedAt: string;
|
|
90
|
+
};
|
|
91
|
+
type INotiTypeStats = {
|
|
92
|
+
_id?: string;
|
|
93
|
+
notiTypeId: string;
|
|
94
|
+
subscribed: number;
|
|
95
|
+
createdAt: string;
|
|
96
|
+
};
|
|
97
|
+
type IUserSubscription = {
|
|
98
|
+
user: INotiHubUser;
|
|
99
|
+
entity: INotiHubCustomer;
|
|
100
|
+
subscriptionId: string;
|
|
101
|
+
type: "SUBSCRIBED" | "UNSUBSCRIBED";
|
|
102
|
+
createdAt: string;
|
|
103
|
+
updatedAt: string;
|
|
104
|
+
};
|
|
105
|
+
type IUserSubscribeNotifier = {
|
|
106
|
+
userId: string;
|
|
107
|
+
entityId: string;
|
|
108
|
+
notiTypeId: string;
|
|
109
|
+
createdAt: string;
|
|
110
|
+
updatedAt: string;
|
|
111
|
+
};
|
|
112
|
+
type INotiHubUserView = {
|
|
113
|
+
userId: string;
|
|
114
|
+
entityId: string;
|
|
115
|
+
notificationId: string;
|
|
116
|
+
createdAt: string;
|
|
117
|
+
};
|
|
118
|
+
type INotiHubSubscription = {
|
|
119
|
+
_id?: string;
|
|
120
|
+
subscriptionId: string;
|
|
121
|
+
entity: INotiHubCustomer;
|
|
122
|
+
user: INotiHubUser;
|
|
123
|
+
type: "SUBSCRIBED" | "UNSUBSCRIBED";
|
|
124
|
+
createdAt: string;
|
|
125
|
+
updatedAt: string;
|
|
126
|
+
};
|
|
127
|
+
type NotiHubTypes = {
|
|
128
|
+
INotiHubUserView: INotiHubUserView;
|
|
129
|
+
IUserSubscribeNotifier: IUserSubscribeNotifier;
|
|
130
|
+
IUserSubscription: IUserSubscription;
|
|
131
|
+
INotiHubUser: INotiHubUser;
|
|
132
|
+
INotiTypeStats: INotiTypeStats;
|
|
133
|
+
INotiHubImage: INotiHubImage;
|
|
134
|
+
INotiHubSubscription: INotiHubSubscription;
|
|
135
|
+
INotiHubNotificationStats: INotiHubNotificationStats;
|
|
136
|
+
INotiHubNotification: INotiHubNotification;
|
|
137
|
+
INotiHubCustomer: INotiHubCustomer;
|
|
138
|
+
INotiHubCustomerMinified: INotiHubCustomerMinified;
|
|
139
|
+
INotiHubStatsHistory: INotiHubStatsHistory;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export type { CreateNotiRequestBody, CreateSubscriptionRequestBody, CreateUserRequestBody, ICreateCustomerRequestBody, ICreateNotiRequestBody, INotiHubCustomer, INotiHubCustomerMinified, INotiHubImage, INotiHubNotification, INotiHubNotificationStats, INotiHubStats, INotiHubStatsHistory, INotiHubSubscription, INotiHubUser, INotiHubUserView, INotiType, INotiTypeStats, IUserSubscribeNotifier, IUserSubscription, NotiHubTypes };
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,142 @@
|
|
|
1
|
+
type CreateNotiRequestBody = {
|
|
2
|
+
subscriptionId: string;
|
|
3
|
+
userId: string;
|
|
4
|
+
title: string;
|
|
5
|
+
message: string;
|
|
6
|
+
type: string;
|
|
7
|
+
};
|
|
8
|
+
type CreateSubscriptionRequestBody = {
|
|
9
|
+
subscriptionId: string;
|
|
10
|
+
type: string;
|
|
11
|
+
};
|
|
12
|
+
type CreateUserRequestBody = {
|
|
13
|
+
name: string;
|
|
14
|
+
email: string;
|
|
15
|
+
token: string;
|
|
16
|
+
};
|
|
17
|
+
type ICreateCustomerRequestBody = {
|
|
18
|
+
email: string;
|
|
19
|
+
username: string;
|
|
20
|
+
name: string;
|
|
21
|
+
};
|
|
22
|
+
type ICreateNotiRequestBody = {};
|
|
23
|
+
type INotiHubCustomerMinified = {
|
|
24
|
+
_id: string;
|
|
25
|
+
name: string;
|
|
26
|
+
img: INotiHubImage;
|
|
27
|
+
username: string;
|
|
28
|
+
createdAt: string;
|
|
29
|
+
updatedAt: string;
|
|
30
|
+
};
|
|
31
|
+
type INotiHubCustomer = {
|
|
32
|
+
_id: string;
|
|
33
|
+
name: string;
|
|
34
|
+
email: string;
|
|
35
|
+
minified: INotiHubCustomerMinified;
|
|
36
|
+
verified: boolean;
|
|
37
|
+
paid: boolean;
|
|
38
|
+
confirmed: boolean;
|
|
39
|
+
createdAt: string;
|
|
40
|
+
updatedAt: string;
|
|
41
|
+
};
|
|
42
|
+
type INotiHubNotification = {
|
|
43
|
+
_id?: string;
|
|
44
|
+
title: string;
|
|
45
|
+
message: string;
|
|
46
|
+
type: string;
|
|
47
|
+
entityId: string;
|
|
48
|
+
entityMinified: INotiHubCustomerMinified;
|
|
49
|
+
body: string;
|
|
50
|
+
createdAt: string;
|
|
51
|
+
updatedAt: string;
|
|
52
|
+
};
|
|
53
|
+
type INotiHubNotificationStats = {
|
|
54
|
+
_id?: string;
|
|
55
|
+
notification: INotiHubNotification;
|
|
56
|
+
views: number;
|
|
57
|
+
};
|
|
58
|
+
type INotiHubUser = {
|
|
59
|
+
_id?: string;
|
|
60
|
+
pushToken: string;
|
|
61
|
+
name: string;
|
|
62
|
+
email: string;
|
|
63
|
+
subscriptions: number;
|
|
64
|
+
events: number;
|
|
65
|
+
};
|
|
66
|
+
type INotiHubImage = {
|
|
67
|
+
bucket: string;
|
|
68
|
+
key: string;
|
|
69
|
+
};
|
|
70
|
+
type INotiHubStats = {
|
|
71
|
+
entityRef: string;
|
|
72
|
+
entity: INotiHubCustomer;
|
|
73
|
+
subscription: number;
|
|
74
|
+
notifications: number;
|
|
75
|
+
views: number;
|
|
76
|
+
};
|
|
77
|
+
type INotiHubStatsHistory = {
|
|
78
|
+
entityId: string;
|
|
79
|
+
type: "MONTH" | "YEAR";
|
|
80
|
+
subscription: number;
|
|
81
|
+
notifications: number;
|
|
82
|
+
views: number;
|
|
83
|
+
};
|
|
84
|
+
type INotiType = {
|
|
85
|
+
_id?: string;
|
|
86
|
+
type: string;
|
|
87
|
+
entity: string;
|
|
88
|
+
createdAt: string;
|
|
89
|
+
updatedAt: string;
|
|
90
|
+
};
|
|
91
|
+
type INotiTypeStats = {
|
|
92
|
+
_id?: string;
|
|
93
|
+
notiTypeId: string;
|
|
94
|
+
subscribed: number;
|
|
95
|
+
createdAt: string;
|
|
96
|
+
};
|
|
97
|
+
type IUserSubscription = {
|
|
98
|
+
user: INotiHubUser;
|
|
99
|
+
entity: INotiHubCustomer;
|
|
100
|
+
subscriptionId: string;
|
|
101
|
+
type: "SUBSCRIBED" | "UNSUBSCRIBED";
|
|
102
|
+
createdAt: string;
|
|
103
|
+
updatedAt: string;
|
|
104
|
+
};
|
|
105
|
+
type IUserSubscribeNotifier = {
|
|
106
|
+
userId: string;
|
|
107
|
+
entityId: string;
|
|
108
|
+
notiTypeId: string;
|
|
109
|
+
createdAt: string;
|
|
110
|
+
updatedAt: string;
|
|
111
|
+
};
|
|
112
|
+
type INotiHubUserView = {
|
|
113
|
+
userId: string;
|
|
114
|
+
entityId: string;
|
|
115
|
+
notificationId: string;
|
|
116
|
+
createdAt: string;
|
|
117
|
+
};
|
|
118
|
+
type INotiHubSubscription = {
|
|
119
|
+
_id?: string;
|
|
120
|
+
subscriptionId: string;
|
|
121
|
+
entity: INotiHubCustomer;
|
|
122
|
+
user: INotiHubUser;
|
|
123
|
+
type: "SUBSCRIBED" | "UNSUBSCRIBED";
|
|
124
|
+
createdAt: string;
|
|
125
|
+
updatedAt: string;
|
|
126
|
+
};
|
|
127
|
+
type NotiHubTypes = {
|
|
128
|
+
INotiHubUserView: INotiHubUserView;
|
|
129
|
+
IUserSubscribeNotifier: IUserSubscribeNotifier;
|
|
130
|
+
IUserSubscription: IUserSubscription;
|
|
131
|
+
INotiHubUser: INotiHubUser;
|
|
132
|
+
INotiTypeStats: INotiTypeStats;
|
|
133
|
+
INotiHubImage: INotiHubImage;
|
|
134
|
+
INotiHubSubscription: INotiHubSubscription;
|
|
135
|
+
INotiHubNotificationStats: INotiHubNotificationStats;
|
|
136
|
+
INotiHubNotification: INotiHubNotification;
|
|
137
|
+
INotiHubCustomer: INotiHubCustomer;
|
|
138
|
+
INotiHubCustomerMinified: INotiHubCustomerMinified;
|
|
139
|
+
INotiHubStatsHistory: INotiHubStatsHistory;
|
|
140
|
+
};
|
|
141
|
+
|
|
142
|
+
export type { CreateNotiRequestBody, CreateSubscriptionRequestBody, CreateUserRequestBody, ICreateCustomerRequestBody, ICreateNotiRequestBody, INotiHubCustomer, INotiHubCustomerMinified, INotiHubImage, INotiHubNotification, INotiHubNotificationStats, INotiHubStats, INotiHubStatsHistory, INotiHubSubscription, INotiHubUser, INotiHubUserView, INotiType, INotiTypeStats, IUserSubscribeNotifier, IUserSubscription, NotiHubTypes };
|
package/dist/index.js
ADDED
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __defProp = Object.defineProperty;
|
|
3
|
+
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
4
|
+
var __getOwnPropNames = Object.getOwnPropertyNames;
|
|
5
|
+
var __hasOwnProp = Object.prototype.hasOwnProperty;
|
|
6
|
+
var __copyProps = (to, from, except, desc) => {
|
|
7
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
8
|
+
for (let key of __getOwnPropNames(from))
|
|
9
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
10
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
11
|
+
}
|
|
12
|
+
return to;
|
|
13
|
+
};
|
|
14
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
15
|
+
|
|
16
|
+
// src/index.ts
|
|
17
|
+
var src_exports = {};
|
|
18
|
+
module.exports = __toCommonJS(src_exports);
|
|
19
|
+
|
|
20
|
+
// src/models/UserModel.ts
|
|
21
|
+
var import_mongoose2 = require("mongoose");
|
|
22
|
+
|
|
23
|
+
// src/models/schemas/UserSchema.ts
|
|
24
|
+
var import_mongoose = require("mongoose");
|
|
25
|
+
var UserSchema = {
|
|
26
|
+
id: { type: import_mongoose.Schema.Types.UUID, default: true },
|
|
27
|
+
name: { type: String, required: true },
|
|
28
|
+
email: { type: String, required: true },
|
|
29
|
+
pushToken: { type: String, required: true },
|
|
30
|
+
signedIn: { type: Boolean, required: true, default: false }
|
|
31
|
+
};
|
|
32
|
+
var UserSchema_default = UserSchema;
|
|
33
|
+
|
|
34
|
+
// src/models/UserModel.ts
|
|
35
|
+
var userSchema = new import_mongoose2.Schema(UserSchema_default, { timestamps: true });
|
|
36
|
+
var UserModel = (0, import_mongoose2.model)("User", userSchema);
|
|
37
|
+
|
|
38
|
+
// src/models/SubscriptionModel.ts
|
|
39
|
+
var import_mongoose6 = require("mongoose");
|
|
40
|
+
|
|
41
|
+
// src/models/schemas/SubscriptionSchema.ts
|
|
42
|
+
var import_mongoose5 = require("mongoose");
|
|
43
|
+
|
|
44
|
+
// src/models/schemas/CustomerSchema.ts
|
|
45
|
+
var import_mongoose4 = require("mongoose");
|
|
46
|
+
|
|
47
|
+
// src/models/schemas/CustomerMinifiedSchema.ts
|
|
48
|
+
var import_mongoose3 = require("mongoose");
|
|
49
|
+
var CustomerMinifiedSchema = {
|
|
50
|
+
id: { type: import_mongoose3.Schema.Types.UUID, default: true },
|
|
51
|
+
username: { type: String, required: true },
|
|
52
|
+
img: {
|
|
53
|
+
bucket: { type: String, required: true },
|
|
54
|
+
key: { type: String, required: true }
|
|
55
|
+
},
|
|
56
|
+
name: { type: String, required: true }
|
|
57
|
+
};
|
|
58
|
+
var CustomerMinifiedSchema_default = CustomerMinifiedSchema;
|
|
59
|
+
|
|
60
|
+
// src/models/schemas/CustomerSchema.ts
|
|
61
|
+
var CustomerSchema = {
|
|
62
|
+
id: { type: import_mongoose4.Schema.Types.UUID, default: true },
|
|
63
|
+
minified: CustomerMinifiedSchema_default,
|
|
64
|
+
paid: { type: Boolean, default: false },
|
|
65
|
+
email: { type: String, required: true },
|
|
66
|
+
verified: { type: Boolean, default: false },
|
|
67
|
+
confirmed: { type: Boolean, default: false }
|
|
68
|
+
};
|
|
69
|
+
var CustomerSchema_default = CustomerSchema;
|
|
70
|
+
|
|
71
|
+
// src/models/schemas/SubscriptionSchema.ts
|
|
72
|
+
var SubscriptionSchema = {
|
|
73
|
+
id: { type: import_mongoose5.Schema.Types.UUID, default: true },
|
|
74
|
+
subscriptionId: { type: String, required: true },
|
|
75
|
+
user: UserSchema_default,
|
|
76
|
+
entity: CustomerSchema_default
|
|
77
|
+
};
|
|
78
|
+
var SubscriptionSchema_default = SubscriptionSchema;
|
|
79
|
+
|
|
80
|
+
// src/models/SubscriptionModel.ts
|
|
81
|
+
var subscriptionSchema = new import_mongoose6.Schema(
|
|
82
|
+
SubscriptionSchema_default,
|
|
83
|
+
{
|
|
84
|
+
timestamps: true
|
|
85
|
+
}
|
|
86
|
+
);
|
|
87
|
+
var Subscription = (0, import_mongoose6.model)(
|
|
88
|
+
"Subscriptions",
|
|
89
|
+
subscriptionSchema
|
|
90
|
+
);
|
|
91
|
+
|
|
92
|
+
// src/models/NotiTypeModel.ts
|
|
93
|
+
var import_mongoose8 = require("mongoose");
|
|
94
|
+
|
|
95
|
+
// src/models/schemas/NotiTypeSchema.ts
|
|
96
|
+
var import_mongoose7 = require("mongoose");
|
|
97
|
+
var NotiTypeSchema = {
|
|
98
|
+
id: { type: import_mongoose7.Schema.Types.UUID, default: true },
|
|
99
|
+
entity: CustomerSchema_default,
|
|
100
|
+
type: { type: String, required: true }
|
|
101
|
+
};
|
|
102
|
+
var NotiTypeSchema_default = NotiTypeSchema;
|
|
103
|
+
|
|
104
|
+
// src/models/NotiTypeModel.ts
|
|
105
|
+
var notiTypeSchema = new import_mongoose8.Schema(NotiTypeSchema_default, {
|
|
106
|
+
timestamps: true
|
|
107
|
+
});
|
|
108
|
+
var NotiTypeModel = (0, import_mongoose8.model)("NotiTypes", notiTypeSchema);
|
|
109
|
+
|
|
110
|
+
// src/models/NotiHubStatsHistoryModel.ts
|
|
111
|
+
var import_mongoose10 = require("mongoose");
|
|
112
|
+
|
|
113
|
+
// src/models/schemas/NotificationStatsHistorySchema.ts
|
|
114
|
+
var import_mongoose9 = require("mongoose");
|
|
115
|
+
var NotihubStatsHistorySchema = {
|
|
116
|
+
id: { type: import_mongoose9.Schema.Types.UUID, default: true },
|
|
117
|
+
entityId: { type: String, required: true },
|
|
118
|
+
notifications: { type: Number, required: true },
|
|
119
|
+
subscription: { type: Number, required: true },
|
|
120
|
+
views: { type: Number, required: true },
|
|
121
|
+
type: { type: String, required: true }
|
|
122
|
+
};
|
|
123
|
+
var NotificationStatsHistorySchema_default = NotihubStatsHistorySchema;
|
|
124
|
+
|
|
125
|
+
// src/models/NotiHubStatsHistoryModel.ts
|
|
126
|
+
var notihubStatsHistorySchema = new import_mongoose10.Schema(
|
|
127
|
+
NotificationStatsHistorySchema_default,
|
|
128
|
+
{
|
|
129
|
+
timestamps: true
|
|
130
|
+
}
|
|
131
|
+
);
|
|
132
|
+
var NotiHubStatsHistory = (0, import_mongoose10.model)(
|
|
133
|
+
"INotiHubStatsHistories",
|
|
134
|
+
notihubStatsHistorySchema
|
|
135
|
+
);
|
|
136
|
+
|
|
137
|
+
// src/models/NotificationStatsModel.ts
|
|
138
|
+
var import_mongoose12 = require("mongoose");
|
|
139
|
+
|
|
140
|
+
// src/models/schemas/NotificationSchema.ts
|
|
141
|
+
var import_mongoose11 = require("mongoose");
|
|
142
|
+
var NotificationSchema = {
|
|
143
|
+
id: { type: import_mongoose11.Schema.Types.UUID, default: true },
|
|
144
|
+
title: { type: String, required: true },
|
|
145
|
+
message: { type: String, required: true },
|
|
146
|
+
type: { type: String, required: true },
|
|
147
|
+
body: { type: String },
|
|
148
|
+
entityId: { type: String, required: true },
|
|
149
|
+
entityMinified: CustomerMinifiedSchema_default
|
|
150
|
+
};
|
|
151
|
+
var NotificationSchema_default = NotificationSchema;
|
|
152
|
+
|
|
153
|
+
// src/models/NotificationStatsModel.ts
|
|
154
|
+
var notificationSchema = new import_mongoose12.Schema(
|
|
155
|
+
{
|
|
156
|
+
notification: NotificationSchema_default,
|
|
157
|
+
views: { type: Number, default: 0 }
|
|
158
|
+
},
|
|
159
|
+
{ timestamps: true }
|
|
160
|
+
);
|
|
161
|
+
var NotificationStatsModel = (0, import_mongoose12.model)(
|
|
162
|
+
"NotificationStats",
|
|
163
|
+
notificationSchema
|
|
164
|
+
);
|
|
165
|
+
|
|
166
|
+
// src/models/NotificationModel.ts
|
|
167
|
+
var import_mongoose13 = require("mongoose");
|
|
168
|
+
var notificationSchema2 = new import_mongoose13.Schema(
|
|
169
|
+
{
|
|
170
|
+
title: { type: String, required: true },
|
|
171
|
+
message: { type: String, required: true },
|
|
172
|
+
type: { type: String, required: true },
|
|
173
|
+
body: { type: String },
|
|
174
|
+
entityId: { type: String, required: true },
|
|
175
|
+
entityMinified: CustomerSchema_default
|
|
176
|
+
},
|
|
177
|
+
{ timestamps: true }
|
|
178
|
+
);
|
|
179
|
+
var NotificationModel = (0, import_mongoose13.model)(
|
|
180
|
+
"Notification",
|
|
181
|
+
notificationSchema2
|
|
182
|
+
);
|
|
183
|
+
|
|
184
|
+
// src/models/CustomerModel.ts
|
|
185
|
+
var import_mongoose14 = require("mongoose");
|
|
186
|
+
var customerSchema = new import_mongoose14.Schema(CustomerSchema_default, {
|
|
187
|
+
timestamps: true
|
|
188
|
+
});
|
|
189
|
+
var Customer = (0, import_mongoose14.model)("Customer", customerSchema);
|
|
190
|
+
|
|
191
|
+
// src/models/CustomerMinifiedModel.ts
|
|
192
|
+
var import_mongoose15 = require("mongoose");
|
|
193
|
+
var customerMinifiedSchema = new import_mongoose15.Schema(
|
|
194
|
+
CustomerMinifiedSchema_default,
|
|
195
|
+
{ timestamps: true }
|
|
196
|
+
);
|
|
197
|
+
var CustomerMinified = (0, import_mongoose15.model)(
|
|
198
|
+
"CustomerMinified",
|
|
199
|
+
customerMinifiedSchema
|
|
200
|
+
);
|
|
201
|
+
|
|
202
|
+
// src/models/SubscriptionTypeModel.ts
|
|
203
|
+
var import_mongoose16 = require("mongoose");
|
|
204
|
+
|
|
205
|
+
// src/models/schemas/SubscriptionTypeSchema.ts
|
|
206
|
+
var SubscriptionSchema2 = {
|
|
207
|
+
userId: { type: String, required: true },
|
|
208
|
+
entityId: { type: String, required: true },
|
|
209
|
+
notiTypeId: { type: String, required: true }
|
|
210
|
+
};
|
|
211
|
+
var SubscriptionTypeSchema_default = SubscriptionSchema2;
|
|
212
|
+
|
|
213
|
+
// src/models/SubscriptionTypeModel.ts
|
|
214
|
+
var subscriptionSchema2 = new import_mongoose16.Schema(
|
|
215
|
+
SubscriptionTypeSchema_default,
|
|
216
|
+
{
|
|
217
|
+
timestamps: true
|
|
218
|
+
}
|
|
219
|
+
);
|
|
220
|
+
var SubscriptionType = (0, import_mongoose16.model)(
|
|
221
|
+
"SubscriptionTypes",
|
|
222
|
+
subscriptionSchema2
|
|
223
|
+
);
|
package/dist/index.mjs
ADDED
|
@@ -0,0 +1,204 @@
|
|
|
1
|
+
// src/models/UserModel.ts
|
|
2
|
+
import { Schema as Schema2, model } from "mongoose";
|
|
3
|
+
|
|
4
|
+
// src/models/schemas/UserSchema.ts
|
|
5
|
+
import { Schema } from "mongoose";
|
|
6
|
+
var UserSchema = {
|
|
7
|
+
id: { type: Schema.Types.UUID, default: true },
|
|
8
|
+
name: { type: String, required: true },
|
|
9
|
+
email: { type: String, required: true },
|
|
10
|
+
pushToken: { type: String, required: true },
|
|
11
|
+
signedIn: { type: Boolean, required: true, default: false }
|
|
12
|
+
};
|
|
13
|
+
var UserSchema_default = UserSchema;
|
|
14
|
+
|
|
15
|
+
// src/models/UserModel.ts
|
|
16
|
+
var userSchema = new Schema2(UserSchema_default, { timestamps: true });
|
|
17
|
+
var UserModel = model("User", userSchema);
|
|
18
|
+
|
|
19
|
+
// src/models/SubscriptionModel.ts
|
|
20
|
+
import { Schema as Schema6, model as model3 } from "mongoose";
|
|
21
|
+
|
|
22
|
+
// src/models/schemas/SubscriptionSchema.ts
|
|
23
|
+
import { Schema as Schema5 } from "mongoose";
|
|
24
|
+
|
|
25
|
+
// src/models/schemas/CustomerSchema.ts
|
|
26
|
+
import { Schema as Schema4 } from "mongoose";
|
|
27
|
+
|
|
28
|
+
// src/models/schemas/CustomerMinifiedSchema.ts
|
|
29
|
+
import { Schema as Schema3 } from "mongoose";
|
|
30
|
+
var CustomerMinifiedSchema = {
|
|
31
|
+
id: { type: Schema3.Types.UUID, default: true },
|
|
32
|
+
username: { type: String, required: true },
|
|
33
|
+
img: {
|
|
34
|
+
bucket: { type: String, required: true },
|
|
35
|
+
key: { type: String, required: true }
|
|
36
|
+
},
|
|
37
|
+
name: { type: String, required: true }
|
|
38
|
+
};
|
|
39
|
+
var CustomerMinifiedSchema_default = CustomerMinifiedSchema;
|
|
40
|
+
|
|
41
|
+
// src/models/schemas/CustomerSchema.ts
|
|
42
|
+
var CustomerSchema = {
|
|
43
|
+
id: { type: Schema4.Types.UUID, default: true },
|
|
44
|
+
minified: CustomerMinifiedSchema_default,
|
|
45
|
+
paid: { type: Boolean, default: false },
|
|
46
|
+
email: { type: String, required: true },
|
|
47
|
+
verified: { type: Boolean, default: false },
|
|
48
|
+
confirmed: { type: Boolean, default: false }
|
|
49
|
+
};
|
|
50
|
+
var CustomerSchema_default = CustomerSchema;
|
|
51
|
+
|
|
52
|
+
// src/models/schemas/SubscriptionSchema.ts
|
|
53
|
+
var SubscriptionSchema = {
|
|
54
|
+
id: { type: Schema5.Types.UUID, default: true },
|
|
55
|
+
subscriptionId: { type: String, required: true },
|
|
56
|
+
user: UserSchema_default,
|
|
57
|
+
entity: CustomerSchema_default
|
|
58
|
+
};
|
|
59
|
+
var SubscriptionSchema_default = SubscriptionSchema;
|
|
60
|
+
|
|
61
|
+
// src/models/SubscriptionModel.ts
|
|
62
|
+
var subscriptionSchema = new Schema6(
|
|
63
|
+
SubscriptionSchema_default,
|
|
64
|
+
{
|
|
65
|
+
timestamps: true
|
|
66
|
+
}
|
|
67
|
+
);
|
|
68
|
+
var Subscription = model3(
|
|
69
|
+
"Subscriptions",
|
|
70
|
+
subscriptionSchema
|
|
71
|
+
);
|
|
72
|
+
|
|
73
|
+
// src/models/NotiTypeModel.ts
|
|
74
|
+
import { Schema as Schema8, model as model4 } from "mongoose";
|
|
75
|
+
|
|
76
|
+
// src/models/schemas/NotiTypeSchema.ts
|
|
77
|
+
import { Schema as Schema7 } from "mongoose";
|
|
78
|
+
var NotiTypeSchema = {
|
|
79
|
+
id: { type: Schema7.Types.UUID, default: true },
|
|
80
|
+
entity: CustomerSchema_default,
|
|
81
|
+
type: { type: String, required: true }
|
|
82
|
+
};
|
|
83
|
+
var NotiTypeSchema_default = NotiTypeSchema;
|
|
84
|
+
|
|
85
|
+
// src/models/NotiTypeModel.ts
|
|
86
|
+
var notiTypeSchema = new Schema8(NotiTypeSchema_default, {
|
|
87
|
+
timestamps: true
|
|
88
|
+
});
|
|
89
|
+
var NotiTypeModel = model4("NotiTypes", notiTypeSchema);
|
|
90
|
+
|
|
91
|
+
// src/models/NotiHubStatsHistoryModel.ts
|
|
92
|
+
import { Schema as Schema10, model as model5 } from "mongoose";
|
|
93
|
+
|
|
94
|
+
// src/models/schemas/NotificationStatsHistorySchema.ts
|
|
95
|
+
import { Schema as Schema9 } from "mongoose";
|
|
96
|
+
var NotihubStatsHistorySchema = {
|
|
97
|
+
id: { type: Schema9.Types.UUID, default: true },
|
|
98
|
+
entityId: { type: String, required: true },
|
|
99
|
+
notifications: { type: Number, required: true },
|
|
100
|
+
subscription: { type: Number, required: true },
|
|
101
|
+
views: { type: Number, required: true },
|
|
102
|
+
type: { type: String, required: true }
|
|
103
|
+
};
|
|
104
|
+
var NotificationStatsHistorySchema_default = NotihubStatsHistorySchema;
|
|
105
|
+
|
|
106
|
+
// src/models/NotiHubStatsHistoryModel.ts
|
|
107
|
+
var notihubStatsHistorySchema = new Schema10(
|
|
108
|
+
NotificationStatsHistorySchema_default,
|
|
109
|
+
{
|
|
110
|
+
timestamps: true
|
|
111
|
+
}
|
|
112
|
+
);
|
|
113
|
+
var NotiHubStatsHistory = model5(
|
|
114
|
+
"INotiHubStatsHistories",
|
|
115
|
+
notihubStatsHistorySchema
|
|
116
|
+
);
|
|
117
|
+
|
|
118
|
+
// src/models/NotificationStatsModel.ts
|
|
119
|
+
import { Schema as Schema12, model as model6 } from "mongoose";
|
|
120
|
+
|
|
121
|
+
// src/models/schemas/NotificationSchema.ts
|
|
122
|
+
import { Schema as Schema11 } from "mongoose";
|
|
123
|
+
var NotificationSchema = {
|
|
124
|
+
id: { type: Schema11.Types.UUID, default: true },
|
|
125
|
+
title: { type: String, required: true },
|
|
126
|
+
message: { type: String, required: true },
|
|
127
|
+
type: { type: String, required: true },
|
|
128
|
+
body: { type: String },
|
|
129
|
+
entityId: { type: String, required: true },
|
|
130
|
+
entityMinified: CustomerMinifiedSchema_default
|
|
131
|
+
};
|
|
132
|
+
var NotificationSchema_default = NotificationSchema;
|
|
133
|
+
|
|
134
|
+
// src/models/NotificationStatsModel.ts
|
|
135
|
+
var notificationSchema = new Schema12(
|
|
136
|
+
{
|
|
137
|
+
notification: NotificationSchema_default,
|
|
138
|
+
views: { type: Number, default: 0 }
|
|
139
|
+
},
|
|
140
|
+
{ timestamps: true }
|
|
141
|
+
);
|
|
142
|
+
var NotificationStatsModel = model6(
|
|
143
|
+
"NotificationStats",
|
|
144
|
+
notificationSchema
|
|
145
|
+
);
|
|
146
|
+
|
|
147
|
+
// src/models/NotificationModel.ts
|
|
148
|
+
import { Schema as Schema13, model as model7 } from "mongoose";
|
|
149
|
+
var notificationSchema2 = new Schema13(
|
|
150
|
+
{
|
|
151
|
+
title: { type: String, required: true },
|
|
152
|
+
message: { type: String, required: true },
|
|
153
|
+
type: { type: String, required: true },
|
|
154
|
+
body: { type: String },
|
|
155
|
+
entityId: { type: String, required: true },
|
|
156
|
+
entityMinified: CustomerSchema_default
|
|
157
|
+
},
|
|
158
|
+
{ timestamps: true }
|
|
159
|
+
);
|
|
160
|
+
var NotificationModel = model7(
|
|
161
|
+
"Notification",
|
|
162
|
+
notificationSchema2
|
|
163
|
+
);
|
|
164
|
+
|
|
165
|
+
// src/models/CustomerModel.ts
|
|
166
|
+
import { Schema as Schema14, model as model8 } from "mongoose";
|
|
167
|
+
var customerSchema = new Schema14(CustomerSchema_default, {
|
|
168
|
+
timestamps: true
|
|
169
|
+
});
|
|
170
|
+
var Customer = model8("Customer", customerSchema);
|
|
171
|
+
|
|
172
|
+
// src/models/CustomerMinifiedModel.ts
|
|
173
|
+
import { Schema as Schema15, model as model9 } from "mongoose";
|
|
174
|
+
var customerMinifiedSchema = new Schema15(
|
|
175
|
+
CustomerMinifiedSchema_default,
|
|
176
|
+
{ timestamps: true }
|
|
177
|
+
);
|
|
178
|
+
var CustomerMinified = model9(
|
|
179
|
+
"CustomerMinified",
|
|
180
|
+
customerMinifiedSchema
|
|
181
|
+
);
|
|
182
|
+
|
|
183
|
+
// src/models/SubscriptionTypeModel.ts
|
|
184
|
+
import { Schema as Schema16, model as model10 } from "mongoose";
|
|
185
|
+
|
|
186
|
+
// src/models/schemas/SubscriptionTypeSchema.ts
|
|
187
|
+
var SubscriptionSchema2 = {
|
|
188
|
+
userId: { type: String, required: true },
|
|
189
|
+
entityId: { type: String, required: true },
|
|
190
|
+
notiTypeId: { type: String, required: true }
|
|
191
|
+
};
|
|
192
|
+
var SubscriptionTypeSchema_default = SubscriptionSchema2;
|
|
193
|
+
|
|
194
|
+
// src/models/SubscriptionTypeModel.ts
|
|
195
|
+
var subscriptionSchema2 = new Schema16(
|
|
196
|
+
SubscriptionTypeSchema_default,
|
|
197
|
+
{
|
|
198
|
+
timestamps: true
|
|
199
|
+
}
|
|
200
|
+
);
|
|
201
|
+
var SubscriptionType = model10(
|
|
202
|
+
"SubscriptionTypes",
|
|
203
|
+
subscriptionSchema2
|
|
204
|
+
);
|