@igxjs/node-components 1.0.4 → 1.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.
package/README.md CHANGED
@@ -295,6 +295,7 @@ httpCodes.NOT_FOUND // 404
295
295
  httpCodes.NOT_ACCEPTABLE // 406
296
296
  httpCodes.CONFLICT // 409
297
297
  httpCodes.SYSTEM_FAILURE // 500
298
+ httpCodes.NOT_IMPLEMENTED // 501
298
299
 
299
300
  // Corresponding messages
300
301
  httpMessages.OK // 'OK'
@@ -11,6 +11,7 @@ export const httpMessages = {
11
11
  NOT_ACCEPTABLE: 'Not Acceptable',
12
12
  CONFLICT: 'Conflict',
13
13
  SYSTEM_FAILURE: 'System Error',
14
+ NOT_IMPLEMENTED: 'Not Implemented',
14
15
  };
15
16
 
16
17
  export const httpCodes = {
package/index.d.ts CHANGED
@@ -1,9 +1,8 @@
1
1
  import 'express-session';
2
- import '@types/express';
3
2
 
4
3
  import { AxiosError } from 'axios';
5
4
  import { RedisClientType } from '@redis/client';
6
- import { Application, RequestHandler, Request, Response, NextFunction, Router } from '@types/express';
5
+ import { Application, RequestHandler, Request, Response, NextFunction, Router } from 'express';
7
6
 
8
7
  // Session Configuration
9
8
  export interface SessionConfig {
@@ -95,7 +94,7 @@ export class SessionManager {
95
94
  app: Application,
96
95
  updateUser: (user: SessionUser | undefined) => any
97
96
  ): Promise<void>;
98
-
97
+
99
98
  /**
100
99
  * Resource protection middleware
101
100
  * @param isDebugging Debugging flag (default: false)
@@ -103,26 +102,26 @@ export class SessionManager {
103
102
  * @returns Returns express Request Handler
104
103
  */
105
104
  authenticate(isDebugging?: boolean, redirectUrl?: string): RequestHandler;
106
-
105
+
107
106
  /**
108
107
  * SSO callback for successful login
109
108
  * @param initUser Initialize user object function
110
109
  * @returns Returns express Request Handler
111
110
  */
112
111
  callback(initUser: (user: SessionUser) => SessionUser): RequestHandler;
113
-
112
+
114
113
  /**
115
114
  * Get Identity Providers
116
115
  * @returns Returns express Request Handler
117
116
  */
118
117
  identityProviders(): RequestHandler;
119
-
118
+
120
119
  /**
121
120
  * Application logout (NOT SSO)
122
121
  * @returns Returns express Request Handler
123
122
  */
124
123
  logout(): RequestHandler;
125
-
124
+
126
125
  /**
127
126
  * Refresh user session
128
127
  * @param initUser Initialize user object function
@@ -134,9 +133,9 @@ export class SessionManager {
134
133
  // Custom Error class
135
134
  export class CustomError extends Error {
136
135
  code: number;
137
- object;
136
+ data: object;
138
137
  error: object;
139
-
138
+
140
139
  /**
141
140
  * Construct a custom error
142
141
  * @param code Error code
@@ -152,7 +151,7 @@ export class FlexRouter {
152
151
  context: string;
153
152
  router: Router;
154
153
  handlers: RequestHandler[];
155
-
154
+
156
155
  /**
157
156
  * Constructor
158
157
  * @param context Context path
@@ -160,7 +159,7 @@ export class FlexRouter {
160
159
  * @param handlers Request handlers (optional)
161
160
  */
162
161
  constructor(context: string, router: Router, handlers?: RequestHandler[]);
163
-
162
+
164
163
  /**
165
164
  * Mount router to Express app
166
165
  * @param app Express application
@@ -178,19 +177,19 @@ export class RedisManager {
178
177
  * @returns Returns true if Redis server is connected
179
178
  */
180
179
  connect(redisUrl: string, certPath: string): Promise<boolean>;
181
-
180
+
182
181
  /**
183
182
  * Get Redis client
184
183
  * @returns Returns Redis client instance
185
184
  */
186
185
  getClient(): RedisClientType;
187
-
186
+
188
187
  /**
189
188
  * Determine if the Redis server is connected
190
189
  * @returns Returns true if Redis server is connected
191
190
  */
192
191
  isConnected(): Promise<boolean>;
193
-
192
+
194
193
  /**
195
194
  * Disconnect from Redis
196
195
  * @returns Returns nothing
@@ -210,6 +209,7 @@ export const httpCodes: {
210
209
  NOT_ACCEPTABLE: number;
211
210
  CONFLICT: number;
212
211
  SYSTEM_FAILURE: number;
212
+ NOT_IMPLEMENTED: number;
213
213
  };
214
214
 
215
215
  // HTTP message keys (exposed for type safety)
@@ -224,6 +224,7 @@ export const httpMessages: {
224
224
  NOT_ACCEPTABLE: string;
225
225
  CONFLICT: string;
226
226
  SYSTEM_FAILURE: string;
227
+ NOT_IMPLEMENTED: string;
227
228
  };
228
229
 
229
230
  /**
@@ -268,6 +269,18 @@ export function httpErrorHandler(
268
269
  next: NextFunction
269
270
  ): void;
270
271
 
272
+ /**
273
+ * HTTP not found handler middleware
274
+ * @param req Express Request
275
+ * @param res Express Response
276
+ * @param next Next function
277
+ */
278
+ export function httpNotFoundHandler(
279
+ req: Request,
280
+ res: Response,
281
+ next: NextFunction
282
+ ): void;
283
+
271
284
  declare global {
272
285
  namespace Express {
273
286
  export interface Request {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@igxjs/node-components",
3
- "version": "1.0.4",
3
+ "version": "1.0.6",
4
4
  "description": "Node components for igxjs",
5
5
  "main": "index.js",
6
6
  "type": "module",