jscrambler 6.1.0 → 6.1.1

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.
@@ -1,12 +1,29 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
- exports.intoObjectType = exports.query = exports.mutation = exports.type = undefined;
6
+ exports.intoObjectType = intoObjectType;
7
+ exports.mutation = mutation;
8
+ exports.query = query;
9
+ exports.type = type;
7
10
 
8
- var type = exports.type = function () {
9
- var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(client, name) {
11
+ var _lodash = _interopRequireDefault(require("lodash.clonedeep"));
12
+
13
+ function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
14
+
15
+ 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); } }
16
+
17
+ 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); }); }; }
18
+
19
+ var typeCache = {};
20
+
21
+ function type(_x, _x2) {
22
+ return _type.apply(this, arguments);
23
+ }
24
+
25
+ function _type() {
26
+ _type = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee(client, name) {
10
27
  var jscramblerVersion, query, res, __type;
11
28
 
12
29
  return regeneratorRuntime.wrap(function _callee$(_context) {
@@ -15,7 +32,6 @@ var type = exports.type = function () {
15
32
  case 0:
16
33
  jscramblerVersion = client.options.jscramblerVersion;
17
34
 
18
-
19
35
  if (!typeCache[jscramblerVersion]) {
20
36
  typeCache[jscramblerVersion] = {};
21
37
  }
@@ -25,11 +41,11 @@ var type = exports.type = function () {
25
41
  break;
26
42
  }
27
43
 
28
- return _context.abrupt('return', typeCache[jscramblerVersion][name]);
44
+ return _context.abrupt("return", typeCache[jscramblerVersion][name]);
29
45
 
30
46
  case 4:
31
47
  query = {
32
- query: '\nquery getType($name: String!) {\n __type(name: $name) {\n kind\n name\n description\n fields(includeDeprecated: true) {\n name\n description\n args {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n description\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n }\n}\n\nfragment InputValue on __InputValue {\n name\n description\n type { ...TypeRef }\n defaultValue\n}\n\nfragment TypeRef on __Type {\n kind\n name\n inputFields {\n name\n type {\n name\n kind\n }\n }\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n}',
48
+ query: "\nquery getType($name: String!) {\n __type(name: $name) {\n kind\n name\n description\n fields(includeDeprecated: true) {\n name\n description\n args {\n ...InputValue\n }\n type {\n ...TypeRef\n }\n isDeprecated\n deprecationReason\n }\n inputFields {\n ...InputValue\n }\n interfaces {\n ...TypeRef\n }\n enumValues(includeDeprecated: true) {\n name\n description\n isDeprecated\n deprecationReason\n }\n possibleTypes {\n ...TypeRef\n }\n }\n}\n\nfragment InputValue on __InputValue {\n name\n description\n type { ...TypeRef }\n defaultValue\n}\n\nfragment TypeRef on __Type {\n kind\n name\n inputFields {\n name\n type {\n name\n kind\n }\n }\n ofType {\n kind\n name\n ofType {\n kind\n name\n ofType {\n kind\n name\n }\n }\n }\n}",
33
49
  params: JSON.stringify({
34
50
  name: name
35
51
  })
@@ -40,27 +56,25 @@ var type = exports.type = function () {
40
56
  case 7:
41
57
  res = _context.sent;
42
58
  __type = res.data.__type;
43
-
44
-
45
59
  typeCache[jscramblerVersion][__type.name] = __type;
46
-
47
- return _context.abrupt('return', __type);
60
+ return _context.abrupt("return", __type);
48
61
 
49
62
  case 11:
50
- case 'end':
63
+ case "end":
51
64
  return _context.stop();
52
65
  }
53
66
  }
54
- }, _callee, this);
67
+ }, _callee);
55
68
  }));
69
+ return _type.apply(this, arguments);
70
+ }
56
71
 
57
- return function type(_x, _x2) {
58
- return _ref.apply(this, arguments);
59
- };
60
- }();
72
+ function mutation(_x3, _x4) {
73
+ return _mutation.apply(this, arguments);
74
+ }
61
75
 
