quidproquo-webserver
Advanced tools
Comparing version 0.0.51 to 0.0.52
@@ -7,4 +7,5 @@ export declare enum QPQWebServerConfigSettingType { | ||
Seo = "@quidproquo-webserver/config/Seo", | ||
DeployRegion = "@quidproquo-webserver/config/DeployRegion", | ||
SubdomainRedirect = "@quidproquo-webserver/config/SubdomainRedirect" | ||
SubdomainRedirect = "@quidproquo-webserver/config/SubdomainRedirect", | ||
WebEntry = "@quidproquo-webserver/config/WebEntry", | ||
Api = "@quidproquo-webserver/config/Api" | ||
} |
@@ -11,4 +11,5 @@ "use strict"; | ||
QPQWebServerConfigSettingType["Seo"] = "@quidproquo-webserver/config/Seo"; | ||
QPQWebServerConfigSettingType["DeployRegion"] = "@quidproquo-webserver/config/DeployRegion"; | ||
QPQWebServerConfigSettingType["SubdomainRedirect"] = "@quidproquo-webserver/config/SubdomainRedirect"; | ||
QPQWebServerConfigSettingType["WebEntry"] = "@quidproquo-webserver/config/WebEntry"; | ||
QPQWebServerConfigSettingType["Api"] = "@quidproquo-webserver/config/Api"; | ||
})(QPQWebServerConfigSettingType = exports.QPQWebServerConfigSettingType || (exports.QPQWebServerConfigSettingType = {})); |
@@ -6,2 +6,2 @@ import { QPQConfigSetting } from 'quidproquo-core'; | ||
} | ||
export declare const defineDefaultRouteOptions: (routeOptions: RouteOptions) => DefaultRouteOptionsQPQWebServerConfigSetting; | ||
export declare const defineDefaultRouteOptions: (groupName: string, routeOptions: RouteOptions) => DefaultRouteOptionsQPQWebServerConfigSetting; |
@@ -5,6 +5,7 @@ "use strict"; | ||
const QPQConfig_1 = require("../QPQConfig"); | ||
const defineDefaultRouteOptions = (routeOptions) => ({ | ||
const defineDefaultRouteOptions = (groupName, routeOptions) => ({ | ||
configSettingType: QPQConfig_1.QPQWebServerConfigSettingType.DefaultRouteOptions, | ||
uniqueKey: groupName, | ||
routeOptions, | ||
}); | ||
exports.defineDefaultRouteOptions = defineDefaultRouteOptions; |
@@ -1,2 +0,2 @@ | ||
import { QPQConfigSetting } from "quidproquo-core"; | ||
import { QPQConfigSetting } from 'quidproquo-core'; | ||
export interface DnsQPQWebServerConfigSetting extends QPQConfigSetting { | ||
@@ -3,0 +3,0 @@ dnsBase: string; |
@@ -7,4 +7,5 @@ "use strict"; | ||
configSettingType: QPQConfig_1.QPQWebServerConfigSettingType.Dns, | ||
uniqueKey: dnsBase, | ||
dnsBase, | ||
}); | ||
exports.defineDns = defineDns; |
@@ -0,3 +1,3 @@ | ||
export * from './api'; | ||
export * from './defaultRouteOptions'; | ||
export * from './deployRegion'; | ||
export * from './dns'; | ||
@@ -8,1 +8,2 @@ export * from './openApi'; | ||
export * from './subdomainRedirect'; | ||
export * from './webEntry'; |
@@ -17,4 +17,4 @@ "use strict"; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
__exportStar(require("./api"), exports); | ||
__exportStar(require("./defaultRouteOptions"), exports); | ||
__exportStar(require("./deployRegion"), exports); | ||
__exportStar(require("./dns"), exports); | ||
@@ -25,1 +25,2 @@ __exportStar(require("./openApi"), exports); | ||
__exportStar(require("./subdomainRedirect"), exports); | ||
__exportStar(require("./webEntry"), exports); |
@@ -8,2 +8,3 @@ "use strict"; | ||
configSettingType: QPQConfig_1.QPQWebServerConfigSettingType.OpenApi, | ||
uniqueKey: openApiSpecPath, | ||
openApiSpecPath, | ||
@@ -10,0 +11,0 @@ }; |
@@ -7,2 +7,3 @@ "use strict"; | ||
configSettingType: QPQConfig_1.QPQWebServerConfigSettingType.Route, | ||
uniqueKey: runtime, | ||
method, | ||
@@ -9,0 +10,0 @@ path, |
@@ -7,2 +7,3 @@ "use strict"; | ||
configSettingType: QPQConfig_1.QPQWebServerConfigSettingType.Seo, | ||
uniqueKey: runtime, | ||
path, | ||
@@ -9,0 +10,0 @@ src, |
@@ -7,2 +7,3 @@ "use strict"; | ||
configSettingType: QPQConfig_1.QPQWebServerConfigSettingType.SubdomainRedirect, | ||
uniqueKey: subdomain, | ||
subdomain, | ||
@@ -9,0 +10,0 @@ redirectUrl, |
@@ -8,10 +8,15 @@ import { QPQConfig } from 'quidproquo-core'; | ||
import { RouteOptions } from './config/settings/route'; | ||
import { WebEntryQPQWebServerConfigSetting, ApiQPQWebServerConfigSetting } from './config'; | ||
export declare const getAllRoutes: (configs: QPQConfig) => RouteQPQWebServerConfigSetting[]; | ||
export declare const getAllSeo: (configs: QPQConfig) => SeoQPQWebServerConfigSetting[]; | ||
export declare const getDeployRegion: (configs: QPQConfig) => string; | ||
export declare const getAllOpenApiSpecs: (configs: QPQConfig) => OpenApiQPQWebServerConfigSetting[]; | ||
export declare const getAllSrcEntries: (configs: QPQConfig) => string[]; | ||
export declare const getDomainName: (configs: QPQConfig) => string; | ||
export declare const getWebEntry: (configs: QPQConfig) => string; | ||
export declare const getWebEntryFullPath: (qpqConfig: QPQConfig, webEntryQPQWebServerConfigSetting: WebEntryQPQWebServerConfigSetting) => string; | ||
export declare const getWebEntrySeoFullPath: (qpqConfig: QPQConfig, webEntryQPQWebServerConfigSetting: WebEntryQPQWebServerConfigSetting) => string; | ||
export declare const getApiEntryFullPath: (qpqConfig: QPQConfig, apiConfig: ApiQPQWebServerConfigSetting) => string; | ||
export declare const getSubdomainRedirects: (configs: QPQConfig) => SubdomainRedirectQPQWebServerConfigSetting[]; | ||
export declare const getFeatureDomainName: (configs: QPQConfig) => string; | ||
export declare const getServiceDomainName: (qpqConfig: QPQConfig) => string; | ||
export declare const getHeaderValue: (header: string, headers: HttpEventHeaders) => string | null; | ||
@@ -18,0 +23,0 @@ export declare const getAllowedOrigins: (configs: QPQConfig, route: RouteOptions) => string[]; |
"use strict"; | ||
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
var desc = Object.getOwnPropertyDescriptor(m, k); | ||
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) { | ||
desc = { enumerable: true, get: function() { return m[k]; } }; | ||
} | ||
Object.defineProperty(o, k2, desc); | ||
}) : (function(o, m, k, k2) { | ||
if (k2 === undefined) k2 = k; | ||
o[k2] = m[k]; | ||
})); | ||
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) { | ||
Object.defineProperty(o, "default", { enumerable: true, value: v }); | ||
}) : function(o, v) { | ||
o["default"] = v; | ||
}); | ||
var __importStar = (this && this.__importStar) || function (mod) { | ||
if (mod && mod.__esModule) return mod; | ||
var result = {}; | ||
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k); | ||
__setModuleDefault(result, mod); | ||
return result; | ||
}; | ||
Object.defineProperty(exports, "__esModule", { value: true }); | ||
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; | ||
exports.toJsonEventResponse = exports.fromJsonEventRequest = exports.getCorsHeaders = exports.getAllowedOrigins = exports.getHeaderValue = exports.getServiceDomainName = exports.getFeatureDomainName = exports.getSubdomainRedirects = exports.getApiEntryFullPath = exports.getWebEntrySeoFullPath = exports.getWebEntryFullPath = exports.getWebEntry = exports.getDomainName = exports.getAllSrcEntries = exports.getAllOpenApiSpecs = exports.getAllSeo = exports.getAllRoutes = void 0; | ||
const path = __importStar(require("path")); | ||
const quidproquo_core_1 = require("quidproquo-core"); | ||
@@ -17,8 +41,2 @@ const QPQConfig_1 = require("./config/QPQConfig"); | ||
exports.getAllSeo = getAllSeo; | ||
const getDeployRegion = (configs) => { | ||
var _a; | ||
const deployRegions = quidproquo_core_1.qpqCoreUtils.getConfigSettings(configs, QPQConfig_1.QPQWebServerConfigSettingType.DeployRegion); | ||
return ((_a = deployRegions[0]) === null || _a === void 0 ? void 0 : _a.deployRegion) || 'ap-southeast-2'; | ||
}; | ||
exports.getDeployRegion = getDeployRegion; | ||
const getAllOpenApiSpecs = (configs) => { | ||
@@ -44,2 +62,26 @@ const openApiSpecs = quidproquo_core_1.qpqCoreUtils.getConfigSettings(configs, QPQConfig_1.QPQWebServerConfigSettingType.OpenApi); | ||
exports.getDomainName = getDomainName; | ||
const getWebEntry = (configs) => { | ||
const webEntry = quidproquo_core_1.qpqCoreUtils.getConfigSetting(configs, QPQConfig_1.QPQWebServerConfigSettingType.WebEntry); | ||
if (!(webEntry === null || webEntry === void 0 ? void 0 : webEntry.buildPath)) { | ||
throw new Error('please use defineWebEntry in your qpq config'); | ||
} | ||
return webEntry === null || webEntry === void 0 ? void 0 : webEntry.buildPath; | ||
}; | ||
exports.getWebEntry = getWebEntry; | ||
const getWebEntryFullPath = (qpqConfig, webEntryQPQWebServerConfigSetting) => { | ||
return path.join(quidproquo_core_1.qpqCoreUtils.getConfigRoot(qpqConfig), webEntryQPQWebServerConfigSetting.buildPath); | ||
}; | ||
exports.getWebEntryFullPath = getWebEntryFullPath; | ||
const getWebEntrySeoFullPath = (qpqConfig, webEntryQPQWebServerConfigSetting) => { | ||
return path.join(quidproquo_core_1.qpqCoreUtils.getConfigRoot(qpqConfig), webEntryQPQWebServerConfigSetting.seoBuildPath || webEntryQPQWebServerConfigSetting.buildPath); | ||
}; | ||
exports.getWebEntrySeoFullPath = getWebEntrySeoFullPath; | ||
const getApiEntryFullPath = (qpqConfig, apiConfig) => { | ||
const apiEntry = apiConfig.buildPath; | ||
if (!apiEntry) { | ||
throw new Error('please use defineWebEntry in your qpq config'); | ||
} | ||
return path.join(quidproquo_core_1.qpqCoreUtils.getConfigRoot(qpqConfig), apiEntry); | ||
}; | ||
exports.getApiEntryFullPath = getApiEntryFullPath; | ||
const getSubdomainRedirects = (configs) => { | ||
@@ -59,2 +101,8 @@ const subdomainRedirects = quidproquo_core_1.qpqCoreUtils.getConfigSettings(configs, QPQConfig_1.QPQWebServerConfigSettingType.SubdomainRedirect); | ||
exports.getFeatureDomainName = getFeatureDomainName; | ||
const getServiceDomainName = (qpqConfig) => { | ||
const appName = quidproquo_core_1.qpqCoreUtils.getAppName(qpqConfig); | ||
const featureDomain = (0, exports.getFeatureDomainName)(qpqConfig); | ||
return `${appName}.${featureDomain}`; | ||
}; | ||
exports.getServiceDomainName = getServiceDomainName; | ||
const getHeaderValue = (header, headers) => { | ||
@@ -61,0 +109,0 @@ const headerAsLower = header.toLowerCase(); |
{ | ||
"name": "quidproquo-webserver", | ||
"version": "0.0.51", | ||
"version": "0.0.52", | ||
"description": "", | ||
@@ -5,0 +5,0 @@ "main": "./lib/index.js", |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
32261
50
648