@kravc/dos 1.11.15 → 1.11.17

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@kravc/dos",
3
- "version": "1.11.15",
3
+ "version": "1.11.17",
4
4
  "description": "Convention-based, easy-to-use library for building API-driven serverless services.",
5
5
  "keywords": [
6
6
  "Service",
package/src/index.d.ts CHANGED
@@ -222,13 +222,27 @@ interface ISpec {
222
222
  paths: Record<string, unknown>;
223
223
  }
224
224
 
225
- interface IRequest {
225
+ interface HttpRequest {
226
226
  url: string;
227
+ path?: string;
227
228
  body?: string | Record<string, unknown>;
228
229
  method: string;
229
- headers: Headers;
230
- operationId?: string;
231
- };
230
+ headers?: Headers;
231
+ requestContext?: {
232
+ requestId?: string;
233
+ };
234
+ }
235
+
236
+ interface SystemRequest {
237
+ body?: string | Record<string, unknown>;
238
+ operationId: string;
239
+ queryStringParameters?: Record<string, unknown>;
240
+ requestContext?: {
241
+ requestId?: string;
242
+ };
243
+ }
244
+
245
+ type IRequest = HttpRequest | SystemRequest;
232
246
 
233
247
  interface IResponse {
234
248
  body?: string,
@@ -320,3 +334,5 @@ interface Identity {
320
334
  }
321
335
 
322
336
  export declare function authorize(Operation, Context): Promise<Identity>;
337
+
338
+ export declare function maskSecrets(object: Record<string, unknown>): Record<string, unknown>;
package/src/index.js CHANGED
@@ -15,6 +15,7 @@ module.exports = {
15
15
  handler: require('./helpers/handler'),
16
16
  getOrFail: require('./helpers/getOrFail'),
17
17
  authorize: require('./helpers/authorize'),
18
+ maskSecrets: require('./helpers/maskSecrets'),
18
19
  security: require('./security'),
19
20
  verifyToken: require('./security/verifyToken'),
20
21
  JwtAuthorization: require('./security/JwtAuthorization'),