@ms-cloudpack/create-express-app 1.3.8 → 1.3.10

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.
@@ -10,7 +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
+ // eslint-disable-next-line @ms-cloudpack/internal/no-sync-filesystem
14
14
  sslOptions[key] = fs.readFileSync(certFilePath);
15
15
  }
16
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,gDAAgD;gBAChD,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;aACjD;iBAAM;gBACL,MAAM,IAAI,KAAK,CACb,0EAA0E,YAAY,4EAA4E,CACnK,CAAC;aACH;SACF;aAAM;YACL,4CAA4C;YAC5C,UAAU,CAAC,GAAG,CAAC,GAAG,KAA6B,CAAC;SACjD;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 new Error(\n `The specified certificate to be used for the web server is missing at \"${certFilePath}\". Make sure the path is correct, the file exists, and try starting again.`,\n );\n }\n } else {\n // If not a certificate, just use the value.\n sslOptions[key] = value as ValueOf<HttpsConfig>;\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,qEAAqE;gBACrE,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;aACjD;iBAAM;gBACL,MAAM,IAAI,KAAK,CACb,0EAA0E,YAAY,4EAA4E,CACnK,CAAC;aACH;SACF;aAAM;YACL,4CAA4C;YAC5C,UAAU,CAAC,GAAG,CAAC,GAAG,KAA6B,CAAC;SACjD;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 @ms-cloudpack/internal/no-sync-filesystem\n sslOptions[key] = fs.readFileSync(certFilePath);\n } else {\n throw new Error(\n `The specified certificate to be used for the web server is missing at \"${certFilePath}\". Make sure the path is correct, the file exists, and try starting again.`,\n );\n }\n } else {\n // If not a certificate, just use the value.\n sslOptions[key] = value as ValueOf<HttpsConfig>;\n }\n }\n return sslOptions;\n}\n"]}
@@ -5,7 +5,7 @@
5
5
  "toolPackages": [
6
6
  {
7
7
  "packageName": "@microsoft/api-extractor",
8
- "packageVersion": "7.36.1"
8
+ "packageVersion": "7.36.4"
9
9
  }
10
10
  ]
11
11
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ms-cloudpack/create-express-app",
3
- "version": "1.3.8",
3
+ "version": "1.3.10",
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.3.1",
16
+ "@ms-cloudpack/path-utilities": "^2.3.3",
17
17
  "@types/express": "^4.17.16",
18
18
  "compression": "^1.7.4",
19
19
  "cors": "^2.8.5",