@amohamud23/notihub 1.0.75 → 1.0.76
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.cjs +384 -0
- package/dist/index.d.cts +243 -0
- package/dist/index.d.ts +243 -2
- package/dist/index.js +361 -3
- package/package.json +5 -5
- package/dist/models/CustomerMinifiedModel.d.ts +0 -33
- package/dist/models/CustomerMinifiedModel.js +0 -7
- package/dist/models/CustomerModel.d.ts +0 -33
- package/dist/models/CustomerModel.js +0 -9
- package/dist/models/Functions.d.ts +0 -6
- package/dist/models/Functions.js +0 -54
- package/dist/models/NotiHubStatsHistoryModel.d.ts +0 -33
- package/dist/models/NotiHubStatsHistoryModel.js +0 -9
- package/dist/models/NotiHubStatsModel.d.ts +0 -33
- package/dist/models/NotiHubStatsModel.js +0 -12
- package/dist/models/NotiTypeModel.d.ts +0 -33
- package/dist/models/NotiTypeModel.js +0 -9
- package/dist/models/NotificationModel.d.ts +0 -33
- package/dist/models/NotificationModel.js +0 -14
- package/dist/models/NotificationStatsModel.d.ts +0 -33
- package/dist/models/NotificationStatsModel.js +0 -10
- package/dist/models/SubscriptionModel.d.ts +0 -33
- package/dist/models/SubscriptionModel.js +0 -9
- package/dist/models/SubscriptionTypeModel.d.ts +0 -33
- package/dist/models/SubscriptionTypeModel.js +0 -9
- package/dist/models/UserModel.d.ts +0 -33
- package/dist/models/UserModel.js +0 -7
- package/dist/models/index.d.ts +0 -79
- package/dist/models/index.js +0 -22
- package/dist/models/schemas/CustomerMinifiedSchema.d.ts +0 -51
- package/dist/models/schemas/CustomerMinifiedSchema.js +0 -12
- package/dist/models/schemas/CustomerSchema.d.ts +0 -73
- package/dist/models/schemas/CustomerSchema.js +0 -12
- package/dist/models/schemas/NotiTypeSchema.d.ts +0 -83
- package/dist/models/schemas/NotiTypeSchema.js +0 -9
- package/dist/models/schemas/NotificationSchema.d.ts +0 -76
- package/dist/models/schemas/NotificationSchema.js +0 -13
- package/dist/models/schemas/NotificationStatsHistorySchema.d.ts +0 -53
- package/dist/models/schemas/NotificationStatsHistorySchema.js +0 -10
- package/dist/models/schemas/NotificationStatsSchema.d.ts +0 -82
- package/dist/models/schemas/NotificationStatsSchema.js +0 -7
- package/dist/models/schemas/SubscriptionSchema.d.ts +0 -106
- package/dist/models/schemas/SubscriptionSchema.js +0 -11
- package/dist/models/schemas/SubscriptionTypeSchema.d.ts +0 -15
- package/dist/models/schemas/SubscriptionTypeSchema.js +0 -6
- package/dist/models/schemas/UserSchema.d.ts +0 -50
- package/dist/models/schemas/UserSchema.js +0 -9
- package/dist/types.d.ts +0 -140
- package/dist/types.js +0 -1
- package/dist/util/index.d.ts +0 -10
- package/dist/util/index.js +0 -54
- package/dist/util/types.d.ts +0 -4
- package/dist/util/types.js +0 -1
package/dist/index.cjs
ADDED
|
@@ -0,0 +1,384 @@
|
|
|
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 __export = (target, all) => {
|
|
7
|
+
for (var name in all)
|
|
8
|
+
__defProp(target, name, { get: all[name], enumerable: true });
|
|
9
|
+
};
|
|
10
|
+
var __copyProps = (to, from, except, desc) => {
|
|
11
|
+
if (from && typeof from === "object" || typeof from === "function") {
|
|
12
|
+
for (let key of __getOwnPropNames(from))
|
|
13
|
+
if (!__hasOwnProp.call(to, key) && key !== except)
|
|
14
|
+
__defProp(to, key, { get: () => from[key], enumerable: !(desc = __getOwnPropDesc(from, key)) || desc.enumerable });
|
|
15
|
+
}
|
|
16
|
+
return to;
|
|
17
|
+
};
|
|
18
|
+
var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
|
|
19
|
+
|
|
20
|
+
// src/index.ts
|
|
21
|
+
var src_exports = {};
|
|
22
|
+
__export(src_exports, {
|
|
23
|
+
models: () => models_exports,
|
|
24
|
+
types: () => types_exports,
|
|
25
|
+
util: () => util_exports
|
|
26
|
+
});
|
|
27
|
+
module.exports = __toCommonJS(src_exports);
|
|
28
|
+
|
|
29
|
+
// src/types.ts
|
|
30
|
+
var types_exports = {};
|
|
31
|
+
|
|
32
|
+
// src/util/index.ts
|
|
33
|
+
var util_exports = {};
|
|
34
|
+
__export(util_exports, {
|
|
35
|
+
default: () => util_default
|
|
36
|
+
});
|
|
37
|
+
function getDate(dateStr) {
|
|
38
|
+
const date = new Date(dateStr);
|
|
39
|
+
const year = date.getFullYear();
|
|
40
|
+
const month = (date.getMonth() + 1).toString().padStart(2, "0");
|
|
41
|
+
const day = date.getDate().toString().padStart(2, "0");
|
|
42
|
+
const formattedDate = `${month}-${day}-${year}`;
|
|
43
|
+
return formattedDate;
|
|
44
|
+
}
|
|
45
|
+
function getDateFormat(dateStr) {
|
|
46
|
+
const date = new Date(dateStr);
|
|
47
|
+
const now = /* @__PURE__ */ new Date();
|
|
48
|
+
const seconds = Math.floor((now.getTime() - date.getTime()) / 1e3);
|
|
49
|
+
let interval = seconds / 31536e3;
|
|
50
|
+
if (interval > 1) {
|
|
51
|
+
return date.toLocaleDateString("en-US", {
|
|
52
|
+
year: "numeric",
|
|
53
|
+
month: "short",
|
|
54
|
+
day: "numeric"
|
|
55
|
+
});
|
|
56
|
+
}
|
|
57
|
+
interval = seconds / 2592e3;
|
|
58
|
+
if (interval > 1) {
|
|
59
|
+
return date.toLocaleDateString("en-US", {
|
|
60
|
+
year: "numeric",
|
|
61
|
+
month: "short",
|
|
62
|
+
day: "numeric"
|
|
63
|
+
});
|
|
64
|
+
}
|
|
65
|
+
interval = seconds / 86400;
|
|
66
|
+
if (interval > 7) {
|
|
67
|
+
return date.toLocaleDateString("en-US", {
|
|
68
|
+
year: "numeric",
|
|
69
|
+
month: "short",
|
|
70
|
+
day: "numeric"
|
|
71
|
+
});
|
|
72
|
+
} else if (interval > 1) {
|
|
73
|
+
return Math.floor(interval) + "d ago";
|
|
74
|
+
}
|
|
75
|
+
interval = seconds / 3600;
|
|
76
|
+
if (interval > 1) {
|
|
77
|
+
return Math.floor(interval) + "h ago";
|
|
78
|
+
}
|
|
79
|
+
interval = seconds / 60;
|
|
80
|
+
if (interval > 1) {
|
|
81
|
+
return Math.floor(interval) + "m ago";
|
|
82
|
+
}
|
|
83
|
+
return Math.floor(seconds) + "s ago";
|
|
84
|
+
}
|
|
85
|
+
function addMonths({ date, months }) {
|
|
86
|
+
date.setMonth(date.getMonth() + months);
|
|
87
|
+
return date;
|
|
88
|
+
}
|
|
89
|
+
var util_default = { getDate, getDateFormat, addMonths };
|
|
90
|
+
|
|
91
|
+
// src/models/index.ts
|
|
92
|
+
var models_exports = {};
|
|
93
|
+
__export(models_exports, {
|
|
94
|
+
default: () => models_default
|
|
95
|
+
});
|
|
96
|
+
|
|
97
|
+
// src/models/UserModel.ts
|
|
98
|
+
var import_mongoose2 = require("mongoose");
|
|
99
|
+
|
|
100
|
+
// src/models/schemas/UserSchema.ts
|
|
101
|
+
var import_mongoose = require("mongoose");
|
|
102
|
+
var UserSchema = {
|
|
103
|
+
id: { type: import_mongoose.Schema.Types.UUID, default: true },
|
|
104
|
+
name: { type: String, required: true },
|
|
105
|
+
email: { type: String, required: true },
|
|
106
|
+
pushToken: { type: String, required: true },
|
|
107
|
+
signedIn: { type: Boolean, required: true, default: false }
|
|
108
|
+
};
|
|
109
|
+
var UserSchema_default = UserSchema;
|
|
110
|
+
|
|
111
|
+
// src/models/UserModel.ts
|
|
112
|
+
var userSchema = new import_mongoose2.Schema(UserSchema_default, { timestamps: true });
|
|
113
|
+
var UserModel = (0, import_mongoose2.model)("User", userSchema);
|
|
114
|
+
var UserModel_default = UserModel;
|
|
115
|
+
|
|
116
|
+
// src/models/SubscriptionModel.ts
|
|
117
|
+
var import_mongoose6 = require("mongoose");
|
|
118
|
+
|
|
119
|
+
// src/models/schemas/SubscriptionSchema.ts
|
|
120
|
+
var import_mongoose5 = require("mongoose");
|
|
121
|
+
|
|
122
|
+
// src/models/schemas/CustomerSchema.ts
|
|
123
|
+
var import_mongoose4 = require("mongoose");
|
|
124
|
+
|
|
125
|
+
// src/models/schemas/CustomerMinifiedSchema.ts
|
|
126
|
+
var import_mongoose3 = require("mongoose");
|
|
127
|
+
var CustomerMinifiedSchema = {
|
|
128
|
+
id: { type: import_mongoose3.Schema.Types.UUID, default: true },
|
|
129
|
+
username: { type: String, required: true },
|
|
130
|
+
img: {
|
|
131
|
+
bucket: { type: String, required: true },
|
|
132
|
+
key: { type: String, required: true }
|
|
133
|
+
},
|
|
134
|
+
name: { type: String, required: true }
|
|
135
|
+
};
|
|
136
|
+
var CustomerMinifiedSchema_default = CustomerMinifiedSchema;
|
|
137
|
+
|
|
138
|
+
// src/models/schemas/CustomerSchema.ts
|
|
139
|
+
var CustomerSchema = {
|
|
140
|
+
id: { type: import_mongoose4.Schema.Types.UUID, default: true },
|
|
141
|
+
minified: CustomerMinifiedSchema_default,
|
|
142
|
+
paid: { type: Boolean, default: false },
|
|
143
|
+
email: { type: String, required: true },
|
|
144
|
+
verified: { type: Boolean, default: false },
|
|
145
|
+
confirmed: { type: Boolean, default: false }
|
|
146
|
+
};
|
|
147
|
+
var CustomerSchema_default = CustomerSchema;
|
|
148
|
+
|
|
149
|
+
// src/models/schemas/SubscriptionSchema.ts
|
|
150
|
+
var SubscriptionSchema = {
|
|
151
|
+
id: { type: import_mongoose5.Schema.Types.UUID, default: true },
|
|
152
|
+
subscriptionId: { type: String, required: true },
|
|
153
|
+
user: UserSchema_default,
|
|
154
|
+
entity: CustomerSchema_default
|
|
155
|
+
};
|
|
156
|
+
var SubscriptionSchema_default = SubscriptionSchema;
|
|
157
|
+
|
|
158
|
+
// src/models/SubscriptionModel.ts
|
|
159
|
+
var subscriptionSchema = new import_mongoose6.Schema(
|
|
160
|
+
SubscriptionSchema_default,
|
|
161
|
+
{
|
|
162
|
+
timestamps: true
|
|
163
|
+
}
|
|
164
|
+
);
|
|
165
|
+
var Subscription = (0, import_mongoose6.model)(
|
|
166
|
+
"Subscriptions",
|
|
167
|
+
subscriptionSchema
|
|
168
|
+
);
|
|
169
|
+
var SubscriptionModel_default = Subscription;
|
|
170
|
+
|
|
171
|
+
// src/models/NotiTypeModel.ts
|
|
172
|
+
var import_mongoose8 = require("mongoose");
|
|
173
|
+
|
|
174
|
+
// src/models/schemas/NotiTypeSchema.ts
|
|
175
|
+
var import_mongoose7 = require("mongoose");
|
|
176
|
+
var NotiTypeSchema = {
|
|
177
|
+
id: { type: import_mongoose7.Schema.Types.UUID, default: true },
|
|
178
|
+
entity: CustomerSchema_default,
|
|
179
|
+
type: { type: String, required: true }
|
|
180
|
+
};
|
|
181
|
+
var NotiTypeSchema_default = NotiTypeSchema;
|
|
182
|
+
|
|
183
|
+
// src/models/NotiTypeModel.ts
|
|
184
|
+
var notiTypeSchema = new import_mongoose8.Schema(NotiTypeSchema_default, {
|
|
185
|
+
timestamps: true
|
|
186
|
+
});
|
|
187
|
+
var NotiTypeModel = (0, import_mongoose8.model)("NotiTypes", notiTypeSchema);
|
|
188
|
+
var NotiTypeModel_default = NotiTypeModel;
|
|
189
|
+
|
|
190
|
+
// src/models/NotiHubStatsHistoryModel.ts
|
|
191
|
+
var import_mongoose10 = require("mongoose");
|
|
192
|
+
|
|
193
|
+
// src/models/schemas/NotificationStatsHistorySchema.ts
|
|
194
|
+
var import_mongoose9 = require("mongoose");
|
|
195
|
+
var NotihubStatsHistorySchema = {
|
|
196
|
+
id: { type: import_mongoose9.Schema.Types.UUID, default: true },
|
|
197
|
+
entityId: { type: String, required: true },
|
|
198
|
+
notifications: { type: Number, required: true },
|
|
199
|
+
subscription: { type: Number, required: true },
|
|
200
|
+
views: { type: Number, required: true },
|
|
201
|
+
type: { type: String, required: true }
|
|
202
|
+
};
|
|
203
|
+
var NotificationStatsHistorySchema_default = NotihubStatsHistorySchema;
|
|
204
|
+
|
|
205
|
+
// src/models/NotiHubStatsHistoryModel.ts
|
|
206
|
+
var notihubStatsHistorySchema = new import_mongoose10.Schema(
|
|
207
|
+
NotificationStatsHistorySchema_default,
|
|
208
|
+
{
|
|
209
|
+
timestamps: true
|
|
210
|
+
}
|
|
211
|
+
);
|
|
212
|
+
var NotiHubStatsHistory = (0, import_mongoose10.model)(
|
|
213
|
+
"INotiHubStatsHistories",
|
|
214
|
+
notihubStatsHistorySchema
|
|
215
|
+
);
|
|
216
|
+
var NotiHubStatsHistoryModel_default = NotiHubStatsHistory;
|
|
217
|
+
|
|
218
|
+
// src/models/NotificationStatsModel.ts
|
|
219
|
+
var import_mongoose12 = require("mongoose");
|
|
220
|
+
|
|
221
|
+
// src/models/schemas/NotificationSchema.ts
|
|
222
|
+
var import_mongoose11 = require("mongoose");
|
|
223
|
+
var NotificationSchema = {
|
|
224
|
+
id: { type: import_mongoose11.Schema.Types.UUID, default: true },
|
|
225
|
+
title: { type: String, required: true },
|
|
226
|
+
message: { type: String, required: true },
|
|
227
|
+
type: { type: String, required: true },
|
|
228
|
+
body: { type: String },
|
|
229
|
+
entityId: { type: String, required: true },
|
|
230
|
+
entityMinified: CustomerMinifiedSchema_default
|
|
231
|
+
};
|
|
232
|
+
var NotificationSchema_default = NotificationSchema;
|
|
233
|
+
|
|
234
|
+
// src/models/NotificationStatsModel.ts
|
|
235
|
+
var notificationSchema = new import_mongoose12.Schema(
|
|
236
|
+
{
|
|
237
|
+
notification: NotificationSchema_default,
|
|
238
|
+
views: { type: Number, default: 0 }
|
|
239
|
+
},
|
|
240
|
+
{ timestamps: true }
|
|
241
|
+
);
|
|
242
|
+
var NotificationStatsModel = (0, import_mongoose12.model)(
|
|
243
|
+
"NotificationStats",
|
|
244
|
+
notificationSchema
|
|
245
|
+
);
|
|
246
|
+
var NotificationStatsModel_default = NotificationStatsModel;
|
|
247
|
+
|
|
248
|
+
// src/models/NotificationModel.ts
|
|
249
|
+
var import_mongoose13 = require("mongoose");
|
|
250
|
+
var notificationSchema2 = new import_mongoose13.Schema(
|
|
251
|
+
{
|
|
252
|
+
title: { type: String, required: true },
|
|
253
|
+
message: { type: String, required: true },
|
|
254
|
+
type: { type: String, required: true },
|
|
255
|
+
body: { type: String },
|
|
256
|
+
entityId: { type: String, required: true },
|
|
257
|
+
entityMinified: CustomerSchema_default
|
|
258
|
+
},
|
|
259
|
+
{ timestamps: true }
|
|
260
|
+
);
|
|
261
|
+
var NotificationModel = (0, import_mongoose13.model)(
|
|
262
|
+
"Notification",
|
|
263
|
+
notificationSchema2
|
|
264
|
+
);
|
|
265
|
+
var NotificationModel_default = NotificationModel;
|
|
266
|
+
|
|
267
|
+
// src/models/CustomerModel.ts
|
|
268
|
+
var import_mongoose14 = require("mongoose");
|
|
269
|
+
var customerSchema = new import_mongoose14.Schema(CustomerSchema_default, {
|
|
270
|
+
timestamps: true
|
|
271
|
+
});
|
|
272
|
+
var Customer = (0, import_mongoose14.model)("Customer", customerSchema);
|
|
273
|
+
var CustomerModel_default = Customer;
|
|
274
|
+
|
|
275
|
+
// src/models/CustomerMinifiedModel.ts
|
|
276
|
+
var import_mongoose15 = require("mongoose");
|
|
277
|
+
var customerMinifiedSchema = new import_mongoose15.Schema(
|
|
278
|
+
CustomerMinifiedSchema_default,
|
|
279
|
+
{ timestamps: true }
|
|
280
|
+
);
|
|
281
|
+
var CustomerMinified = (0, import_mongoose15.model)(
|
|
282
|
+
"CustomerMinified",
|
|
283
|
+
customerMinifiedSchema
|
|
284
|
+
);
|
|
285
|
+
var CustomerMinifiedModel_default = CustomerMinified;
|
|
286
|
+
|
|
287
|
+
// src/models/SubscriptionTypeModel.ts
|
|
288
|
+
var import_mongoose16 = require("mongoose");
|
|
289
|
+
|
|
290
|
+
// src/models/schemas/SubscriptionTypeSchema.ts
|
|
291
|
+
var SubscriptionSchema2 = {
|
|
292
|
+
userId: { type: String, required: true },
|
|
293
|
+
entityId: { type: String, required: true },
|
|
294
|
+
notiTypeId: { type: String, required: true }
|
|
295
|
+
};
|
|
296
|
+
var SubscriptionTypeSchema_default = SubscriptionSchema2;
|
|
297
|
+
|
|
298
|
+
// src/models/SubscriptionTypeModel.ts
|
|
299
|
+
var subscriptionSchema2 = new import_mongoose16.Schema(
|
|
300
|
+
SubscriptionTypeSchema_default,
|
|
301
|
+
{
|
|
302
|
+
timestamps: true
|
|
303
|
+
}
|
|
304
|
+
);
|
|
305
|
+
var SubscriptionType = (0, import_mongoose16.model)(
|
|
306
|
+
"SubscriptionTypes",
|
|
307
|
+
subscriptionSchema2
|
|
308
|
+
);
|
|
309
|
+
var SubscriptionTypeModel_default = SubscriptionType;
|
|
310
|
+
|
|
311
|
+
// src/models/Functions.ts
|
|
312
|
+
var getDate2 = (dateStr) => {
|
|
313
|
+
const date = new Date(dateStr);
|
|
314
|
+
const year = date.getFullYear();
|
|
315
|
+
const month = (date.getMonth() + 1).toString().padStart(2, "0");
|
|
316
|
+
const day = date.getDate().toString().padStart(2, "0");
|
|
317
|
+
const formattedDate = `${month}-${day}-${year}`;
|
|
318
|
+
return formattedDate;
|
|
319
|
+
};
|
|
320
|
+
var getDateFormat2 = (dateStr) => {
|
|
321
|
+
const date = new Date(dateStr);
|
|
322
|
+
const now = /* @__PURE__ */ new Date();
|
|
323
|
+
const seconds = Math.floor((now.getTime() - date.getTime()) / 1e3);
|
|
324
|
+
let interval = seconds / 31536e3;
|
|
325
|
+
if (interval > 1) {
|
|
326
|
+
return date.toLocaleDateString("en-US", {
|
|
327
|
+
year: "numeric",
|
|
328
|
+
month: "short",
|
|
329
|
+
day: "numeric"
|
|
330
|
+
});
|
|
331
|
+
}
|
|
332
|
+
interval = seconds / 2592e3;
|
|
333
|
+
if (interval > 1) {
|
|
334
|
+
return date.toLocaleDateString("en-US", {
|
|
335
|
+
year: "numeric",
|
|
336
|
+
month: "short",
|
|
337
|
+
day: "numeric"
|
|
338
|
+
});
|
|
339
|
+
}
|
|
340
|
+
interval = seconds / 86400;
|
|
341
|
+
if (interval > 7) {
|
|
342
|
+
return date.toLocaleDateString("en-US", {
|
|
343
|
+
year: "numeric",
|
|
344
|
+
month: "short",
|
|
345
|
+
day: "numeric"
|
|
346
|
+
});
|
|
347
|
+
} else if (interval > 1) {
|
|
348
|
+
return Math.floor(interval) + "d ago";
|
|
349
|
+
}
|
|
350
|
+
interval = seconds / 3600;
|
|
351
|
+
if (interval > 1) {
|
|
352
|
+
return Math.floor(interval) + "h ago";
|
|
353
|
+
}
|
|
354
|
+
interval = seconds / 60;
|
|
355
|
+
if (interval > 1) {
|
|
356
|
+
return Math.floor(interval) + "m ago";
|
|
357
|
+
}
|
|
358
|
+
return Math.floor(seconds) + "s ago";
|
|
359
|
+
};
|
|
360
|
+
var addMonths2 = (date, months) => {
|
|
361
|
+
date.setMonth(date.getMonth() + months);
|
|
362
|
+
return date;
|
|
363
|
+
};
|
|
364
|
+
var Functions_default = { getDate: getDate2, getDateFormat: getDateFormat2, addMonths: addMonths2 };
|
|
365
|
+
|
|
366
|
+
// src/models/index.ts
|
|
367
|
+
var models_default = {
|
|
368
|
+
UserModel: UserModel_default,
|
|
369
|
+
Subscription: SubscriptionModel_default,
|
|
370
|
+
SubscriptionType: SubscriptionTypeModel_default,
|
|
371
|
+
NotiTypeModel: NotiTypeModel_default,
|
|
372
|
+
NotificationStatsModel: NotificationStatsModel_default,
|
|
373
|
+
NotiHubStatsHistory: NotiHubStatsHistoryModel_default,
|
|
374
|
+
NotificationModel: NotificationModel_default,
|
|
375
|
+
Customer: CustomerModel_default,
|
|
376
|
+
CustomerMinified: CustomerMinifiedModel_default,
|
|
377
|
+
Functions: Functions_default
|
|
378
|
+
};
|
|
379
|
+
// Annotate the CommonJS export names for ESM import in node:
|
|
380
|
+
0 && (module.exports = {
|
|
381
|
+
models,
|
|
382
|
+
types,
|
|
383
|
+
util
|
|
384
|
+
});
|
package/dist/index.d.cts
ADDED
|
@@ -0,0 +1,243 @@
|
|
|
1
|
+
import * as mongoose from 'mongoose';
|
|
2
|
+
|
|
3
|
+
type CreateNotiRequestBody = {
|
|
4
|
+
subscriptionId: string;
|
|
5
|
+
userId: string;
|
|
6
|
+
title: string;
|
|
7
|
+
message: string;
|
|
8
|
+
type: string;
|
|
9
|
+
};
|
|
10
|
+
type CreateSubscriptionRequestBody = {
|
|
11
|
+
subscriptionId: string;
|
|
12
|
+
type: string;
|
|
13
|
+
};
|
|
14
|
+
type CreateUserRequestBody = {
|
|
15
|
+
name: string;
|
|
16
|
+
email: string;
|
|
17
|
+
token: string;
|
|
18
|
+
};
|
|
19
|
+
type ICreateCustomerRequestBody = {
|
|
20
|
+
email: string;
|
|
21
|
+
username: string;
|
|
22
|
+
name: string;
|
|
23
|
+
};
|
|
24
|
+
type ICreateNotiRequestBody = {};
|
|
25
|
+
type INotiHubCustomerMinified = {
|
|
26
|
+
_id: string;
|
|
27
|
+
name: string;
|
|
28
|
+
img: INotiHubImage;
|
|
29
|
+
username: string;
|
|
30
|
+
createdAt: string;
|
|
31
|
+
updatedAt: string;
|
|
32
|
+
};
|
|
33
|
+
type INotiHubCustomer = {
|
|
34
|
+
_id: string;
|
|
35
|
+
name: string;
|
|
36
|
+
email: string;
|
|
37
|
+
minified: INotiHubCustomerMinified;
|
|
38
|
+
verified: boolean;
|
|
39
|
+
paid: boolean;
|
|
40
|
+
confirmed: boolean;
|
|
41
|
+
createdAt: string;
|
|
42
|
+
updatedAt: string;
|
|
43
|
+
};
|
|
44
|
+
type INotiHubNotification = {
|
|
45
|
+
_id?: string;
|
|
46
|
+
title: string;
|
|
47
|
+
message: string;
|
|
48
|
+
type: string;
|
|
49
|
+
entityId: string;
|
|
50
|
+
entityMinified: INotiHubCustomerMinified;
|
|
51
|
+
body: string;
|
|
52
|
+
createdAt: string;
|
|
53
|
+
updatedAt: string;
|
|
54
|
+
};
|
|
55
|
+
type INotiHubNotificationStats = {
|
|
56
|
+
_id?: string;
|
|
57
|
+
notification: INotiHubNotification;
|
|
58
|
+
views: number;
|
|
59
|
+
};
|
|
60
|
+
type INotiHubUser = {
|
|
61
|
+
_id?: string;
|
|
62
|
+
pushToken: string;
|
|
63
|
+
name: string;
|
|
64
|
+
email: string;
|
|
65
|
+
subscriptions: number;
|
|
66
|
+
events: number;
|
|
67
|
+
};
|
|
68
|
+
type INotiHubImage = {
|
|
69
|
+
bucket: string;
|
|
70
|
+
key: string;
|
|
71
|
+
};
|
|
72
|
+
type INotiHubStats = {
|
|
73
|
+
entityRef: string;
|
|
74
|
+
entity: INotiHubCustomer;
|
|
75
|
+
subscription: number;
|
|
76
|
+
notifications: number;
|
|
77
|
+
views: number;
|
|
78
|
+
};
|
|
79
|
+
type INotiHubStatsHistory = {
|
|
80
|
+
entityId: string;
|
|
81
|
+
type: "MONTH" | "YEAR";
|
|
82
|
+
subscription: number;
|
|
83
|
+
notifications: number;
|
|
84
|
+
views: number;
|
|
85
|
+
};
|
|
86
|
+
type INotiType = {
|
|
87
|
+
_id?: string;
|
|
88
|
+
type: string;
|
|
89
|
+
entity: string;
|
|
90
|
+
createdAt: string;
|
|
91
|
+
updatedAt: string;
|
|
92
|
+
};
|
|
93
|
+
type INotiTypeStats = {
|
|
94
|
+
_id?: string;
|
|
95
|
+
notiTypeId: string;
|
|
96
|
+
subscribed: number;
|
|
97
|
+
createdAt: string;
|
|
98
|
+
};
|
|
99
|
+
type IUserSubscription = {
|
|
100
|
+
user: INotiHubUser;
|
|
101
|
+
entity: INotiHubCustomer;
|
|
102
|
+
subscriptionId: string;
|
|
103
|
+
type: "SUBSCRIBED" | "UNSUBSCRIBED";
|
|
104
|
+
createdAt: string;
|
|
105
|
+
updatedAt: string;
|
|
106
|
+
};
|
|
107
|
+
type IUserSubscribeNotifier = {
|
|
108
|
+
userId: string;
|
|
109
|
+
entityId: string;
|
|
110
|
+
notiTypeId: string;
|
|
111
|
+
createdAt: string;
|
|
112
|
+
updatedAt: string;
|
|
113
|
+
};
|
|
114
|
+
type INotiHubUserView = {
|
|
115
|
+
userId: string;
|
|
116
|
+
entityId: string;
|
|
117
|
+
notificationId: string;
|
|
118
|
+
createdAt: string;
|
|
119
|
+
};
|
|
120
|
+
type INotiHubSubscription = {
|
|
121
|
+
_id?: string;
|
|
122
|
+
subscriptionId: string;
|
|
123
|
+
entity: INotiHubCustomer;
|
|
124
|
+
user: INotiHubUser;
|
|
125
|
+
type: "SUBSCRIBED" | "UNSUBSCRIBED";
|
|
126
|
+
createdAt: string;
|
|
127
|
+
updatedAt: string;
|
|
128
|
+
};
|
|
129
|
+
type NotiHubTypes = {
|
|
130
|
+
INotiHubUserView: INotiHubUserView;
|
|
131
|
+
IUserSubscribeNotifier: IUserSubscribeNotifier;
|
|
132
|
+
IUserSubscription: IUserSubscription;
|
|
133
|
+
INotiHubUser: INotiHubUser;
|
|
134
|
+
INotiTypeStats: INotiTypeStats;
|
|
135
|
+
INotiHubImage: INotiHubImage;
|
|
136
|
+
INotiHubSubscription: INotiHubSubscription;
|
|
137
|
+
INotiHubNotificationStats: INotiHubNotificationStats;
|
|
138
|
+
INotiHubNotification: INotiHubNotification;
|
|
139
|
+
INotiHubCustomer: INotiHubCustomer;
|
|
140
|
+
INotiHubCustomerMinified: INotiHubCustomerMinified;
|
|
141
|
+
INotiHubStatsHistory: INotiHubStatsHistory;
|
|
142
|
+
};
|
|
143
|
+
|
|
144
|
+
type types_CreateNotiRequestBody = CreateNotiRequestBody;
|
|
145
|
+
type types_CreateSubscriptionRequestBody = CreateSubscriptionRequestBody;
|
|
146
|
+
type types_CreateUserRequestBody = CreateUserRequestBody;
|
|
147
|
+
type types_ICreateCustomerRequestBody = ICreateCustomerRequestBody;
|
|
148
|
+
type types_ICreateNotiRequestBody = ICreateNotiRequestBody;
|
|
149
|
+
type types_INotiHubCustomer = INotiHubCustomer;
|
|
150
|
+
type types_INotiHubCustomerMinified = INotiHubCustomerMinified;
|
|
151
|
+
type types_INotiHubImage = INotiHubImage;
|
|
152
|
+
type types_INotiHubNotification = INotiHubNotification;
|
|
153
|
+
type types_INotiHubNotificationStats = INotiHubNotificationStats;
|
|
154
|
+
type types_INotiHubStats = INotiHubStats;
|
|
155
|
+
type types_INotiHubStatsHistory = INotiHubStatsHistory;
|
|
156
|
+
type types_INotiHubSubscription = INotiHubSubscription;
|
|
157
|
+
type types_INotiHubUser = INotiHubUser;
|
|
158
|
+
type types_INotiHubUserView = INotiHubUserView;
|
|
159
|
+
type types_INotiType = INotiType;
|
|
160
|
+
type types_INotiTypeStats = INotiTypeStats;
|
|
161
|
+
type types_IUserSubscribeNotifier = IUserSubscribeNotifier;
|
|
162
|
+
type types_IUserSubscription = IUserSubscription;
|
|
163
|
+
type types_NotiHubTypes = NotiHubTypes;
|
|
164
|
+
declare namespace types {
|
|
165
|
+
export type { types_CreateNotiRequestBody as CreateNotiRequestBody, types_CreateSubscriptionRequestBody as CreateSubscriptionRequestBody, types_CreateUserRequestBody as CreateUserRequestBody, types_ICreateCustomerRequestBody as ICreateCustomerRequestBody, types_ICreateNotiRequestBody as ICreateNotiRequestBody, types_INotiHubCustomer as INotiHubCustomer, types_INotiHubCustomerMinified as INotiHubCustomerMinified, types_INotiHubImage as INotiHubImage, types_INotiHubNotification as INotiHubNotification, types_INotiHubNotificationStats as INotiHubNotificationStats, types_INotiHubStats as INotiHubStats, types_INotiHubStatsHistory as INotiHubStatsHistory, types_INotiHubSubscription as INotiHubSubscription, types_INotiHubUser as INotiHubUser, types_INotiHubUserView as INotiHubUserView, types_INotiType as INotiType, types_INotiTypeStats as INotiTypeStats, types_IUserSubscribeNotifier as IUserSubscribeNotifier, types_IUserSubscription as IUserSubscription, types_NotiHubTypes as NotiHubTypes };
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
type AddMonths = {
|
|
169
|
+
date: Date;
|
|
170
|
+
months: number;
|
|
171
|
+
};
|
|
172
|
+
|
|
173
|
+
declare function getDate(dateStr: string): string;
|
|
174
|
+
declare function getDateFormat(dateStr: string): string;
|
|
175
|
+
declare function addMonths({ date, months }: AddMonths): Date;
|
|
176
|
+
declare const _default$1: {
|
|
177
|
+
getDate: typeof getDate;
|
|
178
|
+
getDateFormat: typeof getDateFormat;
|
|
179
|
+
addMonths: typeof addMonths;
|
|
180
|
+
};
|
|
181
|
+
|
|
182
|
+
declare namespace index$1 {
|
|
183
|
+
export { _default$1 as default };
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
declare const _default: {
|
|
187
|
+
UserModel: mongoose.Model<INotiHubUser, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubUser> & INotiHubUser & Required<{
|
|
188
|
+
_id: string;
|
|
189
|
+
}> & {
|
|
190
|
+
__v?: number | undefined;
|
|
191
|
+
}, any>;
|
|
192
|
+
Subscription: mongoose.Model<INotiHubSubscription, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubSubscription> & INotiHubSubscription & Required<{
|
|
193
|
+
_id: string;
|
|
194
|
+
}> & {
|
|
195
|
+
__v?: number | undefined;
|
|
196
|
+
}, any>;
|
|
197
|
+
SubscriptionType: mongoose.Model<IUserSubscribeNotifier, {}, {}, {}, mongoose.Document<unknown, {}, IUserSubscribeNotifier> & IUserSubscribeNotifier & {
|
|
198
|
+
_id: mongoose.Types.ObjectId;
|
|
199
|
+
} & {
|
|
200
|
+
__v?: number | undefined;
|
|
201
|
+
}, any>;
|
|
202
|
+
NotiTypeModel: mongoose.Model<INotiType, {}, {}, {}, mongoose.Document<unknown, {}, INotiType> & INotiType & Required<{
|
|
203
|
+
_id: string;
|
|
204
|
+
}> & {
|
|
205
|
+
__v?: number | undefined;
|
|
206
|
+
}, any>;
|
|
207
|
+
NotificationStatsModel: mongoose.Model<INotiHubNotificationStats, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubNotificationStats> & INotiHubNotificationStats & Required<{
|
|
208
|
+
_id: string;
|
|
209
|
+
}> & {
|
|
210
|
+
__v?: number | undefined;
|
|
211
|
+
}, any>;
|
|
212
|
+
NotiHubStatsHistory: mongoose.Model<INotiHubStatsHistory, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubStatsHistory> & INotiHubStatsHistory & {
|
|
213
|
+
_id: mongoose.Types.ObjectId;
|
|
214
|
+
} & {
|
|
215
|
+
__v?: number | undefined;
|
|
216
|
+
}, any>;
|
|
217
|
+
NotificationModel: mongoose.Model<INotiHubNotification, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubNotification> & INotiHubNotification & Required<{
|
|
218
|
+
_id: string;
|
|
219
|
+
}> & {
|
|
220
|
+
__v?: number | undefined;
|
|
221
|
+
}, any>;
|
|
222
|
+
Customer: mongoose.Model<INotiHubCustomer, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubCustomer> & INotiHubCustomer & Required<{
|
|
223
|
+
_id: string;
|
|
224
|
+
}> & {
|
|
225
|
+
__v?: number | undefined;
|
|
226
|
+
}, any>;
|
|
227
|
+
CustomerMinified: mongoose.Model<INotiHubCustomerMinified, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubCustomerMinified> & INotiHubCustomerMinified & Required<{
|
|
228
|
+
_id: string;
|
|
229
|
+
}> & {
|
|
230
|
+
__v?: number | undefined;
|
|
231
|
+
}, any>;
|
|
232
|
+
Functions: {
|
|
233
|
+
getDate: (dateStr: string) => string;
|
|
234
|
+
getDateFormat: (dateStr: string) => string;
|
|
235
|
+
addMonths: (date: Date, months: number) => Date;
|
|
236
|
+
};
|
|
237
|
+
};
|
|
238
|
+
|
|
239
|
+
declare namespace index {
|
|
240
|
+
export { _default as default };
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
export { index as models, types, index$1 as util };
|