@amohamud23/notihub 1.0.83 → 1.0.85

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 CHANGED
@@ -1,7 +1,9 @@
1
1
  "use strict";
2
+ var __create = Object.create;
2
3
  var __defProp = Object.defineProperty;
3
4
  var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
4
5
  var __getOwnPropNames = Object.getOwnPropertyNames;
6
+ var __getProtoOf = Object.getPrototypeOf;
5
7
  var __hasOwnProp = Object.prototype.hasOwnProperty;
6
8
  var __export = (target, all) => {
7
9
  for (var name in all)
@@ -15,6 +17,14 @@ var __copyProps = (to, from, except, desc) => {
15
17
  }
16
18
  return to;
17
19
  };
20
+ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__getProtoOf(mod)) : {}, __copyProps(
21
+ // If the importer is in node compatibility mode or this is not an ESM
22
+ // file that has been converted to a CommonJS file using a Babel-
23
+ // compatible transform (i.e. "__esModule" has not been set), then set
24
+ // "default" to the CommonJS "module.exports" for node compatibility.
25
+ isNodeMode || !mod || !mod.__esModule ? __defProp(target, "default", { value: mod, enumerable: true }) : target,
26
+ mod
27
+ ));
18
28
  var __toCommonJS = (mod) => __copyProps(__defProp({}, "__esModule", { value: true }), mod);
19
29
 
20
30
  // src/index.ts
@@ -34,6 +44,7 @@ __export(src_exports, {
34
44
  getDateFormat: () => getDateFormat
35
45
  });
36
46
  module.exports = __toCommonJS(src_exports);
47
+ var import_mongoose16 = __toESM(require("mongoose"), 1);
37
48
 
38
49
  // src/util/index.ts
