jscrambler 6.1.0 → 6.1.3
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/bin/jscrambler.js +106 -133
- package/dist/cleanup-input-fields.js +4 -7
- package/dist/cli.js +8 -13
- package/dist/client.js +105 -84
- 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 +50 -50
- package/dist/index.js +631 -917
- package/dist/introspection.js +66 -66
- package/dist/mutations.js +70 -79
- package/dist/queries.js +38 -36
- package/dist/utils.js +11 -12
- package/dist/zip.js +152 -124
- package/package.json +7 -6
|
@@ -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];
|
|
@@ -96,16 +103,13 @@ var protectionFields = {
|
|
|
96
103
|
finishedAt: 1,
|
|
97
104
|
transformedSize: 1
|
|
98
105
|
};
|
|
99
|
-
|
|
100
106
|
var deprecationFields = {
|
|
101
107
|
type: 1,
|
|
102
108
|
entity: 1
|
|
103
109
|
};
|
|
104
|
-
|
|
105
110
|
var sourceFields = {
|
|
106
111
|
filename: 1
|
|
107
112
|
};
|
|
108
|
-
|
|
109
113
|
var errorMessageFields = {
|
|
110
114
|
message: 1,
|
|
111
115
|
line: 1,
|
|
@@ -113,8 +117,12 @@ var errorMessageFields = {
|
|
|
113
117
|
fatal: 1
|
|
114
118
|
};
|
|
115
119
|
|
|
116
|
-
|
|
117
|
-
|
|
120
|
+
function _default(_x3) {
|
|
121
|
+
return _ref.apply(this, arguments);
|
|
122
|
+
}
|
|
123
|
+
|
|
124
|
+
function _ref() {
|
|
125
|
+
_ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(client) {
|
|
118
126
|
var appProtection, deprecation, source, errorMessage, fragments;
|
|
119
127
|
return regeneratorRuntime.wrap(function _callee2$(_context2) {
|
|
120
128
|
while (1) {
|
|
@@ -146,29 +154,21 @@ exports.default = function () {
|
|
|
146
154
|
},
|
|
147
155
|
applicationProtection: {}
|
|
148
156
|
};
|
|
149
|
-
|
|
150
157
|
fragments.applicationProtection = appProtection && getAvaliableFragments(appProtection.fields, protectionFields);
|
|
151
|
-
|
|
152
158
|
fragments.applicationProtection.deprecations = deprecation && getAvaliableFragments(deprecation.fields, deprecationFields);
|
|
153
|
-
|
|
154
159
|
fragments.applicationProtection.sources = source && getAvaliableFragments(source.fields, sourceFields);
|
|
155
|
-
|
|
156
160
|
fragments.applicationProtection.sources.errorMessages = errorMessage && getAvaliableFragments(errorMessage.fields, errorMessageFields);
|
|
157
|
-
|
|
158
|
-
return _context2.abrupt('return', {
|
|
161
|
+
return _context2.abrupt("return", {
|
|
159
162
|
application: fragmentToQL(fragments.application),
|
|
160
163
|
applicationProtection: fragmentToQL(fragments.applicationProtection)
|
|
161
164
|
});
|
|
162
165
|
|
|
163
166
|
case 18:
|
|
164
|
-
case
|
|
167
|
+
case "end":
|
|
165
168
|
return _context2.stop();
|
|
166
169
|
}
|
|
167
170
|
}
|
|
168
|
-
}, _callee2
|
|
171
|
+
}, _callee2);
|
|
169
172
|
}));
|
|
170
|
-
|
|
171
|
-
|
|
172
|
-
return _ref2.apply(this, arguments);
|
|
173
|
-
};
|
|
174
|
-
}();
|
|
173
|
+
return _ref.apply(this, arguments);
|
|
174
|
+
}
|