@ms-cloudpack/create-express-app 1.10.78 → 1.10.80

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 +1 @@
1
- {"version":3,"file":"parseHttpsConfig.js","sourceRoot":"","sources":["../src/parseHttpsConfig.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAI/D;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAItC;IACC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;IAE/B,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;QAElD,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CACb,wCAAwC,OAAO,CAAC,MAAM,8EAA8E,CACrI,CAAC;QACJ,CAAC;QAED,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,MAAM,UAAU,GAAyC,EAAE,CAAC;IAE5D,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;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,CAAC;YAC5E,kDAAkD;YAClD,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAE5E,IAAI,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;gBAChC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;YAClD,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CACb,0EAA0E,YAAY,QAAQ;oBAC5F,uIAAuI,CAC1I,CAAC;YACJ,CAAC;QACH,CAAC;aAAM,CAAC;YACN,4CAA4C;YAC5C,UAAU,CAAC,GAAG,CAAC,GAAG,KAA6B,CAAC;QAClD,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import path from 'path';\nimport fs from 'fs';\nimport type { HttpsConfig } from '@ms-cloudpack/common-types';\nimport { pathSymbolReplacement } from '@ms-cloudpack/path-utilities';\nimport { slash } from '@ms-cloudpack/path-string-parsing';\nimport { getCertificate } from '@ms-cloudpack/setup-utilities';\n\ntype ValueOf<T> = T[keyof T];\n\n/**\n * Read certificates files in Https Config and return the contents.\n *\n * Note: If you update the errors thrown by this function, also update the ones in `handleKnownParseHttpsErrors.ts`.\n */\nexport async function parseHttpsConfig(options: {\n domain?: string;\n https: true | HttpsConfig;\n cwd: string;\n}): Promise<HttpsConfig> {\n const { https, cwd } = options;\n\n if (https === true) {\n const httpsConfig = await getCertificate(options);\n\n if (!httpsConfig) {\n throw new Error(\n `No certificate found for the domain \"${options.domain}\". Make sure you have a valid certificate in the cloudpack.config.json file.`,\n );\n }\n\n return httpsConfig;\n }\n\n const sslOptions: Record<string, ValueOf<HttpsConfig>> = {};\n\n for (const [key, value] of Object.entries(https)) {\n // Read the file contents for the certificates.\n if (['ca', 'cert', 'key', 'pfx'].includes(key) && typeof value === 'string') {\n // Get a standard path with expanded path symbols.\n const certFilePath = slash(path.resolve(cwd, pathSymbolReplacement(value)));\n\n if (fs.existsSync(certFilePath)) {\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}\".\\n\\n` +\n 'Make sure the path is correct, the necessary setup to install the certificate has been done, 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,IAAI,MAAM,MAAM,CAAC;AACxB,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,EAAE,qBAAqB,EAAE,MAAM,8BAA8B,CAAC;AACrE,OAAO,EAAE,KAAK,EAAE,MAAM,mCAAmC,CAAC;AAC1D,OAAO,EAAE,cAAc,EAAE,MAAM,+BAA+B,CAAC;AAI/D;;;;GAIG;AACH,MAAM,CAAC,KAAK,UAAU,gBAAgB,CAAC,OAItC;IACC,MAAM,EAAE,KAAK,EAAE,GAAG,EAAE,GAAG,OAAO,CAAC;IAE/B,IAAI,KAAK,KAAK,IAAI,EAAE,CAAC;QACnB,MAAM,WAAW,GAAG,MAAM,cAAc,CAAC,OAAO,CAAC,CAAC;QAElD,IAAI,CAAC,WAAW,EAAE,CAAC;YACjB,MAAM,IAAI,KAAK,CACb,wCAAwC,OAAO,CAAC,MAAM,8EAA8E,CACrI,CAAC;QACJ,CAAC;QAED,OAAO,WAAW,CAAC;IACrB,CAAC;IAED,MAAM,UAAU,GAAyC,EAAE,CAAC;IAE5D,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;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,CAAC;YAC5E,kDAAkD;YAClD,MAAM,YAAY,GAAG,KAAK,CAAC,IAAI,CAAC,OAAO,CAAC,GAAG,EAAE,qBAAqB,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;YAE5E,IAAI,EAAE,CAAC,UAAU,CAAC,YAAY,CAAC,EAAE,CAAC;gBAChC,UAAU,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,YAAY,CAAC,YAAY,CAAC,CAAC;YAClD,CAAC;iBAAM,CAAC;gBACN,MAAM,IAAI,KAAK,CACb,0EAA0E,YAAY,QAAQ;oBAC5F,uIAAuI,CAC1I,CAAC;YACJ,CAAC;QACH,CAAC;aAAM,CAAC;YACN,4CAA4C;YAC5C,UAAU,CAAC,GAAG,CAAC,GAAG,KAAK,CAAC;QAC1B,CAAC;IACH,CAAC;IACD,OAAO,UAAU,CAAC;AACpB,CAAC","sourcesContent":["import path from 'path';\nimport fs from 'fs';\nimport type { HttpsConfig } from '@ms-cloudpack/common-types';\nimport { pathSymbolReplacement } from '@ms-cloudpack/path-utilities';\nimport { slash } from '@ms-cloudpack/path-string-parsing';\nimport { getCertificate } from '@ms-cloudpack/setup-utilities';\n\ntype ValueOf<T> = T[keyof T];\n\n/**\n * Read certificates files in Https Config and return the contents.\n *\n * Note: If you update the errors thrown by this function, also update the ones in `handleKnownParseHttpsErrors.ts`.\n */\nexport async function parseHttpsConfig(options: {\n domain?: string;\n https: true | HttpsConfig;\n cwd: string;\n}): Promise<HttpsConfig> {\n const { https, cwd } = options;\n\n if (https === true) {\n const httpsConfig = await getCertificate(options);\n\n if (!httpsConfig) {\n throw new Error(\n `No certificate found for the domain \"${options.domain}\". Make sure you have a valid certificate in the cloudpack.config.json file.`,\n );\n }\n\n return httpsConfig;\n }\n\n const sslOptions: Record<string, ValueOf<HttpsConfig>> = {};\n\n for (const [key, value] of Object.entries(https)) {\n // Read the file contents for the certificates.\n if (['ca', 'cert', 'key', 'pfx'].includes(key) && typeof value === 'string') {\n // Get a standard path with expanded path symbols.\n const certFilePath = slash(path.resolve(cwd, pathSymbolReplacement(value)));\n\n if (fs.existsSync(certFilePath)) {\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}\".\\n\\n` +\n 'Make sure the path is correct, the necessary setup to install the certificate has been done, the file exists, and try starting again.',\n );\n }\n } else {\n // If not a certificate, just use the value.\n sslOptions[key] = 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.10.78",
3
+ "version": "1.10.80",
4
4
  "description": "Helper for creating an Express server, abstracting a common plugin setup",
5
5
  "license": "MIT",
6
6
  "type": "module",
@@ -24,10 +24,10 @@
24
24
  "test": "cloudpack-scripts test"
25
25
  },
26
26
  "dependencies": {
27
- "@ms-cloudpack/common-types": "^0.34.3",
28
- "@ms-cloudpack/path-string-parsing": "^1.3.3",
29
- "@ms-cloudpack/path-utilities": "^3.2.14",
30
- "@ms-cloudpack/setup-utilities": "^0.5.61",
27
+ "@ms-cloudpack/common-types": "^0.34.5",
28
+ "@ms-cloudpack/path-string-parsing": "^1.3.5",
29
+ "@ms-cloudpack/path-utilities": "^3.2.16",
30
+ "@ms-cloudpack/setup-utilities": "^0.5.63",
31
31
  "@types/express": "^4.17.16",
32
32
  "compression": "^1.7.4",
33
33
  "cors": "^2.8.5",