@nu-art/build-and-install 0.204.20 → 0.204.21

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.
@@ -0,0 +1,7 @@
1
+ {
2
+ "rules": {
3
+ ".read": false,
4
+ ".write": false
5
+ }
6
+ }
7
+
@@ -0,0 +1,4 @@
1
+ {
2
+ "indexes": [],
3
+ "fieldOverrides": []
4
+ }
@@ -0,0 +1,8 @@
1
+ rules_version = '2';
2
+ service cloud.firestore {
3
+ match /databases/{database}/documents {
4
+ match /{document=**} {
5
+ allow read, write: if false;
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,8 @@
1
+ rules_version = '2';
2
+ service firebase.storage {
3
+ match /b/{bucket}/o {
4
+ match /{allPaths=**} {
5
+ allow read, write: if request.auth!=null;
6
+ }
7
+ }
8
+ }
@@ -0,0 +1,64 @@
1
+ import express from 'express';
2
+ import 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.204.20",
3
+ "version": "0.204.21",
4
4
  "description": "",
5
5
  "keywords": [
6
6
  "TacB0sS",
package/tsconfig.json ADDED
@@ -0,0 +1,23 @@
1
+ {
2
+ "compilerOptions": {
3
+ "target": "es2017",
4
+ "jsx": "react",
5
+ "lib": [
6
+ "es5",
7
+ "es6",
8
+ "es7",
9
+ "dom"
10
+ ],
11
+ "declaration": true,
12
+ "resolveJsonModule": true,
13
+ "esModuleInterop": true,
14
+ "experimentalDecorators": true,
15
+ "moduleResolution": "node",
16
+ "noUnusedLocals": true,
17
+ "module": "commonjs",
18
+ "sourceMap": true,
19
+ "strict": true
20
+ },
21
+ "esModuleInterop": true,
22
+ "module": "ES2020"
23
+ }