quidproquo-webserver 0.0.43 → 0.0.44

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,6 +1,8 @@
1
1
  export declare enum QPQWebServerConfigSettingType {
2
2
  Route = "@quidproquo-webserver/config/Route",
3
+ DefaultRouteOptions = "@quidproquo-webserver/config/DefaultRouteOptions",
3
4
  Dns = "@quidproquo-webserver/config/Dns",
4
5
  OpenApi = "@quidproquo-webserver/config/OpenApi",
5
- DefaultRouteOptions = "@quidproquo-webserver/config/DefaultRouteOptions"
6
+ Seo = "@quidproquo-webserver/config/Seo",
7
+ DeployRegion = "@quidproquo-webserver/config/DeployRegion"
6
8
  }
@@ -4,7 +4,9 @@ exports.QPQWebServerConfigSettingType = void 0;
4
4
  var QPQWebServerConfigSettingType;
5
5
  (function (QPQWebServerConfigSettingType) {
6
6
  QPQWebServerConfigSettingType["Route"] = "@quidproquo-webserver/config/Route";
7
+ QPQWebServerConfigSettingType["DefaultRouteOptions"] = "@quidproquo-webserver/config/DefaultRouteOptions";
7
8
  QPQWebServerConfigSettingType["Dns"] = "@quidproquo-webserver/config/Dns";
8
9
  QPQWebServerConfigSettingType["OpenApi"] = "@quidproquo-webserver/config/OpenApi";
9
- QPQWebServerConfigSettingType["DefaultRouteOptions"] = "@quidproquo-webserver/config/DefaultRouteOptions";
10
+ QPQWebServerConfigSettingType["Seo"] = "@quidproquo-webserver/config/Seo";
11
+ QPQWebServerConfigSettingType["DeployRegion"] = "@quidproquo-webserver/config/DeployRegion";
10
12
  })(QPQWebServerConfigSettingType = exports.QPQWebServerConfigSettingType || (exports.QPQWebServerConfigSettingType = {}));
@@ -0,0 +1,5 @@
1
+ import { QPQConfigSetting } from 'quidproquo-core';
2
+ export interface DeployRegionQPQWebServerConfigSetting extends QPQConfigSetting {
3
+ deployRegion: string;
4
+ }
5
+ export declare const defineDeployRegion: (deployRegion: string) => DeployRegionQPQWebServerConfigSetting;
@@ -0,0 +1,11 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defineDeployRegion = void 0;
4
+ const QPQConfig_1 = require("../QPQConfig");
5
+ const defineDeployRegion = (deployRegion) => {
6
+ return {
7
+ configSettingType: QPQConfig_1.QPQWebServerConfigSettingType.DeployRegion,
8
+ deployRegion,
9
+ };
10
+ };
11
+ exports.defineDeployRegion = defineDeployRegion;
@@ -1,4 +1,6 @@
1
1
  export * from './defaultRouteOptions';
2
+ export * from './deployRegion';
2
3
  export * from './dns';
3
4
  export * from './openApi';
4
5
  export * from './route';
6
+ export * from './seo';
@@ -15,6 +15,8 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
17
  __exportStar(require("./defaultRouteOptions"), exports);
18
+ __exportStar(require("./deployRegion"), exports);
18
19
  __exportStar(require("./dns"), exports);
19
20
  __exportStar(require("./openApi"), exports);
20
21
  __exportStar(require("./route"), exports);
22
+ __exportStar(require("./seo"), exports);
@@ -0,0 +1,9 @@
1
+ import { QPQConfigSetting } from 'quidproquo-core';
2
+ export type SeoOptions = {};
3
+ export interface SeoQPQWebServerConfigSetting extends QPQConfigSetting {
4
+ path: string;
5
+ src: string;
6
+ runtime: string;
7
+ options: SeoOptions;
8
+ }
9
+ export declare const defineSeo: (path: string, src: string, runtime: string, options?: SeoOptions) => SeoQPQWebServerConfigSetting;
@@ -0,0 +1,12 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ exports.defineSeo = void 0;
4
+ const QPQConfig_1 = require("../QPQConfig");
5
+ const defineSeo = (path, src, runtime, options = {}) => ({
6
+ configSettingType: QPQConfig_1.QPQWebServerConfigSettingType.Seo,
7
+ path,
8
+ src,
9
+ runtime,
10
+ options,
11
+ });
12
+ exports.defineSeo = defineSeo;
@@ -1,9 +1,12 @@
1
1
  import { QPQConfig } from 'quidproquo-core';
2
2
  import { RouteQPQWebServerConfigSetting } from './config/settings/route';
3
+ import { SeoQPQWebServerConfigSetting } from './config/settings/seo';
3
4
  import { OpenApiQPQWebServerConfigSetting } from './config/settings/openApi';
4
5
  import { HttpEventHeaders } from './types/HTTPEvent';