62
- var mutation = exports.mutation = function () {
63
- var _ref2 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(client, name) {
76
+ function _mutation() {
77
+ _mutation = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee2(client, name) {
64
78
  var rootMutation, mutationType;
65
79
  return regeneratorRuntime.wrap(function _callee2$(_context2) {
66
80
  while (1) {
@@ -74,23 +88,24 @@ var mutation = exports.mutation = function () {
74
88
  mutationType = rootMutation.fields.find(function (f) {
75
89
  return f.name === name;
76
90
  });
77
- return _context2.abrupt('return', mutationType);
91
+ return _context2.abrupt("return", mutationType);
78
92
 
79
93
  case 5:
80
- case 'end':
94
+ case "end":
81
95
  return _context2.stop();
82
96
  }
83
97
  }
84
- }, _callee2, this);
98
+ }, _callee2);
85
99
  }));
100
+ return _mutation.apply(this, arguments);
101
+ }
86
102
 
87
- return function mutation(_x3, _x4) {
88
- return _ref2.apply(this, arguments);
89
- };
90
- }();
103
+ function query(_x5, _x6) {
104
+ return _query.apply(this, arguments);
105
+ }
91
106
 
92
- var query = exports.query = function () {
93
- var _ref3 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(client, name) {
107
+ function _query() {
108
+ _query = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee3(client, name) {
94
109
  var rootQuery, queryType;
95
110
  return regeneratorRuntime.wrap(function _callee3$(_context3) {
96
111
  while (1) {
@@ -104,25 +119,24 @@ var query = exports.query = function () {
104
119
  queryType = rootQuery.fields.find(function (f) {
105
120
  return f.name === name;
106
121
  });
107
- return _context3.abrupt('return', queryType);
122
+ return _context3.abrupt("return", queryType);
108
123
 
109
124
  case 5:
110
- case 'end':
125
+ case "end":
111
126
  return _context3.stop();
112
127
  }
113
128
  }
114
- }, _callee3, this);
129
+ }, _callee3);
115
130
  }));
131
+ return _query.apply(this, arguments);
132
+ }
116
133
 
