jp.ms.common.modules 1.0.4 → 1.0.6
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/dist/config/cert.d.ts +6 -0
- package/dist/config/cert.js +16 -0
- package/dist/config/cert.js.map +1 -0
- package/dist/config/cors.d.ts +5 -0
- package/dist/config/cors.js +15 -0
- package/dist/config/cors.js.map +1 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.js +5 -1
- package/dist/config/index.js.map +1 -1
- package/dist/tsconfig.tsbuildinfo +1 -1
- package/package.json +1 -1
- package/src/config/cert.ts +13 -0
- package/src/config/cors.ts +13 -0
- package/src/config/index.ts +2 -0
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCertificate = getCertificate;
|
|
4
|
+
const process = require("process");
|
|
5
|
+
const fs = require("fs");
|
|
6
|
+
function getCertificate() {
|
|
7
|
+
if (process.env.NODE_ENV === 'prod') {
|
|
8
|
+
return {
|
|
9
|
+
httpsOptions: {
|
|
10
|
+
key: fs.readFileSync(process.env.SSL_PRIVATE_KEY_PATH ?? ''),
|
|
11
|
+
cert: fs.readFileSync(process.env.SSL_CERT_PATH ?? ''),
|
|
12
|
+
},
|
|
13
|
+
};
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
//# sourceMappingURL=cert.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cert.js","sourceRoot":"","sources":["../../src/config/cert.ts"],"names":[],"mappings":";;AAGA,wCASC;AAZD,mCAAmC;AACnC,yBAAyB;AAEzB,SAAgB,cAAc;IAC5B,IAAI,OAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;QACpC,OAAO;YACL,YAAY,EAAE;gBACZ,GAAG,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,EAAE,CAAC;gBAC5D,IAAI,EAAE,EAAE,CAAC,YAAY,CAAC,OAAO,CAAC,GAAG,CAAC,aAAa,IAAI,EAAE,CAAC;aACvD;SACF,CAAC;IACJ,CAAC;AACH,CAAC"}
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
+
exports.getCors = getCors;
|
|
4
|
+
const process_1 = require("process");
|
|
5
|
+
function getCors() {
|
|
6
|
+
if (process_1.default.env.NODE_ENV === 'prod') {
|
|
7
|
+
return {
|
|
8
|
+
origin: [new RegExp(process_1.default.env.CORS_ADDRESS ?? '')],
|
|
9
|
+
methods: ['GET', 'POST', 'PUT', 'DELETE', 'PATCH', 'OPTIONS'],
|
|
10
|
+
credentials: true,
|
|
11
|
+
};
|
|
12
|
+
}
|
|
13
|
+
return null;
|
|
14
|
+
}
|
|
15
|
+
//# sourceMappingURL=cors.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"cors.js","sourceRoot":"","sources":["../../src/config/cors.ts"],"names":[],"mappings":";;AAEA,0BAUC;AAZD,qCAA8B;AAE9B,SAAgB,OAAO;IACrB,IAAI,iBAAO,CAAC,GAAG,CAAC,QAAQ,KAAK,MAAM,EAAE,CAAC;QACpC,OAAO;YACL,MAAM,EAAE,CAAC,IAAI,MAAM,CAAC,iBAAO,CAAC,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;YACpD,OAAO,EAAE,CAAC,KAAK,EAAE,MAAM,EAAE,KAAK,EAAE,QAAQ,EAAE,OAAO,EAAE,SAAS,CAAC;YAC7D,WAAW,EAAE,IAAI;SAClB,CAAA;IACH,CAAC;IAED,OAAO,IAAI,CAAC;AACd,CAAC"}
|
package/dist/config/index.d.ts
CHANGED
package/dist/config/index.js
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.getDatabaseConfig = exports.getLocaleConfig = exports.getMenuConfig = void 0;
|
|
3
|
+
exports.getCors = exports.getCertificate = exports.getDatabaseConfig = exports.getLocaleConfig = exports.getMenuConfig = void 0;
|
|
4
4
|
var menu_1 = require("./menu");
|
|
5
5
|
Object.defineProperty(exports, "getMenuConfig", { enumerable: true, get: function () { return menu_1.getMenuConfig; } });
|
|
6
6
|
var locale_1 = require("./locale");
|
|
7
7
|
Object.defineProperty(exports, "getLocaleConfig", { enumerable: true, get: function () { return locale_1.getLocaleConfig; } });
|
|
8
8
|
var database_1 = require("./database");
|
|
9
9
|
Object.defineProperty(exports, "getDatabaseConfig", { enumerable: true, get: function () { return database_1.getDatabaseConfig; } });
|
|
10
|
+
var cert_1 = require("./cert");
|
|
11
|
+
Object.defineProperty(exports, "getCertificate", { enumerable: true, get: function () { return cert_1.getCertificate; } });
|
|
12
|
+
var cors_1 = require("./cors");
|
|
13
|
+
Object.defineProperty(exports, "getCors", { enumerable: true, get: function () { return cors_1.getCors; } });
|
|
10
14
|
//# sourceMappingURL=index.js.map
|
package/dist/config/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":";;;AAAA,+BAAuC;AAA9B,qGAAA,aAAa,OAAA;AACtB,mCAA2C;AAAlC,yGAAA,eAAe,OAAA;AACxB,uCAA+C;AAAtC,6GAAA,iBAAiB,OAAA"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../src/config/index.ts"],"names":[],"mappings":";;;AAAA,+BAAuC;AAA9B,qGAAA,aAAa,OAAA;AACtB,mCAA2C;AAAlC,yGAAA,eAAe,OAAA;AACxB,uCAA+C;AAAtC,6GAAA,iBAAiB,OAAA;AAC1B,+BAAwC;AAA/B,sGAAA,cAAc,OAAA;AACvB,+BAAiC;AAAxB,+FAAA,OAAO,OAAA"}
|