@amohamud23/notihub 1.0.145 → 1.0.147
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 +33 -16
- package/dist/index.d.cts +18 -18
- package/dist/index.d.ts +18 -18
- package/dist/index.js +43 -16
- package/package.json +10 -3
package/dist/index.cjs
CHANGED
|
@@ -500,24 +500,20 @@ var CustomerMetadataModel_default = CustomerMetadata;
|
|
|
500
500
|
|
|
501
501
|
// src/client/MongooseClient.ts
|
|
502
502
|
var import_mongoose24 = __toESM(require("mongoose"), 1);
|
|
503
|
-
var
|
|
504
|
-
|
|
505
|
-
|
|
506
|
-
|
|
507
|
-
|
|
508
|
-
|
|
509
|
-
|
|
510
|
-
|
|
511
|
-
|
|
512
|
-
|
|
503
|
+
var conn = null;
|
|
504
|
+
var connectionStr = process.env.DB_CONNECTION_STRING;
|
|
505
|
+
var dbName = process.env.DB_NAME;
|
|
506
|
+
var client = async function() {
|
|
507
|
+
if (conn == null) {
|
|
508
|
+
conn = import_mongoose24.default.createConnection(connectionStr, {
|
|
509
|
+
dbName,
|
|
510
|
+
serverSelectionTimeoutMS: 5e3
|
|
511
|
+
});
|
|
512
|
+
await conn.asPromise();
|
|
513
513
|
}
|
|
514
|
-
return
|
|
515
|
-
console.log("Database Connected!");
|
|
516
|
-
}).catch((err) => {
|
|
517
|
-
console.error(`Error Connecting to the Database: ${err}`);
|
|
518
|
-
});
|
|
514
|
+
return conn;
|
|
519
515
|
};
|
|
520
|
-
var MongooseClient_default =
|
|
516
|
+
var MongooseClient_default = client;
|
|
521
517
|
|
|
522
518
|
// src/exceptions.ts
|
|
523
519
|
var DocumentNotFoundException = class _DocumentNotFoundException extends Error {
|
|
@@ -527,6 +523,27 @@ var DocumentNotFoundException = class _DocumentNotFoundException extends Error {
|
|
|
527
523
|
}
|
|
528
524
|
};
|
|
529
525
|
|
|
526
|
+
// src/client/DynamoDBClient.ts
|
|
527
|
+
var import_client_dynamodb = require("@aws-sdk/client-dynamodb");
|
|
528
|
+
var import_lib_dynamodb = require("@aws-sdk/lib-dynamodb");
|
|
529
|
+
var REGION = process.env.AWS_REGION || "us-west-2";
|
|
530
|
+
var ddbClient = new import_client_dynamodb.DynamoDBClient({
|
|
531
|
+
region: REGION,
|
|
532
|
+
maxAttempts: 3
|
|
533
|
+
// Retry config
|
|
534
|
+
});
|
|
535
|
+
var ddbDocClient = import_lib_dynamodb.DynamoDBDocumentClient.from(ddbClient, {
|
|
536
|
+
marshallOptions: {
|
|
537
|
+
removeUndefinedValues: true
|
|
538
|
+
}
|
|
539
|
+
});
|
|
540
|
+
|
|
541
|
+
// src/DynamoModels/UserModel.ts
|
|
542
|
+
var import_lib_dynamodb2 = require("@aws-sdk/lib-dynamodb");
|
|
543
|
+
|
|
544
|
+
// src/DynamoModels/Customer.ts
|
|
545
|
+
var import_lib_dynamodb3 = require("@aws-sdk/lib-dynamodb");
|
|
546
|
+
|
|
530
547
|
// src/errorcodes.ts
|
|
531
548
|
var errorcodes_exports = {};
|
|
532
549
|
__export(errorcodes_exports, {
|
package/dist/index.d.cts
CHANGED
|
@@ -208,100 +208,100 @@ declare function addMonths({ date, months }: AddMonths): Date;
|
|
|
208
208
|
declare const UserModel: mongoose.Model<INotiHubUser, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubUser> & INotiHubUser & Required<{
|
|
209
209
|
_id: string;
|
|
210
210
|
}> & {
|
|
211
|
-
__v?: number
|
|
211
|
+
__v?: number;
|
|
212
212
|
}, any>;
|
|
213
213
|
|
|
214
214
|
declare const Subscription: mongoose__default.Model<INotiHubSubscription, {}, {}, {}, mongoose__default.Document<unknown, {}, INotiHubSubscription> & INotiHubSubscription & Required<{
|
|
215
215
|
_id: string;
|
|
216
216
|
}> & {
|
|
217
|
-
__v?: number
|
|
217
|
+
__v?: number;
|
|
218
218
|
}, any>;
|
|
219
219
|
|
|
220
220
|
declare const NotiTypeModel: mongoose.Model<INotiType, {}, {}, {}, mongoose.Document<unknown, {}, INotiType> & INotiType & Required<{
|
|
221
221
|
_id: string;
|
|
222
222
|
}> & {
|
|
223
|
-
__v?: number
|
|
223
|
+
__v?: number;
|
|
224
224
|
}, any>;
|
|
225
225
|
|
|
226
226
|
declare const NotiHubStatsHistory: mongoose.Model<INotiHubStatsHistory, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubStatsHistory> & INotiHubStatsHistory & {
|
|
227
227
|
_id: mongoose.Types.ObjectId;
|
|
228
228
|
} & {
|
|
229
|
-
__v?: number
|
|
229
|
+
__v?: number;
|
|
230
230
|
}, any>;
|
|
231
231
|
|
|
232
232
|
declare const NotificationStatsModel: mongoose.Model<INotiHubNotificationStats, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubNotificationStats> & INotiHubNotificationStats & Required<{
|
|
233
233
|
_id: string;
|
|
234
234
|
}> & {
|
|
235
|
-
__v?: number
|
|
235
|
+
__v?: number;
|
|
236
236
|
}, any>;
|
|
237
237
|
|
|
238
238
|
declare const NotificationModel: mongoose.Model<INotiHubNotification, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubNotification> & INotiHubNotification & Required<{
|
|
239
239
|
_id: string;
|
|
240
240
|
}> & {
|
|
241
|
-
__v?: number
|
|
241
|
+
__v?: number;
|
|
242
242
|
}, any>;
|
|
243
243
|
|
|
244
244
|
declare const Customer: mongoose.Model<INotiHubCustomer, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubCustomer> & INotiHubCustomer & Required<{
|
|
245
245
|
_id: string;
|
|
246
246
|
}> & {
|
|
247
|
-
__v?: number
|
|
247
|
+
__v?: number;
|
|
248
248
|
}, any>;
|
|
249
249
|
|
|
250
250
|
declare const CustomerMinified: mongoose.Model<INotiHubCustomerMinified, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubCustomerMinified> & INotiHubCustomerMinified & Required<{
|
|
251
251
|
_id: string;
|
|
252
252
|
}> & {
|
|
253
|
-
__v?: number
|
|
253
|
+
__v?: number;
|
|
254
254
|
}, any>;
|
|
255
255
|
|
|
256
256
|
declare const SubscriptionType: mongoose.Model<IUserSubscribeNotifier, {}, {}, {}, mongoose.Document<unknown, {}, IUserSubscribeNotifier> & IUserSubscribeNotifier & {
|
|
257
257
|
_id: mongoose.Types.ObjectId;
|
|
258
258
|
} & {
|
|
259
|
-
__v?: number
|
|
259
|
+
__v?: number;
|
|
260
260
|
}, any>;
|
|
261
261
|
|
|
262
262
|
declare const CustomerNotiHubStats: mongoose.Model<INotiHubStats, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubStats> & INotiHubStats & {
|
|
263
263
|
_id: mongoose.Types.ObjectId;
|
|
264
264
|
} & {
|
|
265
|
-
__v?: number
|
|
265
|
+
__v?: number;
|
|
266
266
|
}, any>;
|
|
267
267
|
|
|
268
268
|
declare const ViewsModel: mongoose.Model<INotiHubUserView, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubUserView> & INotiHubUserView & {
|
|
269
269
|
_id: mongoose.Types.ObjectId;
|
|
270
270
|
} & {
|
|
271
|
-
__v?: number
|
|
271
|
+
__v?: number;
|
|
272
272
|
}, any>;
|
|
273
273
|
|
|
274
274
|
declare const NotiTypeStatsModel: mongoose.Model<INotiTypeStats, {}, {}, {}, mongoose.Document<unknown, {}, INotiTypeStats> & INotiTypeStats & Required<{
|
|
275
275
|
_id: string;
|
|
276
276
|
}> & {
|
|
277
|
-
__v?: number
|
|
277
|
+
__v?: number;
|
|
278
278
|
}, any>;
|
|
279
279
|
|
|
280
280
|
declare const StripScriptionModel: mongoose.Model<INotiHubStripeSubscription, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubStripeSubscription> & INotiHubStripeSubscription & {
|
|
281
281
|
_id: mongoose.Types.ObjectId;
|
|
282
282
|
} & {
|
|
283
|
-
__v?: number
|
|
283
|
+
__v?: number;
|
|
284
284
|
}, any>;
|
|
285
285
|
|
|
286
286
|
declare const PaymentSessionModel: mongoose.Model<INotiHubPaymentSession, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubPaymentSession> & INotiHubPaymentSession & {
|
|
287
287
|
_id: mongoose.Types.ObjectId;
|
|
288
288
|
} & {
|
|
289
|
-
__v?: number
|
|
289
|
+
__v?: number;
|
|
290
290
|
}, any>;
|
|
291
291
|
|
|
292
292
|
declare const SubscriptionActivity: mongoose.Model<INotiHubSubscriptionActivity, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubSubscriptionActivity> & INotiHubSubscriptionActivity & Required<{
|
|
293
293
|
_id: string;
|
|
294
294
|
}> & {
|
|
295
|
-
__v?: number
|
|
295
|
+
__v?: number;
|
|
296
296
|
}, any>;
|
|
297
297
|
|
|
298
298
|
declare const CustomerMetadata: mongoose.Model<INotiHubCustomerMetadata, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubCustomerMetadata> & INotiHubCustomerMetadata & Required<{
|
|
299
299
|
_id: string;
|
|
300
300
|
}> & {
|
|
301
|
-
__v?: number
|
|
301
|
+
__v?: number;
|
|
302
302
|
}, any>;
|
|
303
303
|
|
|
304
|
-
declare const
|
|
304
|
+
declare const client: () => Promise<mongoose__default.Connection>;
|
|
305
305
|
|
|
306
306
|
declare class DocumentNotFoundException extends Error {
|
|
307
307
|
constructor(msg: string);
|
|
@@ -326,4 +326,4 @@ declare namespace errorcodes {
|
|
|
326
326
|
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 };
|
|
327
327
|
}
|
|
328
328
|
|
|
329
|
-
export { type CreateNotiRequestBody, type CreateSubscriptionRequestBody, type CreateUserRequestBody, Customer, CustomerMetadata, CustomerMinified, CustomerNotiHubStats, DocumentNotFoundException, errorcodes as ErrorCode, type ICreateCustomerRequestBody, type ICreateNotiRequestBody, type INotiHubCustomer, type INotiHubCustomerMetadata, type INotiHubCustomerMinified, type INotiHubImage, type INotiHubNotification, type INotiHubNotificationStats, type INotiHubPaymentSession, type INotiHubStats, type INotiHubStatsHistory, type INotiHubStripeSubscription, type INotiHubSubscription, type INotiHubSubscriptionActivity, type INotiHubUser, type INotiHubUserView, type INotiType, type INotiTypeStats, type IUserSubscribeNotifier, type IUserSubscription,
|
|
329
|
+
export { type CreateNotiRequestBody, type CreateSubscriptionRequestBody, type CreateUserRequestBody, Customer, CustomerMetadata, CustomerMinified, CustomerNotiHubStats, DocumentNotFoundException, errorcodes as ErrorCode, type ICreateCustomerRequestBody, type ICreateNotiRequestBody, type INotiHubCustomer, type INotiHubCustomerMetadata, type INotiHubCustomerMinified, type INotiHubImage, type INotiHubNotification, type INotiHubNotificationStats, type INotiHubPaymentSession, type INotiHubStats, type INotiHubStatsHistory, type INotiHubStripeSubscription, type INotiHubSubscription, type INotiHubSubscriptionActivity, type INotiHubUser, type INotiHubUserView, type INotiType, type INotiTypeStats, type IUserSubscribeNotifier, type IUserSubscription, client as MongooseClient, NotiHubStatsHistory, type NotiHubTypes, NotiTypeModel, NotiTypeStatsModel, NotificationModel, NotificationStatsModel as NotificationStats, PaymentSessionModel, StripScriptionModel, Subscription, SubscriptionActivity, SubscriptionType, UserModel, ViewsModel, addMonths, getDate, getDateFormat };
|
package/dist/index.d.ts
CHANGED
|
@@ -208,100 +208,100 @@ declare function addMonths({ date, months }: AddMonths): Date;
|
|
|
208
208
|
declare const UserModel: mongoose.Model<INotiHubUser, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubUser> & INotiHubUser & Required<{
|
|
209
209
|
_id: string;
|
|
210
210
|
}> & {
|
|
211
|
-
__v?: number
|
|
211
|
+
__v?: number;
|
|
212
212
|
}, any>;
|
|
213
213
|
|
|
214
214
|
declare const Subscription: mongoose__default.Model<INotiHubSubscription, {}, {}, {}, mongoose__default.Document<unknown, {}, INotiHubSubscription> & INotiHubSubscription & Required<{
|
|
215
215
|
_id: string;
|
|
216
216
|
}> & {
|
|
217
|
-
__v?: number
|
|
217
|
+
__v?: number;
|
|
218
218
|
}, any>;
|
|
219
219
|
|
|
220
220
|
declare const NotiTypeModel: mongoose.Model<INotiType, {}, {}, {}, mongoose.Document<unknown, {}, INotiType> & INotiType & Required<{
|
|
221
221
|
_id: string;
|
|
222
222
|
}> & {
|
|
223
|
-
__v?: number
|
|
223
|
+
__v?: number;
|
|
224
224
|
}, any>;
|
|
225
225
|
|
|
226
226
|
declare const NotiHubStatsHistory: mongoose.Model<INotiHubStatsHistory, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubStatsHistory> & INotiHubStatsHistory & {
|
|
227
227
|
_id: mongoose.Types.ObjectId;
|
|
228
228
|
} & {
|
|
229
|
-
__v?: number
|
|
229
|
+
__v?: number;
|
|
230
230
|
}, any>;
|
|
231
231
|
|
|
232
232
|
declare const NotificationStatsModel: mongoose.Model<INotiHubNotificationStats, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubNotificationStats> & INotiHubNotificationStats & Required<{
|
|
233
233
|
_id: string;
|
|
234
234
|
}> & {
|
|
235
|
-
__v?: number
|
|
235
|
+
__v?: number;
|
|
236
236
|
}, any>;
|
|
237
237
|
|
|
238
238
|
declare const NotificationModel: mongoose.Model<INotiHubNotification, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubNotification> & INotiHubNotification & Required<{
|
|
239
239
|
_id: string;
|
|
240
240
|
}> & {
|
|
241
|
-
__v?: number
|
|
241
|
+
__v?: number;
|
|
242
242
|
}, any>;
|
|
243
243
|
|
|
244
244
|
declare const Customer: mongoose.Model<INotiHubCustomer, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubCustomer> & INotiHubCustomer & Required<{
|
|
245
245
|
_id: string;
|
|
246
246
|
}> & {
|
|
247
|
-
__v?: number
|
|
247
|
+
__v?: number;
|
|
248
248
|
}, any>;
|
|
249
249
|
|
|
250
250
|
declare const CustomerMinified: mongoose.Model<INotiHubCustomerMinified, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubCustomerMinified> & INotiHubCustomerMinified & Required<{
|
|
251
251
|
_id: string;
|
|
252
252
|
}> & {
|
|
253
|
-
__v?: number
|
|
253
|
+
__v?: number;
|
|
254
254
|
}, any>;
|
|
255
255
|
|
|
256
256
|
declare const SubscriptionType: mongoose.Model<IUserSubscribeNotifier, {}, {}, {}, mongoose.Document<unknown, {}, IUserSubscribeNotifier> & IUserSubscribeNotifier & {
|
|
257
257
|
_id: mongoose.Types.ObjectId;
|
|
258
258
|
} & {
|
|
259
|
-
__v?: number
|
|
259
|
+
__v?: number;
|
|
260
260
|
}, any>;
|
|
261
261
|
|
|
262
262
|
declare const CustomerNotiHubStats: mongoose.Model<INotiHubStats, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubStats> & INotiHubStats & {
|
|
263
263
|
_id: mongoose.Types.ObjectId;
|
|
264
264
|
} & {
|
|
265
|
-
__v?: number
|
|
265
|
+
__v?: number;
|
|
266
266
|
}, any>;
|
|
267
267
|
|
|
268
268
|
declare const ViewsModel: mongoose.Model<INotiHubUserView, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubUserView> & INotiHubUserView & {
|
|
269
269
|
_id: mongoose.Types.ObjectId;
|
|
270
270
|
} & {
|
|
271
|
-
__v?: number
|
|
271
|
+
__v?: number;
|
|
272
272
|
}, any>;
|
|
273
273
|
|
|
274
274
|
declare const NotiTypeStatsModel: mongoose.Model<INotiTypeStats, {}, {}, {}, mongoose.Document<unknown, {}, INotiTypeStats> & INotiTypeStats & Required<{
|
|
275
275
|
_id: string;
|
|
276
276
|
}> & {
|
|
277
|
-
__v?: number
|
|
277
|
+
__v?: number;
|
|
278
278
|
}, any>;
|
|
279
279
|
|
|
280
280
|
declare const StripScriptionModel: mongoose.Model<INotiHubStripeSubscription, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubStripeSubscription> & INotiHubStripeSubscription & {
|
|
281
281
|
_id: mongoose.Types.ObjectId;
|
|
282
282
|
} & {
|
|
283
|
-
__v?: number
|
|
283
|
+
__v?: number;
|
|
284
284
|
}, any>;
|
|
285
285
|
|
|
286
286
|
declare const PaymentSessionModel: mongoose.Model<INotiHubPaymentSession, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubPaymentSession> & INotiHubPaymentSession & {
|
|
287
287
|
_id: mongoose.Types.ObjectId;
|
|
288
288
|
} & {
|
|
289
|
-
__v?: number
|
|
289
|
+
__v?: number;
|
|
290
290
|
}, any>;
|
|
291
291
|
|
|
292
292
|
declare const SubscriptionActivity: mongoose.Model<INotiHubSubscriptionActivity, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubSubscriptionActivity> & INotiHubSubscriptionActivity & Required<{
|
|
293
293
|
_id: string;
|
|
294
294
|
}> & {
|
|
295
|
-
__v?: number
|
|
295
|
+
__v?: number;
|
|
296
296
|
}, any>;
|
|
297
297
|
|
|
298
298
|
declare const CustomerMetadata: mongoose.Model<INotiHubCustomerMetadata, {}, {}, {}, mongoose.Document<unknown, {}, INotiHubCustomerMetadata> & INotiHubCustomerMetadata & Required<{
|
|
299
299
|
_id: string;
|
|
300
300
|
}> & {
|
|
301
|
-
__v?: number
|
|
301
|
+
__v?: number;
|
|
302
302
|
}, any>;
|
|
303
303
|
|
|
304
|
-
declare const
|
|
304
|
+
declare const client: () => Promise<mongoose__default.Connection>;
|
|
305
305
|
|
|
306
306
|
declare class DocumentNotFoundException extends Error {
|
|
307
307
|
constructor(msg: string);
|
|
@@ -326,4 +326,4 @@ declare namespace errorcodes {
|
|
|
326
326
|
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 };
|
|
327
327
|
}
|
|
328
328
|
|
|
329
|
-
export { type CreateNotiRequestBody, type CreateSubscriptionRequestBody, type CreateUserRequestBody, Customer, CustomerMetadata, CustomerMinified, CustomerNotiHubStats, DocumentNotFoundException, errorcodes as ErrorCode, type ICreateCustomerRequestBody, type ICreateNotiRequestBody, type INotiHubCustomer, type INotiHubCustomerMetadata, type INotiHubCustomerMinified, type INotiHubImage, type INotiHubNotification, type INotiHubNotificationStats, type INotiHubPaymentSession, type INotiHubStats, type INotiHubStatsHistory, type INotiHubStripeSubscription, type INotiHubSubscription, type INotiHubSubscriptionActivity, type INotiHubUser, type INotiHubUserView, type INotiType, type INotiTypeStats, type IUserSubscribeNotifier, type IUserSubscription,
|
|
329
|
+
export { type CreateNotiRequestBody, type CreateSubscriptionRequestBody, type CreateUserRequestBody, Customer, CustomerMetadata, CustomerMinified, CustomerNotiHubStats, DocumentNotFoundException, errorcodes as ErrorCode, type ICreateCustomerRequestBody, type ICreateNotiRequestBody, type INotiHubCustomer, type INotiHubCustomerMetadata, type INotiHubCustomerMinified, type INotiHubImage, type INotiHubNotification, type INotiHubNotificationStats, type INotiHubPaymentSession, type INotiHubStats, type INotiHubStatsHistory, type INotiHubStripeSubscription, type INotiHubSubscription, type INotiHubSubscriptionActivity, type INotiHubUser, type INotiHubUserView, type INotiType, type INotiTypeStats, type IUserSubscribeNotifier, type IUserSubscription, client as MongooseClient, NotiHubStatsHistory, type NotiHubTypes, NotiTypeModel, NotiTypeStatsModel, NotificationModel, NotificationStatsModel as NotificationStats, PaymentSessionModel, StripScriptionModel, Subscription, SubscriptionActivity, SubscriptionType, UserModel, ViewsModel, addMonths, getDate, getDateFormat };
|
package/dist/index.js
CHANGED
|
@@ -449,24 +449,20 @@ var CustomerMetadataModel_default = CustomerMetadata;
|
|
|
449
449
|
|
|
450
450
|
// src/client/MongooseClient.ts
|
|
451
451
|
import mongoose3 from "mongoose";
|
|
452
|
-
var
|
|
453
|
-
|
|
454
|
-
|
|
455
|
-
|
|
456
|
-
|
|
457
|
-
|
|
458
|
-
|
|
459
|
-
|
|
460
|
-
|
|
461
|
-
|
|
452
|
+
var conn = null;
|
|
453
|
+
var connectionStr = process.env.DB_CONNECTION_STRING;
|
|
454
|
+
var dbName = process.env.DB_NAME;
|
|
455
|
+
var client = async function() {
|
|
456
|
+
if (conn == null) {
|
|
457
|
+
conn = mongoose3.createConnection(connectionStr, {
|
|
458
|
+
dbName,
|
|
459
|
+
serverSelectionTimeoutMS: 5e3
|
|
460
|
+
});
|
|
461
|
+
await conn.asPromise();
|
|
462
462
|
}
|
|
463
|
-
return
|
|
464
|
-
console.log("Database Connected!");
|
|
465
|
-
}).catch((err) => {
|
|
466
|
-
console.error(`Error Connecting to the Database: ${err}`);
|
|
467
|
-
});
|
|
463
|
+
return conn;
|
|
468
464
|
};
|
|
469
|
-
var MongooseClient_default =
|
|
465
|
+
var MongooseClient_default = client;
|
|
470
466
|
|
|
471
467
|
// src/exceptions.ts
|
|
472
468
|
var DocumentNotFoundException = class _DocumentNotFoundException extends Error {
|
|
@@ -476,6 +472,37 @@ var DocumentNotFoundException = class _DocumentNotFoundException extends Error {
|
|
|
476
472
|
}
|
|
477
473
|
};
|
|
478
474
|
|
|
475
|
+
// src/client/DynamoDBClient.ts
|
|
476
|
+
import { DynamoDBClient } from "@aws-sdk/client-dynamodb";
|
|
477
|
+
import { DynamoDBDocumentClient } from "@aws-sdk/lib-dynamodb";
|
|
478
|
+
var REGION = process.env.AWS_REGION || "us-west-2";
|
|
479
|
+
var ddbClient = new DynamoDBClient({
|
|
480
|
+
region: REGION,
|
|
481
|
+
maxAttempts: 3
|
|
482
|
+
// Retry config
|
|
483
|
+
});
|
|
484
|
+
var ddbDocClient = DynamoDBDocumentClient.from(ddbClient, {
|
|
485
|
+
marshallOptions: {
|
|
486
|
+
removeUndefinedValues: true
|
|
487
|
+
}
|
|
488
|
+
});
|
|
489
|
+
|
|
490
|
+
// src/DynamoModels/UserModel.ts
|
|
491
|
+
import {
|
|
492
|
+
DeleteCommand,
|
|
493
|
+
GetCommand,
|
|
494
|
+
PutCommand,
|
|
495
|
+
UpdateCommand
|
|
496
|
+
} from "@aws-sdk/lib-dynamodb";
|
|
497
|
+
|
|
498
|
+
// src/DynamoModels/Customer.ts
|
|
499
|
+
import {
|
|
500
|
+
DeleteCommand as DeleteCommand2,
|
|
501
|
+
GetCommand as GetCommand2,
|
|
502
|
+
PutCommand as PutCommand2,
|
|
503
|
+
UpdateCommand as UpdateCommand2
|
|
504
|
+
} from "@aws-sdk/lib-dynamodb";
|
|
505
|
+
|
|
479
506
|
// src/errorcodes.ts
|
|
480
507
|
var errorcodes_exports = {};
|
|
481
508
|
__export(errorcodes_exports, {
|
package/package.json
CHANGED
|
@@ -1,13 +1,13 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@amohamud23/notihub",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.147",
|
|
4
4
|
"description": "Notihub Package",
|
|
5
5
|
"main": "./dist/index.cjs",
|
|
6
6
|
"types": "./dist/index.d.cts",
|
|
7
7
|
"type": "module",
|
|
8
8
|
"scripts": {
|
|
9
9
|
"build": "tsup",
|
|
10
|
-
"test": "
|
|
10
|
+
"test": "jest"
|
|
11
11
|
},
|
|
12
12
|
"files": [
|
|
13
13
|
"dist"
|
|
@@ -21,11 +21,18 @@
|
|
|
21
21
|
"author": "Abdi Mohamud",
|
|
22
22
|
"license": "ISC",
|
|
23
23
|
"devDependencies": {
|
|
24
|
+
"@types/jest": "^29.5.14",
|
|
24
25
|
"@types/node": "^22.8.4",
|
|
25
|
-
"
|
|
26
|
+
"jest": "^29.7.0",
|
|
27
|
+
"ts-jest": "^29.3.4",
|
|
28
|
+
"typescript": "^5.8.3"
|
|
26
29
|
},
|
|
27
30
|
"dependencies": {
|
|
31
|
+
"@aws-sdk/client-dynamodb": "^3.821.0",
|
|
32
|
+
"@aws-sdk/lib-dynamodb": "^3.821.0",
|
|
33
|
+
"aws-sdk-client-mock": "^4.1.0",
|
|
28
34
|
"mongoose": "^8.7.2",
|
|
35
|
+
"ts-node": "^10.9.2",
|
|
29
36
|
"tsup": "^8.3.5",
|
|
30
37
|
"uuid": "^11.0.2"
|
|
31
38
|
}
|