@nu-art/build-and-install 0.203.128 → 0.203.130
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/defaults/.firebase_config/database.rules.json +7 -0
- package/defaults/.firebase_config/firestore.indexes.json +4 -0
- package/defaults/.firebase_config/firestore.rules +8 -0
- package/defaults/.firebase_config/storage.rules +8 -0
- package/defaults/backend-proxy/proxy._ts +64 -0
- package/package.json +3 -3
- package/tsconfig.json +21 -0
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
import * as express from 'express';
|
|
2
|
+
import * as request from 'request';
|
|
3
|
+
import * as fs from 'fs';
|
|
4
|
+
|
|
5
|
+
|
|
6
|
+
const _express: express.Express = express();
|
|
7
|
+
let _counter = 0;
|
|
8
|
+
_express.all('*', (req, res) => {
|
|
9
|
+
const counter = ++_counter;
|
|
10
|
+
const qMark = req.originalUrl.indexOf('?');
|
|
11
|
+
const query = qMark > 1 ? req.originalUrl.substring(qMark) : '';
|
|
12
|
+
const path = req.path;
|
|
13
|
+
let url = `http://127.0.0.1:SERVER_PORT/shopify-manager-tool-dev/us-central1/api${path}${query}`;
|
|
14
|
+
if (path.startsWith('/emulatorDownload') || path.startsWith('/emulatorUpload'))
|
|
15
|
+
url = `http://127.0.0.1:SERVER_PORT/shopify-manager-tool-dev/us-central1${path}${query}`;
|
|
16
|
+
|
|
17
|
+
console.log(`PROXY ${counter} - [${req.method}] ${url}`);
|
|
18
|
+
|
|
19
|
+
try {
|
|
20
|
+
let reqContent;
|
|
21
|
+
if (req.method === 'POST') {
|
|
22
|
+
reqContent = request.post({uri: url, body: req.body});
|
|
23
|
+
} else if (req.method === 'PUT') {
|
|
24
|
+
reqContent = request.put({uri: url, body: req.body});
|
|
25
|
+
} else if (req.method === 'GET') {
|
|
26
|
+
reqContent = request.get(url);
|
|
27
|
+
} else if (req.method === 'DELETE') {
|
|
28
|
+
reqContent = request.delete(url);
|
|
29
|
+
} else if (req.method === 'HEAD') {
|
|
30
|
+
reqContent = request.head(url);
|
|
31
|
+
} else {
|
|
32
|
+
reqContent = request(url);
|
|
33
|
+
}
|
|
34
|
+
|
|
35
|
+
req.pipe(reqContent).pipe(res, {end: true});
|
|
36
|
+
console.log(`PROXY ${counter} - END`);
|
|
37
|
+
} catch (e) {
|
|
38
|
+
console.log(`ERROR calling: ${url}`, e);
|
|
39
|
+
res.end(500);
|
|
40
|
+
}
|
|
41
|
+
});
|
|
42
|
+
|
|
43
|
+
const ssl = {
|
|
44
|
+
key: 'PATH_TO_SSL_KEY',
|
|
45
|
+
cert: 'PATH_TO_SSL_CERTIFICATE'
|
|
46
|
+
};
|
|
47
|
+
|
|
48
|
+
let key = ssl.key;
|
|
49
|
+
if (!ssl.key.startsWith('-----BEGIN'))
|
|
50
|
+
key = fs.readFileSync(ssl.key, 'utf8');
|
|
51
|
+
|
|
52
|
+
let cert = ssl.cert;
|
|
53
|
+
if (!ssl.cert.startsWith('-----BEGIN'))
|
|
54
|
+
cert = fs.readFileSync(ssl.cert, 'utf8');
|
|
55
|
+
|
|
56
|
+
const options = {
|
|
57
|
+
key: key,
|
|
58
|
+
cert: cert,
|
|
59
|
+
rejectUnauthorized: false,
|
|
60
|
+
requestCert: false,
|
|
61
|
+
};
|
|
62
|
+
|
|
63
|
+
require('https').createServer(options, _express).listen(8008);
|
|
64
|
+
console.log('SSL proxy started!!!');
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@nu-art/build-and-install",
|
|
3
|
-
"version": "0.203.
|
|
3
|
+
"version": "0.203.130",
|
|
4
4
|
"description": "",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"TacB0sS",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
34
|
"chokidar": "^3.6.0",
|
|
35
|
-
"@nu-art/ts-common": "0.203.
|
|
36
|
-
"@nu-art/commando": "0.203.
|
|
35
|
+
"@nu-art/ts-common": "0.203.130",
|
|
36
|
+
"@nu-art/commando": "0.203.130"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^18.0.0"
|
package/tsconfig.json
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
{
|
|
2
|
+
"compilerOptions": {
|
|
3
|
+
"target": "es2017",
|
|
4
|
+
"jsx": "react",
|
|
5
|
+
"lib": [
|
|
6
|
+
"es5",
|
|
7
|
+
"es6",
|
|
8
|
+
"es7",
|
|
9
|
+
"dom"
|
|
10
|
+
],
|
|
11
|
+
"declaration": true,
|
|
12
|
+
"experimentalDecorators": true,
|
|
13
|
+
"moduleResolution": "node",
|
|
14
|
+
"noUnusedLocals": true,
|
|
15
|
+
"module": "commonjs",
|
|
16
|
+
"sourceMap": false,
|
|
17
|
+
"strict": true
|
|
18
|
+
},
|
|
19
|
+
"esModuleInterop": true,
|
|
20
|
+
"module": "ES2020"
|
|
21
|
+
}
|