39
50
  function getDate(dateStr) {
@@ -109,12 +120,9 @@ var UserModel = (0, import_mongoose2.model)("User", userSchema);
109
120
  var UserModel_default = UserModel;
110
121
 
111
122
  // src/models/SubscriptionModel.ts
112
- var import_mongoose6 = require("mongoose");
113
-
114
- // src/models/schemas/SubscriptionSchema.ts
115
123
  var import_mongoose5 = require("mongoose");
116
124
 
117
- // src/models/schemas/CustomerSchema.ts
125
+ // src/models/schemas/SubscriptionSchema.ts
118
126
  var import_mongoose4 = require("mongoose");
119
127
 
120
128
  // src/models/schemas/CustomerMinifiedSchema.ts
@@ -132,7 +140,7 @@ var CustomerMinifiedSchema_default = CustomerMinifiedSchema;
132
140
 
133
141
  // src/models/schemas/CustomerSchema.ts
134
142
  var CustomerSchema = {
135
- id: { type: import_mongoose4.Schema.Types.UUID, default: true },
143
+ // id: { type: Schema.Types.UUID, default: true },
136
144
  minified: CustomerMinifiedSchema_default,
137
145
  paid: { type: Boolean, default: false },
138
146
  email: { type: String, required: true },
@@ -143,7 +151,7 @@ var CustomerSchema_default = CustomerSchema;
143
151
 
144
152
  // src/models/schemas/SubscriptionSchema.ts
145
153
  var SubscriptionSchema = {
146
- id: { type: import_mongoose5.Schema.Types.UUID, default: true },
154
+ id: { type: import_mongoose4.Schema.Types.UUID, default: true },
147
155
  subscriptionId: { type: String, required: true },
148
156
  user: UserSchema_default,
149
157
  entity: CustomerSchema_default
@@ -151,44 +159,44 @@ var SubscriptionSchema = {
151
159
  var SubscriptionSchema_default = SubscriptionSchema;
152
160
 
153
161
  // src/models/SubscriptionModel.ts
154
- var subscriptionSchema = new import_mongoose6.Schema(
162
+ var subscriptionSchema = new import_mongoose5.Schema(
155
163
  SubscriptionSchema_default,
156
164
  {
157
165
  timestamps: true
158
166
  }
159
167
  );
160
- var Subscription = (0, import_mongoose6.model)(
168
+ var Subscription = (0, import_mongoose5.model)(
161
169
  "Subscriptions",
162
170
  subscriptionSchema
163
171
  );
164
172
  var SubscriptionModel_default = Subscription;
165
173
 
166
174
  // src/models/NotiTypeModel.ts
167
- var import_mongoose8 = require("mongoose");
175
+ var import_mongoose7 = require("mongoose");
168
176
 
169
177
  // src/models/schemas/NotiTypeSchema.ts
170
- var import_mongoose7 = require("mongoose");
178
+ var import_mongoose6 = require("mongoose");
171
179
  var NotiTypeSchema = {
172
- id: { type: import_mongoose7.Schema.Types.UUID, default: true },
180
+ id: { type: import_mongoose6.Schema.Types.UUID, default: true },
173
181
  entity: CustomerSchema_default,
174
182
  type: { type: String, required: true }
175
183
  };
176
184
  var NotiTypeSchema_default = NotiTypeSchema;
177
185
 
178
186
  // src/models/NotiTypeModel.ts
179
- var notiTypeSchema = new import_mongoose8.Schema(NotiTypeSchema_default, {
187
+ var notiTypeSchema = new import_mongoose7.Schema(NotiTypeSchema_default, {
180
188
  timestamps: true
181
189
  });
182
- var NotiTypeModel = (0, import_mongoose8.model)("NotiTypes", notiTypeSchema);
190
+ var NotiTypeModel = (0, import_mongoose7.model)("NotiTypes", notiTypeSchema);
183
191
  var NotiTypeModel_default = NotiTypeModel;
184
192
 
185
193
  // src/models/NotiHubStatsHistoryModel.ts
186
- var import_mongoose10 = require("mongoose");
194
+ var import_mongoose9 = require("mongoose");
187
195
 
188
196
  // src/models/schemas/NotificationStatsHistorySchema.ts
189
- var import_mongoose9 = require("mongoose");
197
+ var import_mongoose8 = require("mongoose");
190
198
  var NotihubStatsHistorySchema = {
191
- id: { type: import_mongoose9.Schema.Types.UUID, default: true },
199
+ id: { type: import_mongoose8.Schema.Types.UUID, default: true },
192
200
  entityId: { type: String, required: true },
193
201
  notifications: { type: Number, required: true },
194
202
  subscription: { type: Number, required: true },
@@ -198,25 +206,25 @@ var NotihubStatsHistorySchema = {
198
206
  var NotificationStatsHistorySchema_default = NotihubStatsHistorySchema;
199
207
 
200
208
  // src/models/NotiHubStatsHistoryModel.ts
201
- var notihubStatsHistorySchema = new import_mongoose10.Schema(
209
+ var notihubStatsHistorySchema = new import_mongoose9.Schema(
202
210
  NotificationStatsHistorySchema_default,
203
211
  {
204
212
  timestamps: true
205
213
  }
206
214
  );
207
- var NotiHubStatsHistory = (0, import_mongoose10.model)(
215
+ var NotiHubStatsHistory = (0, import_mongoose9.model)(
208
216
  "INotiHubStatsHistories",
209
217
  notihubStatsHistorySchema
210
218
  );
211
219
  var NotiHubStatsHistoryModel_default = NotiHubStatsHistory;
212
220
 
213
221
  // src/models/NotificationStatsModel.ts
214
- var import_mongoose12 = require("mongoose");
222
+ var import_mongoose11 = require("mongoose");
215
223
 
216
224
  // src/models/schemas/NotificationSchema.ts
217
- var import_mongoose11 = require("mongoose");
225
+ var import_mongoose10 = require("mongoose");
218
226
  var NotificationSchema = {
219
- id: { type: import_mongoose11.Schema.Types.UUID, default: true },
227
+ id: { type: import_mongoose10.Schema.Types.UUID, default: true },
220
228
  title: { type: String, required: true },
221
229
  message: { type: String, required: true },
222
230
  type: { type: String, required: true },
@@ -227,22 +235,22 @@ var NotificationSchema = {
227
235
  var NotificationSchema_default = NotificationSchema;
228
236
 
229
237
  // src/models/NotificationStatsModel.ts
230
- var notificationSchema = new import_mongoose12.Schema(
238
+ var notificationSchema = new import_mongoose11.Schema(
231
239
  {
232
240
  notification: NotificationSchema_default,
233
241
  views: { type: Number, default: 0 }
234
242
  },
235
243
  { timestamps: true }
236
244
  );
237
- var NotificationStatsModel = (0, import_mongoose12.model)(
245
+ var NotificationStatsModel = (0, import_mongoose11.model)(
238
246
  "NotificationStats",
239
247
  notificationSchema
240
248
  );
241
249
  var NotificationStatsModel_default = NotificationStatsModel;
242
250
 
243
251
  // src/models/NotificationModel.ts
244
- var import_mongoose13 = require("mongoose");
245
- var notificationSchema2 = new import_mongoose13.Schema(
252
+ var import_mongoose12 = require("mongoose");
253
+ var notificationSchema2 = new import_mongoose12.Schema(
246
254
  {
247
255
  title: { type: String, required: true },
248
256
  message: { type: String, required: true },
@@ -253,34 +261,34 @@ var notificationSchema2 = new import_mongoose13.Schema(
253
261
  },
254
262
  { timestamps: true }
255
263
  );
256
- var NotificationModel = (0, import_mongoose13.model)(
264
+ var NotificationModel = (0, import_mongoose12.model)(
257
265
  "Notification",
258
266
  notificationSchema2
259
267
  );
260
268
  var NotificationModel_default = NotificationModel;
261
269
 
262
270
  // src/models/CustomerModel.ts
263
- var import_mongoose14 = require("mongoose");
264
- var customerSchema = new import_mongoose14.Schema(CustomerSchema_default, {
271
+ var import_mongoose13 = require("mongoose");
272
+ var customerSchema = new import_mongoose13.Schema(CustomerSchema_default, {
265
273
  timestamps: true
266
274
  });
267
- var Customer = (0, import_mongoose14.model)("Customer", customerSchema);
275
+ var Customer = (0, import_mongoose13.model)("Customer", customerSchema);
268
276
  var CustomerModel_default = Customer;
269
277
 
270
278
  // src/models/CustomerMinifiedModel.ts
271
- var import_mongoose15 = require("mongoose");
272
- var customerMinifiedSchema = new import_mongoose15.Schema(
279
+ var import_mongoose14 = require("mongoose");
280
+ var customerMinifiedSchema = new import_mongoose14.Schema(
273
281
  CustomerMinifiedSchema_default,
274
282
  { timestamps: true }
275
283
  );
276
- var CustomerMinified = (0, import_mongoose15.model)(
284
+ var CustomerMinified = (0, import_mongoose14.model)(
277
285
  "CustomerMinified",
278
286
  customerMinifiedSchema
279
287
  );
280
288
  var CustomerMinifiedModel_default = CustomerMinified;
281
289
 
282
290
  // src/models/SubscriptionTypeModel.ts
283
- var import_mongoose16 = require("mongoose");
291
+ var import_mongoose15 = require("mongoose");
284
292
 
285
293
  // src/models/schemas/SubscriptionTypeSchema.ts
286
294
  var SubscriptionSchema2 = {
@@ -291,17 +299,25 @@ var SubscriptionSchema2 = {
291
299
  var SubscriptionTypeSchema_default = SubscriptionSchema2;
292
300
 
293
301
  // src/models/SubscriptionTypeModel.ts
294
- var subscriptionSchema2 = new import_mongoose16.Schema(
302
+ var subscriptionSchema2 = new import_mongoose15.Schema(
295
303
  SubscriptionTypeSchema_default,
296
304
  {
297
305
  timestamps: true
298
306
  }
299
307
  );
300
- var SubscriptionType = (0, import_mongoose16.model)(
308
+ var SubscriptionType = (0, import_mongoose15.model)(
301
309
  "SubscriptionTypes",
302
310
  subscriptionSchema2
303
311
  );
304
312
  var SubscriptionTypeModel_default = SubscriptionType;
313
+
314
+ // src/index.ts
315
+ import_mongoose16.default.connect(
316
+ "mongodb+srv://admin:YF6ImNWyAMUUu72I@nftcluster.llzxp.mongodb.net/test?authSource=admin&replicaSet=atlas-p5dddq-shard-0&readPreference=primary&ssl=true",
317
+ { dbName: "notihub" }
318
+ ).then(() => console.log("Database Connected")).catch((err) => {
319
+ console.error(`Error Connecting to the Database: ${err}`);
320
+ });
305
321
  // Annotate the CommonJS export names for ESM import in node:
306
322
  0 && (module.exports = {
307
323
  Customer,
package/dist/index.js CHANGED
@@ -1,3 +1,6 @@
1
+ // src/index.ts
2
+ import mongoose3 from "mongoose";
3
+
1
4
  // src/util/index.ts
2
5
  function getDate(dateStr) {
3
6
  const date = new Date(dateStr);
@@ -72,12 +75,9 @@ var UserModel = model("User", userSchema);
72
75
  var UserModel_default = UserModel;
73
76
 
74
77
  // src/models/SubscriptionModel.ts
75
- import { Schema as Schema6, model as model3 } from "mongoose";
78
+ import { Schema as Schema5, model as model3 } from "mongoose";
76
79
 
77
80
  // src/models/schemas/SubscriptionSchema.ts
78
- import { Schema as Schema5 } from "mongoose";
79
-
80
- // src/models/schemas/CustomerSchema.ts
81
81
  import { Schema as Schema4 } from "mongoose";
82
82
 
83
83
  // src/models/schemas/CustomerMinifiedSchema.ts
@@ -95,7 +95,7 @@ var CustomerMinifiedSchema_default = CustomerMinifiedSchema;
95
95
 
96
96
  // src/models/schemas/CustomerSchema.ts
97
97
  var CustomerSchema = {
98
- id: { type: Schema4.Types.UUID, default: true },
98
+ // id: { type: Schema.Types.UUID, default: true },
99
99
  minified: CustomerMinifiedSchema_default,
100
100
  paid: { type: Boolean, default: false },
101
101
  email: { type: String, required: true },
@@ -106,7 +106,7 @@ var CustomerSchema_default = CustomerSchema;
106
106
 
107
107
  // src/models/schemas/SubscriptionSchema.ts
108
108
  var SubscriptionSchema = {
109
- id: { type: Schema5.Types.UUID, default: true },
109
+ id: { type: Schema4.Types.UUID, default: true },
110
110
  subscriptionId: { type: String, required: true },
111
111
  user: UserSchema_default,
112
112
  entity: CustomerSchema_default
@@ -114,7 +114,7 @@ var SubscriptionSchema = {
114
114
  var SubscriptionSchema_default = SubscriptionSchema;
115
115
 
116
116
  // src/models/SubscriptionModel.ts
117
- var subscriptionSchema = new Schema6(
117
+ var subscriptionSchema = new Schema5(
118
118
  SubscriptionSchema_default,
119
119
  {
120
120
  timestamps: true
@@ -127,31 +127,31 @@ var Subscription = model3(
127
127
  var SubscriptionModel_default = Subscription;
128
128
 
129
129
  // src/models/NotiTypeModel.ts
130
- import { Schema as Schema8, model as model4 } from "mongoose";
130
+ import { Schema as Schema7, model as model4 } from "mongoose";
131
131
 
132
132
  // src/models/schemas/NotiTypeSchema.ts
133
- import { Schema as Schema7 } from "mongoose";
133
+ import { Schema as Schema6 } from "mongoose";
134
134
  var NotiTypeSchema = {
135
- id: { type: Schema7.Types.UUID, default: true },
135
+ id: { type: Schema6.Types.UUID, default: true },
136
136
  entity: CustomerSchema_default,
137
137
  type: { type: String, required: true }
138
138
  };
139
139
  var NotiTypeSchema_default = NotiTypeSchema;
140
140
 
141
141
  // src/models/NotiTypeModel.ts
142
- var notiTypeSchema = new Schema8(NotiTypeSchema_default, {
142
+ var notiTypeSchema = new Schema7(NotiTypeSchema_default, {
143
143
  timestamps: true
144
144
  });
145
145
  var NotiTypeModel = model4("NotiTypes", notiTypeSchema);
146
146
  var NotiTypeModel_default = NotiTypeModel;
147
147
 
148
148
  // src/models/NotiHubStatsHistoryModel.ts
149
- import { Schema as Schema10, model as model5 } from "mongoose";
149
+ import { Schema as Schema9, model as model5 } from "mongoose";
150
150
 
151
151
  // src/models/schemas/NotificationStatsHistorySchema.ts
152
- import { Schema as Schema9 } from "mongoose";
152
+ import { Schema as Schema8 } from "mongoose";
153
153
  var NotihubStatsHistorySchema = {
154
- id: { type: Schema9.Types.UUID, default: true },
154
+ id: { type: Schema8.Types.UUID, default: true },
155
155
  entityId: { type: String, required: true },
156
156
  notifications: { type: Number, required: true },
157
157
  subscription: { type: Number, required: true },
@@ -161,7 +161,7 @@ var NotihubStatsHistorySchema = {
161
161
  var NotificationStatsHistorySchema_default = NotihubStatsHistorySchema;
162
162
 
163
163
  // src/models/NotiHubStatsHistoryModel.ts
164
- var notihubStatsHistorySchema = new Schema10(
164
+ var notihubStatsHistorySchema = new Schema9(
165
165
  NotificationStatsHistorySchema_default,
166
166
  {
167
167
  timestamps: true
@@ -174,12 +174,12 @@ var NotiHubStatsHistory = model5(
174
174
  var NotiHubStatsHistoryModel_default = NotiHubStatsHistory;
175
175
 
176
176
  // src/models/NotificationStatsModel.ts
177
- import { Schema as Schema12, model as model6 } from "mongoose";
177
+ import { Schema as Schema11, model as model6 } from "mongoose";
178
178
 
179
179
  // src/models/schemas/NotificationSchema.ts
180
- import { Schema as Schema11 } from "mongoose";
180
+ import { Schema as Schema10 } from "mongoose";
181
181
  var NotificationSchema = {
182
- id: { type: Schema11.Types.UUID, default: true },
182
+ id: { type: Schema10.Types.UUID, default: true },
183
183
  title: { type: String, required: true },
184
184
  message: { type: String, required: true },
185
185
  type: { type: String, required: true },
@@ -190,7 +190,7 @@ var NotificationSchema = {
190
190
  var NotificationSchema_default = NotificationSchema;
191
191
 
192
192
  // src/models/NotificationStatsModel.ts
193
- var notificationSchema = new Schema12(
193
+ var notificationSchema = new Schema11(
194
194
  {
195
195
  notification: NotificationSchema_default,
196
196
  views: { type: Number, default: 0 }
@@ -204,8 +204,8 @@ var NotificationStatsModel = model6(
204
204
  var NotificationStatsModel_default = NotificationStatsModel;
205
205
 
206
206
  // src/models/NotificationModel.ts
207
- import { Schema as Schema13, model as model7 } from "mongoose";
208
- var notificationSchema2 = new Schema13(
207
+ import { Schema as Schema12, model as model7 } from "mongoose";
208
+ var notificationSchema2 = new Schema12(
209
209
  {
210
210
  title: { type: String, required: true },
211
211
  message: { type: String, required: true },
@@ -223,16 +223,16 @@ var NotificationModel = model7(
223
223
  var NotificationModel_default = NotificationModel;
224
224
 
225
225
  // src/models/CustomerModel.ts
226
- import { Schema as Schema14, model as model8 } from "mongoose";
227
- var customerSchema = new Schema14(CustomerSchema_default, {
226
+ import { Schema as Schema13, model as model8 } from "mongoose";
227
+ var customerSchema = new Schema13(CustomerSchema_default, {
228
228
  timestamps: true
229
229
  });
230
230
  var Customer = model8("Customer", customerSchema);
231
231
  var CustomerModel_default = Customer;
232
232
 
233
233
  // src/models/CustomerMinifiedModel.ts
234
- import { Schema as Schema15, model as model9 } from "mongoose";
235
- var customerMinifiedSchema = new Schema15(
234
+ import { Schema as Schema14, model as model9 } from "mongoose";
235
+ var customerMinifiedSchema = new Schema14(
236
236
  CustomerMinifiedSchema_default,
237
237
  { timestamps: true }
238
238
  );
@@ -243,7 +243,7 @@ var CustomerMinified = model9(
243
243
  var CustomerMinifiedModel_default = CustomerMinified;
244
244
 
245
245
  // src/models/SubscriptionTypeModel.ts
246
- import { Schema as Schema16, model as model10 } from "mongoose";
246
+ import { Schema as Schema15, model as model10 } from "mongoose";
247
247
 
248
248
  // src/models/schemas/SubscriptionTypeSchema.ts
249
249
  var SubscriptionSchema2 = {
@@ -254,7 +254,7 @@ var SubscriptionSchema2 = {
254
254
  var SubscriptionTypeSchema_default = SubscriptionSchema2;
255
255
 
256
256
  // src/models/SubscriptionTypeModel.ts
257
- var subscriptionSchema2 = new Schema16(
257
+ var subscriptionSchema2 = new Schema15(
258
258
  SubscriptionTypeSchema_default,
259
259
  {
260
260
  timestamps: true
@@ -265,6 +265,14 @@ var SubscriptionType = model10(
265
265
  subscriptionSchema2
266
266
  );
267
267
  var SubscriptionTypeModel_default = SubscriptionType;
268
+
269
+ // src/index.ts
270
+ mongoose3.connect(
271
+ "mongodb+srv://admin:YF6ImNWyAMUUu72I@nftcluster.llzxp.mongodb.net/test?authSource=admin&replicaSet=atlas-p5dddq-shard-0&readPreference=primary&ssl=true",
272
+ { dbName: "notihub" }
273
+ ).then(() => console.log("Database Connected")).catch((err) => {
274
+ console.error(`Error Connecting to the Database: ${err}`);
275
+ });
268
276
  export {
269
277
  CustomerModel_default as Customer,
270
278
  CustomerMinifiedModel_default as CustomerMinified,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amohamud23/notihub",
3
- "version": "1.0.83",
3
+ "version": "1.0.85",
4
4
  "description": "Notihub Package",
5
5
  "main": "./dist/index.cjs",
6
6
  "types": "./dist/index.d.cts",