@ms-cloudpack/create-express-app 1.3.1 → 1.3.3
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/parseHttpsConfig.js
CHANGED
|
@@ -10,6 +10,7 @@ export function parseHttpsConfig(config) {
|
|
|
10
10
|
if (['ca', 'cert', 'key', 'pfx'].includes(key) && typeof value === 'string') {
|
|
11
11
|
const certFilePath = pathSymbolReplacement(value);
|
|
12
12
|
if (fs.existsSync(certFilePath)) {
|
|
13
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
13
14
|
sslOptions[key] = fs.readFileSync(certFilePath);
|
|
14
15
|
}
|
|
15
16
|
else {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"parseHttpsConfig.js","sourceRoot":"","sources":["../src/parseHttpsConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAQrE;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAmB;IAClD,MAAM,UAAU,GAAyC,EAAE,CAAC;IAE5D,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACjD,+CAA+C;QAC/C,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC3E,MAAM,YAAY,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;YAClD,IAAI,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE;gBAC/B,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;aACjD;iBAAM;gBACL,MAAM,8BAA8B,GAAG,YAAY,CAAC;aACrD;SACF;aAAM;YACL,4CAA4C;YAC5C,UAAU,CAAC,GAAG,CAAC,GAAyB,KAAK,CAAC;SAC/C;KACF;IACD,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import fs from 'fs';\nimport { pathSymbolReplacement } from '@ms-cloudpack/path-utilities';\nimport type { ServerOptions } from 'https';\nimport type { IncomingMessage, ServerResponse } from 'http';\n\ntype ValueOf<T> = T[keyof T];\n\nexport type HttpsConfig = ServerOptions<typeof IncomingMessage, typeof ServerResponse>;\n\n/*\n * Read certificates files in Https Config and return the contents.\n */\nexport function parseHttpsConfig(config: HttpsConfig): HttpsConfig {\n const sslOptions: Record<string, ValueOf<HttpsConfig>> = {};\n\n for (const [key, value] of Object.entries(config)) {\n // Read the file contents for the certificates.\n if (['ca', 'cert', 'key', 'pfx'].includes(key) && typeof value === 'string') {\n const certFilePath = pathSymbolReplacement(value);\n if (fs.existsSync(certFilePath)) {\n sslOptions[key] = fs.readFileSync(certFilePath);\n } else {\n throw 'Certificate file not found: ' + certFilePath;\n }\n } else {\n // If not a certificate, just use the value.\n sslOptions[key] = <ValueOf<HttpsConfig>>value;\n }\n }\n return sslOptions;\n}\n"]}
|
|
1
|
+
{"version":3,"file":"parseHttpsConfig.js","sourceRoot":"","sources":["../src/parseHttpsConfig.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,IAAI,CAAC;AACpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AAQrE;;GAEG;AACH,MAAM,UAAU,gBAAgB,CAAC,MAAmB;IAClD,MAAM,UAAU,GAAyC,EAAE,CAAC;IAE5D,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,EAAE;QACjD,+CAA+C;QAC/C,IAAI,CAAC,IAAI,EAAE,MAAM,EAAE,KAAK,EAAE,KAAK,CAAC,CAAC,QAAQ,CAAC,GAAG,CAAC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;YAC3E,MAAM,YAAY,GAAG,qBAAqB,CAAC,KAAK,CAAC,CAAC;YAClD,IAAI,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE;gBAC/B,gDAAgD;gBAChD,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;aACjD;iBAAM;gBACL,MAAM,8BAA8B,GAAG,YAAY,CAAC;aACrD;SACF;aAAM;YACL,4CAA4C;YAC5C,UAAU,CAAC,GAAG,CAAC,GAAyB,KAAK,CAAC;SAC/C;KACF;IACD,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import fs from 'fs';\nimport { pathSymbolReplacement } from '@ms-cloudpack/path-utilities';\nimport type { ServerOptions } from 'https';\nimport type { IncomingMessage, ServerResponse } from 'http';\n\ntype ValueOf<T> = T[keyof T];\n\nexport type HttpsConfig = ServerOptions<typeof IncomingMessage, typeof ServerResponse>;\n\n/*\n * Read certificates files in Https Config and return the contents.\n */\nexport function parseHttpsConfig(config: HttpsConfig): HttpsConfig {\n const sslOptions: Record<string, ValueOf<HttpsConfig>> = {};\n\n for (const [key, value] of Object.entries(config)) {\n // Read the file contents for the certificates.\n if (['ca', 'cert', 'key', 'pfx'].includes(key) && typeof value === 'string') {\n const certFilePath = pathSymbolReplacement(value);\n if (fs.existsSync(certFilePath)) {\n // eslint-disable-next-line no-restricted-syntax\n sslOptions[key] = fs.readFileSync(certFilePath);\n } else {\n throw 'Certificate file not found: ' + certFilePath;\n }\n } else {\n // If not a certificate, just use the value.\n sslOptions[key] = <ValueOf<HttpsConfig>>value;\n }\n }\n return sslOptions;\n}\n"]}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ms-cloudpack/create-express-app",
|
|
3
|
-
"version": "1.3.
|
|
3
|
+
"version": "1.3.3",
|
|
4
4
|
"description": "Helper for creating an express app server, abstracting a common plugin setup.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"type": "module",
|
|
@@ -13,7 +13,7 @@
|
|
|
13
13
|
}
|
|
14
14
|
},
|
|
15
15
|
"dependencies": {
|
|
16
|
-
"@ms-cloudpack/path-utilities": "^2.1
|
|
16
|
+
"@ms-cloudpack/path-utilities": "^2.2.1",
|
|
17
17
|
"@types/express": "^4.17.16",
|
|
18
18
|
"compression": "^1.7.4",
|
|
19
19
|
"cors": "^2.8.5",
|