powr-sdk-api 3.0.0 → 3.0.2

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.js CHANGED
@@ -14,13 +14,19 @@ const {
14
14
  createSwaggerSpec
15
15
  } = require("./swagger");
16
16
  const {
17
- createPowrRoutes
17
+ createPowrRoutes,
18
+ initializePlexx
18
19
  } = require("./routes");
20
+ const {
21
+ verifyToken
22
+ } = require("./middleware/jwtToken");
19
23
  module.exports = {
20
24
  errorCatcher,
21
25
  errorHandler,
22
26
  requestHandler,
23
27
  createSwaggerSpec,
24
28
  notFoundHandler,
25
- createPowrRoutes
29
+ createPowrRoutes,
30
+ initializePlexx,
31
+ verifyToken
26
32
  };
@@ -25,11 +25,10 @@ const slidesRoutes = require('./slides');
25
25
  const notificationsRoutes = require('./notifications');
26
26
  const profilesRoutes = require('./profiles');
27
27
  const chatRoutes = require('./chat');
28
- const createPowrRoutes = async (options = {}) => {
29
- const router = express.Router();
30
28
 
31
- // Initialize Plexx manager with options
32
- await plexxManager.initialize(options);
29
+ // Synchronous router creation
30
+ const createPowrRoutes = (options = {}) => {
31
+ const router = express.Router();
33
32
 
34
33
  // Use the dedicated projectId injection middleware
35
34
  router.use(injectProjectId(options));
@@ -50,6 +49,13 @@ const createPowrRoutes = async (options = {}) => {
50
49
  router.use('/chat', verifyToken, chatRoutes);
51
50
  return router;
52
51
  };
52
+
53
+ // Async Plexx initialization function
54
+ const initializePlexx = async (options = {}) => {
55
+ // Initialize Plexx manager with options
56
+ await plexxManager.initialize(options);
57
+ };
53
58
  module.exports = {
54
- createPowrRoutes
59
+ createPowrRoutes,
60
+ initializePlexx
55
61
  };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "powr-sdk-api",
3
- "version": "3.0.0",
3
+ "version": "3.0.2",
4
4
  "description": "Shared API core library for PowrStack projects",
5
5
  "main": "dist/index.js",
6
6
  "types": "dist/index.d.ts",