quidproquo-webserver 0.0.18 → 0.0.19

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.
@@ -1 +1,2 @@
1
1
  export * from './genericDataResource';
2
+ export * from './openApiSpec';
@@ -15,3 +15,4 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./genericDataResource"), exports);
18
+ __exportStar(require("./openApiSpec"), exports);
@@ -0,0 +1,3 @@
1
+ export declare enum OpenApiSpecActionType {
2
+ GetOpenApiSpec = "@quidproquo-core/OpenApiSpec/GetOpenApiSpec"
3
+ }
@@ -0,0 +1,7 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.OpenApiSpecActionType = void 0;
4
+ var OpenApiSpecActionType;
5
+ (function (OpenApiSpecActionType) {
6
+ OpenApiSpecActionType["GetOpenApiSpec"] = "@quidproquo-core/OpenApiSpec/GetOpenApiSpec";
7
+ })(OpenApiSpecActionType = exports.OpenApiSpecActionType || (exports.OpenApiSpecActionType = {}));
@@ -0,0 +1,2 @@
1
+ import { OpenApiSpecGetOpenApiSpecActionRequester } from './OpenApiSpecGetOpenApiSpecActionTypes';
2
+ export declare function askGetOpenApiSpec(): OpenApiSpecGetOpenApiSpecActionRequester;
@@ -0,0 +1,8 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.askGetOpenApiSpec = void 0;
4
+ const OpenApiSpecActionType_1 = require("./OpenApiSpecActionType");
5
+ function* askGetOpenApiSpec() {
6
+ return yield { type: OpenApiSpecActionType_1.OpenApiSpecActionType.GetOpenApiSpec };
7
+ }
8
+ exports.askGetOpenApiSpec = askGetOpenApiSpec;
@@ -0,0 +1,9 @@
1
+ import { Action, ActionProcessor, ActionRequester } from 'quidproquo-core';
2
+ import { OpenApiSpecActionType } from './OpenApiSpecActionType';
3
+ export interface OpenApiSpecGetOpenApiSpecActionPayload {
4
+ }
5
+ export interface OpenApiSpecGetOpenApiSpecAction extends Action<OpenApiSpecGetOpenApiSpecActionPayload> {
6
+ type: OpenApiSpecActionType.GetOpenApiSpec;
7
+ }
8
+ export type OpenApiSpecGetOpenApiSpecActionProcessor = ActionProcessor<OpenApiSpecGetOpenApiSpecAction, string>;
9
+ export type OpenApiSpecGetOpenApiSpecActionRequester = ActionRequester<OpenApiSpecGetOpenApiSpecAction, string>;
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -0,0 +1,3 @@
1
+ export * from './OpenApiSpecActionType';
2
+ export * from './OpenApiSpecGetOpenApiSpecActionRequester';
3
+ export * from './OpenApiSpecGetOpenApiSpecActionTypes';
@@ -0,0 +1,19 @@
1
+ "use strict";
2
+ var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
+ if (k2 === undefined) k2 = k;
4
+ var desc = Object.getOwnPropertyDescriptor(m, k);
5
+ if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
+ desc = { enumerable: true, get: function() { return m[k]; } };
7
+ }
8
+ Object.defineProperty(o, k2, desc);
9
+ }) : (function(o, m, k, k2) {
10
+ if (k2 === undefined) k2 = k;
11
+ o[k2] = m[k];
12
+ }));
13
+ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
+ for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
+ };
16
+ Object.defineProperty(exports, "__esModule", { value: true });
17
+ __exportStar(require("./OpenApiSpecActionType"), exports);
18
+ __exportStar(require("./OpenApiSpecGetOpenApiSpecActionRequester"), exports);
19
+ __exportStar(require("./OpenApiSpecGetOpenApiSpecActionTypes"), exports);
@@ -1,4 +1,5 @@
1
1
  export declare enum QPQWebServerConfigSettingType {
2
2
  Route = "@quidproquo-webserver/config/Route",
3
- Dns = "@quidproquo-webserver/config/Dns"
3
+ Dns = "@quidproquo-webserver/config/Dns",
4
+ OpenApi = "@quidproquo-webserver/config/OpenApi"
4
5
  }
@@ -5,4 +5,5 @@ var QPQWebServerConfigSettingType;
5
5
  (function (QPQWebServerConfigSettingType) {
6
6
  QPQWebServerConfigSettingType["Route"] = "@quidproquo-webserver/config/Route";
7
7
  QPQWebServerConfigSettingType["Dns"] = "@quidproquo-webserver/config/Dns";
8
+ QPQWebServerConfigSettingType["OpenApi"] = "@quidproquo-webserver/config/OpenApi";
8
9
  })(QPQWebServerConfigSettingType = exports.QPQWebServerConfigSettingType || (exports.QPQWebServerConfigSettingType = {}));
@@ -1,2 +1,3 @@
1
1
  export * from './dns';
