@amohamud23/notihub 1.0.122 → 1.0.124

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
@@ -41,6 +41,7 @@ __export(src_exports, {
41
41
  NotiTypeStatsModel: () => NotiTypeStatsModel_default,
42
42
  NotificationModel: () => NotificationModel_default,
43
43
  NotificationStats: () => NotificationStatsModel_default,
44
+ StripScriptionModel: () => StripeSubscriptionModel_default,
44
45
  Subscription: () => SubscriptionModel_default,
45
46
  SubscriptionType: () => SubscriptionTypeModel_default,
46
47
  UserModel: () => UserModel_default,
@@ -389,9 +390,43 @@ var NotiTypeStatsModel = (0, import_mongoose18.model)(
389
390
  );
390
391
  var NotiTypeStatsModel_default = NotiTypeStatsModel;
391
392
 
393
+ // src/models/StripeSubscriptionModel.ts
394
+ var import_mongoose20 = require("mongoose");
395
+
396
+ // src/models/schemas/StripeSubscriptionSchema.ts
397
+ var import_mongoose19 = require("mongoose");
398
+ var StripeSubscriptionSchema = {
399
+ /**
400
+ * The ID of the NotiHub customer associated with the subscription.
401
+ */
402
+ entityRef: { type: import_mongoose19.Schema.ObjectId, ref: "Customer", required: true },
403
+ /**
404
+ * The ID of the Stripe customer associated with the subscription.
405
+ */
406
+ customerId: { type: String, default: true },
407
+ /**
408
+ * The ID of the subscription.
409
+ */
410
+ subscriptionId: { type: String, required: true }
411
+ };
412
+ var StripeSubscriptionSchema_default = StripeSubscriptionSchema;
413
+
414
+ // src/models/StripeSubscriptionModel.ts
415
+ var stripeSubscriptionSchema = new import_mongoose20.Schema(
416
+ StripeSubscriptionSchema_default,
417
+ {
418
+ timestamps: true
419
+ }
420
+ );
421
+ var StripScriptionModel = (0, import_mongoose20.model)(
422
+ "StripeSubscription",
423
+ stripeSubscriptionSchema
424
+ );
425
+ var StripeSubscriptionModel_default = StripScriptionModel;
426
+
392
427
  // src/client/MongooseClient.ts
393
- var import_mongoose19 = __toESM(require("mongoose"), 1);
394
- var Connect = () => import_mongoose19.default.connect(
428
+ var import_mongoose21 = __toESM(require("mongoose"), 1);
429
+ var Connect = () => import_mongoose21.default.connect(
395
430
  "mongodb+srv://admin:YF6ImNWyAMUUu72I@nftcluster.llzxp.mongodb.net/test?authSource=admin&replicaSet=atlas-p5dddq-shard-0&readPreference=primary&ssl=true",
396
431
  { dbName: "notihub" }
397
432
  ).then(() => {
@@ -440,6 +475,7 @@ var InvalidPushToken = "4009";
440
475
  NotiTypeStatsModel,
441
476
  NotificationModel,
442
477
  NotificationStats,
478
+ StripScriptionModel,
443
479
  Subscription,
444
480
  SubscriptionType,
445
481
  UserModel,
package/dist/index.d.cts CHANGED
@@ -146,6 +146,11 @@ type INotiHubStripeSubscription = {
146
146
  entityRef: INotiHubCustomer;
147
147
  stripe_subscription: string;
148
148
  };
149
+ type INotiHubPaymentSession = {
150
+ id: string;
151
+ session: string;
152
+ customerId: string;
153
+ };
149
154
  type NotiHubTypes = {
150
155
  INotiHubUserView: INotiHubUserView;
151
156
  IUserSubscribeNotifier: IUserSubscribeNotifier;
@@ -242,6 +247,12 @@ declare const NotiTypeStatsModel: mongoose.Model<INotiTypeStats, {}, {}, {}, mon
242
247
  __v?: number | undefined;
243
248
  }, any>;
244
249
 
250
+ declare const StripScriptionModel: mongoose.Model<INotiHubStripeSubscription, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubStripeSubscription> & INotiHubStripeSubscription & {
251
+ _id: mongoose.Types.ObjectId;
252
+ } & {
253
+ __v?: number | undefined;
254
+ }, any>;
255
+
245
256
  declare const Connect: () => Promise<void>;
246
257
 
247
258
  declare class DocumentNotFoundException extends Error {
@@ -267,4 +278,4 @@ declare namespace errorcodes {
267
278
  export { errorcodes_CustomerNotFound as CustomerNotFound, errorcodes_DocumentNotFound as DocumentNotFound, errorcodes_InvalidEmail as InvalidEmail, errorcodes_InvalidName as InvalidName, errorcodes_InvalidPassword as InvalidPassword, errorcodes_InvalidPushToken as InvalidPushToken, errorcodes_UserNotFound as UserNotFound };
268
279
  }
269
280
 
270
- export { type CreateNotiRequestBody, type CreateSubscriptionRequestBody, type CreateUserRequestBody, Customer, CustomerMinified, CustomerNotiHubStats, DocumentNotFoundException, errorcodes as ErrorCode, type ICreateCustomerRequestBody, type ICreateNotiRequestBody, type INotiHubCustomer, type INotiHubCustomerMinified, type INotiHubImage, type INotiHubNotification, type INotiHubNotificationStats, type INotiHubStats, type INotiHubStatsHistory, type INotiHubStripeSubscription, type INotiHubSubscription, type INotiHubUser, type INotiHubUserView, type INotiType, type INotiTypeStats, type IUserSubscribeNotifier, type IUserSubscription, Connect as MongooseClient, NotiHubStatsHistory, type NotiHubTypes, NotiTypeModel, NotiTypeStatsModel, NotificationModel, NotificationStatsModel as NotificationStats, Subscription, SubscriptionType, UserModel, ViewsModel, addMonths, getDate, getDateFormat };
281
+ export { type CreateNotiRequestBody, type CreateSubscriptionRequestBody, type CreateUserRequestBody, Customer, CustomerMinified, CustomerNotiHubStats, DocumentNotFoundException, errorcodes as ErrorCode, type ICreateCustomerRequestBody, type ICreateNotiRequestBody, type INotiHubCustomer, type INotiHubCustomerMinified, type INotiHubImage, type INotiHubNotification, type INotiHubNotificationStats, type INotiHubPaymentSession, type INotiHubStats, type INotiHubStatsHistory, type INotiHubStripeSubscription, type INotiHubSubscription, type INotiHubUser, type INotiHubUserView, type INotiType, type INotiTypeStats, type IUserSubscribeNotifier, type IUserSubscription, Connect as MongooseClient, NotiHubStatsHistory, type NotiHubTypes, NotiTypeModel, NotiTypeStatsModel, NotificationModel, NotificationStatsModel as NotificationStats, StripScriptionModel, Subscription, SubscriptionType, UserModel, ViewsModel, addMonths, getDate, getDateFormat };
package/dist/index.d.ts CHANGED
@@ -146,6 +146,11 @@ type INotiHubStripeSubscription = {
146
146
  entityRef: INotiHubCustomer;
147
147
  stripe_subscription: string;
148
148
  };
149
+ type INotiHubPaymentSession = {
150
+ id: string;
151
+ session: string;
152
+ customerId: string;
153
+ };
149
154
  type NotiHubTypes = {
150
155
  INotiHubUserView: INotiHubUserView;
151
156
  IUserSubscribeNotifier: IUserSubscribeNotifier;
@@ -242,6 +247,12 @@ declare const NotiTypeStatsModel: mongoose.Model<INotiTypeStats, {}, {}, {}, mon
242
247
  __v?: number | undefined;
243
248
  }, any>;
244
249
 
250
+ declare const StripScriptionModel: mongoose.Model<INotiHubStripeSubscription, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubStripeSubscription> & INotiHubStripeSubscription & {
251
+ _id: mongoose.Types.ObjectId;
252
+ } & {
253
+ __v?: number | undefined;
254
+ }, any>;
255
+
245
256
  declare const Connect: () => Promise<void>;
246
257
 
247
258
  declare class DocumentNotFoundException extends Error {
@@ -267,4 +278,4 @@ declare namespace errorcodes {
267
278
  export { errorcodes_CustomerNotFound as CustomerNotFound, errorcodes_DocumentNotFound as DocumentNotFound, errorcodes_InvalidEmail as InvalidEmail, errorcodes_InvalidName as InvalidName, errorcodes_InvalidPassword as InvalidPassword, errorcodes_InvalidPushToken as InvalidPushToken, errorcodes_UserNotFound as UserNotFound };
268
279
  }
269
280
 
270
- export { type CreateNotiRequestBody, type CreateSubscriptionRequestBody, type CreateUserRequestBody, Customer, CustomerMinified, CustomerNotiHubStats, DocumentNotFoundException, errorcodes as ErrorCode, type ICreateCustomerRequestBody, type ICreateNotiRequestBody, type INotiHubCustomer, type INotiHubCustomerMinified, type INotiHubImage, type INotiHubNotification, type INotiHubNotificationStats, type INotiHubStats, type INotiHubStatsHistory, type INotiHubStripeSubscription, type INotiHubSubscription, type INotiHubUser, type INotiHubUserView, type INotiType, type INotiTypeStats, type IUserSubscribeNotifier, type IUserSubscription, Connect as MongooseClient, NotiHubStatsHistory, type NotiHubTypes, NotiTypeModel, NotiTypeStatsModel, NotificationModel, NotificationStatsModel as NotificationStats, Subscription, SubscriptionType, UserModel, ViewsModel, addMonths, getDate, getDateFormat };
281
+ export { type CreateNotiRequestBody, type CreateSubscriptionRequestBody, type CreateUserRequestBody, Customer, CustomerMinified, CustomerNotiHubStats, DocumentNotFoundException, errorcodes as ErrorCode, type ICreateCustomerRequestBody, type ICreateNotiRequestBody, type INotiHubCustomer, type INotiHubCustomerMinified, type INotiHubImage, type INotiHubNotification, type INotiHubNotificationStats, type INotiHubPaymentSession, type INotiHubStats, type INotiHubStatsHistory, type INotiHubStripeSubscription, type INotiHubSubscription, type INotiHubUser, type INotiHubUserView, type INotiType, type INotiTypeStats, type IUserSubscribeNotifier, type IUserSubscription, Connect as MongooseClient, NotiHubStatsHistory, type NotiHubTypes, NotiTypeModel, NotiTypeStatsModel, NotificationModel, NotificationStatsModel as NotificationStats, StripScriptionModel, Subscription, SubscriptionType, UserModel, ViewsModel, addMonths, getDate, getDateFormat };
package/dist/index.js CHANGED
@@ -342,6 +342,40 @@ var NotiTypeStatsModel = model12(
342
342
  );
343
343
  var NotiTypeStatsModel_default = NotiTypeStatsModel;
344
344
 
345
+ // src/models/StripeSubscriptionModel.ts
346
+ import { Schema as Schema20, model as model13 } from "mongoose";
347
+
348
+ // src/models/schemas/StripeSubscriptionSchema.ts
349
+ import { Schema as Schema19 } from "mongoose";
350
+ var StripeSubscriptionSchema = {
351
+ /**
352
+ * The ID of the NotiHub customer associated with the subscription.
353
+ */
354
+ entityRef: { type: Schema19.ObjectId, ref: "Customer", required: true },
355
+ /**
356
+ * The ID of the Stripe customer associated with the subscription.
357
+ */
358
+ customerId: { type: String, default: true },
359
+ /**
360
+ * The ID of the subscription.
361
+ */
362
+ subscriptionId: { type: String, required: true }
363
+ };
364
+ var StripeSubscriptionSchema_default = StripeSubscriptionSchema;
365
+
366
+ // src/models/StripeSubscriptionModel.ts
367
+ var stripeSubscriptionSchema = new Schema20(
368
+ StripeSubscriptionSchema_default,
369
+ {
370
+ timestamps: true
371
+ }
372
+ );
373
+ var StripScriptionModel = model13(
374
+ "StripeSubscription",
375
+ stripeSubscriptionSchema
376
+ );
377
+ var StripeSubscriptionModel_default = StripScriptionModel;
378
+
345
379
  // src/client/MongooseClient.ts
346
380
  import mongoose3 from "mongoose";
347
381
  var Connect = () => mongoose3.connect(
@@ -392,6 +426,7 @@ export {
392
426
  NotiTypeStatsModel_default as NotiTypeStatsModel,
393
427
  NotificationModel_default as NotificationModel,
394
428
  NotificationStatsModel_default as NotificationStats,
429
+ StripeSubscriptionModel_default as StripScriptionModel,
395
430
  SubscriptionModel_default as Subscription,
396
431
  SubscriptionTypeModel_default as SubscriptionType,
397
432
  UserModel_default as UserModel,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amohamud23/notihub",
3
- "version": "1.0.122",
3
+ "version": "1.0.124",
4
4
  "description": "Notihub Package",
5
5
  "main": "./dist/index.cjs",
6
6
  "types": "./dist/index.d.cts",