payservedb 6.9.6 → 6.9.8
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.
|
@@ -3,7 +3,9 @@
|
|
|
3
3
|
<component name="MaterialThemeProjectNewConfig">
|
|
4
4
|
<option name="metadata">
|
|
5
5
|
<MTProjectMetadataState>
|
|
6
|
-
<option name="
|
|
6
|
+
<option name="migrated" value="true" />
|
|
7
|
+
<option name="pristineConfig" value="false" />
|
|
8
|
+
<option name="userId" value="1756d2b0:198e001a643:-7ffe" />
|
|
7
9
|
</MTProjectMetadataState>
|
|
8
10
|
</option>
|
|
9
11
|
</component>
|
package/index.js
CHANGED
|
@@ -6,277 +6,278 @@ const connections = {};
|
|
|
6
6
|
|
|
7
7
|
// Utility function to connect to MongoDB
|
|
8
8
|
async function connectToMongoDB(
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
9
|
+
dbName,
|
|
10
|
+
secured,
|
|
11
|
+
username,
|
|
12
|
+
password,
|
|
13
|
+
url,
|
|
14
|
+
port,
|
|
15
15
|
) {
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
|
|
27
|
-
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
16
|
+
try {
|
|
17
|
+
if (secured === false) {
|
|
18
|
+
const url_ = url + ":" + port;
|
|
19
|
+
const connectionString = `mongodb://${url_}/${dbName}`;
|
|
20
|
+
await mongoose.connect(connectionString, {
|
|
21
|
+
useNewUrlParser: true,
|
|
22
|
+
});
|
|
23
|
+
console.log("Connected to MongoDB");
|
|
24
|
+
} else {
|
|
25
|
+
const url_ = `${username}:${password}@${url}:${port}`;
|
|
26
|
+
const source = "?authSource=admin";
|
|
27
|
+
const connectionString = `mongodb://${url_}/${dbName}${source}`;
|
|
28
|
+
await mongoose.connect(connectionString, {
|
|
29
|
+
useNewUrlParser: true,
|
|
30
|
+
});
|
|
31
|
+
console.log("Connected to MongoDB");
|
|
32
|
+
}
|
|
33
|
+
} catch (err) {
|
|
34
|
+
console.error("Error connecting to MongoDB:", err);
|
|
35
|
+
throw err;
|
|
32
36
|
}
|
|
33
|
-
} catch (err) {
|
|
34
|
-
console.error("Error connecting to MongoDB:", err);
|
|
35
|
-
throw err;
|
|
36
|
-
}
|
|
37
37
|
}
|
|
38
38
|
|
|
39
39
|
// Function to switch databases dynamically
|
|
40
40
|
async function switchDB(dbName) {
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
41
|
+
// Check if there's already a connection to the desired database
|
|
42
|
+
if (connections[dbName]) {
|
|
43
|
+
return connections[dbName]; // Return existing connection
|
|
44
|
+
}
|
|
45
45
|
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
46
|
+
try {
|
|
47
|
+
// Use environment variables for connection parameters - same as in connectToMongoDB
|
|
48
|
+
const username = process.env.MONGODB_USER;
|
|
49
|
+
const password = process.env.MONGODB_PASSWORD;
|
|
50
|
+
const url = process.env.MONGODB_HOST;
|
|
51
|
+
const port = process.env.MONGODB_PORT;
|
|
52
|
+
const source = "?authSource=admin";
|
|
53
53
|
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
54
|
+
const connectionString = `mongodb://${username}:${password}@${url}:${port}/${dbName}${source}`;
|
|
55
|
+
const dbConnection = await mongoose.createConnection(connectionString, {
|
|
56
|
+
useNewUrlParser: true,
|
|
57
|
+
});
|
|
58
58
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
59
|
+
connections[dbName] = dbConnection; // Store the connection for reuse
|
|
60
|
+
console.log(`Switched to database: ${dbName}`);
|
|
61
|
+
return dbConnection;
|
|
62
|
+
} catch (err) {
|
|
63
|
+
console.error(`Error switching to database: ${dbName}`, err);
|
|
64
|
+
throw err;
|
|
65
|
+
}
|
|
66
66
|
}
|
|
67
67
|
|
|
68
68
|
// Importing all model files (Note: models may need to be re-registered for different connections)
|
|
69
69
|
// This maintains backward compatibility for existing services
|
|
70
70
|
const models = {
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
138
|
-
|
|
139
|
-
|
|
140
|
-
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
146
|
-
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
|
|
150
|
-
|
|
151
|
-
|
|
152
|
-
|
|
153
|
-
|
|
154
|
-
|
|
155
|
-
|
|
156
|
-
|
|
157
|
-
|
|
158
|
-
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
|
|
164
|
-
|
|
165
|
-
|
|
166
|
-
|
|
167
|
-
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
|
|
178
|
-
|
|
179
|
-
|
|
180
|
-
|
|
181
|
-
|
|
182
|
-
|
|
183
|
-
|
|
184
|
-
|
|
185
|
-
|
|
186
|
-
|
|
187
|
-
|
|
188
|
-
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
|
|
193
|
-
|
|
194
|
-
|
|
195
|
-
|
|
196
|
-
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
207
|
-
|
|
208
|
-
|
|
209
|
-
|
|
210
|
-
|
|
211
|
-
|
|
212
|
-
|
|
213
|
-
|
|
71
|
+
User: require("./src/models/user"),
|
|
72
|
+
Company: require("./src/models/company"),
|
|
73
|
+
Customer: require("./src/models/customer"),
|
|
74
|
+
FacilityEmailDetails: require("./src/models/email"),
|
|
75
|
+
Module: require("./src/models/module"),
|
|
76
|
+
Facility: require("./src/models/facility"),
|
|
77
|
+
RefreshToken: require("./src/models/refresh_token"),
|
|
78
|
+
ApiLog: require("./src/models/apilog"),
|
|
79
|
+
ArchivedApiLog: require("./src/models/archivedapilog"),
|
|
80
|
+
FacilityAsset: require("./src/models/facilityasset"),
|
|
81
|
+
Unit: require("./src/models/units"),
|
|
82
|
+
FAQ: require("./src/models/faq"),
|
|
83
|
+
UnitAsset: require("./src/models/unitasset"),
|
|
84
|
+
CombinedUnit: require("./src/models/combinedUnits"),
|
|
85
|
+
Message: require("./src/models/message"),
|
|
86
|
+
SMSAfricastalking: require("./src/models/sms_africastalking"),
|
|
87
|
+
SMSMeliora: require("./src/models/sms_meliora"),
|
|
88
|
+
EntryExit: require("./src/models/entry_exit"),
|
|
89
|
+
Guard: require("./src/models/guard"),
|
|
90
|
+
Visitor: require("./src/models/visitor"),
|
|
91
|
+
VisitLog: require("./src/models/visitLog"),
|
|
92
|
+
Settings: require("./src/models/settings"),
|
|
93
|
+
Levy: require("./src/models/levy"),
|
|
94
|
+
LevyType: require("./src/models/levytype"),
|
|
95
|
+
LevyContract: require("./src/models/levycontract"),
|
|
96
|
+
Invoice: require("./src/models/invoice"),
|
|
97
|
+
Reminder: require("./src/models/reminder"),
|
|
98
|
+
Penalty: require("./src/models/penalty"),
|
|
99
|
+
Notifiaction: require("./src/models/notification"),
|
|
100
|
+
Resident: require("./src/models/resident"),
|
|
101
|
+
Asset: require("./src/models/asset"),
|
|
102
|
+
DutyRoster: require("./src/models/dutyroster"),
|
|
103
|
+
LeaseTemplate: require("./src/models/leasetemplate"),
|
|
104
|
+
Report: require("./src/models/report"),
|
|
105
|
+
Ticket: require("./src/models/tickets"),
|
|
106
|
+
Stocksandspare: require("./src/models/stocksandspare"),
|
|
107
|
+
ServiceVendor: require("./src/models/maintenance_service_vendor"),
|
|
108
|
+
MaintenanceServices: require("./src/models/maintenance_services"),
|
|
109
|
+
StockRequisition: require("./src/models/maintenancerequisition"),
|
|
110
|
+
LeaseAgreement: require("./src/models/leaseagreement"),
|
|
111
|
+
WorkOrder: require("./src/models/workorder"),
|
|
112
|
+
ValueAddedService: require("./src/models/valueaddedservices"),
|
|
113
|
+
VasInvoice: require("./src/models/vasinvoice"),
|
|
114
|
+
VasVendor: require("./src/models/vasvendor"),
|
|
115
|
+
Staff: require("./src/models/staff"),
|
|
116
|
+
ServiceRequest: require("./src/models/servicerequest"),
|
|
117
|
+
CountryTaxRate: require("./src/models/country_tax"),
|
|
118
|
+
WaterMeter: require("./src/models/water_meters"),
|
|
119
|
+
DailyConsumption: require("./src/models/smart_meter_daily_consumption"),
|
|
120
|
+
WaterMeterSettings: require("./src/models/water_meter_settings"),
|
|
121
|
+
AnalogBilling: require("./src/models/water_meter_billing"),
|
|
122
|
+
MeterSize: require("./src/models/water_meter_size"),
|
|
123
|
+
WaterInvoice: require("./src/models/water_invoice"),
|
|
124
|
+
MeterProtocol: require("./src/models/water_meter_communication"),
|
|
125
|
+
MeterManufacturer: require("./src/models/water_meter_manufacturer"),
|
|
126
|
+
MeterIotCard: require("./src/models/water_meter_iot_cards"),
|
|
127
|
+
MetersDelivery: require("./src/models/water_meters_delivery"),
|
|
128
|
+
Notification: require("./src/models/notification"),
|
|
129
|
+
Concentrator: require("./src/models/water_meter_concentrator"),
|
|
130
|
+
Handover: require("./src/models/handover"),
|
|
131
|
+
Budget: require("./src/models/budget"),
|
|
132
|
+
BudgetCategory: require("./src/models/budgetCategory"),
|
|
133
|
+
Expense: require("./src/models/expense"),
|
|
134
|
+
ExpenseCategory: require("./src/models/expense_category"),
|
|
135
|
+
InvoiceSettings: require("./src/models/levy_invoice_settings"),
|
|
136
|
+
Account: require("./src/models/account"),
|
|
137
|
+
FacilityPaymentDetails: require("./src/models/facility_payment_details"),
|
|
138
|
+
DefaultPaymentDetails: require("./src/models/default_payment_details"),
|
|
139
|
+
Currency: require("./src/models/currency_settings"),
|
|
140
|
+
WaterMeterAccount: require("./src/models/water_meter_account"),
|
|
141
|
+
SingleDayWaterMeterHistory: require("./src/models/water_meter_single_day_history"),
|
|
142
|
+
DailyWaterMeterHistory: require("./src/models/water_meter_daily_history"),
|
|
143
|
+
MonthlyWaterMeterHistory: require("./src/models/water_meter_monthly_history"),
|
|
144
|
+
WaterPrepaidCredit: require("./src/models/water_prepaid_credit"),
|
|
145
|
+
WaterPrepaidDebit: require("./src/models/water_prepaid_debit"),
|
|
146
|
+
MeterLog: require("./src/models/water_meter_communication_logs"),
|
|
147
|
+
CashPayment: require("./src/models/cashpayment"),
|
|
148
|
+
VasPayment: require("./src/models/vas_payments"),
|
|
149
|
+
VasInvoicesQuickBooks: require("./src/models/vas_invoices_upload"),
|
|
150
|
+
ServiceChargePayment: require("./src/models/service_charge_payments"),
|
|
151
|
+
ServiceChargeInvoiceUpload: require("./src/models/service_charge_invoice_upload"),
|
|
152
|
+
Campaign: require("./src/models/campaigns"),
|
|
153
|
+
InspectionItem: require("./src/models/item_inspection"),
|
|
154
|
+
Supplier: require("./src/models/suppliers"),
|
|
155
|
+
PurchaseRequest: require("./src/models/purchase_request"),
|
|
156
|
+
PurchaseOrder: require("./src/models/purchase_order"),
|
|
157
|
+
PaymentTermMark: require("./src/models/paymentTermsMarks"),
|
|
158
|
+
DeliveryTimeMark: require("./src/models/deliveryTimeMarks"),
|
|
159
|
+
RFQDetails: require("./src/models/rfq_details"),
|
|
160
|
+
RFQResponse: require("./src/models/rfq_response"),
|
|
161
|
+
ApprovalWorkflow: require("./src/models/approvalsWorkflows"),
|
|
162
|
+
CommonAreaElectricityReading: require("./src/models/common_area_electricity"),
|
|
163
|
+
CommonAreaWaterReading: require("./src/models/common_area_water"),
|
|
164
|
+
CommonAreaGeneratorReading: require("./src/models/common_area_generator"),
|
|
165
|
+
CommonAreaUtilityAlert: require("./src/models/common_area_utility_alert"),
|
|
166
|
+
BookingProperty: require("./src/models/bookingproperty"),
|
|
167
|
+
BookingReservation: require("./src/models/bookingreservation"),
|
|
168
|
+
BookingConfig: require("./src/models/bookingconfig"),
|
|
169
|
+
BookingAnalytics: require("./src/models/bookinganalytics"),
|
|
170
|
+
BookingInvoice: require("./src/models/booking_invoice"),
|
|
171
|
+
BankDetails: require("./src/models/bankdetails"),
|
|
172
|
+
RevenueRecord: require("./src/models/bookingrevenuerecord"),
|
|
173
|
+
GLAccount: require("./src/models/gl_accounts"),
|
|
174
|
+
GLEntry: require("./src/models/gl_entries"),
|
|
175
|
+
GLAccountDoubleEntries: require("./src/models/gl_account_double_entries"),
|
|
176
|
+
PendingCredential: require("./src/models/pendingCredentials"),
|
|
177
|
+
UnitManagementTemplate: require("./src/models/unitManagementTemplate"),
|
|
178
|
+
PropertyManagerRevenue: require("./src/models/propertyManagerRevenue"),
|
|
179
|
+
PropertyManagerContract: require("./src/models/propertyManagerContract"),
|
|
180
|
+
BillerAddress: require("./src/models/billerAddress"),
|
|
181
|
+
AssetAssignment: require("./src/models/assetsAssignment"),
|
|
182
|
+
Wallet: require("./src/models/wallet"),
|
|
183
|
+
WalletTransaction: require("./src/models/wallet_transactions"),
|
|
184
|
+
GoodsReceivedNote: require("./src/models/goodsReceivedNotes"),
|
|
185
|
+
CommunicationStatus: require("./src/models/communication_status"),
|
|
186
|
+
MeterCommandQueue: require("./src/models/water_meter_Command_Queue"),
|
|
187
|
+
FacilityDepartment: require("./src/models/facility_departements"),
|
|
188
|
+
EmailSmsQueue: require("./src/models/email_sms_queue"),
|
|
189
|
+
PurchaseOrderInvoice: require("./src/models/purchaseOrderInvoice"),
|
|
190
|
+
PowerMeterCustomerBand: require("./src/models/powerMeterCustomerBand"),
|
|
191
|
+
PowerMeterCommunicationProtocol: require("./src/models/powerMeterCommunicationProtocol"),
|
|
192
|
+
PowerMeterDailyReading: require("./src/models/powerMeterDailyReading"),
|
|
193
|
+
PowerMeterPowerCharge: require("./src/models/powerMeterPowerCharges"),
|
|
194
|
+
PowerMeterGateway: require("./src/models/powerMeterGateways"),
|
|
195
|
+
PowerMeters: require("./src/models/powerMeters"),
|
|
196
|
+
PowerMeterSingleDayReading: require("./src/models/powerMeterSingleDayReading"),
|
|
197
|
+
PowerMeterAccount: require("./src/models/power_meter_account"),
|
|
198
|
+
PowerMeterLog: require("./src/models/power_meter_command_logs"),
|
|
199
|
+
PowerMeterManufacturer: require("./src/models/powerMetersManufacturer"),
|
|
200
|
+
PowerMeterMonthlyReading: require("./src/models/powerMeterMonthlyReading"),
|
|
201
|
+
PowerMeterSettings: require("./src/models/powerMeterSettings"),
|
|
202
|
+
FacilityWalletTransactionsMetadata: require("./src/models/facilityWalletTransactionsMetadata"),
|
|
203
|
+
PowerMeterCustomerAccount: require("./src/models/powerMeterCustomerAccount"),
|
|
204
|
+
SmsNotification: require("./src/models/sms_balance_notification"),
|
|
205
|
+
NegativeBalance: require("./src/models/water_meter_negative_amounts"),
|
|
206
|
+
MasterWorkplan: require("./src/models/master_workplan"),
|
|
207
|
+
MasterWorkplanChild: require("./src/models/master_workplan_child"),
|
|
208
|
+
DutyRosterChecklist: require("./src/models/dutyRosterChecklist"),
|
|
209
|
+
AuditTrail: require("./src/models/auditTrail"),
|
|
210
|
+
DailyChecklist: require("./src/models/dailyChecklist"),
|
|
211
|
+
CoreInvoiceSettings: require("./src/models/coreInvoiceSettings"),
|
|
212
|
+
FacilityInvoice: require("./src/models/facilityInvoice"),
|
|
213
|
+
CoreBaseSettings: require("./src/models/coreBaseSettings"),
|
|
214
|
+
RecipientSchema: require("./src/models/facilityInvoiceRecipient")
|
|
214
215
|
};
|
|
215
216
|
|
|
216
217
|
// Function to get models dynamically from a specific database connection
|
|
217
218
|
async function getModelFromDB(dbConnection, modelName, schema) {
|
|
218
|
-
|
|
219
|
-
|
|
220
|
-
|
|
221
|
-
|
|
219
|
+
if (!dbConnection.models[modelName]) {
|
|
220
|
+
return dbConnection.model(modelName, schema); // Register the model in the db connection
|
|
221
|
+
}
|
|
222
|
+
return dbConnection.models[modelName]; // Return existing model if already registered
|
|
222
223
|
}
|
|
223
224
|
|
|
224
225
|
// Function to initialize service with specific models - NEW FEATURE
|
|
225
226
|
function initializeService(modelNames = []) {
|
|
226
|
-
|
|
227
|
+
let currentConnection = null;
|
|
227
228
|
|
|
228
|
-
|
|
229
|
-
|
|
230
|
-
|
|
231
|
-
|
|
232
|
-
|
|
233
|
-
|
|
234
|
-
|
|
235
|
-
|
|
236
|
-
|
|
237
|
-
|
|
238
|
-
|
|
229
|
+
// Enhanced connect function that only registers specified models
|
|
230
|
+
async function connectWithModels(
|
|
231
|
+
dbName,
|
|
232
|
+
secured,
|
|
233
|
+
username,
|
|
234
|
+
password,
|
|
235
|
+
url,
|
|
236
|
+
port,
|
|
237
|
+
) {
|
|
238
|
+
await connectToMongoDB(dbName, secured, username, password, url, port);
|
|
239
|
+
currentConnection = mongoose.connection;
|
|
239
240
|
|
|
240
|
-
|
|
241
|
-
|
|
242
|
-
|
|
243
|
-
|
|
241
|
+
// Only register the models specified in modelNames
|
|
242
|
+
modelNames.forEach((modelName) => {
|
|
243
|
+
if (models[modelName]) {
|
|
244
|
+
let schema;
|
|
244
245
|
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
|
|
248
|
-
|
|
249
|
-
|
|
250
|
-
|
|
251
|
-
|
|
246
|
+
// Extract schema from the imported model
|
|
247
|
+
if (models[modelName].schema) {
|
|
248
|
+
schema = models[modelName].schema;
|
|
249
|
+
} else {
|
|
250
|
+
console.warn(`Unable to extract schema from model ${modelName}`);
|
|
251
|
+
return;
|
|
252
|
+
}
|
|
252
253
|
|
|
253
|
-
|
|
254
|
-
|
|
255
|
-
|
|
256
|
-
|
|
257
|
-
|
|
258
|
-
|
|
259
|
-
|
|
260
|
-
|
|
261
|
-
|
|
262
|
-
|
|
263
|
-
|
|
254
|
+
if (!currentConnection.models[modelName]) {
|
|
255
|
+
const modelInstance = currentConnection.model(modelName, schema);
|
|
256
|
+
// Make model globally accessible through payservedb
|
|
257
|
+
module.exports[modelName] = modelInstance;
|
|
258
|
+
} else {
|
|
259
|
+
module.exports[modelName] = currentConnection.models[modelName];
|
|
260
|
+
}
|
|
261
|
+
} else {
|
|
262
|
+
console.warn(`Model ${modelName} not found in models registry`);
|
|
263
|
+
}
|
|
264
|
+
});
|
|
264
265
|
|
|
265
|
-
|
|
266
|
-
|
|
266
|
+
return module.exports;
|
|
267
|
+
}
|
|
267
268
|
|
|
268
|
-
|
|
269
|
-
|
|
270
|
-
|
|
271
|
-
|
|
272
|
-
|
|
273
|
-
|
|
269
|
+
return {
|
|
270
|
+
connectToMongoDB: connectWithModels,
|
|
271
|
+
switchDB,
|
|
272
|
+
getModelFromDB,
|
|
273
|
+
getCurrentConnection: () => currentConnection,
|
|
274
|
+
};
|
|
274
275
|
}
|
|
275
276
|
|
|
276
277
|
module.exports = {
|
|
277
|
-
|
|
278
|
-
|
|
279
|
-
|
|
280
|
-
|
|
281
|
-
|
|
278
|
+
connectToMongoDB,
|
|
279
|
+
switchDB,
|
|
280
|
+
getModelFromDB,
|
|
281
|
+
initializeService,
|
|
282
|
+
...models,
|
|
282
283
|
};
|
package/package.json
CHANGED
|
File without changes
|