jscrambler 6.0.4 → 6.1.2
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/LICENSE-MIT +1 -1
- package/README.md +1 -0
- package/dist/bin/jscrambler.js +108 -131
- package/dist/cleanup-input-fields.js +4 -7
- package/dist/cli.js +8 -13
- package/dist/client.js +106 -85
- package/dist/config.js +7 -8
- package/dist/constants.js +10 -8
- package/dist/generate-signed-params.js +21 -26
- package/dist/get-protection-default-fragments.js +52 -50
- package/dist/index.js +1094 -1058
- package/dist/introspection.js +66 -66
- package/dist/mutations.js +81 -72
- package/dist/queries.js +39 -32
- package/dist/utils.js +24 -11
- package/dist/zip.js +152 -124
- package/package.json +8 -10
|
@@ -1,70 +1,76 @@
|
|
|
1
|
-
|
|
1
|
+
"use strict";
|
|
2
2
|
|
|
3
3
|
Object.defineProperty(exports, "__esModule", {
|
|
4
4
|
value: true
|
|
5
5
|
});
|
|
6
|
+
exports.default = _default;
|
|
6
7
|
|
|
7
|
-
var
|
|
8
|
+
var introspection = _interopRequireWildcard(require("./introspection"));
|
|
8
9
|
|
|
9
|
-
var
|
|
10
|
-
|
|
10
|
+
function _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== "function") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }
|
|
11
|
+
|
|
12
|
+
function _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== "object" && typeof obj !== "function") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== "default" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }
|
|
13
|
+
|
|
14
|
+
function _typeof(obj) { "@babel/helpers - typeof"; return _typeof = "function" == typeof Symbol && "symbol" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && "function" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }, _typeof(obj); }
|
|
15
|
+
|
|
16
|
+
function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { Promise.resolve(value).then(_next, _throw); } }
|
|
17
|
+
|
|
18
|
+
function _asyncToGenerator(fn) { return function () { var self = this, args = arguments; return new Promise(function (resolve, reject) { var gen = fn.apply(self, args); function _next(value) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "next", value); } function _throw(err) { asyncGeneratorStep(gen, resolve, reject, _next, _throw, "throw", err); } _next(undefined); }); }; }
|
|
19
|
+
|
|
20
|
+
function getIntrospection(_x, _x2) {
|
|
21
|
+
return _getIntrospection.apply(this, arguments);
|
|
22
|
+
}
|
|
23
|
+
|
|
24
|
+
function _getIntrospection() {
|
|
25
|
+
_getIntrospection = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(client, typeName) {
|
|
11
26
|
var _introspection;
|
|
12
27
|
|
|
13
28
|
return regeneratorRuntime.wrap(function _callee$(_context) {
|
|
14
29
|
while (1) {
|
|
15
30
|
switch (_context.prev = _context.next) {
|
|
16
31
|
case 0:
|
|
17
|
-
|
|
18
|
-
_context.
|
|
19
|
-
_context.next = 4;
|
|
32
|
+
_context.prev = 0;
|
|
33
|
+
_context.next = 3;
|
|
20
34
|
return introspection.type(client, typeName);
|
|
21
35
|
|
|
22
|
-
case
|
|
36
|
+
case 3:
|
|
23
37
|
_introspection = _context.sent;
|
|
24
|
-
_context.next =
|
|
38
|
+
_context.next = 8;
|
|
25
39
|
break;
|
|
26
40
|
|
|
27
|
-
case
|
|
28
|
-
_context.prev =
|
|
29
|
-
_context.t0 = _context[
|
|
41
|
+
case 6:
|
|
42
|
+
_context.prev = 6;
|
|
43
|
+
_context.t0 = _context["catch"](0);
|
|
30
44
|
|
|
31
|
-
case
|
|
32
|
-
return _context.abrupt(
|
|
45
|
+
case 8:
|
|
46
|
+
return _context.abrupt("return", _introspection);
|
|
33
47
|
|
|
34
|
-
case
|
|
35
|
-
case
|
|
48
|
+
case 9:
|
|
49
|
+
case "end":
|
|
36
50
|
return _context.stop();
|
|
37
51
|
}
|
|
38
52
|
}
|
|
39
|
-
}, _callee,
|
|
53
|
+
}, _callee, null, [[0, 6]]);
|
|
40
54
|
}));
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
return _ref.apply(this, arguments);
|
|
44
|
-
};
|
|
45
|
-
}();
|
|
46
|
-
|
|
47
|
-
var _introspection2 = require('./introspection');
|
|
48
|
-
|
|
49
|
-
var introspection = _interopRequireWildcard(_introspection2);
|
|
50
|
-
|
|
51
|
-
function _interopRequireWildcard(obj) { if (obj && obj.__esModule) { return obj; } else { var newObj = {}; if (obj != null) { for (var key in obj) { if (Object.prototype.hasOwnProperty.call(obj, key)) newObj[key] = obj[key]; } } newObj.default = obj; return newObj; } }
|
|
52
|
-
|
|
53
|
-
function _asyncToGenerator(fn) { return function () { var gen = fn.apply(this, arguments); return new Promise(function (resolve, reject) { function step(key, arg) { try { var info = gen[key](arg); var value = info.value; } catch (error) { reject(error); return; } if (info.done) { resolve(value); } else { return Promise.resolve(value).then(function (value) { step("next", value); }, function (err) { step("throw", err); }); } } return step("next"); }); }; }
|
|
55
|
+
return _getIntrospection.apply(this, arguments);
|
|
56
|
+
}
|
|
54
57
|
|
|
55
58
|
function fragmentToQL(fragment) {
|
|
56
59
|
var iterate = function iterate(i) {
|
|
57
60
|
return Object.keys(i).map(function (key) {
|
|
58
61
|
var result;
|
|
59
62
|
var value = i[key];
|
|
60
|
-
|
|
61
|
-
|
|
63
|
+
|
|
64
|
+
if (_typeof(value) === 'object') {
|
|
65
|
+
result = "".concat(key, " { ").concat(iterate(value), " }");
|
|
62
66
|
} else {
|
|
63
67
|
result = key;
|
|
64
68
|
}
|
|
69
|
+
|
|
65
70
|
return result;
|
|
66
71
|
}).join(',');
|
|
67
72
|
};
|
|
73
|
+
|
|
68
74
|
return iterate(fragment);
|
|
69
75
|
}
|
|
70
76
|
|
|
@@ -74,6 +80,7 @@ function getAvaliableFragments(a, b) {
|
|
|
74
80
|
var _field = a.find(function (f) {
|
|
75
81
|
return f.name === field;
|
|
76
82
|
});
|
|
83
|
+
|
|
77
84
|
if (_field) {
|
|
78
85
|
if (_typeof(b[field]) === 'object' && _field.type.ofType.kind === 'OBJECT') {
|
|
79
86
|
fragment[field] = b[field];
|
|
@@ -92,18 +99,17 @@ var protectionFields = {
|
|
|
92
99
|
growthWarning: 1,
|
|
93
100
|
errorMessage: 1,
|
|
94
101
|
size: 1,
|
|
102
|
+
startedAt: 1,
|
|
103
|
+
finishedAt: 1,
|
|
95
104
|
transformedSize: 1
|
|
96
105
|
};
|
|
97
|
-
|
|
98
106
|
var deprecationFields = {
|
|
99
107
|
type: 1,
|
|
100
108
|
entity: 1
|
|
101
109
|
};
|
|
102
|
-
|
|
103
110
|
var sourceFields = {
|
|
104
111
|
filename: 1
|
|
105
112
|
};
|
|
106
|
-
|
|
107
113
|
var errorMessageFields = {
|
|
108
114
|
message: 1,
|
|
109
115
|
line: 1,
|
|
@@ -111,8 +117,12 @@ var errorMessageFields = {
|
|
|
111
117
|
fatal: 1
|
|
112
118
|
};
|
|
113
119
|
|
|
114
|
-
|
|
115
|
-
|
|
120
|
+
function _default(_x3) {
|
|
121
|
+
return _ref.apply(this, arguments);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function _ref() {
|
|
125
|
+
_ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(client) {
|
|
116
126
|
var appProtection, deprecation, source, errorMessage, fragments;
|
|
117
127
|
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
118
128
|
while (1) {
|
|
@@ -144,29 +154,21 @@ exports.default = function () {
|
|
|
144
154
|
},
|
|
145
155
|
applicationProtection: {}
|
|
146
156
|
};
|
|
147
|
-
|
|
148
157
|
fragments.applicationProtection = appProtection && getAvaliableFragments(appProtection.fields, protectionFields);
|
|
149
|
-
|
|
150
158
|
fragments.applicationProtection.deprecations = deprecation && getAvaliableFragments(deprecation.fields, deprecationFields);
|
|
151
|
-
|
|
152
159
|
fragments.applicationProtection.sources = source && getAvaliableFragments(source.fields, sourceFields);
|
|
153
|
-
|
|
154
160
|
fragments.applicationProtection.sources.errorMessages = errorMessage && getAvaliableFragments(errorMessage.fields, errorMessageFields);
|
|
155
|
-
|
|
156
|
-
return _context2.abrupt('return', {
|
|
161
|
+
return _context2.abrupt("return", {
|
|
157
162
|
application: fragmentToQL(fragments.application),
|
|
158
163
|
applicationProtection: fragmentToQL(fragments.applicationProtection)
|
|
159
164
|
});
|
|
160
165
|
|
|
161
166
|
case 18:
|
|
162
|
-
case
|
|
167
|
+
case "end":
|
|
163
168
|
return _context2.stop();
|
|
164
169
|
}
|
|
165
170
|
}
|
|
166
|
-
}, _callee2
|
|
171
|
+
}, _callee2);
|
|
167
172
|
}));
|
|
168
|
-
|
|
169
|
-
|
|
170
|
-
return _ref2.apply(this, arguments);
|
|
171
|
-
};
|
|
172
|
-
}();
|
|
173
|
+
return _ref.apply(this, arguments);
|
|
174
|
+
}
|