117
- return function query(_x5, _x6) {
118
- return _ref3.apply(this, arguments);
119
- };
120
- }();
121
-
122
- var intoObjectType = exports.intoObjectType = function () {
123
- var _ref4 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(client, obj, name) {
124
- var _this = this;
134
+ function intoObjectType(_x7, _x8, _x9) {
135
+ return _intoObjectType.apply(this, arguments);
136
+ }
125
137
 
138
+ function _intoObjectType() {
139
+ _intoObjectType = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee5(client, obj, name) {
126
140
  var fields, finalObj, keys;
127
141
  return regeneratorRuntime.wrap(function _callee5$(_context5) {
128
142
  while (1) {
@@ -136,8 +150,8 @@ var intoObjectType = exports.intoObjectType = function () {
136
150
  finalObj = {};
137
151
  keys = Object.keys(obj);
138
152
  _context5.next = 7;
139
- return Promise.all(keys.map(function () {
140
- var _ref5 = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(k) {
153
+ return Promise.all(keys.map( /*#__PURE__*/function () {
154
+ var _ref = _asyncToGenerator( /*#__PURE__*/regeneratorRuntime.mark(function _callee4(k) {
141
155
  var field;
142
156
  return regeneratorRuntime.wrap(function _callee4$(_context4) {
143
157
  while (1) {
@@ -152,7 +166,7 @@ var intoObjectType = exports.intoObjectType = function () {
152
166
  break;
153
167
  }
154
168
 
155
- finalObj[k] = (0, _lodash2.default)(obj[k]);
169
+ finalObj[k] = (0, _lodash.default)(obj[k]);
156
170
 
157
171
  if (!(field.type.kind === 'OBJECT' && !!field.type.name)) {
158
172
  _context4.next = 8;
@@ -164,7 +178,7 @@ var intoObjectType = exports.intoObjectType = function () {
164
178
 
165
179
  case 6:
166
180
  finalObj[k] = _context4.sent;
167
- return _context4.abrupt('return');
181
+ return _context4.abrupt("return");
168
182
 
169
183
  case 8:
170
184
  if (!((field.type.kind === 'NON_NULL' || field.type.kind === 'LIST') && field.type.ofType.kind === 'OBJECT')) {
@@ -177,49 +191,35 @@ var intoObjectType = exports.intoObjectType = function () {
177
191
 
178
192
  case 11:
179
193
  finalObj[k] = _context4.sent;
180
- return _context4.abrupt('return');
194
+ return _context4.abrupt("return");
181
195
 
182
196
  case 13:
183
-
184
197
  if (field.type.name === 'String' && typeof finalObj[k] !== 'string') {
185
198
  finalObj[k] = JSON.stringify(finalObj[k]);
186
199
  }
187
200
 
188
201
  case 14:
189
- case 'end':
202
+ case "end":
190
203
  return _context4.stop();
191
204
  }
192
205
  }
193
- }, _callee4, _this);
206
+ }, _callee4);
194
207
  }));
195
208
 
196
209
  return function (_x10) {
197
- return _ref5.apply(this, arguments);
210
+ return _ref.apply(this, arguments);
198
211
  };
199
212
  }()));
200
213
 
201
214
  case 7:
202
- return _context5.abrupt('return', finalObj);
215
+ return _context5.abrupt("return", finalObj);
203
216
 
204
217
  case 8:
205
- case 'end':
218
+ case "end":
206
219
  return _context5.stop();
207
220
  }
208
221
  }
209
- }, _callee5, this);
222
+ }, _callee5);
210
223
  }));
211
-
212
- return function intoObjectType(_x7, _x8, _x9) {
213
- return _ref4.apply(this, arguments);
214
- };
215
- }();
216
-
217
- var _lodash = require('lodash.clonedeep');
218
-
219
- var _lodash2 = _interopRequireDefault(_lodash);
220
-
221
- function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
222
-
223
- 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"); }); }; }
224
-
225
- var typeCache = {};
224
+ return _intoObjectType.apply(this, arguments);
225
+ }
package/dist/mutations.js CHANGED
@@ -1,80 +1,83 @@
1
- 'use strict';
1
+ "use strict";
2
2
 
3
3
  Object.defineProperty(exports, "__esModule", {
4
4
  value: true
5
5
  });
6
-
7
- var _slicedToArray = function () { function sliceIterator(arr, i) { var _arr = []; var _n = true; var _d = false; var _e = undefined; try { for (var _i = arr[Symbol.iterator](), _s; !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"]) _i["return"](); } finally { if (_d) throw _e; } } return _arr; } return function (arr, i) { if (Array.isArray(arr)) { return arr; } else if (Symbol.iterator in Object(arr)) { return sliceIterator(arr, i); } else { throw new TypeError("Invalid attempt to destructure non-iterable instance"); } }; }();
8
-
6
+ exports.addApplicationSource = addApplicationSource;
7
+ exports.applyTemplate = applyTemplate;
8
+ exports.cancelProtection = cancelProtection;
9
9
  exports.createApplication = createApplication;
10
+ exports.createApplicationProtection = createApplicationProtection;
11
+ exports.createApplicationProtections = createApplicationProtections;
12
+ exports.createTemplate = createTemplate;
10
13
  exports.duplicateApplication = duplicateApplication;
11
14
  exports.removeApplication = removeApplication;
12
15
  exports.removeProtection = removeProtection;
13
- exports.cancelProtection = cancelProtection;
14
- exports.updateApplication = updateApplication;
15
- exports.unlockApplication = unlockApplication;
16
- exports.addApplicationSource = addApplicationSource;
17
- exports.updateApplicationSource = updateApplicationSource;
18
16
  exports.removeSourceFromApplication = removeSourceFromApplication;
19
- exports.createTemplate = createTemplate;
20
17
  exports.removeTemplate = removeTemplate;
18
+ exports.unlockApplication = unlockApplication;
19
+ exports.updateApplication = updateApplication;
20
+ exports.updateApplicationSource = updateApplicationSource;
21
21
  exports.updateTemplate = updateTemplate;
22
- exports.createApplicationProtection = createApplicationProtection;
23
- exports.createApplicationProtections = createApplicationProtections;
24
- exports.applyTemplate = applyTemplate;
25
-
26
- var _cleanupInputFields3 = require('./cleanup-input-fields');
27
22
 
28
- var _cleanupInputFields4 = _interopRequireDefault(_cleanupInputFields3);
23
+ var _cleanupInputFields3 = _interopRequireDefault(require("./cleanup-input-fields"));
29
24
 
30
25
  function _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }
31
26
 
32
- var createApplicationDefaultFragments = '\n _id,\n createdAt,\n name\n';
27
+ function _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }
28
+
29
+ function _nonIterableRest() { throw new TypeError("Invalid attempt to destructure non-iterable instance.\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method."); }
30
+
31
+ function _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === "string") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === "Object" && o.constructor) n = o.constructor.name; if (n === "Map" || n === "Set") return Array.from(o); if (n === "Arguments" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }
32
+
33
+ function _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }
34
+
35
+ function _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== "undefined" && arr[Symbol.iterator] || arr["@@iterator"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i["return"] != null) _i["return"](); } finally { if (_d) throw _e; } } return _arr; }
36
+
37
+ function _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }
38
+
39
+ var createApplicationDefaultFragments = "\n _id,\n createdAt,\n name\n";
33
40
 