5
6
  import { RouteOptions } from './config/settings/route';
6
7
  export declare const getAllRoutes: (configs: QPQConfig) => RouteQPQWebServerConfigSetting[];
8
+ export declare const getAllSeo: (configs: QPQConfig) => SeoQPQWebServerConfigSetting[];
9
+ export declare const getDeployRegion: (configs: QPQConfig) => string;
7
10
  export declare const getAllOpenApiSpecs: (configs: QPQConfig) => OpenApiQPQWebServerConfigSetting[];
8
11
  export declare const getAllSrcEntries: (configs: QPQConfig) => string[];
9
12
  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.getCorsHeaders = exports.getAllowedOrigins = exports.getHeaderValue = exports.getFeatureDomainName = exports.getDomainName = exports.getAllSrcEntries = exports.getAllOpenApiSpecs = exports.getAllRoutes = void 0;
3
+ exports.getCorsHeaders = exports.getAllowedOrigins = exports.getHeaderValue = exports.getFeatureDomainName = exports.getDomainName = exports.getAllSrcEntries = exports.getAllOpenApiSpecs = exports.getDeployRegion = exports.getAllSeo = exports.getAllRoutes = void 0;
4
4
  const quidproquo_core_1 = require("quidproquo-core");
5
5
  const QPQConfig_1 = require("./config/QPQConfig");
6
6
  const qpqCoreUtils_1 = require("quidproquo-core/lib/qpqCoreUtils");
@@ -9,6 +9,17 @@ const getAllRoutes = (configs) => {
9
9
  return routes;
10
10
  };
11
11
  exports.getAllRoutes = getAllRoutes;
12
+ const getAllSeo = (configs) => {
13
+ const seoConfigs = quidproquo_core_1.qpqCoreUtils.getConfigSettings(configs, QPQConfig_1.QPQWebServerConfigSettingType.Seo);
14
+ return seoConfigs;
15
+ };
16
+ exports.getAllSeo = getAllSeo;
17
+ const getDeployRegion = (configs) => {
18
+ var _a;
19
+ const deployRegions = quidproquo_core_1.qpqCoreUtils.getConfigSettings(configs, QPQConfig_1.QPQWebServerConfigSettingType.DeployRegion);
20
+ return ((_a = deployRegions[0]) === null || _a === void 0 ? void 0 : _a.deployRegion) || 'ap-southeast-2';
21
+ };
22
+ exports.getDeployRegion = getDeployRegion;
12
23
  const getAllOpenApiSpecs = (configs) => {
13
24
  const openApiSpecs = quidproquo_core_1.qpqCoreUtils.getConfigSettings(configs, QPQConfig_1.QPQWebServerConfigSettingType.OpenApi);
14
25
  return openApiSpecs;
@@ -20,6 +31,7 @@ const getAllSrcEntries = (configs) => {
20
31
  return [
21
32
  ...(0, exports.getAllRoutes)(configs).map((r) => r.src),
22
33
  ...(0, exports.getAllOpenApiSpecs)(configs).map((r) => r.openApiSpecPath),
34
+ ...(0, exports.getAllSeo)(configs).map((seo) => seo.src),
23
35
  ];
24
36
  };
25
37
  exports.getAllSrcEntries = getAllSrcEntries;
@@ -0,0 +1,21 @@
1
+ import { HTTPMethod } from 'quidproquo-core';
2
+ export interface SeoEventHeaders {
3
+ [key: string]: undefined | string;
4
+ }
5
+ export interface SeoEventParams<T = null> {
6
+ path: string;
7
+ query: {
8
+ [key: string]: undefined | string | string[];
9
+ };
10
+ body: T;
11
+ headers: SeoEventHeaders;
12
+ method: HTTPMethod;
13
+ correlation: string;
14
+ sourceIp: string;
15
+ }
16
+ export interface SeoEventResponse {
17
+ fallbackToCDN?: boolean;
18
+ status: number;
19
+ body?: string;
20
+ headers?: SeoEventHeaders;
21
+ }
@@ -0,0 +1,2 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
@@ -1 +1,2 @@
1
1
  export * from './HTTPEvent';
2
+ export * from './SEOEvent';
@@ -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("./HTTPEvent"), exports);
18
+ __exportStar(require("./SEOEvent"), exports);
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "quidproquo-webserver",
3
- "version": "0.0.43",
3
+ "version": "0.0.44",
4
4
  "description": "",
5
5
  "main": "./lib/index.js",
6
6
  "types": "./lib/index.d.js",
@@ -11,7 +11,7 @@
11
11
  "test": "echo \"Error: no test specified\" && exit 1",
12
12
  "clean": "npx rimraf lib",
13
13
  "build": "npm run clean && tsc",
14
- "watch": "npm run clean && tsc -w"
14
+ "watch": "tsc -w"
15
15
  },
16
16
  "repository": {
17
17
  "type": "git",