powr-sdk-api 3.0.5 → 3.0.6

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.
@@ -30,7 +30,8 @@ class PlexxManager {
30
30
  const projectId = config.projectId;
31
31
  console.log(`📦 Loading routes for project: ${projectId}`);
32
32
  try {
33
- const routes = await getDb().collection("routes").find({
33
+ const db = await getDb();
34
+ const routes = await db.collection("routes").find({
34
35
  projectId
35
36
  }).toArray();
36
37
  routes.forEach(route => {
@@ -117,7 +118,8 @@ class PlexxManager {
117
118
  throw new Error("Dynamic loading only available in central service mode");
118
119
  }
119
120
  try {
120
- const routeData = await getDb().collection("routes").findOne({
121
+ const db = await getDb();
122
+ const routeData = await db.collection("routes").findOne({
121
123
  projectId,
122
124
  route
123
125
  });
@@ -139,7 +141,8 @@ class PlexxManager {
139
141
  throw new Error("Dynamic loading only available in central service mode");
140
142
  }
141
143
  try {
142
- const routes = await getDb().collection("routes").find({
144
+ const db = await getDb();
145
+ const routes = await db.collection("routes").find({
143
146
  projectId
144
147
  }).toArray();
145
148
  routes.forEach(route => {
@@ -174,7 +177,8 @@ class PlexxManager {
174
177
 
175
178
  // Optionally save to database
176
179
  try {
177
- await getDb().collection("routes").updateOne({
180
+ const db = await getDb();
181
+ await db.collection("routes").updateOne({
178
182
  projectId,
179
183
  route
180
184
  }, {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powr-sdk-api",
3
- "version": "3.0.5",
3
+ "version": "3.0.6",
4
4
  "description": "Shared API core library for PowrStack projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",