34
41
  function createApplication(data) {
35
42
  var fragments = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : createApplicationDefaultFragments;
36
-
37
43
  return {
38
- query: '\n mutation createApplication ($data: ApplicationCreate!) {\n createApplication(data: $data) {\n ' + fragments + '\n }\n }\n ',
44
+ query: "\n mutation createApplication ($data: ApplicationCreate!) {\n createApplication(data: $data) {\n ".concat(fragments, "\n }\n }\n "),
39
45
  params: {
40
46
  data: data
41
47
  }
42
48
  };
43
49
  }
44
50
 
45
- var duplicateApplicationDefaultFragments = '\n _id\n';
51
+ var duplicateApplicationDefaultFragments = "\n _id\n";
46
52
 
47
53
  function duplicateApplication(id) {
48
54
  var fragments = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : duplicateApplicationDefaultFragments;
49
-
50
55
  return {
51
- query: '\n mutation duplicateApplication ($_id: String!) {\n duplicateApplication (_id: $_id) {\n ' + fragments + '\n }\n }\n ',
56
+ query: "\n mutation duplicateApplication ($_id: String!) {\n duplicateApplication (_id: $_id) {\n ".concat(fragments, "\n }\n }\n "),
52
57
  params: {
53
58
  _id: id
54
59
  }
55
60
  };
56
61
  }
57
62
 
58
- var removeApplicationDefaultFragments = '\n _id\n';
63
+ var removeApplicationDefaultFragments = "\n _id\n";
59
64
 
60
65
  function removeApplication(id) {
61
66
  var fragments = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : removeApplicationDefaultFragments;
62
-
63
67
  return {
64
- query: '\n mutation removeApplication ($_id: String!) {\n removeApplication (_id: $_id) {\n ' + fragments + '\n }\n }\n ',
68
+ query: "\n mutation removeApplication ($_id: String!) {\n removeApplication (_id: $_id) {\n ".concat(fragments, "\n }\n }\n "),
65
69
  params: {
66
70
  _id: id
67
71
  }
68
72
  };
69
73
  }
70
74
 
71
- var removeProtectionDefaultFragments = '\n _id\n';
75
+ var removeProtectionDefaultFragments = "\n _id\n";
72
76
 
