@amohamud23/notihub 1.0.133 → 1.0.135

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
@@ -475,14 +475,23 @@ var SubscriptionActivity_default = SubscriptionActivity;
475
475
 
476
476
  // src/client/MongooseClient.ts
477
477
  var import_mongoose23 = __toESM(require("mongoose"), 1);
478
- var Connect = () => import_mongoose23.default.connect(
479
- "mongodb+srv://admin:YF6ImNWyAMUUu72I@nftcluster.llzxp.mongodb.net/test?authSource=admin&replicaSet=atlas-p5dddq-shard-0&readPreference=primary&ssl=true",
480
- { dbName: "notihub" }
481
- ).then(() => {
482
- console.log("Database Connected!");
483
- }).catch((err) => {
484
- console.error(`Error Connecting to the Database: ${err}`);
485
- });
478
+ var Connect = () => {
479
+ const connectionStr = process.env.DB_CONNECTION_STRING;
480
+ const dbName = process.env.DB_NAME;
481
+ if (!connectionStr) {
482
+ console.error("No connection string provided!");
483
+ process.exit(1);
484
+ }
485
+ if (!dbName) {
486
+ console.error("No database name provided!");
487
+ process.exit(1);
488
+ }
489
+ return import_mongoose23.default.connect(connectionStr, { dbName }).then(() => {
490
+ console.log("Database Connected!");
491
+ }).catch((err) => {
492
+ console.error(`Error Connecting to the Database: ${err}`);
493
+ });
494
+ };
486
495
  var MongooseClient_default = Connect;
487
496
 
488
497
  // src/exceptions.ts
package/dist/index.js CHANGED
@@ -425,14 +425,23 @@ var SubscriptionActivity_default = SubscriptionActivity;
425
425
 
426
426
  // src/client/MongooseClient.ts
427
427
  import mongoose3 from "mongoose";
428
- var Connect = () => mongoose3.connect(
429
- "mongodb+srv://admin:YF6ImNWyAMUUu72I@nftcluster.llzxp.mongodb.net/test?authSource=admin&replicaSet=atlas-p5dddq-shard-0&readPreference=primary&ssl=true",
430
- { dbName: "notihub" }
431
- ).then(() => {
432
- console.log("Database Connected!");
433
- }).catch((err) => {
434
- console.error(`Error Connecting to the Database: ${err}`);
435
- });
428
+ var Connect = () => {
429
+ const connectionStr = process.env.DB_CONNECTION_STRING;
430
+ const dbName = process.env.DB_NAME;
431
+ if (!connectionStr) {
432
+ console.error("No connection string provided!");
433
+ process.exit(1);
434
+ }
435
+ if (!dbName) {
436
+ console.error("No database name provided!");
437
+ process.exit(1);
438
+ }
439
+ return mongoose3.connect(connectionStr, { dbName }).then(() => {
440
+ console.log("Database Connected!");
441
+ }).catch((err) => {
442
+ console.error(`Error Connecting to the Database: ${err}`);
443
+ });
444
+ };
436
445
  var MongooseClient_default = Connect;
437
446
 
438
447
  // src/exceptions.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@amohamud23/notihub",
3
- "version": "1.0.133",
3
+ "version": "1.0.135",
4
4
  "description": "Notihub Package",
5
5
  "main": "./dist/index.cjs",
6
6
  "types": "./dist/index.d.cts",