2
+ export * from './openApi';
2
3
  export * from './route';
@@ -15,4 +15,5 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./dns"), exports);
18
+ __exportStar(require("./openApi"), exports);
18
19
  __exportStar(require("./route"), exports);
@@ -0,0 +1,5 @@
1
+ import { QPQConfigSetting } from 'quidproquo-core';
2
+ export interface OpenApiQPQWebServerConfigSetting extends QPQConfigSetting {
3
+ openApiSpecPath: string;
4
+ }
5
+ export declare const defineOpenApi: (openApiSpecPath: string) => OpenApiQPQWebServerConfigSetting;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defineOpenApi = void 0;
4
+ const QPQConfig_1 = require("../QPQConfig");
5
+ const defineOpenApi = (openApiSpecPath) => {
6
+ return {
7
+ configSettingType: QPQConfig_1.QPQWebServerConfigSettingType.OpenApi,
8
+ openApiSpecPath,
9
+ };
10
+ };
11
+ exports.defineOpenApi = defineOpenApi;
@@ -1,5 +1,4 @@
1
- import { QPQConfigSetting } from 'quidproquo-core';
2
- import { HTTPMethod } from '../../types/HTTPEvent';
1
+ import { QPQConfigSetting, HTTPMethod } from 'quidproquo-core';
3
2
  export type RouteOptions = {};
4
3
  export interface RouteQPQWebServerConfigSetting extends QPQConfigSetting {
5
4
  method: HTTPMethod;
@@ -1,5 +1,7 @@
1
1
  import { QPQConfig } from 'quidproquo-core';
2
2
  import { RouteQPQWebServerConfigSetting } from './config/settings/route';
3
+ import { OpenApiQPQWebServerConfigSetting } from './config/settings/openApi';
3
4
  export declare const getAllRoutes: (configs: QPQConfig) => RouteQPQWebServerConfigSetting[];
5
+ export declare const getAllOpenApiSpecs: (configs: QPQConfig) => OpenApiQPQWebServerConfigSetting[];
4
6
  export declare const getAllSrcEntries: (configs: QPQConfig) => string[];
5
7
  export declare const getDomainName: (configs: QPQConfig) => string;
@@ -1,6 +1,6 @@
1
1
  "use strict";
2
2
  Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.getDomainName = exports.getAllSrcEntries = exports.getAllRoutes = void 0;
3
+ exports.getDomainName = exports.getAllSrcEntries = exports.getAllOpenApiSpecs = exports.getAllRoutes = void 0;
4
4
  const quidproquo_core_1 = require("quidproquo-core");
5
5
  const QPQConfig_1 = require("./config/QPQConfig");
6
6
  const getAllRoutes = (configs) => {
@@ -8,10 +8,18 @@ const getAllRoutes = (configs) => {
8
8
  return routes;
9
9
  };
10
10
  exports.getAllRoutes = getAllRoutes;
11
+ const getAllOpenApiSpecs = (configs) => {
12
+ const openApiSpecs = quidproquo_core_1.qpqCoreUtils.getConfigSettings(configs, QPQConfig_1.QPQWebServerConfigSettingType.OpenApi);
13
+ return openApiSpecs;
14
+ };
15
+ exports.getAllOpenApiSpecs = getAllOpenApiSpecs;
11
16
  // Used in bundlers to know where and what to build and index
12
17
  // Events, routes, etc
13
18
  const getAllSrcEntries = (configs) => {
14
- return (0, exports.getAllRoutes)(configs).map((r) => r.src);
19
+ return [
20
+ ...(0, exports.getAllRoutes)(configs).map((r) => r.src),
21
+ ...(0, exports.getAllOpenApiSpecs)(configs).map((r) => r.openApiSpecPath),
22
+ ];
15
23
  };
16
24
  exports.getAllSrcEntries = getAllSrcEntries;
17
25
  // Used in bundlers to know where and what to build and index
@@ -1,4 +1,4 @@
1
- export type HTTPMethod = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'CONNECT' | 'OPTIONS' | 'PATCH';
1
+ import { HTTPMethod } from 'quidproquo-core';
2
2
  export interface HTTPEventParams<T> {
3
3
  path: string;
4
4
  query: {
@@ -10,4 +10,5 @@ export interface HTTPEventParams<T> {
10
10
  };
11
11
  method: HTTPMethod;
12
12
  correlation: string;
13
+ sourceIp: string;
13
14
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quidproquo-webserver",
3
- "version": "0.0.18",
3
+ "version": "0.0.19",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.js",
@@ -9,7 +9,8 @@
9
9
  ],
10
10
  "scripts": {
11
11
  "test": "echo \"Error: no test specified\" && exit 1",
12
- "build": "npx rimraf lib && tsc"
12
+ "build": "npx rimraf lib && tsc",
13
+ "watch": "tsc -w"
13
14
  },
14
15
  "repository": {
15
16
  "type": "git",