73
77
  function removeProtection(id, appId) {
74
78
  var fragments = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : removeProtectionDefaultFragments;
75
-
76
79
  return {
77
- query: '\n mutation removeProtection ($_id: String!, $applicationId: String!) {\n removeProtection (_id: $_id, applicationId: $applicationId) {\n ' + fragments + '\n }\n }\n ',
80
+ query: "\n mutation removeProtection ($_id: String!, $applicationId: String!) {\n removeProtection (_id: $_id, applicationId: $applicationId) {\n ".concat(fragments, "\n }\n }\n "),
78
81
  params: {
79
82
  _id: id,
80
83
  applicationId: appId
@@ -82,13 +85,12 @@ function removeProtection(id, appId) {
82
85
  };
83
86
  }
84
87
 
85
- var cancelProtectionDefaultFragments = '\n _id\n';
88
+ var cancelProtectionDefaultFragments = "\n _id\n";
86
89
 
87
90
  function cancelProtection(id, appId) {
88
91
  var fragments = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : cancelProtectionDefaultFragments;
89
-
90
92
  return {
91
- query: '\n mutation cancelProtection ($_id: String!, $applicationId: String!) {\n cancelProtection (_id: $_id, applicationId: $applicationId) {\n ' + fragments + '\n }\n }\n ',
93
+ query: "\n mutation cancelProtection ($_id: String!, $applicationId: String!) {\n cancelProtection (_id: $_id, applicationId: $applicationId) {\n ".concat(fragments, "\n }\n }\n "),
92
94
  params: {
93
95
  _id: id,
94
96
  applicationId: appId
@@ -96,16 +98,14 @@ function cancelProtection(id, appId) {
96
98
  };
97
99
  }
98
100
 
99
- var updateApplicationDefaultFragments = '\n _id,\n createdAt,\n name\n';
101
+ var updateApplicationDefaultFragments = "\n _id,\n createdAt,\n name\n";
100
102
 
101
103
  function updateApplication(application) {
102
104
  var fragments = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : updateApplicationDefaultFragments;
103
-
104
105
  var applicationId = application._id;
105
106
  delete application._id;
106
-
107
107
  return {
108
- query: '\n mutation updateApplication ($applicationId: String!, $data: ApplicationUpdate!) {\n updateApplication (_id: $applicationId, data: $data) {\n ' + fragments + '\n }\n }\n ',
108
+ query: "\n mutation updateApplication ($applicationId: String!, $data: ApplicationUpdate!) {\n updateApplication (_id: $applicationId, data: $data) {\n ".concat(fragments, "\n }\n }\n "),
109
109
  params: {
110
110
  applicationId: applicationId,
111
111
  data: application
@@ -113,26 +113,24 @@ function updateApplication(application) {
113
113
  };
114
114
  }
115
115
 
116
- var unlockApplicationDefaultFragments = '\n _id,\n createdAt,\n name\n';
116
+ var unlockApplicationDefaultFragments = "\n _id,\n createdAt,\n name\n";
117
117
 
118
118
  function unlockApplication(application) {
119
119
  var fragments = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : unlockApplicationDefaultFragments;
120
-
121
120
  return {
122
- query: '\n mutation unlockApplication ($applicationId: String!) {\n unlockApplication (_id: $applicationId) {\n ' + fragments + '\n }\n }\n ',
121
+ query: "\n mutation unlockApplication ($applicationId: String!) {\n unlockApplication (_id: $applicationId) {\n ".concat(fragments, "\n }\n }\n "),
123
122
  params: {
124
123
  applicationId: application._id
125
124
  }
126
125
  };
127
126
  }
128
127
 
129
- var addApplicationSourceDefaultFragments = '\n _id,\n filename,\n extension\n';
128
+ var addApplicationSourceDefaultFragments = "\n _id,\n filename,\n extension\n";
130
129
 
131
130
  function addApplicationSource(applicationId, data) {
132
131
  var fragments = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : addApplicationSourceDefaultFragments;
133
-
134
132
  return {
135
- query: '\n mutation addSourceToApplication ($applicationId: String!, $data: ApplicationSourceCreate!) {\n addSourceToApplication(applicationId: $applicationId, data: $data) {\n ' + fragments + '\n }\n }\n ',
133
+ query: "\n mutation addSourceToApplication ($applicationId: String!, $data: ApplicationSourceCreate!) {\n addSourceToApplication(applicationId: $applicationId, data: $data) {\n ".concat(fragments, "\n }\n }\n "),
136
134
  params: {
137
135
  applicationId: applicationId,
138
136
  data: data
@@ -140,16 +138,14 @@ function addApplicationSource(applicationId, data) {
140
138
  };
141
139
  }
142
140
 
143
- var updateApplicationSourceDefaultFragments = '\n _id,\n filename,\n extension\n';
141
+ var updateApplicationSourceDefaultFragments = "\n _id,\n filename,\n extension\n";
144
142
 
145
143
  function updateApplicationSource(applicationSource) {
146
144
  var fragments = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : updateApplicationSourceDefaultFragments;
147
-
148
145
  var sourceId = applicationSource._id;
149
146
  delete applicationSource._id;
150
-
151
147
  return {
152
- query: '\n mutation updateApplicationSource ($sourceId: String!, $data: ApplicationSourceUpdate!) {\n updateApplicationSource(_id: $sourceId, data: $data) {\n ' + fragments + '\n }\n }\n ',
148
+ query: "\n mutation updateApplicationSource ($sourceId: String!, $data: ApplicationSourceUpdate!) {\n updateApplicationSource(_id: $sourceId, data: $data) {\n ".concat(fragments, "\n }\n }\n "),
153
149
  params: {
154
150
  sourceId: sourceId,
155
151
  data: applicationSource
@@ -157,13 +153,12 @@ function updateApplicationSource(applicationSource) {
157
153
  };
158
154
  }
159
155
 
160
- var removeSourceFromApplicationDefaultFragments = '\n _id,\n sources {\n filename\n }\n';
156
+ var removeSourceFromApplicationDefaultFragments = "\n _id,\n sources {\n filename\n }\n";
161
157
 
162
158
  function removeSourceFromApplication(filename, applicationId) {
163
159
  var fragments = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : removeSourceFromApplicationDefaultFragments;
164
-
165
160
  return {
166
- query: '\n mutation removeSource ($filename: String!, $applicationId: String!) {\n removeSource (filename: $filename, applicationId: $applicationId) {\n ' + fragments + '\n }\n }\n ',
161
+ query: "\n mutation removeSource ($filename: String!, $applicationId: String!) {\n removeSource (filename: $filename, applicationId: $applicationId) {\n ".concat(fragments, "\n }\n }\n "),
167
162
  params: {
168
163
  filename: filename,
169
164
  applicationId: applicationId
@@ -171,42 +166,38 @@ function removeSourceFromApplication(filename, applicationId) {
171
166
  };
172
167
  }
173
168
 
174
- var createTemplateDefaultFragments = '\n _id,\n name,\n description,\n parameters\n';
169
+ var createTemplateDefaultFragments = "\n _id,\n name,\n description,\n parameters\n";
175
170
 
176
171
  function createTemplate(template) {
177
172
  var fragments = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : createTemplateDefaultFragments;
178
-
179
173
  return {
180
- query: '\n mutation createTemplate ($data: TemplateInput!) {\n createTemplate (data: $data) {\n ' + fragments + '\n }\n }\n ',
174
+ query: "\n mutation createTemplate ($data: TemplateInput!) {\n createTemplate (data: $data) {\n ".concat(fragments, "\n }\n }\n "),
181
175
  params: {
182
176
  data: template
183
177
  }
184
178
  };
185
179
  }
186
180
 
187
- var removeTemplateDefaultFragments = '\n _id\n';
181
+ var removeTemplateDefaultFragments = "\n _id\n";
188
182
 
189
183
  function removeTemplate(id) {
190
184
  var fragments = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : removeTemplateDefaultFragments;
191
-
192
185
  return {
193
- query: '\n mutation removeTemplate ($_id: String!) {\n removeTemplate (_id: $_id) {\n ' + fragments + '\n }\n }\n ',
186
+ query: "\n mutation removeTemplate ($_id: String!) {\n removeTemplate (_id: $_id) {\n ".concat(fragments, "\n }\n }\n "),
194
187
  params: {
195
188
  _id: id
196
189
  }
197
190
  };
198
191
  }
199
192
 
200
- var updateTemplateDefaultFragments = '\n _id,\n parameters\n';
193
+ var updateTemplateDefaultFragments = "\n _id,\n parameters\n";
201
194
 
202
195
  function updateTemplate(template) {
203
196
  var fragments = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : updateTemplateDefaultFragments;
204
-
205
197
  var templateId = template._id;
206
198
  delete template._id;
207
-
208
199
  return {
209
- query: '\n mutation updateTemplate ($templateId: ID!, $data: TemplateInput!) {\n updateTemplate (_id: $templateId, data: $data) {\n ' + fragments + '\n }\n }\n ',
200
+ query: "\n mutation updateTemplate ($templateId: ID!, $data: TemplateInput!) {\n updateTemplate (_id: $templateId, data: $data) {\n ".concat(fragments, "\n }\n }\n "),
210
201
  params: {
211
202
  templateId: templateId,
212
203
  data: template
@@ -214,55 +205,53 @@ function updateTemplate(template) {
214
205
  };
215
206
  }
216
207
 
217
- var createProtectionDefaultFragments = '\n _id,\n state\n';
208
+ var createProtectionDefaultFragments = "\n _id,\n state\n";
218
209
 
219
210
  function createApplicationProtection(applicationId) {
220
211
  var _fragments = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : createProtectionDefaultFragments;
221
212
 
222
- var _options = arguments[2];
223
- var args = arguments[3];
213
+ var _options = arguments.length > 2 ? arguments[2] : undefined;
214
+
215
+ var args = arguments.length > 3 ? arguments[3] : undefined;
224
216
 
225
217
  var _ref = arguments.length > 4 && arguments[4] !== undefined ? arguments[4] : {},
226
218
  _ref$mutationName = _ref.mutationName,
227
- mutationName = _ref$mutationName === undefined ? 'createApplicationProtection' : _ref$mutationName,
219
+ mutationName = _ref$mutationName === void 0 ? 'createApplicationProtection' : _ref$mutationName,
228
220
  _ref$mutationInputTyp = _ref.mutationInputType,
229
- mutationInputType = _ref$mutationInputTyp === undefined ? 'ApplicationProtectionCreate' : _ref$mutationInputTyp;
221
+ mutationInputType = _ref$mutationInputTyp === void 0 ? 'ApplicationProtectionCreate' : _ref$mutationInputTyp;
230
222
 
231
223
  var fragments = _fragments;
232
224
  var options = _options;
233
225
 
234
- var _cleanupInputFields = (0, _cleanupInputFields4.default)(args, fragments, options);
226
+ var _cleanupInputFields = (0, _cleanupInputFields3.default)(args, fragments, options);
235
227
 
236
228
  var _cleanupInputFields2 = _slicedToArray(_cleanupInputFields, 2);
237
229
 
238
230
  options = _cleanupInputFields2[0];
239
231
  fragments = _cleanupInputFields2[1];
240
232
 
241
-
242
233
  if (!args.some(function (f) {
243
234
  return f.name === 'options';
244
235
  })) {
245
236
  var _options2 = options,
246
237
  bail = _options2.bail,
247
238
  randomizationSeed = _options2.randomizationSeed;
248
-
249
-
250
239
  return {
251
- query: '\n mutation ' + mutationName + ' ($applicationId: String!, $bail: Boolean, $randomizationSeed: String) {\n ' + mutationName + ' (applicationId: $applicationId, bail: $bail, randomizationSeed: $randomizationSeed) {\n ' + fragments + '\n }\n }\n ',
240
+ query: "\n mutation ".concat(mutationName, " ($applicationId: String!, $bail: Boolean, $randomizationSeed: String) {\n ").concat(mutationName, " (applicationId: $applicationId, bail: $bail, randomizationSeed: $randomizationSeed) {\n ").concat(fragments, "\n }\n }\n "),
252
241
  params: {
253
242
  applicationId: applicationId,
254
243
  bail: bail,
255
244
  randomizationSeed: randomizationSeed
256
245
  }
257
246
  };
258
- }
247
+ } // Check if createApplicationProtection supports "data" argument
248
+
259
249
 
260
- // Check if createApplicationProtection supports "data" argument
261
250
  if (args.some(function (arg) {
262
251
  return arg.name === 'data';
263
252
  })) {
264
253
  return {
265
- query: '\n mutation ' + mutationName + ' ($applicationId: String!, $data: ' + mutationInputType + ') {\n ' + mutationName + ' (applicationId: $applicationId, data: $data) {\n ' + fragments + '\n }\n }\n ',
254
+ query: "\n mutation ".concat(mutationName, " ($applicationId: String!, $data: ").concat(mutationInputType, ") {\n ").concat(mutationName, " (applicationId: $applicationId, data: $data) {\n ").concat(fragments, "\n }\n }\n "),
266
255
  params: {
267
256
  applicationId: applicationId,
268
257
  data: options
@@ -271,7 +260,7 @@ function createApplicationProtection(applicationId) {
271
260
  }
272
261
 
273
262
  return {
274
- query: '\n mutation ' + mutationName + ' ($applicationId: String!, $options: JSON) {\n ' + mutationName + ' (applicationId: $applicationId, options: $options) {\n ' + fragments + '\n }\n }\n ',
263
+ query: "\n mutation ".concat(mutationName, " ($applicationId: String!, $options: JSON) {\n ").concat(mutationName, " (applicationId: $applicationId, options: $options) {\n ").concat(fragments, "\n }\n }\n "),
275
264
  params: {
276
265
  applicationId: applicationId,
277
266
  options: options
@@ -279,24 +268,26 @@ function createApplicationProtection(applicationId) {
279
268
  };
280
269
  }
281
270
 
282
- var createProtectionsDefaultFragments = '\n protections {\n ' + createProtectionDefaultFragments + '\n }\n';
271
+ var createProtectionsDefaultFragments = "\n protections {\n ".concat(createProtectionDefaultFragments, "\n }\n");
283
272
 
284
273
  function createApplicationProtections(applicationId) {
285
274
  var _fragments = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : createProtectionsDefaultFragments;
286
275
 
287
- var _options = arguments[2];
288
- var args = arguments[3];
276
+ var _options = arguments.length > 2 ? arguments[2] : undefined;
289
277
 
290
- return createApplicationProtection(applicationId, _fragments, _options, args, { mutationName: 'createApplicationProtections', mutationInputType: 'ApplicationProtectionsCreate' });
278
+ var args = arguments.length > 3 ? arguments[3] : undefined;
279
+ return createApplicationProtection(applicationId, _fragments, _options, args, {
280
+ mutationName: 'createApplicationProtections',
281
+ mutationInputType: 'ApplicationProtectionsCreate'
282
+ });
291
283
  }
292
284
 
293
- var applyTemplateDefaultFragments = '\n _id,\n parameters\n';
285
+ var applyTemplateDefaultFragments = "\n _id,\n parameters\n";
294
286
 
295
287
  function applyTemplate(templateId, appId) {
296
288
  var fragments = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : applyTemplateDefaultFragments;
297
-
298
289
  return {
299
- query: '\n mutation applyTemplate ($templateId: String!, $appId: String!) {\n applyTemplate (templateId: $templateId, appId: $appId) {\n ' + fragments + '\n }\n }\n ',
290
+ query: "\n mutation applyTemplate ($templateId: String!, $appId: String!) {\n applyTemplate (templateId: $templateId, appId: $appId) {\n ".concat(fragments, "\n }\n }\n "),
300
291
  params: {
301
292
  templateId: templateId,
302
293
  appId: appId