quidproquo-webserver 0.0.49 → 0.0.51
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/lib/config/QPQConfig.d.ts +2 -1
- package/lib/config/QPQConfig.js +1 -0
- package/lib/config/settings/index.d.ts +1 -0
- package/lib/config/settings/index.js +1 -0
- package/lib/config/settings/subdomainRedirect.d.ts +7 -0
- package/lib/config/settings/subdomainRedirect.js +11 -0
- package/lib/qpqWebServerUtils.d.ts +2 -0
- package/lib/qpqWebServerUtils.js +6 -1
- package/package.json +1 -1
|
@@ -4,5 +4,6 @@ export declare enum QPQWebServerConfigSettingType {
|
|
|
4
4
|
Dns = "@quidproquo-webserver/config/Dns",
|
|
5
5
|
OpenApi = "@quidproquo-webserver/config/OpenApi",
|
|
6
6
|
Seo = "@quidproquo-webserver/config/Seo",
|
|
7
|
-
DeployRegion = "@quidproquo-webserver/config/DeployRegion"
|
|
7
|
+
DeployRegion = "@quidproquo-webserver/config/DeployRegion",
|
|
8
|
+
SubdomainRedirect = "@quidproquo-webserver/config/SubdomainRedirect"
|
|
8
9
|
}
|
package/lib/config/QPQConfig.js
CHANGED
|
@@ -9,4 +9,5 @@ var QPQWebServerConfigSettingType;
|
|
|
9
9
|
QPQWebServerConfigSettingType["OpenApi"] = "@quidproquo-webserver/config/OpenApi";
|
|
10
10
|
QPQWebServerConfigSettingType["Seo"] = "@quidproquo-webserver/config/Seo";
|
|
11
11
|
QPQWebServerConfigSettingType["DeployRegion"] = "@quidproquo-webserver/config/DeployRegion";
|
|
12
|
+
QPQWebServerConfigSettingType["SubdomainRedirect"] = "@quidproquo-webserver/config/SubdomainRedirect";
|
|
12
13
|
})(QPQWebServerConfigSettingType = exports.QPQWebServerConfigSettingType || (exports.QPQWebServerConfigSettingType = {}));
|
|
@@ -0,0 +1,7 @@
|
|
|
1
|
+
import { QPQConfigSetting } from 'quidproquo-core';
|
|
2
|
+
export interface SubdomainRedirectQPQWebServerConfigSetting extends QPQConfigSetting {
|
|
3
|
+
subdomain: string;
|
|
4
|
+
redirectUrl: string;
|
|
5
|
+
addFeatureEnvironment: boolean;
|
|
6
|
+
}
|
|
7
|
+
export declare const defineSubdomainRedirect: (subdomain: string, redirectUrl: string, addFeatureEnvironment?: boolean) => SubdomainRedirectQPQWebServerConfigSetting;
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.defineSubdomainRedirect = void 0;
|
|
4
|
+
const QPQConfig_1 = require("../QPQConfig");
|
|
5
|
+
const defineSubdomainRedirect = (subdomain, redirectUrl, addFeatureEnvironment = false) => ({
|
|
6
|
+
configSettingType: QPQConfig_1.QPQWebServerConfigSettingType.SubdomainRedirect,
|
|
7
|
+
subdomain,
|
|
8
|
+
redirectUrl,
|
|
9
|
+
addFeatureEnvironment,
|
|
10
|
+
});
|
|
11
|
+
exports.defineSubdomainRedirect = defineSubdomainRedirect;
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { QPQConfig } from 'quidproquo-core';
|
|
2
2
|
import { RouteQPQWebServerConfigSetting } from './config/settings/route';
|
|
3
3
|
import { SeoQPQWebServerConfigSetting } from './config/settings/seo';
|
|
4
|
+
import { SubdomainRedirectQPQWebServerConfigSetting } from './config/settings/subdomainRedirect';
|
|
4
5
|
import { OpenApiQPQWebServerConfigSetting } from './config/settings/openApi';
|
|
5
6
|
import { HttpEventHeaders, HTTPEventParams, HTTPEventResponse } from './types/HTTPEvent';
|
|
6
7
|
import { RouteOptions } from './config/settings/route';
|
|
@@ -10,6 +11,7 @@ export declare const getDeployRegion: (configs: QPQConfig) => string;
|
|
|
10
11
|
export declare const getAllOpenApiSpecs: (configs: QPQConfig) => OpenApiQPQWebServerConfigSetting[];
|
|
11
12
|
export declare const getAllSrcEntries: (configs: QPQConfig) => string[];
|
|
12
13
|
export declare const getDomainName: (configs: QPQConfig) => string;
|
|
14
|
+
export declare const getSubdomainRedirects: (configs: QPQConfig) => SubdomainRedirectQPQWebServerConfigSetting[];
|
|
13
15
|
export declare const getFeatureDomainName: (configs: QPQConfig) => string;
|
|
14
16
|
export declare const getHeaderValue: (header: string, headers: HttpEventHeaders) => string | null;
|
|
15
17
|
export declare const getAllowedOrigins: (configs: QPQConfig, route: RouteOptions) => string[];
|
package/lib/qpqWebServerUtils.js
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.toJsonEventResponse = exports.fromJsonEventRequest = exports.getCorsHeaders = exports.getAllowedOrigins = exports.getHeaderValue = exports.getFeatureDomainName = exports.getDomainName = exports.getAllSrcEntries = exports.getAllOpenApiSpecs = exports.getDeployRegion = exports.getAllSeo = exports.getAllRoutes = void 0;
|
|
3
|
+
exports.toJsonEventResponse = exports.fromJsonEventRequest = exports.getCorsHeaders = exports.getAllowedOrigins = exports.getHeaderValue = exports.getFeatureDomainName = exports.getSubdomainRedirects = 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");
|
|
@@ -40,6 +40,11 @@ const getDomainName = (configs) => {
|
|
|
40
40
|
return (dnsSettings === null || dnsSettings === void 0 ? void 0 : dnsSettings.dnsBase) || '';
|
|
41
41
|
};
|
|
42
42
|
exports.getDomainName = getDomainName;
|
|
43
|
+
const getSubdomainRedirects = (configs) => {
|
|
44
|
+
const subdomainRedirects = quidproquo_core_1.qpqCoreUtils.getConfigSettings(configs, QPQConfig_1.QPQWebServerConfigSettingType.SubdomainRedirect);
|
|
45
|
+
return subdomainRedirects;
|
|
46
|
+
};
|
|
47
|
+
exports.getSubdomainRedirects = getSubdomainRedirects;
|
|
43
48
|
const getFeatureDomainName = (configs) => {
|
|
44
49
|
const feature = (0, qpqCoreUtils_1.getAppFeature)(configs);
|
|
45
50
|
const apexDomainName = (0, exports.getDomainName)(configs);
|