@bcrumbs.net/bc-api 0.0.3 → 0.0.4
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/index.d.ts +22 -20
- package/index.esm.js +556 -3619
- package/index.umd.js +481 -3581
- package/lib/clients/dconfigClient.d.ts +4 -4
- package/lib/clients/dqueryClient.d.ts +13 -13
- package/lib/clients/showcaseClient.d.ts +12 -12
- package/lib/config/index.d.ts +19 -17
- package/lib/endpoints/graphql/showcase/index.d.ts +17 -16
- package/lib/endpoints/rest/auth/index.d.ts +22 -22
- package/lib/endpoints/rest/billing/index.d.ts +2 -2
- package/lib/endpoints/rest/companies/index.d.ts +10 -10
- package/lib/endpoints/rest/contents/index.d.ts +17 -17
- package/lib/endpoints/rest/files/index.d.ts +14 -14
- package/lib/endpoints/rest/models/index.d.ts +39 -39
- package/lib/endpoints/rest/showcase/index.d.ts +27 -16
- package/lib/models/config.d.ts +13 -0
- package/lib/models/content.d.ts +35 -27
- package/lib/models/contentInstance.d.ts +32 -32
- package/lib/models/file.d.ts +12 -12
- package/lib/models/folder.d.ts +11 -11
- package/lib/models/model.d.ts +33 -33
- package/lib/models/usage.d.ts +16 -0
- package/lib/services/auth/index.d.ts +123 -120
- package/lib/services/i18n/index.d.ts +11 -11
- package/lib/services/validators/index.d.ts +20 -20
- package/lib/utils/httpStatusCode.d.ts +381 -381
- package/lib/utils/index.d.ts +2 -2
- package/lib/utils/strings.d.ts +5 -5
- package/package.json +3 -3
- package/lib/endpoints/graphql/usage/index.d.ts +0 -1
package/index.esm.js
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
|
+
import gql from 'graphql-tag';
|
|
1
2
|
import { InMemoryCache, ApolloClient, from, useQuery, createHttpLink, useMutation, useLazyQuery } from '@apollo/client';
|
|
2
3
|
import { onError } from '@apollo/client/link/error';
|
|
3
4
|
import { setContext } from '@apollo/client/link/context';
|
|
4
5
|
import { RestLink } from 'apollo-link-rest';
|
|
5
|
-
import { onError as onError$1 } from 'apollo-link-error';
|
|
6
6
|
import withApollo from 'next-with-apollo';
|
|
7
7
|
import decode from 'jwt-decode';
|
|
8
8
|
import { isAfter } from 'date-fns';
|
|
@@ -19,3253 +19,6 @@ import { initReactI18next } from 'react-i18next';
|
|
|
19
19
|
import Backend from 'i18next-http-backend';
|
|
20
20
|
import LanguageDetector from 'i18next-browser-languagedetector';
|
|
21
21
|
|
|
22
|
-
/******************************************************************************
|
|
23
|
-
Copyright (c) Microsoft Corporation.
|
|
24
|
-
|
|
25
|
-
Permission to use, copy, modify, and/or distribute this software for any
|
|
26
|
-
purpose with or without fee is hereby granted.
|
|
27
|
-
|
|
28
|
-
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
29
|
-
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
30
|
-
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
31
|
-
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
32
|
-
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
33
|
-
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
34
|
-
PERFORMANCE OF THIS SOFTWARE.
|
|
35
|
-
***************************************************************************** */
|
|
36
|
-
|
|
37
|
-
var __assign = function() {
|
|
38
|
-
__assign = Object.assign || function __assign(t) {
|
|
39
|
-
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
40
|
-
s = arguments[i];
|
|
41
|
-
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];
|
|
42
|
-
}
|
|
43
|
-
return t;
|
|
44
|
-
};
|
|
45
|
-
return __assign.apply(this, arguments);
|
|
46
|
-
};
|
|
47
|
-
|
|
48
|
-
function __awaiter(thisArg, _arguments, P, generator) {
|
|
49
|
-
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
50
|
-
return new (P || (P = Promise))(function (resolve, reject) {
|
|
51
|
-
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
52
|
-
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
53
|
-
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
54
|
-
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
55
|
-
});
|
|
56
|
-
}
|
|
57
|
-
|
|
58
|
-
function _typeof$3(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$3 = function _typeof(obj) { return typeof obj; }; } else { _typeof$3 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$3(obj); }
|
|
59
|
-
|
|
60
|
-
/**
|
|
61
|
-
* Return true if `value` is object-like. A value is object-like if it's not
|
|
62
|
-
* `null` and has a `typeof` result of "object".
|
|
63
|
-
*/
|
|
64
|
-
function isObjectLike(value) {
|
|
65
|
-
return _typeof$3(value) == 'object' && value !== null;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
|
-
// In ES2015 (or a polyfilled) environment, this will be Symbol.iterator
|
|
69
|
-
|
|
70
|
-
var SYMBOL_TO_STRING_TAG = typeof Symbol === 'function' && Symbol.toStringTag != null ? Symbol.toStringTag : '@@toStringTag';
|
|
71
|
-
|
|
72
|
-
/**
|
|
73
|
-
* Represents a location in a Source.
|
|
74
|
-
*/
|
|
75
|
-
|
|
76
|
-
/**
|
|
77
|
-
* Takes a Source and a UTF-8 character offset, and returns the corresponding
|
|
78
|
-
* line and column as a SourceLocation.
|
|
79
|
-
*/
|
|
80
|
-
function getLocation(source, position) {
|
|
81
|
-
var lineRegexp = /\r\n|[\n\r]/g;
|
|
82
|
-
var line = 1;
|
|
83
|
-
var column = position + 1;
|
|
84
|
-
var match;
|
|
85
|
-
|
|
86
|
-
while ((match = lineRegexp.exec(source.body)) && match.index < position) {
|
|
87
|
-
line += 1;
|
|
88
|
-
column = position + 1 - (match.index + match[0].length);
|
|
89
|
-
}
|
|
90
|
-
|
|
91
|
-
return {
|
|
92
|
-
line: line,
|
|
93
|
-
column: column
|
|
94
|
-
};
|
|
95
|
-
}
|
|
96
|
-
|
|
97
|
-
/**
|
|
98
|
-
* Render a helpful description of the location in the GraphQL Source document.
|
|
99
|
-
*/
|
|
100
|
-
|
|
101
|
-
function printLocation(location) {
|
|
102
|
-
return printSourceLocation(location.source, getLocation(location.source, location.start));
|
|
103
|
-
}
|
|
104
|
-
/**
|
|
105
|
-
* Render a helpful description of the location in the GraphQL Source document.
|
|
106
|
-
*/
|
|
107
|
-
|
|
108
|
-
function printSourceLocation(source, sourceLocation) {
|
|
109
|
-
var firstLineColumnOffset = source.locationOffset.column - 1;
|
|
110
|
-
var body = whitespace(firstLineColumnOffset) + source.body;
|
|
111
|
-
var lineIndex = sourceLocation.line - 1;
|
|
112
|
-
var lineOffset = source.locationOffset.line - 1;
|
|
113
|
-
var lineNum = sourceLocation.line + lineOffset;
|
|
114
|
-
var columnOffset = sourceLocation.line === 1 ? firstLineColumnOffset : 0;
|
|
115
|
-
var columnNum = sourceLocation.column + columnOffset;
|
|
116
|
-
var locationStr = "".concat(source.name, ":").concat(lineNum, ":").concat(columnNum, "\n");
|
|
117
|
-
var lines = body.split(/\r\n|[\n\r]/g);
|
|
118
|
-
var locationLine = lines[lineIndex]; // Special case for minified documents
|
|
119
|
-
|
|
120
|
-
if (locationLine.length > 120) {
|
|
121
|
-
var subLineIndex = Math.floor(columnNum / 80);
|
|
122
|
-
var subLineColumnNum = columnNum % 80;
|
|
123
|
-
var subLines = [];
|
|
124
|
-
|
|
125
|
-
for (var i = 0; i < locationLine.length; i += 80) {
|
|
126
|
-
subLines.push(locationLine.slice(i, i + 80));
|
|
127
|
-
}
|
|
128
|
-
|
|
129
|
-
return locationStr + printPrefixedLines([["".concat(lineNum), subLines[0]]].concat(subLines.slice(1, subLineIndex + 1).map(function (subLine) {
|
|
130
|
-
return ['', subLine];
|
|
131
|
-
}), [[' ', whitespace(subLineColumnNum - 1) + '^'], ['', subLines[subLineIndex + 1]]]));
|
|
132
|
-
}
|
|
133
|
-
|
|
134
|
-
return locationStr + printPrefixedLines([// Lines specified like this: ["prefix", "string"],
|
|
135
|
-
["".concat(lineNum - 1), lines[lineIndex - 1]], ["".concat(lineNum), locationLine], ['', whitespace(columnNum - 1) + '^'], ["".concat(lineNum + 1), lines[lineIndex + 1]]]);
|
|
136
|
-
}
|
|
137
|
-
|
|
138
|
-
function printPrefixedLines(lines) {
|
|
139
|
-
var existingLines = lines.filter(function (_ref) {
|
|
140
|
-
_ref[0];
|
|
141
|
-
var line = _ref[1];
|
|
142
|
-
return line !== undefined;
|
|
143
|
-
});
|
|
144
|
-
var padLen = Math.max.apply(Math, existingLines.map(function (_ref2) {
|
|
145
|
-
var prefix = _ref2[0];
|
|
146
|
-
return prefix.length;
|
|
147
|
-
}));
|
|
148
|
-
return existingLines.map(function (_ref3) {
|
|
149
|
-
var prefix = _ref3[0],
|
|
150
|
-
line = _ref3[1];
|
|
151
|
-
return leftPad(padLen, prefix) + (line ? ' | ' + line : ' |');
|
|
152
|
-
}).join('\n');
|
|
153
|
-
}
|
|
154
|
-
|
|
155
|
-
function whitespace(len) {
|
|
156
|
-
return Array(len + 1).join(' ');
|
|
157
|
-
}
|
|
158
|
-
|
|
159
|
-
function leftPad(len, str) {
|
|
160
|
-
return whitespace(len - str.length) + str;
|
|
161
|
-
}
|
|
162
|
-
|
|
163
|
-
function _typeof$2(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$2 = function _typeof(obj) { return typeof obj; }; } else { _typeof$2 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$2(obj); }
|
|
164
|
-
|
|
165
|
-
function ownKeys$2(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }
|
|
166
|
-
|
|
167
|
-
function _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys$2(Object(source), true).forEach(function (key) { _defineProperty(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys$2(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }
|
|
168
|
-
|
|
169
|
-
function _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }
|
|
170
|
-
|
|
171
|
-
function _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError("Cannot call a class as a function"); } }
|
|
172
|
-
|
|
173
|
-
function _defineProperties$1(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
174
|
-
|
|
175
|
-
function _createClass$1(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties$1(Constructor.prototype, protoProps); if (staticProps) _defineProperties$1(Constructor, staticProps); return Constructor; }
|
|
176
|
-
|
|
177
|
-
function _inherits(subClass, superClass) { if (typeof superClass !== "function" && superClass !== null) { throw new TypeError("Super expression must either be null or a function"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); if (superClass) _setPrototypeOf(subClass, superClass); }
|
|
178
|
-
|
|
179
|
-
function _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }
|
|
180
|
-
|
|
181
|
-
function _possibleConstructorReturn(self, call) { if (call && (_typeof$2(call) === "object" || typeof call === "function")) { return call; } return _assertThisInitialized(self); }
|
|
182
|
-
|
|
183
|
-
function _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError("this hasn't been initialised - super() hasn't been called"); } return self; }
|
|
184
|
-
|
|
185
|
-
function _wrapNativeSuper(Class) { var _cache = typeof Map === "function" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== "function") { throw new TypeError("Super expression must either be null or a function"); } if (typeof _cache !== "undefined") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }
|
|
186
|
-
|
|
187
|
-
function _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }
|
|
188
|
-
|
|
189
|
-
function _isNativeReflectConstruct() { if (typeof Reflect === "undefined" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === "function") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }
|
|
190
|
-
|
|
191
|
-
function _isNativeFunction(fn) { return Function.toString.call(fn).indexOf("[native code]") !== -1; }
|
|
192
|
-
|
|
193
|
-
function _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }
|
|
194
|
-
|
|
195
|
-
function _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }
|
|
196
|
-
/**
|
|
197
|
-
* A GraphQLError describes an Error found during the parse, validate, or
|
|
198
|
-
* execute phases of performing a GraphQL operation. In addition to a message
|
|
199
|
-
* and stack trace, it also includes information about the locations in a
|
|
200
|
-
* GraphQL document and/or execution result that correspond to the Error.
|
|
201
|
-
*/
|
|
202
|
-
|
|
203
|
-
var GraphQLError = /*#__PURE__*/function (_Error) {
|
|
204
|
-
_inherits(GraphQLError, _Error);
|
|
205
|
-
|
|
206
|
-
var _super = _createSuper(GraphQLError);
|
|
207
|
-
|
|
208
|
-
/**
|
|
209
|
-
* An array of { line, column } locations within the source GraphQL document
|
|
210
|
-
* which correspond to this error.
|
|
211
|
-
*
|
|
212
|
-
* Errors during validation often contain multiple locations, for example to
|
|
213
|
-
* point out two things with the same name. Errors during execution include a
|
|
214
|
-
* single location, the field which produced the error.
|
|
215
|
-
*
|
|
216
|
-
* Enumerable, and appears in the result of JSON.stringify().
|
|
217
|
-
*/
|
|
218
|
-
|
|
219
|
-
/**
|
|
220
|
-
* An array describing the JSON-path into the execution response which
|
|
221
|
-
* corresponds to this error. Only included for errors during execution.
|
|
222
|
-
*
|
|
223
|
-
* Enumerable, and appears in the result of JSON.stringify().
|
|
224
|
-
*/
|
|
225
|
-
|
|
226
|
-
/**
|
|
227
|
-
* An array of GraphQL AST Nodes corresponding to this error.
|
|
228
|
-
*/
|
|
229
|
-
|
|
230
|
-
/**
|
|
231
|
-
* The source GraphQL document for the first location of this error.
|
|
232
|
-
*
|
|
233
|
-
* Note that if this Error represents more than one node, the source may not
|
|
234
|
-
* represent nodes after the first node.
|
|
235
|
-
*/
|
|
236
|
-
|
|
237
|
-
/**
|
|
238
|
-
* An array of character offsets within the source GraphQL document
|
|
239
|
-
* which correspond to this error.
|
|
240
|
-
*/
|
|
241
|
-
|
|
242
|
-
/**
|
|
243
|
-
* The original error thrown from a field resolver during execution.
|
|
244
|
-
*/
|
|
245
|
-
|
|
246
|
-
/**
|
|
247
|
-
* Extension fields to add to the formatted error.
|
|
248
|
-
*/
|
|
249
|
-
function GraphQLError(message, nodes, source, positions, path, originalError, extensions) {
|
|
250
|
-
var _nodeLocations, _nodeLocations2, _nodeLocations3;
|
|
251
|
-
|
|
252
|
-
var _this;
|
|
253
|
-
|
|
254
|
-
_classCallCheck(this, GraphQLError);
|
|
255
|
-
|
|
256
|
-
_this = _super.call(this, message);
|
|
257
|
-
_this.name = 'GraphQLError';
|
|
258
|
-
_this.originalError = originalError !== null && originalError !== void 0 ? originalError : undefined; // Compute list of blame nodes.
|
|
259
|
-
|
|
260
|
-
_this.nodes = undefinedIfEmpty(Array.isArray(nodes) ? nodes : nodes ? [nodes] : undefined);
|
|
261
|
-
var nodeLocations = [];
|
|
262
|
-
|
|
263
|
-
for (var _i2 = 0, _ref3 = (_this$nodes = _this.nodes) !== null && _this$nodes !== void 0 ? _this$nodes : []; _i2 < _ref3.length; _i2++) {
|
|
264
|
-
var _this$nodes;
|
|
265
|
-
|
|
266
|
-
var _ref4 = _ref3[_i2];
|
|
267
|
-
var loc = _ref4.loc;
|
|
268
|
-
|
|
269
|
-
if (loc != null) {
|
|
270
|
-
nodeLocations.push(loc);
|
|
271
|
-
}
|
|
272
|
-
}
|
|
273
|
-
|
|
274
|
-
nodeLocations = undefinedIfEmpty(nodeLocations); // Compute locations in the source for the given nodes/positions.
|
|
275
|
-
|
|
276
|
-
_this.source = source !== null && source !== void 0 ? source : (_nodeLocations = nodeLocations) === null || _nodeLocations === void 0 ? void 0 : _nodeLocations[0].source;
|
|
277
|
-
_this.positions = positions !== null && positions !== void 0 ? positions : (_nodeLocations2 = nodeLocations) === null || _nodeLocations2 === void 0 ? void 0 : _nodeLocations2.map(function (loc) {
|
|
278
|
-
return loc.start;
|
|
279
|
-
});
|
|
280
|
-
_this.locations = positions && source ? positions.map(function (pos) {
|
|
281
|
-
return getLocation(source, pos);
|
|
282
|
-
}) : (_nodeLocations3 = nodeLocations) === null || _nodeLocations3 === void 0 ? void 0 : _nodeLocations3.map(function (loc) {
|
|
283
|
-
return getLocation(loc.source, loc.start);
|
|
284
|
-
});
|
|
285
|
-
_this.path = path !== null && path !== void 0 ? path : undefined;
|
|
286
|
-
var originalExtensions = originalError === null || originalError === void 0 ? void 0 : originalError.extensions;
|
|
287
|
-
|
|
288
|
-
if (extensions == null && isObjectLike(originalExtensions)) {
|
|
289
|
-
_this.extensions = _objectSpread({}, originalExtensions);
|
|
290
|
-
} else {
|
|
291
|
-
_this.extensions = extensions !== null && extensions !== void 0 ? extensions : {};
|
|
292
|
-
} // By being enumerable, JSON.stringify will include bellow properties in the resulting output.
|
|
293
|
-
// This ensures that the simplest possible GraphQL service adheres to the spec.
|
|
294
|
-
|
|
295
|
-
|
|
296
|
-
Object.defineProperties(_assertThisInitialized(_this), {
|
|
297
|
-
message: {
|
|
298
|
-
enumerable: true
|
|
299
|
-
},
|
|
300
|
-
locations: {
|
|
301
|
-
enumerable: _this.locations != null
|
|
302
|
-
},
|
|
303
|
-
path: {
|
|
304
|
-
enumerable: _this.path != null
|
|
305
|
-
},
|
|
306
|
-
extensions: {
|
|
307
|
-
enumerable: _this.extensions != null && Object.keys(_this.extensions).length > 0
|
|
308
|
-
},
|
|
309
|
-
name: {
|
|
310
|
-
enumerable: false
|
|
311
|
-
},
|
|
312
|
-
nodes: {
|
|
313
|
-
enumerable: false
|
|
314
|
-
},
|
|
315
|
-
source: {
|
|
316
|
-
enumerable: false
|
|
317
|
-
},
|
|
318
|
-
positions: {
|
|
319
|
-
enumerable: false
|
|
320
|
-
},
|
|
321
|
-
originalError: {
|
|
322
|
-
enumerable: false
|
|
323
|
-
}
|
|
324
|
-
}); // Include (non-enumerable) stack trace.
|
|
325
|
-
|
|
326
|
-
if (originalError !== null && originalError !== void 0 && originalError.stack) {
|
|
327
|
-
Object.defineProperty(_assertThisInitialized(_this), 'stack', {
|
|
328
|
-
value: originalError.stack,
|
|
329
|
-
writable: true,
|
|
330
|
-
configurable: true
|
|
331
|
-
});
|
|
332
|
-
return _possibleConstructorReturn(_this);
|
|
333
|
-
} // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')
|
|
334
|
-
|
|
335
|
-
|
|
336
|
-
if (Error.captureStackTrace) {
|
|
337
|
-
Error.captureStackTrace(_assertThisInitialized(_this), GraphQLError);
|
|
338
|
-
} else {
|
|
339
|
-
Object.defineProperty(_assertThisInitialized(_this), 'stack', {
|
|
340
|
-
value: Error().stack,
|
|
341
|
-
writable: true,
|
|
342
|
-
configurable: true
|
|
343
|
-
});
|
|
344
|
-
}
|
|
345
|
-
|
|
346
|
-
return _this;
|
|
347
|
-
}
|
|
348
|
-
|
|
349
|
-
_createClass$1(GraphQLError, [{
|
|
350
|
-
key: "toString",
|
|
351
|
-
value: function toString() {
|
|
352
|
-
return printError(this);
|
|
353
|
-
} // FIXME: workaround to not break chai comparisons, should be remove in v16
|
|
354
|
-
// $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet
|
|
355
|
-
|
|
356
|
-
}, {
|
|
357
|
-
key: SYMBOL_TO_STRING_TAG,
|
|
358
|
-
get: function get() {
|
|
359
|
-
return 'Object';
|
|
360
|
-
}
|
|
361
|
-
}]);
|
|
362
|
-
|
|
363
|
-
return GraphQLError;
|
|
364
|
-
}( /*#__PURE__*/_wrapNativeSuper(Error));
|
|
365
|
-
|
|
366
|
-
function undefinedIfEmpty(array) {
|
|
367
|
-
return array === undefined || array.length === 0 ? undefined : array;
|
|
368
|
-
}
|
|
369
|
-
/**
|
|
370
|
-
* Prints a GraphQLError to a string, representing useful location information
|
|
371
|
-
* about the error's position in the source.
|
|
372
|
-
*/
|
|
373
|
-
|
|
374
|
-
|
|
375
|
-
function printError(error) {
|
|
376
|
-
var output = error.message;
|
|
377
|
-
|
|
378
|
-
if (error.nodes) {
|
|
379
|
-
for (var _i4 = 0, _error$nodes2 = error.nodes; _i4 < _error$nodes2.length; _i4++) {
|
|
380
|
-
var node = _error$nodes2[_i4];
|
|
381
|
-
|
|
382
|
-
if (node.loc) {
|
|
383
|
-
output += '\n\n' + printLocation(node.loc);
|
|
384
|
-
}
|
|
385
|
-
}
|
|
386
|
-
} else if (error.source && error.locations) {
|
|
387
|
-
for (var _i6 = 0, _error$locations2 = error.locations; _i6 < _error$locations2.length; _i6++) {
|
|
388
|
-
var location = _error$locations2[_i6];
|
|
389
|
-
output += '\n\n' + printSourceLocation(error.source, location);
|
|
390
|
-
}
|
|
391
|
-
}
|
|
392
|
-
|
|
393
|
-
return output;
|
|
394
|
-
}
|
|
395
|
-
|
|
396
|
-
/**
|
|
397
|
-
* Produces a GraphQLError representing a syntax error, containing useful
|
|
398
|
-
* descriptive information about the syntax error's position in the source.
|
|
399
|
-
*/
|
|
400
|
-
|
|
401
|
-
function syntaxError(source, position, description) {
|
|
402
|
-
return new GraphQLError("Syntax Error: ".concat(description), undefined, source, [position]);
|
|
403
|
-
}
|
|
404
|
-
|
|
405
|
-
/**
|
|
406
|
-
* The set of allowed kind values for AST nodes.
|
|
407
|
-
*/
|
|
408
|
-
var Kind = Object.freeze({
|
|
409
|
-
// Name
|
|
410
|
-
NAME: 'Name',
|
|
411
|
-
// Document
|
|
412
|
-
DOCUMENT: 'Document',
|
|
413
|
-
OPERATION_DEFINITION: 'OperationDefinition',
|
|
414
|
-
VARIABLE_DEFINITION: 'VariableDefinition',
|
|
415
|
-
SELECTION_SET: 'SelectionSet',
|
|
416
|
-
FIELD: 'Field',
|
|
417
|
-
ARGUMENT: 'Argument',
|
|
418
|
-
// Fragments
|
|
419
|
-
FRAGMENT_SPREAD: 'FragmentSpread',
|
|
420
|
-
INLINE_FRAGMENT: 'InlineFragment',
|
|
421
|
-
FRAGMENT_DEFINITION: 'FragmentDefinition',
|
|
422
|
-
// Values
|
|
423
|
-
VARIABLE: 'Variable',
|
|
424
|
-
INT: 'IntValue',
|
|
425
|
-
FLOAT: 'FloatValue',
|
|
426
|
-
STRING: 'StringValue',
|
|
427
|
-
BOOLEAN: 'BooleanValue',
|
|
428
|
-
NULL: 'NullValue',
|
|
429
|
-
ENUM: 'EnumValue',
|
|
430
|
-
LIST: 'ListValue',
|
|
431
|
-
OBJECT: 'ObjectValue',
|
|
432
|
-
OBJECT_FIELD: 'ObjectField',
|
|
433
|
-
// Directives
|
|
434
|
-
DIRECTIVE: 'Directive',
|
|
435
|
-
// Types
|
|
436
|
-
NAMED_TYPE: 'NamedType',
|
|
437
|
-
LIST_TYPE: 'ListType',
|
|
438
|
-
NON_NULL_TYPE: 'NonNullType',
|
|
439
|
-
// Type System Definitions
|
|
440
|
-
SCHEMA_DEFINITION: 'SchemaDefinition',
|
|
441
|
-
OPERATION_TYPE_DEFINITION: 'OperationTypeDefinition',
|
|
442
|
-
// Type Definitions
|
|
443
|
-
SCALAR_TYPE_DEFINITION: 'ScalarTypeDefinition',
|
|
444
|
-
OBJECT_TYPE_DEFINITION: 'ObjectTypeDefinition',
|
|
445
|
-
FIELD_DEFINITION: 'FieldDefinition',
|
|
446
|
-
INPUT_VALUE_DEFINITION: 'InputValueDefinition',
|
|
447
|
-
INTERFACE_TYPE_DEFINITION: 'InterfaceTypeDefinition',
|
|
448
|
-
UNION_TYPE_DEFINITION: 'UnionTypeDefinition',
|
|
449
|
-
ENUM_TYPE_DEFINITION: 'EnumTypeDefinition',
|
|
450
|
-
ENUM_VALUE_DEFINITION: 'EnumValueDefinition',
|
|
451
|
-
INPUT_OBJECT_TYPE_DEFINITION: 'InputObjectTypeDefinition',
|
|
452
|
-
// Directive Definitions
|
|
453
|
-
DIRECTIVE_DEFINITION: 'DirectiveDefinition',
|
|
454
|
-
// Type System Extensions
|
|
455
|
-
SCHEMA_EXTENSION: 'SchemaExtension',
|
|
456
|
-
// Type Extensions
|
|
457
|
-
SCALAR_TYPE_EXTENSION: 'ScalarTypeExtension',
|
|
458
|
-
OBJECT_TYPE_EXTENSION: 'ObjectTypeExtension',
|
|
459
|
-
INTERFACE_TYPE_EXTENSION: 'InterfaceTypeExtension',
|
|
460
|
-
UNION_TYPE_EXTENSION: 'UnionTypeExtension',
|
|
461
|
-
ENUM_TYPE_EXTENSION: 'EnumTypeExtension',
|
|
462
|
-
INPUT_OBJECT_TYPE_EXTENSION: 'InputObjectTypeExtension'
|
|
463
|
-
});
|
|
464
|
-
/**
|
|
465
|
-
* The enum type representing the possible kind values of AST nodes.
|
|
466
|
-
*/
|
|
467
|
-
|
|
468
|
-
function invariant(condition, message) {
|
|
469
|
-
var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js')
|
|
470
|
-
|
|
471
|
-
if (!booleanCondition) {
|
|
472
|
-
throw new Error(message != null ? message : 'Unexpected invariant triggered.');
|
|
473
|
-
}
|
|
474
|
-
}
|
|
475
|
-
|
|
476
|
-
// istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')
|
|
477
|
-
var nodejsCustomInspectSymbol = typeof Symbol === 'function' && typeof Symbol.for === 'function' ? Symbol.for('nodejs.util.inspect.custom') : undefined;
|
|
478
|
-
var nodejsCustomInspectSymbol$1 = nodejsCustomInspectSymbol;
|
|
479
|
-
|
|
480
|
-
/**
|
|
481
|
-
* The `defineInspect()` function defines `inspect()` prototype method as alias of `toJSON`
|
|
482
|
-
*/
|
|
483
|
-
|
|
484
|
-
function defineInspect(classObject) {
|
|
485
|
-
var fn = classObject.prototype.toJSON;
|
|
486
|
-
typeof fn === 'function' || invariant(0);
|
|
487
|
-
classObject.prototype.inspect = fn; // istanbul ignore else (See: 'https://github.com/graphql/graphql-js/issues/2317')
|
|
488
|
-
|
|
489
|
-
if (nodejsCustomInspectSymbol$1) {
|
|
490
|
-
classObject.prototype[nodejsCustomInspectSymbol$1] = fn;
|
|
491
|
-
}
|
|
492
|
-
}
|
|
493
|
-
|
|
494
|
-
/**
|
|
495
|
-
* Contains a range of UTF-8 character offsets and token references that
|
|
496
|
-
* identify the region of the source from which the AST derived.
|
|
497
|
-
*/
|
|
498
|
-
var Location = /*#__PURE__*/function () {
|
|
499
|
-
/**
|
|
500
|
-
* The character offset at which this Node begins.
|
|
501
|
-
*/
|
|
502
|
-
|
|
503
|
-
/**
|
|
504
|
-
* The character offset at which this Node ends.
|
|
505
|
-
*/
|
|
506
|
-
|
|
507
|
-
/**
|
|
508
|
-
* The Token at which this Node begins.
|
|
509
|
-
*/
|
|
510
|
-
|
|
511
|
-
/**
|
|
512
|
-
* The Token at which this Node ends.
|
|
513
|
-
*/
|
|
514
|
-
|
|
515
|
-
/**
|
|
516
|
-
* The Source document the AST represents.
|
|
517
|
-
*/
|
|
518
|
-
function Location(startToken, endToken, source) {
|
|
519
|
-
this.start = startToken.start;
|
|
520
|
-
this.end = endToken.end;
|
|
521
|
-
this.startToken = startToken;
|
|
522
|
-
this.endToken = endToken;
|
|
523
|
-
this.source = source;
|
|
524
|
-
}
|
|
525
|
-
|
|
526
|
-
var _proto = Location.prototype;
|
|
527
|
-
|
|
528
|
-
_proto.toJSON = function toJSON() {
|
|
529
|
-
return {
|
|
530
|
-
start: this.start,
|
|
531
|
-
end: this.end
|
|
532
|
-
};
|
|
533
|
-
};
|
|
534
|
-
|
|
535
|
-
return Location;
|
|
536
|
-
}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.
|
|
537
|
-
|
|
538
|
-
defineInspect(Location);
|
|
539
|
-
/**
|
|
540
|
-
* Represents a range of characters represented by a lexical token
|
|
541
|
-
* within a Source.
|
|
542
|
-
*/
|
|
543
|
-
|
|
544
|
-
var Token = /*#__PURE__*/function () {
|
|
545
|
-
/**
|
|
546
|
-
* The kind of Token.
|
|
547
|
-
*/
|
|
548
|
-
|
|
549
|
-
/**
|
|
550
|
-
* The character offset at which this Node begins.
|
|
551
|
-
*/
|
|
552
|
-
|
|
553
|
-
/**
|
|
554
|
-
* The character offset at which this Node ends.
|
|
555
|
-
*/
|
|
556
|
-
|
|
557
|
-
/**
|
|
558
|
-
* The 1-indexed line number on which this Token appears.
|
|
559
|
-
*/
|
|
560
|
-
|
|
561
|
-
/**
|
|
562
|
-
* The 1-indexed column number at which this Token begins.
|
|
563
|
-
*/
|
|
564
|
-
|
|
565
|
-
/**
|
|
566
|
-
* For non-punctuation tokens, represents the interpreted value of the token.
|
|
567
|
-
*/
|
|
568
|
-
|
|
569
|
-
/**
|
|
570
|
-
* Tokens exist as nodes in a double-linked-list amongst all tokens
|
|
571
|
-
* including ignored tokens. <SOF> is always the first node and <EOF>
|
|
572
|
-
* the last.
|
|
573
|
-
*/
|
|
574
|
-
function Token(kind, start, end, line, column, prev, value) {
|
|
575
|
-
this.kind = kind;
|
|
576
|
-
this.start = start;
|
|
577
|
-
this.end = end;
|
|
578
|
-
this.line = line;
|
|
579
|
-
this.column = column;
|
|
580
|
-
this.value = value;
|
|
581
|
-
this.prev = prev;
|
|
582
|
-
this.next = null;
|
|
583
|
-
}
|
|
584
|
-
|
|
585
|
-
var _proto2 = Token.prototype;
|
|
586
|
-
|
|
587
|
-
_proto2.toJSON = function toJSON() {
|
|
588
|
-
return {
|
|
589
|
-
kind: this.kind,
|
|
590
|
-
value: this.value,
|
|
591
|
-
line: this.line,
|
|
592
|
-
column: this.column
|
|
593
|
-
};
|
|
594
|
-
};
|
|
595
|
-
|
|
596
|
-
return Token;
|
|
597
|
-
}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.
|
|
598
|
-
|
|
599
|
-
defineInspect(Token);
|
|
600
|
-
/**
|
|
601
|
-
* The list of all possible AST node types.
|
|
602
|
-
*/
|
|
603
|
-
|
|
604
|
-
/**
|
|
605
|
-
* An exported enum describing the different kinds of tokens that the
|
|
606
|
-
* lexer emits.
|
|
607
|
-
*/
|
|
608
|
-
var TokenKind = Object.freeze({
|
|
609
|
-
SOF: '<SOF>',
|
|
610
|
-
EOF: '<EOF>',
|
|
611
|
-
BANG: '!',
|
|
612
|
-
DOLLAR: '$',
|
|
613
|
-
AMP: '&',
|
|
614
|
-
PAREN_L: '(',
|
|
615
|
-
PAREN_R: ')',
|
|
616
|
-
SPREAD: '...',
|
|
617
|
-
COLON: ':',
|
|
618
|
-
EQUALS: '=',
|
|
619
|
-
AT: '@',
|
|
620
|
-
BRACKET_L: '[',
|
|
621
|
-
BRACKET_R: ']',
|
|
622
|
-
BRACE_L: '{',
|
|
623
|
-
PIPE: '|',
|
|
624
|
-
BRACE_R: '}',
|
|
625
|
-
NAME: 'Name',
|
|
626
|
-
INT: 'Int',
|
|
627
|
-
FLOAT: 'Float',
|
|
628
|
-
STRING: 'String',
|
|
629
|
-
BLOCK_STRING: 'BlockString',
|
|
630
|
-
COMMENT: 'Comment'
|
|
631
|
-
});
|
|
632
|
-
/**
|
|
633
|
-
* The enum type representing the token kinds values.
|
|
634
|
-
*/
|
|
635
|
-
|
|
636
|
-
function _typeof$1(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof$1 = function _typeof(obj) { return typeof obj; }; } else { _typeof$1 = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof$1(obj); }
|
|
637
|
-
var MAX_ARRAY_LENGTH = 10;
|
|
638
|
-
var MAX_RECURSIVE_DEPTH = 2;
|
|
639
|
-
/**
|
|
640
|
-
* Used to print values in error messages.
|
|
641
|
-
*/
|
|
642
|
-
|
|
643
|
-
function inspect(value) {
|
|
644
|
-
return formatValue(value, []);
|
|
645
|
-
}
|
|
646
|
-
|
|
647
|
-
function formatValue(value, seenValues) {
|
|
648
|
-
switch (_typeof$1(value)) {
|
|
649
|
-
case 'string':
|
|
650
|
-
return JSON.stringify(value);
|
|
651
|
-
|
|
652
|
-
case 'function':
|
|
653
|
-
return value.name ? "[function ".concat(value.name, "]") : '[function]';
|
|
654
|
-
|
|
655
|
-
case 'object':
|
|
656
|
-
if (value === null) {
|
|
657
|
-
return 'null';
|
|
658
|
-
}
|
|
659
|
-
|
|
660
|
-
return formatObjectValue(value, seenValues);
|
|
661
|
-
|
|
662
|
-
default:
|
|
663
|
-
return String(value);
|
|
664
|
-
}
|
|
665
|
-
}
|
|
666
|
-
|
|
667
|
-
function formatObjectValue(value, previouslySeenValues) {
|
|
668
|
-
if (previouslySeenValues.indexOf(value) !== -1) {
|
|
669
|
-
return '[Circular]';
|
|
670
|
-
}
|
|
671
|
-
|
|
672
|
-
var seenValues = [].concat(previouslySeenValues, [value]);
|
|
673
|
-
var customInspectFn = getCustomFn(value);
|
|
674
|
-
|
|
675
|
-
if (customInspectFn !== undefined) {
|
|
676
|
-
var customValue = customInspectFn.call(value); // check for infinite recursion
|
|
677
|
-
|
|
678
|
-
if (customValue !== value) {
|
|
679
|
-
return typeof customValue === 'string' ? customValue : formatValue(customValue, seenValues);
|
|
680
|
-
}
|
|
681
|
-
} else if (Array.isArray(value)) {
|
|
682
|
-
return formatArray(value, seenValues);
|
|
683
|
-
}
|
|
684
|
-
|
|
685
|
-
return formatObject(value, seenValues);
|
|
686
|
-
}
|
|
687
|
-
|
|
688
|
-
function formatObject(object, seenValues) {
|
|
689
|
-
var keys = Object.keys(object);
|
|
690
|
-
|
|
691
|
-
if (keys.length === 0) {
|
|
692
|
-
return '{}';
|
|
693
|
-
}
|
|
694
|
-
|
|
695
|
-
if (seenValues.length > MAX_RECURSIVE_DEPTH) {
|
|
696
|
-
return '[' + getObjectTag(object) + ']';
|
|
697
|
-
}
|
|
698
|
-
|
|
699
|
-
var properties = keys.map(function (key) {
|
|
700
|
-
var value = formatValue(object[key], seenValues);
|
|
701
|
-
return key + ': ' + value;
|
|
702
|
-
});
|
|
703
|
-
return '{ ' + properties.join(', ') + ' }';
|
|
704
|
-
}
|
|
705
|
-
|
|
706
|
-
function formatArray(array, seenValues) {
|
|
707
|
-
if (array.length === 0) {
|
|
708
|
-
return '[]';
|
|
709
|
-
}
|
|
710
|
-
|
|
711
|
-
if (seenValues.length > MAX_RECURSIVE_DEPTH) {
|
|
712
|
-
return '[Array]';
|
|
713
|
-
}
|
|
714
|
-
|
|
715
|
-
var len = Math.min(MAX_ARRAY_LENGTH, array.length);
|
|
716
|
-
var remaining = array.length - len;
|
|
717
|
-
var items = [];
|
|
718
|
-
|
|
719
|
-
for (var i = 0; i < len; ++i) {
|
|
720
|
-
items.push(formatValue(array[i], seenValues));
|
|
721
|
-
}
|
|
722
|
-
|
|
723
|
-
if (remaining === 1) {
|
|
724
|
-
items.push('... 1 more item');
|
|
725
|
-
} else if (remaining > 1) {
|
|
726
|
-
items.push("... ".concat(remaining, " more items"));
|
|
727
|
-
}
|
|
728
|
-
|
|
729
|
-
return '[' + items.join(', ') + ']';
|
|
730
|
-
}
|
|
731
|
-
|
|
732
|
-
function getCustomFn(object) {
|
|
733
|
-
var customInspectFn = object[String(nodejsCustomInspectSymbol$1)];
|
|
734
|
-
|
|
735
|
-
if (typeof customInspectFn === 'function') {
|
|
736
|
-
return customInspectFn;
|
|
737
|
-
}
|
|
738
|
-
|
|
739
|
-
if (typeof object.inspect === 'function') {
|
|
740
|
-
return object.inspect;
|
|
741
|
-
}
|
|
742
|
-
}
|
|
743
|
-
|
|
744
|
-
function getObjectTag(object) {
|
|
745
|
-
var tag = Object.prototype.toString.call(object).replace(/^\[object /, '').replace(/]$/, '');
|
|
746
|
-
|
|
747
|
-
if (tag === 'Object' && typeof object.constructor === 'function') {
|
|
748
|
-
var name = object.constructor.name;
|
|
749
|
-
|
|
750
|
-
if (typeof name === 'string' && name !== '') {
|
|
751
|
-
return name;
|
|
752
|
-
}
|
|
753
|
-
}
|
|
754
|
-
|
|
755
|
-
return tag;
|
|
756
|
-
}
|
|
757
|
-
|
|
758
|
-
function devAssert(condition, message) {
|
|
759
|
-
var booleanCondition = Boolean(condition); // istanbul ignore else (See transformation done in './resources/inlineInvariant.js')
|
|
760
|
-
|
|
761
|
-
if (!booleanCondition) {
|
|
762
|
-
throw new Error(message);
|
|
763
|
-
}
|
|
764
|
-
}
|
|
765
|
-
|
|
766
|
-
function _typeof(obj) { "@babel/helpers - typeof"; if (typeof Symbol === "function" && typeof Symbol.iterator === "symbol") { _typeof = function _typeof(obj) { return typeof obj; }; } else { _typeof = function _typeof(obj) { return obj && typeof Symbol === "function" && obj.constructor === Symbol && obj !== Symbol.prototype ? "symbol" : typeof obj; }; } return _typeof(obj); }
|
|
767
|
-
/**
|
|
768
|
-
* A replacement for instanceof which includes an error warning when multi-realm
|
|
769
|
-
* constructors are detected.
|
|
770
|
-
*/
|
|
771
|
-
|
|
772
|
-
// See: https://expressjs.com/en/advanced/best-practice-performance.html#set-node_env-to-production
|
|
773
|
-
// See: https://webpack.js.org/guides/production/
|
|
774
|
-
var instanceOf = process.env.NODE_ENV === 'production' ? // istanbul ignore next (See: 'https://github.com/graphql/graphql-js/issues/2317')
|
|
775
|
-
// eslint-disable-next-line no-shadow
|
|
776
|
-
function instanceOf(value, constructor) {
|
|
777
|
-
return value instanceof constructor;
|
|
778
|
-
} : // eslint-disable-next-line no-shadow
|
|
779
|
-
function instanceOf(value, constructor) {
|
|
780
|
-
if (value instanceof constructor) {
|
|
781
|
-
return true;
|
|
782
|
-
}
|
|
783
|
-
|
|
784
|
-
if (_typeof(value) === 'object' && value !== null) {
|
|
785
|
-
var _value$constructor;
|
|
786
|
-
|
|
787
|
-
var className = constructor.prototype[Symbol.toStringTag];
|
|
788
|
-
var valueClassName = // We still need to support constructor's name to detect conflicts with older versions of this library.
|
|
789
|
-
Symbol.toStringTag in value ? value[Symbol.toStringTag] : (_value$constructor = value.constructor) === null || _value$constructor === void 0 ? void 0 : _value$constructor.name;
|
|
790
|
-
|
|
791
|
-
if (className === valueClassName) {
|
|
792
|
-
var stringifiedValue = inspect(value);
|
|
793
|
-
throw new Error("Cannot use ".concat(className, " \"").concat(stringifiedValue, "\" from another module or realm.\n\nEnsure that there is only one instance of \"graphql\" in the node_modules\ndirectory. If different versions of \"graphql\" are the dependencies of other\nrelied on modules, use \"resolutions\" to ensure only one version is installed.\n\nhttps://yarnpkg.com/en/docs/selective-version-resolutions\n\nDuplicate \"graphql\" modules cannot be used at the same time since different\nversions may have different capabilities and behavior. The data from one\nversion used in the function from another could produce confusing and\nspurious results."));
|
|
794
|
-
}
|
|
795
|
-
}
|
|
796
|
-
|
|
797
|
-
return false;
|
|
798
|
-
};
|
|
799
|
-
|
|
800
|
-
function _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if ("value" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }
|
|
801
|
-
|
|
802
|
-
function _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); return Constructor; }
|
|
803
|
-
|
|
804
|
-
/**
|
|
805
|
-
* A representation of source input to GraphQL. The `name` and `locationOffset` parameters are
|
|
806
|
-
* optional, but they are useful for clients who store GraphQL documents in source files.
|
|
807
|
-
* For example, if the GraphQL input starts at line 40 in a file named `Foo.graphql`, it might
|
|
808
|
-
* be useful for `name` to be `"Foo.graphql"` and location to be `{ line: 40, column: 1 }`.
|
|
809
|
-
* The `line` and `column` properties in `locationOffset` are 1-indexed.
|
|
810
|
-
*/
|
|
811
|
-
var Source = /*#__PURE__*/function () {
|
|
812
|
-
function Source(body) {
|
|
813
|
-
var name = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 'GraphQL request';
|
|
814
|
-
var locationOffset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : {
|
|
815
|
-
line: 1,
|
|
816
|
-
column: 1
|
|
817
|
-
};
|
|
818
|
-
typeof body === 'string' || devAssert(0, "Body must be a string. Received: ".concat(inspect(body), "."));
|
|
819
|
-
this.body = body;
|
|
820
|
-
this.name = name;
|
|
821
|
-
this.locationOffset = locationOffset;
|
|
822
|
-
this.locationOffset.line > 0 || devAssert(0, 'line in locationOffset is 1-indexed and must be positive.');
|
|
823
|
-
this.locationOffset.column > 0 || devAssert(0, 'column in locationOffset is 1-indexed and must be positive.');
|
|
824
|
-
} // $FlowFixMe[unsupported-syntax] Flow doesn't support computed properties yet
|
|
825
|
-
|
|
826
|
-
|
|
827
|
-
_createClass(Source, [{
|
|
828
|
-
key: SYMBOL_TO_STRING_TAG,
|
|
829
|
-
get: function get() {
|
|
830
|
-
return 'Source';
|
|
831
|
-
}
|
|
832
|
-
}]);
|
|
833
|
-
|
|
834
|
-
return Source;
|
|
835
|
-
}();
|
|
836
|
-
/**
|
|
837
|
-
* Test if the given value is a Source object.
|
|
838
|
-
*
|
|
839
|
-
* @internal
|
|
840
|
-
*/
|
|
841
|
-
|
|
842
|
-
// eslint-disable-next-line no-redeclare
|
|
843
|
-
function isSource(source) {
|
|
844
|
-
return instanceOf(source, Source);
|
|
845
|
-
}
|
|
846
|
-
|
|
847
|
-
/**
|
|
848
|
-
* The set of allowed directive location values.
|
|
849
|
-
*/
|
|
850
|
-
var DirectiveLocation = Object.freeze({
|
|
851
|
-
// Request Definitions
|
|
852
|
-
QUERY: 'QUERY',
|
|
853
|
-
MUTATION: 'MUTATION',
|
|
854
|
-
SUBSCRIPTION: 'SUBSCRIPTION',
|
|
855
|
-
FIELD: 'FIELD',
|
|
856
|
-
FRAGMENT_DEFINITION: 'FRAGMENT_DEFINITION',
|
|
857
|
-
FRAGMENT_SPREAD: 'FRAGMENT_SPREAD',
|
|
858
|
-
INLINE_FRAGMENT: 'INLINE_FRAGMENT',
|
|
859
|
-
VARIABLE_DEFINITION: 'VARIABLE_DEFINITION',
|
|
860
|
-
// Type System Definitions
|
|
861
|
-
SCHEMA: 'SCHEMA',
|
|
862
|
-
SCALAR: 'SCALAR',
|
|
863
|
-
OBJECT: 'OBJECT',
|
|
864
|
-
FIELD_DEFINITION: 'FIELD_DEFINITION',
|
|
865
|
-
ARGUMENT_DEFINITION: 'ARGUMENT_DEFINITION',
|
|
866
|
-
INTERFACE: 'INTERFACE',
|
|
867
|
-
UNION: 'UNION',
|
|
868
|
-
ENUM: 'ENUM',
|
|
869
|
-
ENUM_VALUE: 'ENUM_VALUE',
|
|
870
|
-
INPUT_OBJECT: 'INPUT_OBJECT',
|
|
871
|
-
INPUT_FIELD_DEFINITION: 'INPUT_FIELD_DEFINITION'
|
|
872
|
-
});
|
|
873
|
-
/**
|
|
874
|
-
* The enum type representing the directive location values.
|
|
875
|
-
*/
|
|
876
|
-
|
|
877
|
-
/**
|
|
878
|
-
* Produces the value of a block string from its parsed raw value, similar to
|
|
879
|
-
* CoffeeScript's block string, Python's docstring trim or Ruby's strip_heredoc.
|
|
880
|
-
*
|
|
881
|
-
* This implements the GraphQL spec's BlockStringValue() static algorithm.
|
|
882
|
-
*
|
|
883
|
-
* @internal
|
|
884
|
-
*/
|
|
885
|
-
function dedentBlockStringValue(rawString) {
|
|
886
|
-
// Expand a block string's raw value into independent lines.
|
|
887
|
-
var lines = rawString.split(/\r\n|[\n\r]/g); // Remove common indentation from all lines but first.
|
|
888
|
-
|
|
889
|
-
var commonIndent = getBlockStringIndentation(rawString);
|
|
890
|
-
|
|
891
|
-
if (commonIndent !== 0) {
|
|
892
|
-
for (var i = 1; i < lines.length; i++) {
|
|
893
|
-
lines[i] = lines[i].slice(commonIndent);
|
|
894
|
-
}
|
|
895
|
-
} // Remove leading and trailing blank lines.
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
var startLine = 0;
|
|
899
|
-
|
|
900
|
-
while (startLine < lines.length && isBlank(lines[startLine])) {
|
|
901
|
-
++startLine;
|
|
902
|
-
}
|
|
903
|
-
|
|
904
|
-
var endLine = lines.length;
|
|
905
|
-
|
|
906
|
-
while (endLine > startLine && isBlank(lines[endLine - 1])) {
|
|
907
|
-
--endLine;
|
|
908
|
-
} // Return a string of the lines joined with U+000A.
|
|
909
|
-
|
|
910
|
-
|
|
911
|
-
return lines.slice(startLine, endLine).join('\n');
|
|
912
|
-
}
|
|
913
|
-
|
|
914
|
-
function isBlank(str) {
|
|
915
|
-
for (var i = 0; i < str.length; ++i) {
|
|
916
|
-
if (str[i] !== ' ' && str[i] !== '\t') {
|
|
917
|
-
return false;
|
|
918
|
-
}
|
|
919
|
-
}
|
|
920
|
-
|
|
921
|
-
return true;
|
|
922
|
-
}
|
|
923
|
-
/**
|
|
924
|
-
* @internal
|
|
925
|
-
*/
|
|
926
|
-
|
|
927
|
-
|
|
928
|
-
function getBlockStringIndentation(value) {
|
|
929
|
-
var _commonIndent;
|
|
930
|
-
|
|
931
|
-
var isFirstLine = true;
|
|
932
|
-
var isEmptyLine = true;
|
|
933
|
-
var indent = 0;
|
|
934
|
-
var commonIndent = null;
|
|
935
|
-
|
|
936
|
-
for (var i = 0; i < value.length; ++i) {
|
|
937
|
-
switch (value.charCodeAt(i)) {
|
|
938
|
-
case 13:
|
|
939
|
-
// \r
|
|
940
|
-
if (value.charCodeAt(i + 1) === 10) {
|
|
941
|
-
++i; // skip \r\n as one symbol
|
|
942
|
-
}
|
|
943
|
-
|
|
944
|
-
// falls through
|
|
945
|
-
|
|
946
|
-
case 10:
|
|
947
|
-
// \n
|
|
948
|
-
isFirstLine = false;
|
|
949
|
-
isEmptyLine = true;
|
|
950
|
-
indent = 0;
|
|
951
|
-
break;
|
|
952
|
-
|
|
953
|
-
case 9: // \t
|
|
954
|
-
|
|
955
|
-
case 32:
|
|
956
|
-
// <space>
|
|
957
|
-
++indent;
|
|
958
|
-
break;
|
|
959
|
-
|
|
960
|
-
default:
|
|
961
|
-
if (isEmptyLine && !isFirstLine && (commonIndent === null || indent < commonIndent)) {
|
|
962
|
-
commonIndent = indent;
|
|
963
|
-
}
|
|
964
|
-
|
|
965
|
-
isEmptyLine = false;
|
|
966
|
-
}
|
|
967
|
-
}
|
|
968
|
-
|
|
969
|
-
return (_commonIndent = commonIndent) !== null && _commonIndent !== void 0 ? _commonIndent : 0;
|
|
970
|
-
}
|
|
971
|
-
|
|
972
|
-
/**
|
|
973
|
-
* Given a Source object, creates a Lexer for that source.
|
|
974
|
-
* A Lexer is a stateful stream generator in that every time
|
|
975
|
-
* it is advanced, it returns the next token in the Source. Assuming the
|
|
976
|
-
* source lexes, the final Token emitted by the lexer will be of kind
|
|
977
|
-
* EOF, after which the lexer will repeatedly return the same EOF token
|
|
978
|
-
* whenever called.
|
|
979
|
-
*/
|
|
980
|
-
|
|
981
|
-
var Lexer = /*#__PURE__*/function () {
|
|
982
|
-
/**
|
|
983
|
-
* The previously focused non-ignored token.
|
|
984
|
-
*/
|
|
985
|
-
|
|
986
|
-
/**
|
|
987
|
-
* The currently focused non-ignored token.
|
|
988
|
-
*/
|
|
989
|
-
|
|
990
|
-
/**
|
|
991
|
-
* The (1-indexed) line containing the current token.
|
|
992
|
-
*/
|
|
993
|
-
|
|
994
|
-
/**
|
|
995
|
-
* The character offset at which the current line begins.
|
|
996
|
-
*/
|
|
997
|
-
function Lexer(source) {
|
|
998
|
-
var startOfFileToken = new Token(TokenKind.SOF, 0, 0, 0, 0, null);
|
|
999
|
-
this.source = source;
|
|
1000
|
-
this.lastToken = startOfFileToken;
|
|
1001
|
-
this.token = startOfFileToken;
|
|
1002
|
-
this.line = 1;
|
|
1003
|
-
this.lineStart = 0;
|
|
1004
|
-
}
|
|
1005
|
-
/**
|
|
1006
|
-
* Advances the token stream to the next non-ignored token.
|
|
1007
|
-
*/
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
var _proto = Lexer.prototype;
|
|
1011
|
-
|
|
1012
|
-
_proto.advance = function advance() {
|
|
1013
|
-
this.lastToken = this.token;
|
|
1014
|
-
var token = this.token = this.lookahead();
|
|
1015
|
-
return token;
|
|
1016
|
-
}
|
|
1017
|
-
/**
|
|
1018
|
-
* Looks ahead and returns the next non-ignored token, but does not change
|
|
1019
|
-
* the state of Lexer.
|
|
1020
|
-
*/
|
|
1021
|
-
;
|
|
1022
|
-
|
|
1023
|
-
_proto.lookahead = function lookahead() {
|
|
1024
|
-
var token = this.token;
|
|
1025
|
-
|
|
1026
|
-
if (token.kind !== TokenKind.EOF) {
|
|
1027
|
-
do {
|
|
1028
|
-
var _token$next;
|
|
1029
|
-
|
|
1030
|
-
// Note: next is only mutable during parsing, so we cast to allow this.
|
|
1031
|
-
token = (_token$next = token.next) !== null && _token$next !== void 0 ? _token$next : token.next = readToken(this, token);
|
|
1032
|
-
} while (token.kind === TokenKind.COMMENT);
|
|
1033
|
-
}
|
|
1034
|
-
|
|
1035
|
-
return token;
|
|
1036
|
-
};
|
|
1037
|
-
|
|
1038
|
-
return Lexer;
|
|
1039
|
-
}();
|
|
1040
|
-
/**
|
|
1041
|
-
* @internal
|
|
1042
|
-
*/
|
|
1043
|
-
|
|
1044
|
-
function isPunctuatorTokenKind(kind) {
|
|
1045
|
-
return kind === TokenKind.BANG || kind === TokenKind.DOLLAR || kind === TokenKind.AMP || kind === TokenKind.PAREN_L || kind === TokenKind.PAREN_R || kind === TokenKind.SPREAD || kind === TokenKind.COLON || kind === TokenKind.EQUALS || kind === TokenKind.AT || kind === TokenKind.BRACKET_L || kind === TokenKind.BRACKET_R || kind === TokenKind.BRACE_L || kind === TokenKind.PIPE || kind === TokenKind.BRACE_R;
|
|
1046
|
-
}
|
|
1047
|
-
|
|
1048
|
-
function printCharCode(code) {
|
|
1049
|
-
return (// NaN/undefined represents access beyond the end of the file.
|
|
1050
|
-
isNaN(code) ? TokenKind.EOF : // Trust JSON for ASCII.
|
|
1051
|
-
code < 0x007f ? JSON.stringify(String.fromCharCode(code)) : // Otherwise print the escaped form.
|
|
1052
|
-
"\"\\u".concat(('00' + code.toString(16).toUpperCase()).slice(-4), "\"")
|
|
1053
|
-
);
|
|
1054
|
-
}
|
|
1055
|
-
/**
|
|
1056
|
-
* Gets the next token from the source starting at the given position.
|
|
1057
|
-
*
|
|
1058
|
-
* This skips over whitespace until it finds the next lexable token, then lexes
|
|
1059
|
-
* punctuators immediately or calls the appropriate helper function for more
|
|
1060
|
-
* complicated tokens.
|
|
1061
|
-
*/
|
|
1062
|
-
|
|
1063
|
-
|
|
1064
|
-
function readToken(lexer, prev) {
|
|
1065
|
-
var source = lexer.source;
|
|
1066
|
-
var body = source.body;
|
|
1067
|
-
var bodyLength = body.length;
|
|
1068
|
-
var pos = prev.end;
|
|
1069
|
-
|
|
1070
|
-
while (pos < bodyLength) {
|
|
1071
|
-
var code = body.charCodeAt(pos);
|
|
1072
|
-
var _line = lexer.line;
|
|
1073
|
-
|
|
1074
|
-
var _col = 1 + pos - lexer.lineStart; // SourceCharacter
|
|
1075
|
-
|
|
1076
|
-
|
|
1077
|
-
switch (code) {
|
|
1078
|
-
case 0xfeff: // <BOM>
|
|
1079
|
-
|
|
1080
|
-
case 9: // \t
|
|
1081
|
-
|
|
1082
|
-
case 32: // <space>
|
|
1083
|
-
|
|
1084
|
-
case 44:
|
|
1085
|
-
// ,
|
|
1086
|
-
++pos;
|
|
1087
|
-
continue;
|
|
1088
|
-
|
|
1089
|
-
case 10:
|
|
1090
|
-
// \n
|
|
1091
|
-
++pos;
|
|
1092
|
-
++lexer.line;
|
|
1093
|
-
lexer.lineStart = pos;
|
|
1094
|
-
continue;
|
|
1095
|
-
|
|
1096
|
-
case 13:
|
|
1097
|
-
// \r
|
|
1098
|
-
if (body.charCodeAt(pos + 1) === 10) {
|
|
1099
|
-
pos += 2;
|
|
1100
|
-
} else {
|
|
1101
|
-
++pos;
|
|
1102
|
-
}
|
|
1103
|
-
|
|
1104
|
-
++lexer.line;
|
|
1105
|
-
lexer.lineStart = pos;
|
|
1106
|
-
continue;
|
|
1107
|
-
|
|
1108
|
-
case 33:
|
|
1109
|
-
// !
|
|
1110
|
-
return new Token(TokenKind.BANG, pos, pos + 1, _line, _col, prev);
|
|
1111
|
-
|
|
1112
|
-
case 35:
|
|
1113
|
-
// #
|
|
1114
|
-
return readComment(source, pos, _line, _col, prev);
|
|
1115
|
-
|
|
1116
|
-
case 36:
|
|
1117
|
-
// $
|
|
1118
|
-
return new Token(TokenKind.DOLLAR, pos, pos + 1, _line, _col, prev);
|
|
1119
|
-
|
|
1120
|
-
case 38:
|
|
1121
|
-
// &
|
|
1122
|
-
return new Token(TokenKind.AMP, pos, pos + 1, _line, _col, prev);
|
|
1123
|
-
|
|
1124
|
-
case 40:
|
|
1125
|
-
// (
|
|
1126
|
-
return new Token(TokenKind.PAREN_L, pos, pos + 1, _line, _col, prev);
|
|
1127
|
-
|
|
1128
|
-
case 41:
|
|
1129
|
-
// )
|
|
1130
|
-
return new Token(TokenKind.PAREN_R, pos, pos + 1, _line, _col, prev);
|
|
1131
|
-
|
|
1132
|
-
case 46:
|
|
1133
|
-
// .
|
|
1134
|
-
if (body.charCodeAt(pos + 1) === 46 && body.charCodeAt(pos + 2) === 46) {
|
|
1135
|
-
return new Token(TokenKind.SPREAD, pos, pos + 3, _line, _col, prev);
|
|
1136
|
-
}
|
|
1137
|
-
|
|
1138
|
-
break;
|
|
1139
|
-
|
|
1140
|
-
case 58:
|
|
1141
|
-
// :
|
|
1142
|
-
return new Token(TokenKind.COLON, pos, pos + 1, _line, _col, prev);
|
|
1143
|
-
|
|
1144
|
-
case 61:
|
|
1145
|
-
// =
|
|
1146
|
-
return new Token(TokenKind.EQUALS, pos, pos + 1, _line, _col, prev);
|
|
1147
|
-
|
|
1148
|
-
case 64:
|
|
1149
|
-
// @
|
|
1150
|
-
return new Token(TokenKind.AT, pos, pos + 1, _line, _col, prev);
|
|
1151
|
-
|
|
1152
|
-
case 91:
|
|
1153
|
-
// [
|
|
1154
|
-
return new Token(TokenKind.BRACKET_L, pos, pos + 1, _line, _col, prev);
|
|
1155
|
-
|
|
1156
|
-
case 93:
|
|
1157
|
-
// ]
|
|
1158
|
-
return new Token(TokenKind.BRACKET_R, pos, pos + 1, _line, _col, prev);
|
|
1159
|
-
|
|
1160
|
-
case 123:
|
|
1161
|
-
// {
|
|
1162
|
-
return new Token(TokenKind.BRACE_L, pos, pos + 1, _line, _col, prev);
|
|
1163
|
-
|
|
1164
|
-
case 124:
|
|
1165
|
-
// |
|
|
1166
|
-
return new Token(TokenKind.PIPE, pos, pos + 1, _line, _col, prev);
|
|
1167
|
-
|
|
1168
|
-
case 125:
|
|
1169
|
-
// }
|
|
1170
|
-
return new Token(TokenKind.BRACE_R, pos, pos + 1, _line, _col, prev);
|
|
1171
|
-
|
|
1172
|
-
case 34:
|
|
1173
|
-
// "
|
|
1174
|
-
if (body.charCodeAt(pos + 1) === 34 && body.charCodeAt(pos + 2) === 34) {
|
|
1175
|
-
return readBlockString(source, pos, _line, _col, prev, lexer);
|
|
1176
|
-
}
|
|
1177
|
-
|
|
1178
|
-
return readString(source, pos, _line, _col, prev);
|
|
1179
|
-
|
|
1180
|
-
case 45: // -
|
|
1181
|
-
|
|
1182
|
-
case 48: // 0
|
|
1183
|
-
|
|
1184
|
-
case 49: // 1
|
|
1185
|
-
|
|
1186
|
-
case 50: // 2
|
|
1187
|
-
|
|
1188
|
-
case 51: // 3
|
|
1189
|
-
|
|
1190
|
-
case 52: // 4
|
|
1191
|
-
|
|
1192
|
-
case 53: // 5
|
|
1193
|
-
|
|
1194
|
-
case 54: // 6
|
|
1195
|
-
|
|
1196
|
-
case 55: // 7
|
|
1197
|
-
|
|
1198
|
-
case 56: // 8
|
|
1199
|
-
|
|
1200
|
-
case 57:
|
|
1201
|
-
// 9
|
|
1202
|
-
return readNumber(source, pos, code, _line, _col, prev);
|
|
1203
|
-
|
|
1204
|
-
case 65: // A
|
|
1205
|
-
|
|
1206
|
-
case 66: // B
|
|
1207
|
-
|
|
1208
|
-
case 67: // C
|
|
1209
|
-
|
|
1210
|
-
case 68: // D
|
|
1211
|
-
|
|
1212
|
-
case 69: // E
|
|
1213
|
-
|
|
1214
|
-
case 70: // F
|
|
1215
|
-
|
|
1216
|
-
case 71: // G
|
|
1217
|
-
|
|
1218
|
-
case 72: // H
|
|
1219
|
-
|
|
1220
|
-
case 73: // I
|
|
1221
|
-
|
|
1222
|
-
case 74: // J
|
|
1223
|
-
|
|
1224
|
-
case 75: // K
|
|
1225
|
-
|
|
1226
|
-
case 76: // L
|
|
1227
|
-
|
|
1228
|
-
case 77: // M
|
|
1229
|
-
|
|
1230
|
-
case 78: // N
|
|
1231
|
-
|
|
1232
|
-
case 79: // O
|
|
1233
|
-
|
|
1234
|
-
case 80: // P
|
|
1235
|
-
|
|
1236
|
-
case 81: // Q
|
|
1237
|
-
|
|
1238
|
-
case 82: // R
|
|
1239
|
-
|
|
1240
|
-
case 83: // S
|
|
1241
|
-
|
|
1242
|
-
case 84: // T
|
|
1243
|
-
|
|
1244
|
-
case 85: // U
|
|
1245
|
-
|
|
1246
|
-
case 86: // V
|
|
1247
|
-
|
|
1248
|
-
case 87: // W
|
|
1249
|
-
|
|
1250
|
-
case 88: // X
|
|
1251
|
-
|
|
1252
|
-
case 89: // Y
|
|
1253
|
-
|
|
1254
|
-
case 90: // Z
|
|
1255
|
-
|
|
1256
|
-
case 95: // _
|
|
1257
|
-
|
|
1258
|
-
case 97: // a
|
|
1259
|
-
|
|
1260
|
-
case 98: // b
|
|
1261
|
-
|
|
1262
|
-
case 99: // c
|
|
1263
|
-
|
|
1264
|
-
case 100: // d
|
|
1265
|
-
|
|
1266
|
-
case 101: // e
|
|
1267
|
-
|
|
1268
|
-
case 102: // f
|
|
1269
|
-
|
|
1270
|
-
case 103: // g
|
|
1271
|
-
|
|
1272
|
-
case 104: // h
|
|
1273
|
-
|
|
1274
|
-
case 105: // i
|
|
1275
|
-
|
|
1276
|
-
case 106: // j
|
|
1277
|
-
|
|
1278
|
-
case 107: // k
|
|
1279
|
-
|
|
1280
|
-
case 108: // l
|
|
1281
|
-
|
|
1282
|
-
case 109: // m
|
|
1283
|
-
|
|
1284
|
-
case 110: // n
|
|
1285
|
-
|
|
1286
|
-
case 111: // o
|
|
1287
|
-
|
|
1288
|
-
case 112: // p
|
|
1289
|
-
|
|
1290
|
-
case 113: // q
|
|
1291
|
-
|
|
1292
|
-
case 114: // r
|
|
1293
|
-
|
|
1294
|
-
case 115: // s
|
|
1295
|
-
|
|
1296
|
-
case 116: // t
|
|
1297
|
-
|
|
1298
|
-
case 117: // u
|
|
1299
|
-
|
|
1300
|
-
case 118: // v
|
|
1301
|
-
|
|
1302
|
-
case 119: // w
|
|
1303
|
-
|
|
1304
|
-
case 120: // x
|
|
1305
|
-
|
|
1306
|
-
case 121: // y
|
|
1307
|
-
|
|
1308
|
-
case 122:
|
|
1309
|
-
// z
|
|
1310
|
-
return readName(source, pos, _line, _col, prev);
|
|
1311
|
-
}
|
|
1312
|
-
|
|
1313
|
-
throw syntaxError(source, pos, unexpectedCharacterMessage(code));
|
|
1314
|
-
}
|
|
1315
|
-
|
|
1316
|
-
var line = lexer.line;
|
|
1317
|
-
var col = 1 + pos - lexer.lineStart;
|
|
1318
|
-
return new Token(TokenKind.EOF, bodyLength, bodyLength, line, col, prev);
|
|
1319
|
-
}
|
|
1320
|
-
/**
|
|
1321
|
-
* Report a message that an unexpected character was encountered.
|
|
1322
|
-
*/
|
|
1323
|
-
|
|
1324
|
-
|
|
1325
|
-
function unexpectedCharacterMessage(code) {
|
|
1326
|
-
if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {
|
|
1327
|
-
return "Cannot contain the invalid character ".concat(printCharCode(code), ".");
|
|
1328
|
-
}
|
|
1329
|
-
|
|
1330
|
-
if (code === 39) {
|
|
1331
|
-
// '
|
|
1332
|
-
return 'Unexpected single quote character (\'), did you mean to use a double quote (")?';
|
|
1333
|
-
}
|
|
1334
|
-
|
|
1335
|
-
return "Cannot parse the unexpected character ".concat(printCharCode(code), ".");
|
|
1336
|
-
}
|
|
1337
|
-
/**
|
|
1338
|
-
* Reads a comment token from the source file.
|
|
1339
|
-
*
|
|
1340
|
-
* #[\u0009\u0020-\uFFFF]*
|
|
1341
|
-
*/
|
|
1342
|
-
|
|
1343
|
-
|
|
1344
|
-
function readComment(source, start, line, col, prev) {
|
|
1345
|
-
var body = source.body;
|
|
1346
|
-
var code;
|
|
1347
|
-
var position = start;
|
|
1348
|
-
|
|
1349
|
-
do {
|
|
1350
|
-
code = body.charCodeAt(++position);
|
|
1351
|
-
} while (!isNaN(code) && ( // SourceCharacter but not LineTerminator
|
|
1352
|
-
code > 0x001f || code === 0x0009));
|
|
1353
|
-
|
|
1354
|
-
return new Token(TokenKind.COMMENT, start, position, line, col, prev, body.slice(start + 1, position));
|
|
1355
|
-
}
|
|
1356
|
-
/**
|
|
1357
|
-
* Reads a number token from the source file, either a float
|
|
1358
|
-
* or an int depending on whether a decimal point appears.
|
|
1359
|
-
*
|
|
1360
|
-
* Int: -?(0|[1-9][0-9]*)
|
|
1361
|
-
* Float: -?(0|[1-9][0-9]*)(\.[0-9]+)?((E|e)(+|-)?[0-9]+)?
|
|
1362
|
-
*/
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
function readNumber(source, start, firstCode, line, col, prev) {
|
|
1366
|
-
var body = source.body;
|
|
1367
|
-
var code = firstCode;
|
|
1368
|
-
var position = start;
|
|
1369
|
-
var isFloat = false;
|
|
1370
|
-
|
|
1371
|
-
if (code === 45) {
|
|
1372
|
-
// -
|
|
1373
|
-
code = body.charCodeAt(++position);
|
|
1374
|
-
}
|
|
1375
|
-
|
|
1376
|
-
if (code === 48) {
|
|
1377
|
-
// 0
|
|
1378
|
-
code = body.charCodeAt(++position);
|
|
1379
|
-
|
|
1380
|
-
if (code >= 48 && code <= 57) {
|
|
1381
|
-
throw syntaxError(source, position, "Invalid number, unexpected digit after 0: ".concat(printCharCode(code), "."));
|
|
1382
|
-
}
|
|
1383
|
-
} else {
|
|
1384
|
-
position = readDigits(source, position, code);
|
|
1385
|
-
code = body.charCodeAt(position);
|
|
1386
|
-
}
|
|
1387
|
-
|
|
1388
|
-
if (code === 46) {
|
|
1389
|
-
// .
|
|
1390
|
-
isFloat = true;
|
|
1391
|
-
code = body.charCodeAt(++position);
|
|
1392
|
-
position = readDigits(source, position, code);
|
|
1393
|
-
code = body.charCodeAt(position);
|
|
1394
|
-
}
|
|
1395
|
-
|
|
1396
|
-
if (code === 69 || code === 101) {
|
|
1397
|
-
// E e
|
|
1398
|
-
isFloat = true;
|
|
1399
|
-
code = body.charCodeAt(++position);
|
|
1400
|
-
|
|
1401
|
-
if (code === 43 || code === 45) {
|
|
1402
|
-
// + -
|
|
1403
|
-
code = body.charCodeAt(++position);
|
|
1404
|
-
}
|
|
1405
|
-
|
|
1406
|
-
position = readDigits(source, position, code);
|
|
1407
|
-
code = body.charCodeAt(position);
|
|
1408
|
-
} // Numbers cannot be followed by . or NameStart
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
if (code === 46 || isNameStart(code)) {
|
|
1412
|
-
throw syntaxError(source, position, "Invalid number, expected digit but got: ".concat(printCharCode(code), "."));
|
|
1413
|
-
}
|
|
1414
|
-
|
|
1415
|
-
return new Token(isFloat ? TokenKind.FLOAT : TokenKind.INT, start, position, line, col, prev, body.slice(start, position));
|
|
1416
|
-
}
|
|
1417
|
-
/**
|
|
1418
|
-
* Returns the new position in the source after reading digits.
|
|
1419
|
-
*/
|
|
1420
|
-
|
|
1421
|
-
|
|
1422
|
-
function readDigits(source, start, firstCode) {
|
|
1423
|
-
var body = source.body;
|
|
1424
|
-
var position = start;
|
|
1425
|
-
var code = firstCode;
|
|
1426
|
-
|
|
1427
|
-
if (code >= 48 && code <= 57) {
|
|
1428
|
-
// 0 - 9
|
|
1429
|
-
do {
|
|
1430
|
-
code = body.charCodeAt(++position);
|
|
1431
|
-
} while (code >= 48 && code <= 57); // 0 - 9
|
|
1432
|
-
|
|
1433
|
-
|
|
1434
|
-
return position;
|
|
1435
|
-
}
|
|
1436
|
-
|
|
1437
|
-
throw syntaxError(source, position, "Invalid number, expected digit but got: ".concat(printCharCode(code), "."));
|
|
1438
|
-
}
|
|
1439
|
-
/**
|
|
1440
|
-
* Reads a string token from the source file.
|
|
1441
|
-
*
|
|
1442
|
-
* "([^"\\\u000A\u000D]|(\\(u[0-9a-fA-F]{4}|["\\/bfnrt])))*"
|
|
1443
|
-
*/
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
function readString(source, start, line, col, prev) {
|
|
1447
|
-
var body = source.body;
|
|
1448
|
-
var position = start + 1;
|
|
1449
|
-
var chunkStart = position;
|
|
1450
|
-
var code = 0;
|
|
1451
|
-
var value = '';
|
|
1452
|
-
|
|
1453
|
-
while (position < body.length && !isNaN(code = body.charCodeAt(position)) && // not LineTerminator
|
|
1454
|
-
code !== 0x000a && code !== 0x000d) {
|
|
1455
|
-
// Closing Quote (")
|
|
1456
|
-
if (code === 34) {
|
|
1457
|
-
value += body.slice(chunkStart, position);
|
|
1458
|
-
return new Token(TokenKind.STRING, start, position + 1, line, col, prev, value);
|
|
1459
|
-
} // SourceCharacter
|
|
1460
|
-
|
|
1461
|
-
|
|
1462
|
-
if (code < 0x0020 && code !== 0x0009) {
|
|
1463
|
-
throw syntaxError(source, position, "Invalid character within String: ".concat(printCharCode(code), "."));
|
|
1464
|
-
}
|
|
1465
|
-
|
|
1466
|
-
++position;
|
|
1467
|
-
|
|
1468
|
-
if (code === 92) {
|
|
1469
|
-
// \
|
|
1470
|
-
value += body.slice(chunkStart, position - 1);
|
|
1471
|
-
code = body.charCodeAt(position);
|
|
1472
|
-
|
|
1473
|
-
switch (code) {
|
|
1474
|
-
case 34:
|
|
1475
|
-
value += '"';
|
|
1476
|
-
break;
|
|
1477
|
-
|
|
1478
|
-
case 47:
|
|
1479
|
-
value += '/';
|
|
1480
|
-
break;
|
|
1481
|
-
|
|
1482
|
-
case 92:
|
|
1483
|
-
value += '\\';
|
|
1484
|
-
break;
|
|
1485
|
-
|
|
1486
|
-
case 98:
|
|
1487
|
-
value += '\b';
|
|
1488
|
-
break;
|
|
1489
|
-
|
|
1490
|
-
case 102:
|
|
1491
|
-
value += '\f';
|
|
1492
|
-
break;
|
|
1493
|
-
|
|
1494
|
-
case 110:
|
|
1495
|
-
value += '\n';
|
|
1496
|
-
break;
|
|
1497
|
-
|
|
1498
|
-
case 114:
|
|
1499
|
-
value += '\r';
|
|
1500
|
-
break;
|
|
1501
|
-
|
|
1502
|
-
case 116:
|
|
1503
|
-
value += '\t';
|
|
1504
|
-
break;
|
|
1505
|
-
|
|
1506
|
-
case 117:
|
|
1507
|
-
{
|
|
1508
|
-
// uXXXX
|
|
1509
|
-
var charCode = uniCharCode(body.charCodeAt(position + 1), body.charCodeAt(position + 2), body.charCodeAt(position + 3), body.charCodeAt(position + 4));
|
|
1510
|
-
|
|
1511
|
-
if (charCode < 0) {
|
|
1512
|
-
var invalidSequence = body.slice(position + 1, position + 5);
|
|
1513
|
-
throw syntaxError(source, position, "Invalid character escape sequence: \\u".concat(invalidSequence, "."));
|
|
1514
|
-
}
|
|
1515
|
-
|
|
1516
|
-
value += String.fromCharCode(charCode);
|
|
1517
|
-
position += 4;
|
|
1518
|
-
break;
|
|
1519
|
-
}
|
|
1520
|
-
|
|
1521
|
-
default:
|
|
1522
|
-
throw syntaxError(source, position, "Invalid character escape sequence: \\".concat(String.fromCharCode(code), "."));
|
|
1523
|
-
}
|
|
1524
|
-
|
|
1525
|
-
++position;
|
|
1526
|
-
chunkStart = position;
|
|
1527
|
-
}
|
|
1528
|
-
}
|
|
1529
|
-
|
|
1530
|
-
throw syntaxError(source, position, 'Unterminated string.');
|
|
1531
|
-
}
|
|
1532
|
-
/**
|
|
1533
|
-
* Reads a block string token from the source file.
|
|
1534
|
-
*
|
|
1535
|
-
* """("?"?(\\"""|\\(?!=""")|[^"\\]))*"""
|
|
1536
|
-
*/
|
|
1537
|
-
|
|
1538
|
-
|
|
1539
|
-
function readBlockString(source, start, line, col, prev, lexer) {
|
|
1540
|
-
var body = source.body;
|
|
1541
|
-
var position = start + 3;
|
|
1542
|
-
var chunkStart = position;
|
|
1543
|
-
var code = 0;
|
|
1544
|
-
var rawValue = '';
|
|
1545
|
-
|
|
1546
|
-
while (position < body.length && !isNaN(code = body.charCodeAt(position))) {
|
|
1547
|
-
// Closing Triple-Quote (""")
|
|
1548
|
-
if (code === 34 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34) {
|
|
1549
|
-
rawValue += body.slice(chunkStart, position);
|
|
1550
|
-
return new Token(TokenKind.BLOCK_STRING, start, position + 3, line, col, prev, dedentBlockStringValue(rawValue));
|
|
1551
|
-
} // SourceCharacter
|
|
1552
|
-
|
|
1553
|
-
|
|
1554
|
-
if (code < 0x0020 && code !== 0x0009 && code !== 0x000a && code !== 0x000d) {
|
|
1555
|
-
throw syntaxError(source, position, "Invalid character within String: ".concat(printCharCode(code), "."));
|
|
1556
|
-
}
|
|
1557
|
-
|
|
1558
|
-
if (code === 10) {
|
|
1559
|
-
// new line
|
|
1560
|
-
++position;
|
|
1561
|
-
++lexer.line;
|
|
1562
|
-
lexer.lineStart = position;
|
|
1563
|
-
} else if (code === 13) {
|
|
1564
|
-
// carriage return
|
|
1565
|
-
if (body.charCodeAt(position + 1) === 10) {
|
|
1566
|
-
position += 2;
|
|
1567
|
-
} else {
|
|
1568
|
-
++position;
|
|
1569
|
-
}
|
|
1570
|
-
|
|
1571
|
-
++lexer.line;
|
|
1572
|
-
lexer.lineStart = position;
|
|
1573
|
-
} else if ( // Escape Triple-Quote (\""")
|
|
1574
|
-
code === 92 && body.charCodeAt(position + 1) === 34 && body.charCodeAt(position + 2) === 34 && body.charCodeAt(position + 3) === 34) {
|
|
1575
|
-
rawValue += body.slice(chunkStart, position) + '"""';
|
|
1576
|
-
position += 4;
|
|
1577
|
-
chunkStart = position;
|
|
1578
|
-
} else {
|
|
1579
|
-
++position;
|
|
1580
|
-
}
|
|
1581
|
-
}
|
|
1582
|
-
|
|
1583
|
-
throw syntaxError(source, position, 'Unterminated string.');
|
|
1584
|
-
}
|
|
1585
|
-
/**
|
|
1586
|
-
* Converts four hexadecimal chars to the integer that the
|
|
1587
|
-
* string represents. For example, uniCharCode('0','0','0','f')
|
|
1588
|
-
* will return 15, and uniCharCode('0','0','f','f') returns 255.
|
|
1589
|
-
*
|
|
1590
|
-
* Returns a negative number on error, if a char was invalid.
|
|
1591
|
-
*
|
|
1592
|
-
* This is implemented by noting that char2hex() returns -1 on error,
|
|
1593
|
-
* which means the result of ORing the char2hex() will also be negative.
|
|
1594
|
-
*/
|
|
1595
|
-
|
|
1596
|
-
|
|
1597
|
-
function uniCharCode(a, b, c, d) {
|
|
1598
|
-
return char2hex(a) << 12 | char2hex(b) << 8 | char2hex(c) << 4 | char2hex(d);
|
|
1599
|
-
}
|
|
1600
|
-
/**
|
|
1601
|
-
* Converts a hex character to its integer value.
|
|
1602
|
-
* '0' becomes 0, '9' becomes 9
|
|
1603
|
-
* 'A' becomes 10, 'F' becomes 15
|
|
1604
|
-
* 'a' becomes 10, 'f' becomes 15
|
|
1605
|
-
*
|
|
1606
|
-
* Returns -1 on error.
|
|
1607
|
-
*/
|
|
1608
|
-
|
|
1609
|
-
|
|
1610
|
-
function char2hex(a) {
|
|
1611
|
-
return a >= 48 && a <= 57 ? a - 48 // 0-9
|
|
1612
|
-
: a >= 65 && a <= 70 ? a - 55 // A-F
|
|
1613
|
-
: a >= 97 && a <= 102 ? a - 87 // a-f
|
|
1614
|
-
: -1;
|
|
1615
|
-
}
|
|
1616
|
-
/**
|
|
1617
|
-
* Reads an alphanumeric + underscore name from the source.
|
|
1618
|
-
*
|
|
1619
|
-
* [_A-Za-z][_0-9A-Za-z]*
|
|
1620
|
-
*/
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
function readName(source, start, line, col, prev) {
|
|
1624
|
-
var body = source.body;
|
|
1625
|
-
var bodyLength = body.length;
|
|
1626
|
-
var position = start + 1;
|
|
1627
|
-
var code = 0;
|
|
1628
|
-
|
|
1629
|
-
while (position !== bodyLength && !isNaN(code = body.charCodeAt(position)) && (code === 95 || // _
|
|
1630
|
-
code >= 48 && code <= 57 || // 0-9
|
|
1631
|
-
code >= 65 && code <= 90 || // A-Z
|
|
1632
|
-
code >= 97 && code <= 122) // a-z
|
|
1633
|
-
) {
|
|
1634
|
-
++position;
|
|
1635
|
-
}
|
|
1636
|
-
|
|
1637
|
-
return new Token(TokenKind.NAME, start, position, line, col, prev, body.slice(start, position));
|
|
1638
|
-
} // _ A-Z a-z
|
|
1639
|
-
|
|
1640
|
-
|
|
1641
|
-
function isNameStart(code) {
|
|
1642
|
-
return code === 95 || code >= 65 && code <= 90 || code >= 97 && code <= 122;
|
|
1643
|
-
}
|
|
1644
|
-
|
|
1645
|
-
/**
|
|
1646
|
-
* Configuration options to control parser behavior
|
|
1647
|
-
*/
|
|
1648
|
-
|
|
1649
|
-
/**
|
|
1650
|
-
* Given a GraphQL source, parses it into a Document.
|
|
1651
|
-
* Throws GraphQLError if a syntax error is encountered.
|
|
1652
|
-
*/
|
|
1653
|
-
function parse$1(source, options) {
|
|
1654
|
-
var parser = new Parser(source, options);
|
|
1655
|
-
return parser.parseDocument();
|
|
1656
|
-
}
|
|
1657
|
-
/**
|
|
1658
|
-
* This class is exported only to assist people in implementing their own parsers
|
|
1659
|
-
* without duplicating too much code and should be used only as last resort for cases
|
|
1660
|
-
* such as experimental syntax or if certain features could not be contributed upstream.
|
|
1661
|
-
*
|
|
1662
|
-
* It is still part of the internal API and is versioned, so any changes to it are never
|
|
1663
|
-
* considered breaking changes. If you still need to support multiple versions of the
|
|
1664
|
-
* library, please use the `versionInfo` variable for version detection.
|
|
1665
|
-
*
|
|
1666
|
-
* @internal
|
|
1667
|
-
*/
|
|
1668
|
-
|
|
1669
|
-
var Parser = /*#__PURE__*/function () {
|
|
1670
|
-
function Parser(source, options) {
|
|
1671
|
-
var sourceObj = isSource(source) ? source : new Source(source);
|
|
1672
|
-
this._lexer = new Lexer(sourceObj);
|
|
1673
|
-
this._options = options;
|
|
1674
|
-
}
|
|
1675
|
-
/**
|
|
1676
|
-
* Converts a name lex token into a name parse node.
|
|
1677
|
-
*/
|
|
1678
|
-
|
|
1679
|
-
|
|
1680
|
-
var _proto = Parser.prototype;
|
|
1681
|
-
|
|
1682
|
-
_proto.parseName = function parseName() {
|
|
1683
|
-
var token = this.expectToken(TokenKind.NAME);
|
|
1684
|
-
return {
|
|
1685
|
-
kind: Kind.NAME,
|
|
1686
|
-
value: token.value,
|
|
1687
|
-
loc: this.loc(token)
|
|
1688
|
-
};
|
|
1689
|
-
} // Implements the parsing rules in the Document section.
|
|
1690
|
-
|
|
1691
|
-
/**
|
|
1692
|
-
* Document : Definition+
|
|
1693
|
-
*/
|
|
1694
|
-
;
|
|
1695
|
-
|
|
1696
|
-
_proto.parseDocument = function parseDocument() {
|
|
1697
|
-
var start = this._lexer.token;
|
|
1698
|
-
return {
|
|
1699
|
-
kind: Kind.DOCUMENT,
|
|
1700
|
-
definitions: this.many(TokenKind.SOF, this.parseDefinition, TokenKind.EOF),
|
|
1701
|
-
loc: this.loc(start)
|
|
1702
|
-
};
|
|
1703
|
-
}
|
|
1704
|
-
/**
|
|
1705
|
-
* Definition :
|
|
1706
|
-
* - ExecutableDefinition
|
|
1707
|
-
* - TypeSystemDefinition
|
|
1708
|
-
* - TypeSystemExtension
|
|
1709
|
-
*
|
|
1710
|
-
* ExecutableDefinition :
|
|
1711
|
-
* - OperationDefinition
|
|
1712
|
-
* - FragmentDefinition
|
|
1713
|
-
*/
|
|
1714
|
-
;
|
|
1715
|
-
|
|
1716
|
-
_proto.parseDefinition = function parseDefinition() {
|
|
1717
|
-
if (this.peek(TokenKind.NAME)) {
|
|
1718
|
-
switch (this._lexer.token.value) {
|
|
1719
|
-
case 'query':
|
|
1720
|
-
case 'mutation':
|
|
1721
|
-
case 'subscription':
|
|
1722
|
-
return this.parseOperationDefinition();
|
|
1723
|
-
|
|
1724
|
-
case 'fragment':
|
|
1725
|
-
return this.parseFragmentDefinition();
|
|
1726
|
-
|
|
1727
|
-
case 'schema':
|
|
1728
|
-
case 'scalar':
|
|
1729
|
-
case 'type':
|
|
1730
|
-
case 'interface':
|
|
1731
|
-
case 'union':
|
|
1732
|
-
case 'enum':
|
|
1733
|
-
case 'input':
|
|
1734
|
-
case 'directive':
|
|
1735
|
-
return this.parseTypeSystemDefinition();
|
|
1736
|
-
|
|
1737
|
-
case 'extend':
|
|
1738
|
-
return this.parseTypeSystemExtension();
|
|
1739
|
-
}
|
|
1740
|
-
} else if (this.peek(TokenKind.BRACE_L)) {
|
|
1741
|
-
return this.parseOperationDefinition();
|
|
1742
|
-
} else if (this.peekDescription()) {
|
|
1743
|
-
return this.parseTypeSystemDefinition();
|
|
1744
|
-
}
|
|
1745
|
-
|
|
1746
|
-
throw this.unexpected();
|
|
1747
|
-
} // Implements the parsing rules in the Operations section.
|
|
1748
|
-
|
|
1749
|
-
/**
|
|
1750
|
-
* OperationDefinition :
|
|
1751
|
-
* - SelectionSet
|
|
1752
|
-
* - OperationType Name? VariableDefinitions? Directives? SelectionSet
|
|
1753
|
-
*/
|
|
1754
|
-
;
|
|
1755
|
-
|
|
1756
|
-
_proto.parseOperationDefinition = function parseOperationDefinition() {
|
|
1757
|
-
var start = this._lexer.token;
|
|
1758
|
-
|
|
1759
|
-
if (this.peek(TokenKind.BRACE_L)) {
|
|
1760
|
-
return {
|
|
1761
|
-
kind: Kind.OPERATION_DEFINITION,
|
|
1762
|
-
operation: 'query',
|
|
1763
|
-
name: undefined,
|
|
1764
|
-
variableDefinitions: [],
|
|
1765
|
-
directives: [],
|
|
1766
|
-
selectionSet: this.parseSelectionSet(),
|
|
1767
|
-
loc: this.loc(start)
|
|
1768
|
-
};
|
|
1769
|
-
}
|
|
1770
|
-
|
|
1771
|
-
var operation = this.parseOperationType();
|
|
1772
|
-
var name;
|
|
1773
|
-
|
|
1774
|
-
if (this.peek(TokenKind.NAME)) {
|
|
1775
|
-
name = this.parseName();
|
|
1776
|
-
}
|
|
1777
|
-
|
|
1778
|
-
return {
|
|
1779
|
-
kind: Kind.OPERATION_DEFINITION,
|
|
1780
|
-
operation: operation,
|
|
1781
|
-
name: name,
|
|
1782
|
-
variableDefinitions: this.parseVariableDefinitions(),
|
|
1783
|
-
directives: this.parseDirectives(false),
|
|
1784
|
-
selectionSet: this.parseSelectionSet(),
|
|
1785
|
-
loc: this.loc(start)
|
|
1786
|
-
};
|
|
1787
|
-
}
|
|
1788
|
-
/**
|
|
1789
|
-
* OperationType : one of query mutation subscription
|
|
1790
|
-
*/
|
|
1791
|
-
;
|
|
1792
|
-
|
|
1793
|
-
_proto.parseOperationType = function parseOperationType() {
|
|
1794
|
-
var operationToken = this.expectToken(TokenKind.NAME);
|
|
1795
|
-
|
|
1796
|
-
switch (operationToken.value) {
|
|
1797
|
-
case 'query':
|
|
1798
|
-
return 'query';
|
|
1799
|
-
|
|
1800
|
-
case 'mutation':
|
|
1801
|
-
return 'mutation';
|
|
1802
|
-
|
|
1803
|
-
case 'subscription':
|
|
1804
|
-
return 'subscription';
|
|
1805
|
-
}
|
|
1806
|
-
|
|
1807
|
-
throw this.unexpected(operationToken);
|
|
1808
|
-
}
|
|
1809
|
-
/**
|
|
1810
|
-
* VariableDefinitions : ( VariableDefinition+ )
|
|
1811
|
-
*/
|
|
1812
|
-
;
|
|
1813
|
-
|
|
1814
|
-
_proto.parseVariableDefinitions = function parseVariableDefinitions() {
|
|
1815
|
-
return this.optionalMany(TokenKind.PAREN_L, this.parseVariableDefinition, TokenKind.PAREN_R);
|
|
1816
|
-
}
|
|
1817
|
-
/**
|
|
1818
|
-
* VariableDefinition : Variable : Type DefaultValue? Directives[Const]?
|
|
1819
|
-
*/
|
|
1820
|
-
;
|
|
1821
|
-
|
|
1822
|
-
_proto.parseVariableDefinition = function parseVariableDefinition() {
|
|
1823
|
-
var start = this._lexer.token;
|
|
1824
|
-
return {
|
|
1825
|
-
kind: Kind.VARIABLE_DEFINITION,
|
|
1826
|
-
variable: this.parseVariable(),
|
|
1827
|
-
type: (this.expectToken(TokenKind.COLON), this.parseTypeReference()),
|
|
1828
|
-
defaultValue: this.expectOptionalToken(TokenKind.EQUALS) ? this.parseValueLiteral(true) : undefined,
|
|
1829
|
-
directives: this.parseDirectives(true),
|
|
1830
|
-
loc: this.loc(start)
|
|
1831
|
-
};
|
|
1832
|
-
}
|
|
1833
|
-
/**
|
|
1834
|
-
* Variable : $ Name
|
|
1835
|
-
*/
|
|
1836
|
-
;
|
|
1837
|
-
|
|
1838
|
-
_proto.parseVariable = function parseVariable() {
|
|
1839
|
-
var start = this._lexer.token;
|
|
1840
|
-
this.expectToken(TokenKind.DOLLAR);
|
|
1841
|
-
return {
|
|
1842
|
-
kind: Kind.VARIABLE,
|
|
1843
|
-
name: this.parseName(),
|
|
1844
|
-
loc: this.loc(start)
|
|
1845
|
-
};
|
|
1846
|
-
}
|
|
1847
|
-
/**
|
|
1848
|
-
* SelectionSet : { Selection+ }
|
|
1849
|
-
*/
|
|
1850
|
-
;
|
|
1851
|
-
|
|
1852
|
-
_proto.parseSelectionSet = function parseSelectionSet() {
|
|
1853
|
-
var start = this._lexer.token;
|
|
1854
|
-
return {
|
|
1855
|
-
kind: Kind.SELECTION_SET,
|
|
1856
|
-
selections: this.many(TokenKind.BRACE_L, this.parseSelection, TokenKind.BRACE_R),
|
|
1857
|
-
loc: this.loc(start)
|
|
1858
|
-
};
|
|
1859
|
-
}
|
|
1860
|
-
/**
|
|
1861
|
-
* Selection :
|
|
1862
|
-
* - Field
|
|
1863
|
-
* - FragmentSpread
|
|
1864
|
-
* - InlineFragment
|
|
1865
|
-
*/
|
|
1866
|
-
;
|
|
1867
|
-
|
|
1868
|
-
_proto.parseSelection = function parseSelection() {
|
|
1869
|
-
return this.peek(TokenKind.SPREAD) ? this.parseFragment() : this.parseField();
|
|
1870
|
-
}
|
|
1871
|
-
/**
|
|
1872
|
-
* Field : Alias? Name Arguments? Directives? SelectionSet?
|
|
1873
|
-
*
|
|
1874
|
-
* Alias : Name :
|
|
1875
|
-
*/
|
|
1876
|
-
;
|
|
1877
|
-
|
|
1878
|
-
_proto.parseField = function parseField() {
|
|
1879
|
-
var start = this._lexer.token;
|
|
1880
|
-
var nameOrAlias = this.parseName();
|
|
1881
|
-
var alias;
|
|
1882
|
-
var name;
|
|
1883
|
-
|
|
1884
|
-
if (this.expectOptionalToken(TokenKind.COLON)) {
|
|
1885
|
-
alias = nameOrAlias;
|
|
1886
|
-
name = this.parseName();
|
|
1887
|
-
} else {
|
|
1888
|
-
name = nameOrAlias;
|
|
1889
|
-
}
|
|
1890
|
-
|
|
1891
|
-
return {
|
|
1892
|
-
kind: Kind.FIELD,
|
|
1893
|
-
alias: alias,
|
|
1894
|
-
name: name,
|
|
1895
|
-
arguments: this.parseArguments(false),
|
|
1896
|
-
directives: this.parseDirectives(false),
|
|
1897
|
-
selectionSet: this.peek(TokenKind.BRACE_L) ? this.parseSelectionSet() : undefined,
|
|
1898
|
-
loc: this.loc(start)
|
|
1899
|
-
};
|
|
1900
|
-
}
|
|
1901
|
-
/**
|
|
1902
|
-
* Arguments[Const] : ( Argument[?Const]+ )
|
|
1903
|
-
*/
|
|
1904
|
-
;
|
|
1905
|
-
|
|
1906
|
-
_proto.parseArguments = function parseArguments(isConst) {
|
|
1907
|
-
var item = isConst ? this.parseConstArgument : this.parseArgument;
|
|
1908
|
-
return this.optionalMany(TokenKind.PAREN_L, item, TokenKind.PAREN_R);
|
|
1909
|
-
}
|
|
1910
|
-
/**
|
|
1911
|
-
* Argument[Const] : Name : Value[?Const]
|
|
1912
|
-
*/
|
|
1913
|
-
;
|
|
1914
|
-
|
|
1915
|
-
_proto.parseArgument = function parseArgument() {
|
|
1916
|
-
var start = this._lexer.token;
|
|
1917
|
-
var name = this.parseName();
|
|
1918
|
-
this.expectToken(TokenKind.COLON);
|
|
1919
|
-
return {
|
|
1920
|
-
kind: Kind.ARGUMENT,
|
|
1921
|
-
name: name,
|
|
1922
|
-
value: this.parseValueLiteral(false),
|
|
1923
|
-
loc: this.loc(start)
|
|
1924
|
-
};
|
|
1925
|
-
};
|
|
1926
|
-
|
|
1927
|
-
_proto.parseConstArgument = function parseConstArgument() {
|
|
1928
|
-
var start = this._lexer.token;
|
|
1929
|
-
return {
|
|
1930
|
-
kind: Kind.ARGUMENT,
|
|
1931
|
-
name: this.parseName(),
|
|
1932
|
-
value: (this.expectToken(TokenKind.COLON), this.parseValueLiteral(true)),
|
|
1933
|
-
loc: this.loc(start)
|
|
1934
|
-
};
|
|
1935
|
-
} // Implements the parsing rules in the Fragments section.
|
|
1936
|
-
|
|
1937
|
-
/**
|
|
1938
|
-
* Corresponds to both FragmentSpread and InlineFragment in the spec.
|
|
1939
|
-
*
|
|
1940
|
-
* FragmentSpread : ... FragmentName Directives?
|
|
1941
|
-
*
|
|
1942
|
-
* InlineFragment : ... TypeCondition? Directives? SelectionSet
|
|
1943
|
-
*/
|
|
1944
|
-
;
|
|
1945
|
-
|
|
1946
|
-
_proto.parseFragment = function parseFragment() {
|
|
1947
|
-
var start = this._lexer.token;
|
|
1948
|
-
this.expectToken(TokenKind.SPREAD);
|
|
1949
|
-
var hasTypeCondition = this.expectOptionalKeyword('on');
|
|
1950
|
-
|
|
1951
|
-
if (!hasTypeCondition && this.peek(TokenKind.NAME)) {
|
|
1952
|
-
return {
|
|
1953
|
-
kind: Kind.FRAGMENT_SPREAD,
|
|
1954
|
-
name: this.parseFragmentName(),
|
|
1955
|
-
directives: this.parseDirectives(false),
|
|
1956
|
-
loc: this.loc(start)
|
|
1957
|
-
};
|
|
1958
|
-
}
|
|
1959
|
-
|
|
1960
|
-
return {
|
|
1961
|
-
kind: Kind.INLINE_FRAGMENT,
|
|
1962
|
-
typeCondition: hasTypeCondition ? this.parseNamedType() : undefined,
|
|
1963
|
-
directives: this.parseDirectives(false),
|
|
1964
|
-
selectionSet: this.parseSelectionSet(),
|
|
1965
|
-
loc: this.loc(start)
|
|
1966
|
-
};
|
|
1967
|
-
}
|
|
1968
|
-
/**
|
|
1969
|
-
* FragmentDefinition :
|
|
1970
|
-
* - fragment FragmentName on TypeCondition Directives? SelectionSet
|
|
1971
|
-
*
|
|
1972
|
-
* TypeCondition : NamedType
|
|
1973
|
-
*/
|
|
1974
|
-
;
|
|
1975
|
-
|
|
1976
|
-
_proto.parseFragmentDefinition = function parseFragmentDefinition() {
|
|
1977
|
-
var _this$_options;
|
|
1978
|
-
|
|
1979
|
-
var start = this._lexer.token;
|
|
1980
|
-
this.expectKeyword('fragment'); // Experimental support for defining variables within fragments changes
|
|
1981
|
-
// the grammar of FragmentDefinition:
|
|
1982
|
-
// - fragment FragmentName VariableDefinitions? on TypeCondition Directives? SelectionSet
|
|
1983
|
-
|
|
1984
|
-
if (((_this$_options = this._options) === null || _this$_options === void 0 ? void 0 : _this$_options.experimentalFragmentVariables) === true) {
|
|
1985
|
-
return {
|
|
1986
|
-
kind: Kind.FRAGMENT_DEFINITION,
|
|
1987
|
-
name: this.parseFragmentName(),
|
|
1988
|
-
variableDefinitions: this.parseVariableDefinitions(),
|
|
1989
|
-
typeCondition: (this.expectKeyword('on'), this.parseNamedType()),
|
|
1990
|
-
directives: this.parseDirectives(false),
|
|
1991
|
-
selectionSet: this.parseSelectionSet(),
|
|
1992
|
-
loc: this.loc(start)
|
|
1993
|
-
};
|
|
1994
|
-
}
|
|
1995
|
-
|
|
1996
|
-
return {
|
|
1997
|
-
kind: Kind.FRAGMENT_DEFINITION,
|
|
1998
|
-
name: this.parseFragmentName(),
|
|
1999
|
-
typeCondition: (this.expectKeyword('on'), this.parseNamedType()),
|
|
2000
|
-
directives: this.parseDirectives(false),
|
|
2001
|
-
selectionSet: this.parseSelectionSet(),
|
|
2002
|
-
loc: this.loc(start)
|
|
2003
|
-
};
|
|
2004
|
-
}
|
|
2005
|
-
/**
|
|
2006
|
-
* FragmentName : Name but not `on`
|
|
2007
|
-
*/
|
|
2008
|
-
;
|
|
2009
|
-
|
|
2010
|
-
_proto.parseFragmentName = function parseFragmentName() {
|
|
2011
|
-
if (this._lexer.token.value === 'on') {
|
|
2012
|
-
throw this.unexpected();
|
|
2013
|
-
}
|
|
2014
|
-
|
|
2015
|
-
return this.parseName();
|
|
2016
|
-
} // Implements the parsing rules in the Values section.
|
|
2017
|
-
|
|
2018
|
-
/**
|
|
2019
|
-
* Value[Const] :
|
|
2020
|
-
* - [~Const] Variable
|
|
2021
|
-
* - IntValue
|
|
2022
|
-
* - FloatValue
|
|
2023
|
-
* - StringValue
|
|
2024
|
-
* - BooleanValue
|
|
2025
|
-
* - NullValue
|
|
2026
|
-
* - EnumValue
|
|
2027
|
-
* - ListValue[?Const]
|
|
2028
|
-
* - ObjectValue[?Const]
|
|
2029
|
-
*
|
|
2030
|
-
* BooleanValue : one of `true` `false`
|
|
2031
|
-
*
|
|
2032
|
-
* NullValue : `null`
|
|
2033
|
-
*
|
|
2034
|
-
* EnumValue : Name but not `true`, `false` or `null`
|
|
2035
|
-
*/
|
|
2036
|
-
;
|
|
2037
|
-
|
|
2038
|
-
_proto.parseValueLiteral = function parseValueLiteral(isConst) {
|
|
2039
|
-
var token = this._lexer.token;
|
|
2040
|
-
|
|
2041
|
-
switch (token.kind) {
|
|
2042
|
-
case TokenKind.BRACKET_L:
|
|
2043
|
-
return this.parseList(isConst);
|
|
2044
|
-
|
|
2045
|
-
case TokenKind.BRACE_L:
|
|
2046
|
-
return this.parseObject(isConst);
|
|
2047
|
-
|
|
2048
|
-
case TokenKind.INT:
|
|
2049
|
-
this._lexer.advance();
|
|
2050
|
-
|
|
2051
|
-
return {
|
|
2052
|
-
kind: Kind.INT,
|
|
2053
|
-
value: token.value,
|
|
2054
|
-
loc: this.loc(token)
|
|
2055
|
-
};
|
|
2056
|
-
|
|
2057
|
-
case TokenKind.FLOAT:
|
|
2058
|
-
this._lexer.advance();
|
|
2059
|
-
|
|
2060
|
-
return {
|
|
2061
|
-
kind: Kind.FLOAT,
|
|
2062
|
-
value: token.value,
|
|
2063
|
-
loc: this.loc(token)
|
|
2064
|
-
};
|
|
2065
|
-
|
|
2066
|
-
case TokenKind.STRING:
|
|
2067
|
-
case TokenKind.BLOCK_STRING:
|
|
2068
|
-
return this.parseStringLiteral();
|
|
2069
|
-
|
|
2070
|
-
case TokenKind.NAME:
|
|
2071
|
-
this._lexer.advance();
|
|
2072
|
-
|
|
2073
|
-
switch (token.value) {
|
|
2074
|
-
case 'true':
|
|
2075
|
-
return {
|
|
2076
|
-
kind: Kind.BOOLEAN,
|
|
2077
|
-
value: true,
|
|
2078
|
-
loc: this.loc(token)
|
|
2079
|
-
};
|
|
2080
|
-
|
|
2081
|
-
case 'false':
|
|
2082
|
-
return {
|
|
2083
|
-
kind: Kind.BOOLEAN,
|
|
2084
|
-
value: false,
|
|
2085
|
-
loc: this.loc(token)
|
|
2086
|
-
};
|
|
2087
|
-
|
|
2088
|
-
case 'null':
|
|
2089
|
-
return {
|
|
2090
|
-
kind: Kind.NULL,
|
|
2091
|
-
loc: this.loc(token)
|
|
2092
|
-
};
|
|
2093
|
-
|
|
2094
|
-
default:
|
|
2095
|
-
return {
|
|
2096
|
-
kind: Kind.ENUM,
|
|
2097
|
-
value: token.value,
|
|
2098
|
-
loc: this.loc(token)
|
|
2099
|
-
};
|
|
2100
|
-
}
|
|
2101
|
-
|
|
2102
|
-
case TokenKind.DOLLAR:
|
|
2103
|
-
if (!isConst) {
|
|
2104
|
-
return this.parseVariable();
|
|
2105
|
-
}
|
|
2106
|
-
|
|
2107
|
-
break;
|
|
2108
|
-
}
|
|
2109
|
-
|
|
2110
|
-
throw this.unexpected();
|
|
2111
|
-
};
|
|
2112
|
-
|
|
2113
|
-
_proto.parseStringLiteral = function parseStringLiteral() {
|
|
2114
|
-
var token = this._lexer.token;
|
|
2115
|
-
|
|
2116
|
-
this._lexer.advance();
|
|
2117
|
-
|
|
2118
|
-
return {
|
|
2119
|
-
kind: Kind.STRING,
|
|
2120
|
-
value: token.value,
|
|
2121
|
-
block: token.kind === TokenKind.BLOCK_STRING,
|
|
2122
|
-
loc: this.loc(token)
|
|
2123
|
-
};
|
|
2124
|
-
}
|
|
2125
|
-
/**
|
|
2126
|
-
* ListValue[Const] :
|
|
2127
|
-
* - [ ]
|
|
2128
|
-
* - [ Value[?Const]+ ]
|
|
2129
|
-
*/
|
|
2130
|
-
;
|
|
2131
|
-
|
|
2132
|
-
_proto.parseList = function parseList(isConst) {
|
|
2133
|
-
var _this = this;
|
|
2134
|
-
|
|
2135
|
-
var start = this._lexer.token;
|
|
2136
|
-
|
|
2137
|
-
var item = function item() {
|
|
2138
|
-
return _this.parseValueLiteral(isConst);
|
|
2139
|
-
};
|
|
2140
|
-
|
|
2141
|
-
return {
|
|
2142
|
-
kind: Kind.LIST,
|
|
2143
|
-
values: this.any(TokenKind.BRACKET_L, item, TokenKind.BRACKET_R),
|
|
2144
|
-
loc: this.loc(start)
|
|
2145
|
-
};
|
|
2146
|
-
}
|
|
2147
|
-
/**
|
|
2148
|
-
* ObjectValue[Const] :
|
|
2149
|
-
* - { }
|
|
2150
|
-
* - { ObjectField[?Const]+ }
|
|
2151
|
-
*/
|
|
2152
|
-
;
|
|
2153
|
-
|
|
2154
|
-
_proto.parseObject = function parseObject(isConst) {
|
|
2155
|
-
var _this2 = this;
|
|
2156
|
-
|
|
2157
|
-
var start = this._lexer.token;
|
|
2158
|
-
|
|
2159
|
-
var item = function item() {
|
|
2160
|
-
return _this2.parseObjectField(isConst);
|
|
2161
|
-
};
|
|
2162
|
-
|
|
2163
|
-
return {
|
|
2164
|
-
kind: Kind.OBJECT,
|
|
2165
|
-
fields: this.any(TokenKind.BRACE_L, item, TokenKind.BRACE_R),
|
|
2166
|
-
loc: this.loc(start)
|
|
2167
|
-
};
|
|
2168
|
-
}
|
|
2169
|
-
/**
|
|
2170
|
-
* ObjectField[Const] : Name : Value[?Const]
|
|
2171
|
-
*/
|
|
2172
|
-
;
|
|
2173
|
-
|
|
2174
|
-
_proto.parseObjectField = function parseObjectField(isConst) {
|
|
2175
|
-
var start = this._lexer.token;
|
|
2176
|
-
var name = this.parseName();
|
|
2177
|
-
this.expectToken(TokenKind.COLON);
|
|
2178
|
-
return {
|
|
2179
|
-
kind: Kind.OBJECT_FIELD,
|
|
2180
|
-
name: name,
|
|
2181
|
-
value: this.parseValueLiteral(isConst),
|
|
2182
|
-
loc: this.loc(start)
|
|
2183
|
-
};
|
|
2184
|
-
} // Implements the parsing rules in the Directives section.
|
|
2185
|
-
|
|
2186
|
-
/**
|
|
2187
|
-
* Directives[Const] : Directive[?Const]+
|
|
2188
|
-
*/
|
|
2189
|
-
;
|
|
2190
|
-
|
|
2191
|
-
_proto.parseDirectives = function parseDirectives(isConst) {
|
|
2192
|
-
var directives = [];
|
|
2193
|
-
|
|
2194
|
-
while (this.peek(TokenKind.AT)) {
|
|
2195
|
-
directives.push(this.parseDirective(isConst));
|
|
2196
|
-
}
|
|
2197
|
-
|
|
2198
|
-
return directives;
|
|
2199
|
-
}
|
|
2200
|
-
/**
|
|
2201
|
-
* Directive[Const] : @ Name Arguments[?Const]?
|
|
2202
|
-
*/
|
|
2203
|
-
;
|
|
2204
|
-
|
|
2205
|
-
_proto.parseDirective = function parseDirective(isConst) {
|
|
2206
|
-
var start = this._lexer.token;
|
|
2207
|
-
this.expectToken(TokenKind.AT);
|
|
2208
|
-
return {
|
|
2209
|
-
kind: Kind.DIRECTIVE,
|
|
2210
|
-
name: this.parseName(),
|
|
2211
|
-
arguments: this.parseArguments(isConst),
|
|
2212
|
-
loc: this.loc(start)
|
|
2213
|
-
};
|
|
2214
|
-
} // Implements the parsing rules in the Types section.
|
|
2215
|
-
|
|
2216
|
-
/**
|
|
2217
|
-
* Type :
|
|
2218
|
-
* - NamedType
|
|
2219
|
-
* - ListType
|
|
2220
|
-
* - NonNullType
|
|
2221
|
-
*/
|
|
2222
|
-
;
|
|
2223
|
-
|
|
2224
|
-
_proto.parseTypeReference = function parseTypeReference() {
|
|
2225
|
-
var start = this._lexer.token;
|
|
2226
|
-
var type;
|
|
2227
|
-
|
|
2228
|
-
if (this.expectOptionalToken(TokenKind.BRACKET_L)) {
|
|
2229
|
-
type = this.parseTypeReference();
|
|
2230
|
-
this.expectToken(TokenKind.BRACKET_R);
|
|
2231
|
-
type = {
|
|
2232
|
-
kind: Kind.LIST_TYPE,
|
|
2233
|
-
type: type,
|
|
2234
|
-
loc: this.loc(start)
|
|
2235
|
-
};
|
|
2236
|
-
} else {
|
|
2237
|
-
type = this.parseNamedType();
|
|
2238
|
-
}
|
|
2239
|
-
|
|
2240
|
-
if (this.expectOptionalToken(TokenKind.BANG)) {
|
|
2241
|
-
return {
|
|
2242
|
-
kind: Kind.NON_NULL_TYPE,
|
|
2243
|
-
type: type,
|
|
2244
|
-
loc: this.loc(start)
|
|
2245
|
-
};
|
|
2246
|
-
}
|
|
2247
|
-
|
|
2248
|
-
return type;
|
|
2249
|
-
}
|
|
2250
|
-
/**
|
|
2251
|
-
* NamedType : Name
|
|
2252
|
-
*/
|
|
2253
|
-
;
|
|
2254
|
-
|
|
2255
|
-
_proto.parseNamedType = function parseNamedType() {
|
|
2256
|
-
var start = this._lexer.token;
|
|
2257
|
-
return {
|
|
2258
|
-
kind: Kind.NAMED_TYPE,
|
|
2259
|
-
name: this.parseName(),
|
|
2260
|
-
loc: this.loc(start)
|
|
2261
|
-
};
|
|
2262
|
-
} // Implements the parsing rules in the Type Definition section.
|
|
2263
|
-
|
|
2264
|
-
/**
|
|
2265
|
-
* TypeSystemDefinition :
|
|
2266
|
-
* - SchemaDefinition
|
|
2267
|
-
* - TypeDefinition
|
|
2268
|
-
* - DirectiveDefinition
|
|
2269
|
-
*
|
|
2270
|
-
* TypeDefinition :
|
|
2271
|
-
* - ScalarTypeDefinition
|
|
2272
|
-
* - ObjectTypeDefinition
|
|
2273
|
-
* - InterfaceTypeDefinition
|
|
2274
|
-
* - UnionTypeDefinition
|
|
2275
|
-
* - EnumTypeDefinition
|
|
2276
|
-
* - InputObjectTypeDefinition
|
|
2277
|
-
*/
|
|
2278
|
-
;
|
|
2279
|
-
|
|
2280
|
-
_proto.parseTypeSystemDefinition = function parseTypeSystemDefinition() {
|
|
2281
|
-
// Many definitions begin with a description and require a lookahead.
|
|
2282
|
-
var keywordToken = this.peekDescription() ? this._lexer.lookahead() : this._lexer.token;
|
|
2283
|
-
|
|
2284
|
-
if (keywordToken.kind === TokenKind.NAME) {
|
|
2285
|
-
switch (keywordToken.value) {
|
|
2286
|
-
case 'schema':
|
|
2287
|
-
return this.parseSchemaDefinition();
|
|
2288
|
-
|
|
2289
|
-
case 'scalar':
|
|
2290
|
-
return this.parseScalarTypeDefinition();
|
|
2291
|
-
|
|
2292
|
-
case 'type':
|
|
2293
|
-
return this.parseObjectTypeDefinition();
|
|
2294
|
-
|
|
2295
|
-
case 'interface':
|
|
2296
|
-
return this.parseInterfaceTypeDefinition();
|
|
2297
|
-
|
|
2298
|
-
case 'union':
|
|
2299
|
-
return this.parseUnionTypeDefinition();
|
|
2300
|
-
|
|
2301
|
-
case 'enum':
|
|
2302
|
-
return this.parseEnumTypeDefinition();
|
|
2303
|
-
|
|
2304
|
-
case 'input':
|
|
2305
|
-
return this.parseInputObjectTypeDefinition();
|
|
2306
|
-
|
|
2307
|
-
case 'directive':
|
|
2308
|
-
return this.parseDirectiveDefinition();
|
|
2309
|
-
}
|
|
2310
|
-
}
|
|
2311
|
-
|
|
2312
|
-
throw this.unexpected(keywordToken);
|
|
2313
|
-
};
|
|
2314
|
-
|
|
2315
|
-
_proto.peekDescription = function peekDescription() {
|
|
2316
|
-
return this.peek(TokenKind.STRING) || this.peek(TokenKind.BLOCK_STRING);
|
|
2317
|
-
}
|
|
2318
|
-
/**
|
|
2319
|
-
* Description : StringValue
|
|
2320
|
-
*/
|
|
2321
|
-
;
|
|
2322
|
-
|
|
2323
|
-
_proto.parseDescription = function parseDescription() {
|
|
2324
|
-
if (this.peekDescription()) {
|
|
2325
|
-
return this.parseStringLiteral();
|
|
2326
|
-
}
|
|
2327
|
-
}
|
|
2328
|
-
/**
|
|
2329
|
-
* SchemaDefinition : Description? schema Directives[Const]? { OperationTypeDefinition+ }
|
|
2330
|
-
*/
|
|
2331
|
-
;
|
|
2332
|
-
|
|
2333
|
-
_proto.parseSchemaDefinition = function parseSchemaDefinition() {
|
|
2334
|
-
var start = this._lexer.token;
|
|
2335
|
-
var description = this.parseDescription();
|
|
2336
|
-
this.expectKeyword('schema');
|
|
2337
|
-
var directives = this.parseDirectives(true);
|
|
2338
|
-
var operationTypes = this.many(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);
|
|
2339
|
-
return {
|
|
2340
|
-
kind: Kind.SCHEMA_DEFINITION,
|
|
2341
|
-
description: description,
|
|
2342
|
-
directives: directives,
|
|
2343
|
-
operationTypes: operationTypes,
|
|
2344
|
-
loc: this.loc(start)
|
|
2345
|
-
};
|
|
2346
|
-
}
|
|
2347
|
-
/**
|
|
2348
|
-
* OperationTypeDefinition : OperationType : NamedType
|
|
2349
|
-
*/
|
|
2350
|
-
;
|
|
2351
|
-
|
|
2352
|
-
_proto.parseOperationTypeDefinition = function parseOperationTypeDefinition() {
|
|
2353
|
-
var start = this._lexer.token;
|
|
2354
|
-
var operation = this.parseOperationType();
|
|
2355
|
-
this.expectToken(TokenKind.COLON);
|
|
2356
|
-
var type = this.parseNamedType();
|
|
2357
|
-
return {
|
|
2358
|
-
kind: Kind.OPERATION_TYPE_DEFINITION,
|
|
2359
|
-
operation: operation,
|
|
2360
|
-
type: type,
|
|
2361
|
-
loc: this.loc(start)
|
|
2362
|
-
};
|
|
2363
|
-
}
|
|
2364
|
-
/**
|
|
2365
|
-
* ScalarTypeDefinition : Description? scalar Name Directives[Const]?
|
|
2366
|
-
*/
|
|
2367
|
-
;
|
|
2368
|
-
|
|
2369
|
-
_proto.parseScalarTypeDefinition = function parseScalarTypeDefinition() {
|
|
2370
|
-
var start = this._lexer.token;
|
|
2371
|
-
var description = this.parseDescription();
|
|
2372
|
-
this.expectKeyword('scalar');
|
|
2373
|
-
var name = this.parseName();
|
|
2374
|
-
var directives = this.parseDirectives(true);
|
|
2375
|
-
return {
|
|
2376
|
-
kind: Kind.SCALAR_TYPE_DEFINITION,
|
|
2377
|
-
description: description,
|
|
2378
|
-
name: name,
|
|
2379
|
-
directives: directives,
|
|
2380
|
-
loc: this.loc(start)
|
|
2381
|
-
};
|
|
2382
|
-
}
|
|
2383
|
-
/**
|
|
2384
|
-
* ObjectTypeDefinition :
|
|
2385
|
-
* Description?
|
|
2386
|
-
* type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition?
|
|
2387
|
-
*/
|
|
2388
|
-
;
|
|
2389
|
-
|
|
2390
|
-
_proto.parseObjectTypeDefinition = function parseObjectTypeDefinition() {
|
|
2391
|
-
var start = this._lexer.token;
|
|
2392
|
-
var description = this.parseDescription();
|
|
2393
|
-
this.expectKeyword('type');
|
|
2394
|
-
var name = this.parseName();
|
|
2395
|
-
var interfaces = this.parseImplementsInterfaces();
|
|
2396
|
-
var directives = this.parseDirectives(true);
|
|
2397
|
-
var fields = this.parseFieldsDefinition();
|
|
2398
|
-
return {
|
|
2399
|
-
kind: Kind.OBJECT_TYPE_DEFINITION,
|
|
2400
|
-
description: description,
|
|
2401
|
-
name: name,
|
|
2402
|
-
interfaces: interfaces,
|
|
2403
|
-
directives: directives,
|
|
2404
|
-
fields: fields,
|
|
2405
|
-
loc: this.loc(start)
|
|
2406
|
-
};
|
|
2407
|
-
}
|
|
2408
|
-
/**
|
|
2409
|
-
* ImplementsInterfaces :
|
|
2410
|
-
* - implements `&`? NamedType
|
|
2411
|
-
* - ImplementsInterfaces & NamedType
|
|
2412
|
-
*/
|
|
2413
|
-
;
|
|
2414
|
-
|
|
2415
|
-
_proto.parseImplementsInterfaces = function parseImplementsInterfaces() {
|
|
2416
|
-
var _this$_options2;
|
|
2417
|
-
|
|
2418
|
-
if (!this.expectOptionalKeyword('implements')) {
|
|
2419
|
-
return [];
|
|
2420
|
-
}
|
|
2421
|
-
|
|
2422
|
-
if (((_this$_options2 = this._options) === null || _this$_options2 === void 0 ? void 0 : _this$_options2.allowLegacySDLImplementsInterfaces) === true) {
|
|
2423
|
-
var types = []; // Optional leading ampersand
|
|
2424
|
-
|
|
2425
|
-
this.expectOptionalToken(TokenKind.AMP);
|
|
2426
|
-
|
|
2427
|
-
do {
|
|
2428
|
-
types.push(this.parseNamedType());
|
|
2429
|
-
} while (this.expectOptionalToken(TokenKind.AMP) || this.peek(TokenKind.NAME));
|
|
2430
|
-
|
|
2431
|
-
return types;
|
|
2432
|
-
}
|
|
2433
|
-
|
|
2434
|
-
return this.delimitedMany(TokenKind.AMP, this.parseNamedType);
|
|
2435
|
-
}
|
|
2436
|
-
/**
|
|
2437
|
-
* FieldsDefinition : { FieldDefinition+ }
|
|
2438
|
-
*/
|
|
2439
|
-
;
|
|
2440
|
-
|
|
2441
|
-
_proto.parseFieldsDefinition = function parseFieldsDefinition() {
|
|
2442
|
-
var _this$_options3;
|
|
2443
|
-
|
|
2444
|
-
// Legacy support for the SDL?
|
|
2445
|
-
if (((_this$_options3 = this._options) === null || _this$_options3 === void 0 ? void 0 : _this$_options3.allowLegacySDLEmptyFields) === true && this.peek(TokenKind.BRACE_L) && this._lexer.lookahead().kind === TokenKind.BRACE_R) {
|
|
2446
|
-
this._lexer.advance();
|
|
2447
|
-
|
|
2448
|
-
this._lexer.advance();
|
|
2449
|
-
|
|
2450
|
-
return [];
|
|
2451
|
-
}
|
|
2452
|
-
|
|
2453
|
-
return this.optionalMany(TokenKind.BRACE_L, this.parseFieldDefinition, TokenKind.BRACE_R);
|
|
2454
|
-
}
|
|
2455
|
-
/**
|
|
2456
|
-
* FieldDefinition :
|
|
2457
|
-
* - Description? Name ArgumentsDefinition? : Type Directives[Const]?
|
|
2458
|
-
*/
|
|
2459
|
-
;
|
|
2460
|
-
|
|
2461
|
-
_proto.parseFieldDefinition = function parseFieldDefinition() {
|
|
2462
|
-
var start = this._lexer.token;
|
|
2463
|
-
var description = this.parseDescription();
|
|
2464
|
-
var name = this.parseName();
|
|
2465
|
-
var args = this.parseArgumentDefs();
|
|
2466
|
-
this.expectToken(TokenKind.COLON);
|
|
2467
|
-
var type = this.parseTypeReference();
|
|
2468
|
-
var directives = this.parseDirectives(true);
|
|
2469
|
-
return {
|
|
2470
|
-
kind: Kind.FIELD_DEFINITION,
|
|
2471
|
-
description: description,
|
|
2472
|
-
name: name,
|
|
2473
|
-
arguments: args,
|
|
2474
|
-
type: type,
|
|
2475
|
-
directives: directives,
|
|
2476
|
-
loc: this.loc(start)
|
|
2477
|
-
};
|
|
2478
|
-
}
|
|
2479
|
-
/**
|
|
2480
|
-
* ArgumentsDefinition : ( InputValueDefinition+ )
|
|
2481
|
-
*/
|
|
2482
|
-
;
|
|
2483
|
-
|
|
2484
|
-
_proto.parseArgumentDefs = function parseArgumentDefs() {
|
|
2485
|
-
return this.optionalMany(TokenKind.PAREN_L, this.parseInputValueDef, TokenKind.PAREN_R);
|
|
2486
|
-
}
|
|
2487
|
-
/**
|
|
2488
|
-
* InputValueDefinition :
|
|
2489
|
-
* - Description? Name : Type DefaultValue? Directives[Const]?
|
|
2490
|
-
*/
|
|
2491
|
-
;
|
|
2492
|
-
|
|
2493
|
-
_proto.parseInputValueDef = function parseInputValueDef() {
|
|
2494
|
-
var start = this._lexer.token;
|
|
2495
|
-
var description = this.parseDescription();
|
|
2496
|
-
var name = this.parseName();
|
|
2497
|
-
this.expectToken(TokenKind.COLON);
|
|
2498
|
-
var type = this.parseTypeReference();
|
|
2499
|
-
var defaultValue;
|
|
2500
|
-
|
|
2501
|
-
if (this.expectOptionalToken(TokenKind.EQUALS)) {
|
|
2502
|
-
defaultValue = this.parseValueLiteral(true);
|
|
2503
|
-
}
|
|
2504
|
-
|
|
2505
|
-
var directives = this.parseDirectives(true);
|
|
2506
|
-
return {
|
|
2507
|
-
kind: Kind.INPUT_VALUE_DEFINITION,
|
|
2508
|
-
description: description,
|
|
2509
|
-
name: name,
|
|
2510
|
-
type: type,
|
|
2511
|
-
defaultValue: defaultValue,
|
|
2512
|
-
directives: directives,
|
|
2513
|
-
loc: this.loc(start)
|
|
2514
|
-
};
|
|
2515
|
-
}
|
|
2516
|
-
/**
|
|
2517
|
-
* InterfaceTypeDefinition :
|
|
2518
|
-
* - Description? interface Name Directives[Const]? FieldsDefinition?
|
|
2519
|
-
*/
|
|
2520
|
-
;
|
|
2521
|
-
|
|
2522
|
-
_proto.parseInterfaceTypeDefinition = function parseInterfaceTypeDefinition() {
|
|
2523
|
-
var start = this._lexer.token;
|
|
2524
|
-
var description = this.parseDescription();
|
|
2525
|
-
this.expectKeyword('interface');
|
|
2526
|
-
var name = this.parseName();
|
|
2527
|
-
var interfaces = this.parseImplementsInterfaces();
|
|
2528
|
-
var directives = this.parseDirectives(true);
|
|
2529
|
-
var fields = this.parseFieldsDefinition();
|
|
2530
|
-
return {
|
|
2531
|
-
kind: Kind.INTERFACE_TYPE_DEFINITION,
|
|
2532
|
-
description: description,
|
|
2533
|
-
name: name,
|
|
2534
|
-
interfaces: interfaces,
|
|
2535
|
-
directives: directives,
|
|
2536
|
-
fields: fields,
|
|
2537
|
-
loc: this.loc(start)
|
|
2538
|
-
};
|
|
2539
|
-
}
|
|
2540
|
-
/**
|
|
2541
|
-
* UnionTypeDefinition :
|
|
2542
|
-
* - Description? union Name Directives[Const]? UnionMemberTypes?
|
|
2543
|
-
*/
|
|
2544
|
-
;
|
|
2545
|
-
|
|
2546
|
-
_proto.parseUnionTypeDefinition = function parseUnionTypeDefinition() {
|
|
2547
|
-
var start = this._lexer.token;
|
|
2548
|
-
var description = this.parseDescription();
|
|
2549
|
-
this.expectKeyword('union');
|
|
2550
|
-
var name = this.parseName();
|
|
2551
|
-
var directives = this.parseDirectives(true);
|
|
2552
|
-
var types = this.parseUnionMemberTypes();
|
|
2553
|
-
return {
|
|
2554
|
-
kind: Kind.UNION_TYPE_DEFINITION,
|
|
2555
|
-
description: description,
|
|
2556
|
-
name: name,
|
|
2557
|
-
directives: directives,
|
|
2558
|
-
types: types,
|
|
2559
|
-
loc: this.loc(start)
|
|
2560
|
-
};
|
|
2561
|
-
}
|
|
2562
|
-
/**
|
|
2563
|
-
* UnionMemberTypes :
|
|
2564
|
-
* - = `|`? NamedType
|
|
2565
|
-
* - UnionMemberTypes | NamedType
|
|
2566
|
-
*/
|
|
2567
|
-
;
|
|
2568
|
-
|
|
2569
|
-
_proto.parseUnionMemberTypes = function parseUnionMemberTypes() {
|
|
2570
|
-
return this.expectOptionalToken(TokenKind.EQUALS) ? this.delimitedMany(TokenKind.PIPE, this.parseNamedType) : [];
|
|
2571
|
-
}
|
|
2572
|
-
/**
|
|
2573
|
-
* EnumTypeDefinition :
|
|
2574
|
-
* - Description? enum Name Directives[Const]? EnumValuesDefinition?
|
|
2575
|
-
*/
|
|
2576
|
-
;
|
|
2577
|
-
|
|
2578
|
-
_proto.parseEnumTypeDefinition = function parseEnumTypeDefinition() {
|
|
2579
|
-
var start = this._lexer.token;
|
|
2580
|
-
var description = this.parseDescription();
|
|
2581
|
-
this.expectKeyword('enum');
|
|
2582
|
-
var name = this.parseName();
|
|
2583
|
-
var directives = this.parseDirectives(true);
|
|
2584
|
-
var values = this.parseEnumValuesDefinition();
|
|
2585
|
-
return {
|
|
2586
|
-
kind: Kind.ENUM_TYPE_DEFINITION,
|
|
2587
|
-
description: description,
|
|
2588
|
-
name: name,
|
|
2589
|
-
directives: directives,
|
|
2590
|
-
values: values,
|
|
2591
|
-
loc: this.loc(start)
|
|
2592
|
-
};
|
|
2593
|
-
}
|
|
2594
|
-
/**
|
|
2595
|
-
* EnumValuesDefinition : { EnumValueDefinition+ }
|
|
2596
|
-
*/
|
|
2597
|
-
;
|
|
2598
|
-
|
|
2599
|
-
_proto.parseEnumValuesDefinition = function parseEnumValuesDefinition() {
|
|
2600
|
-
return this.optionalMany(TokenKind.BRACE_L, this.parseEnumValueDefinition, TokenKind.BRACE_R);
|
|
2601
|
-
}
|
|
2602
|
-
/**
|
|
2603
|
-
* EnumValueDefinition : Description? EnumValue Directives[Const]?
|
|
2604
|
-
*
|
|
2605
|
-
* EnumValue : Name
|
|
2606
|
-
*/
|
|
2607
|
-
;
|
|
2608
|
-
|
|
2609
|
-
_proto.parseEnumValueDefinition = function parseEnumValueDefinition() {
|
|
2610
|
-
var start = this._lexer.token;
|
|
2611
|
-
var description = this.parseDescription();
|
|
2612
|
-
var name = this.parseName();
|
|
2613
|
-
var directives = this.parseDirectives(true);
|
|
2614
|
-
return {
|
|
2615
|
-
kind: Kind.ENUM_VALUE_DEFINITION,
|
|
2616
|
-
description: description,
|
|
2617
|
-
name: name,
|
|
2618
|
-
directives: directives,
|
|
2619
|
-
loc: this.loc(start)
|
|
2620
|
-
};
|
|
2621
|
-
}
|
|
2622
|
-
/**
|
|
2623
|
-
* InputObjectTypeDefinition :
|
|
2624
|
-
* - Description? input Name Directives[Const]? InputFieldsDefinition?
|
|
2625
|
-
*/
|
|
2626
|
-
;
|
|
2627
|
-
|
|
2628
|
-
_proto.parseInputObjectTypeDefinition = function parseInputObjectTypeDefinition() {
|
|
2629
|
-
var start = this._lexer.token;
|
|
2630
|
-
var description = this.parseDescription();
|
|
2631
|
-
this.expectKeyword('input');
|
|
2632
|
-
var name = this.parseName();
|
|
2633
|
-
var directives = this.parseDirectives(true);
|
|
2634
|
-
var fields = this.parseInputFieldsDefinition();
|
|
2635
|
-
return {
|
|
2636
|
-
kind: Kind.INPUT_OBJECT_TYPE_DEFINITION,
|
|
2637
|
-
description: description,
|
|
2638
|
-
name: name,
|
|
2639
|
-
directives: directives,
|
|
2640
|
-
fields: fields,
|
|
2641
|
-
loc: this.loc(start)
|
|
2642
|
-
};
|
|
2643
|
-
}
|
|
2644
|
-
/**
|
|
2645
|
-
* InputFieldsDefinition : { InputValueDefinition+ }
|
|
2646
|
-
*/
|
|
2647
|
-
;
|
|
2648
|
-
|
|
2649
|
-
_proto.parseInputFieldsDefinition = function parseInputFieldsDefinition() {
|
|
2650
|
-
return this.optionalMany(TokenKind.BRACE_L, this.parseInputValueDef, TokenKind.BRACE_R);
|
|
2651
|
-
}
|
|
2652
|
-
/**
|
|
2653
|
-
* TypeSystemExtension :
|
|
2654
|
-
* - SchemaExtension
|
|
2655
|
-
* - TypeExtension
|
|
2656
|
-
*
|
|
2657
|
-
* TypeExtension :
|
|
2658
|
-
* - ScalarTypeExtension
|
|
2659
|
-
* - ObjectTypeExtension
|
|
2660
|
-
* - InterfaceTypeExtension
|
|
2661
|
-
* - UnionTypeExtension
|
|
2662
|
-
* - EnumTypeExtension
|
|
2663
|
-
* - InputObjectTypeDefinition
|
|
2664
|
-
*/
|
|
2665
|
-
;
|
|
2666
|
-
|
|
2667
|
-
_proto.parseTypeSystemExtension = function parseTypeSystemExtension() {
|
|
2668
|
-
var keywordToken = this._lexer.lookahead();
|
|
2669
|
-
|
|
2670
|
-
if (keywordToken.kind === TokenKind.NAME) {
|
|
2671
|
-
switch (keywordToken.value) {
|
|
2672
|
-
case 'schema':
|
|
2673
|
-
return this.parseSchemaExtension();
|
|
2674
|
-
|
|
2675
|
-
case 'scalar':
|
|
2676
|
-
return this.parseScalarTypeExtension();
|
|
2677
|
-
|
|
2678
|
-
case 'type':
|
|
2679
|
-
return this.parseObjectTypeExtension();
|
|
2680
|
-
|
|
2681
|
-
case 'interface':
|
|
2682
|
-
return this.parseInterfaceTypeExtension();
|
|
2683
|
-
|
|
2684
|
-
case 'union':
|
|
2685
|
-
return this.parseUnionTypeExtension();
|
|
2686
|
-
|
|
2687
|
-
case 'enum':
|
|
2688
|
-
return this.parseEnumTypeExtension();
|
|
2689
|
-
|
|
2690
|
-
case 'input':
|
|
2691
|
-
return this.parseInputObjectTypeExtension();
|
|
2692
|
-
}
|
|
2693
|
-
}
|
|
2694
|
-
|
|
2695
|
-
throw this.unexpected(keywordToken);
|
|
2696
|
-
}
|
|
2697
|
-
/**
|
|
2698
|
-
* SchemaExtension :
|
|
2699
|
-
* - extend schema Directives[Const]? { OperationTypeDefinition+ }
|
|
2700
|
-
* - extend schema Directives[Const]
|
|
2701
|
-
*/
|
|
2702
|
-
;
|
|
2703
|
-
|
|
2704
|
-
_proto.parseSchemaExtension = function parseSchemaExtension() {
|
|
2705
|
-
var start = this._lexer.token;
|
|
2706
|
-
this.expectKeyword('extend');
|
|
2707
|
-
this.expectKeyword('schema');
|
|
2708
|
-
var directives = this.parseDirectives(true);
|
|
2709
|
-
var operationTypes = this.optionalMany(TokenKind.BRACE_L, this.parseOperationTypeDefinition, TokenKind.BRACE_R);
|
|
2710
|
-
|
|
2711
|
-
if (directives.length === 0 && operationTypes.length === 0) {
|
|
2712
|
-
throw this.unexpected();
|
|
2713
|
-
}
|
|
2714
|
-
|
|
2715
|
-
return {
|
|
2716
|
-
kind: Kind.SCHEMA_EXTENSION,
|
|
2717
|
-
directives: directives,
|
|
2718
|
-
operationTypes: operationTypes,
|
|
2719
|
-
loc: this.loc(start)
|
|
2720
|
-
};
|
|
2721
|
-
}
|
|
2722
|
-
/**
|
|
2723
|
-
* ScalarTypeExtension :
|
|
2724
|
-
* - extend scalar Name Directives[Const]
|
|
2725
|
-
*/
|
|
2726
|
-
;
|
|
2727
|
-
|
|
2728
|
-
_proto.parseScalarTypeExtension = function parseScalarTypeExtension() {
|
|
2729
|
-
var start = this._lexer.token;
|
|
2730
|
-
this.expectKeyword('extend');
|
|
2731
|
-
this.expectKeyword('scalar');
|
|
2732
|
-
var name = this.parseName();
|
|
2733
|
-
var directives = this.parseDirectives(true);
|
|
2734
|
-
|
|
2735
|
-
if (directives.length === 0) {
|
|
2736
|
-
throw this.unexpected();
|
|
2737
|
-
}
|
|
2738
|
-
|
|
2739
|
-
return {
|
|
2740
|
-
kind: Kind.SCALAR_TYPE_EXTENSION,
|
|
2741
|
-
name: name,
|
|
2742
|
-
directives: directives,
|
|
2743
|
-
loc: this.loc(start)
|
|
2744
|
-
};
|
|
2745
|
-
}
|
|
2746
|
-
/**
|
|
2747
|
-
* ObjectTypeExtension :
|
|
2748
|
-
* - extend type Name ImplementsInterfaces? Directives[Const]? FieldsDefinition
|
|
2749
|
-
* - extend type Name ImplementsInterfaces? Directives[Const]
|
|
2750
|
-
* - extend type Name ImplementsInterfaces
|
|
2751
|
-
*/
|
|
2752
|
-
;
|
|
2753
|
-
|
|
2754
|
-
_proto.parseObjectTypeExtension = function parseObjectTypeExtension() {
|
|
2755
|
-
var start = this._lexer.token;
|
|
2756
|
-
this.expectKeyword('extend');
|
|
2757
|
-
this.expectKeyword('type');
|
|
2758
|
-
var name = this.parseName();
|
|
2759
|
-
var interfaces = this.parseImplementsInterfaces();
|
|
2760
|
-
var directives = this.parseDirectives(true);
|
|
2761
|
-
var fields = this.parseFieldsDefinition();
|
|
2762
|
-
|
|
2763
|
-
if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {
|
|
2764
|
-
throw this.unexpected();
|
|
2765
|
-
}
|
|
2766
|
-
|
|
2767
|
-
return {
|
|
2768
|
-
kind: Kind.OBJECT_TYPE_EXTENSION,
|
|
2769
|
-
name: name,
|
|
2770
|
-
interfaces: interfaces,
|
|
2771
|
-
directives: directives,
|
|
2772
|
-
fields: fields,
|
|
2773
|
-
loc: this.loc(start)
|
|
2774
|
-
};
|
|
2775
|
-
}
|
|
2776
|
-
/**
|
|
2777
|
-
* InterfaceTypeExtension :
|
|
2778
|
-
* - extend interface Name ImplementsInterfaces? Directives[Const]? FieldsDefinition
|
|
2779
|
-
* - extend interface Name ImplementsInterfaces? Directives[Const]
|
|
2780
|
-
* - extend interface Name ImplementsInterfaces
|
|
2781
|
-
*/
|
|
2782
|
-
;
|
|
2783
|
-
|
|
2784
|
-
_proto.parseInterfaceTypeExtension = function parseInterfaceTypeExtension() {
|
|
2785
|
-
var start = this._lexer.token;
|
|
2786
|
-
this.expectKeyword('extend');
|
|
2787
|
-
this.expectKeyword('interface');
|
|
2788
|
-
var name = this.parseName();
|
|
2789
|
-
var interfaces = this.parseImplementsInterfaces();
|
|
2790
|
-
var directives = this.parseDirectives(true);
|
|
2791
|
-
var fields = this.parseFieldsDefinition();
|
|
2792
|
-
|
|
2793
|
-
if (interfaces.length === 0 && directives.length === 0 && fields.length === 0) {
|
|
2794
|
-
throw this.unexpected();
|
|
2795
|
-
}
|
|
2796
|
-
|
|
2797
|
-
return {
|
|
2798
|
-
kind: Kind.INTERFACE_TYPE_EXTENSION,
|
|
2799
|
-
name: name,
|
|
2800
|
-
interfaces: interfaces,
|
|
2801
|
-
directives: directives,
|
|
2802
|
-
fields: fields,
|
|
2803
|
-
loc: this.loc(start)
|
|
2804
|
-
};
|
|
2805
|
-
}
|
|
2806
|
-
/**
|
|
2807
|
-
* UnionTypeExtension :
|
|
2808
|
-
* - extend union Name Directives[Const]? UnionMemberTypes
|
|
2809
|
-
* - extend union Name Directives[Const]
|
|
2810
|
-
*/
|
|
2811
|
-
;
|
|
2812
|
-
|
|
2813
|
-
_proto.parseUnionTypeExtension = function parseUnionTypeExtension() {
|
|
2814
|
-
var start = this._lexer.token;
|
|
2815
|
-
this.expectKeyword('extend');
|
|
2816
|
-
this.expectKeyword('union');
|
|
2817
|
-
var name = this.parseName();
|
|
2818
|
-
var directives = this.parseDirectives(true);
|
|
2819
|
-
var types = this.parseUnionMemberTypes();
|
|
2820
|
-
|
|
2821
|
-
if (directives.length === 0 && types.length === 0) {
|
|
2822
|
-
throw this.unexpected();
|
|
2823
|
-
}
|
|
2824
|
-
|
|
2825
|
-
return {
|
|
2826
|
-
kind: Kind.UNION_TYPE_EXTENSION,
|
|
2827
|
-
name: name,
|
|
2828
|
-
directives: directives,
|
|
2829
|
-
types: types,
|
|
2830
|
-
loc: this.loc(start)
|
|
2831
|
-
};
|
|
2832
|
-
}
|
|
2833
|
-
/**
|
|
2834
|
-
* EnumTypeExtension :
|
|
2835
|
-
* - extend enum Name Directives[Const]? EnumValuesDefinition
|
|
2836
|
-
* - extend enum Name Directives[Const]
|
|
2837
|
-
*/
|
|
2838
|
-
;
|
|
2839
|
-
|
|
2840
|
-
_proto.parseEnumTypeExtension = function parseEnumTypeExtension() {
|
|
2841
|
-
var start = this._lexer.token;
|
|
2842
|
-
this.expectKeyword('extend');
|
|
2843
|
-
this.expectKeyword('enum');
|
|
2844
|
-
var name = this.parseName();
|
|
2845
|
-
var directives = this.parseDirectives(true);
|
|
2846
|
-
var values = this.parseEnumValuesDefinition();
|
|
2847
|
-
|
|
2848
|
-
if (directives.length === 0 && values.length === 0) {
|
|
2849
|
-
throw this.unexpected();
|
|
2850
|
-
}
|
|
2851
|
-
|
|
2852
|
-
return {
|
|
2853
|
-
kind: Kind.ENUM_TYPE_EXTENSION,
|
|
2854
|
-
name: name,
|
|
2855
|
-
directives: directives,
|
|
2856
|
-
values: values,
|
|
2857
|
-
loc: this.loc(start)
|
|
2858
|
-
};
|
|
2859
|
-
}
|
|
2860
|
-
/**
|
|
2861
|
-
* InputObjectTypeExtension :
|
|
2862
|
-
* - extend input Name Directives[Const]? InputFieldsDefinition
|
|
2863
|
-
* - extend input Name Directives[Const]
|
|
2864
|
-
*/
|
|
2865
|
-
;
|
|
2866
|
-
|
|
2867
|
-
_proto.parseInputObjectTypeExtension = function parseInputObjectTypeExtension() {
|
|
2868
|
-
var start = this._lexer.token;
|
|
2869
|
-
this.expectKeyword('extend');
|
|
2870
|
-
this.expectKeyword('input');
|
|
2871
|
-
var name = this.parseName();
|
|
2872
|
-
var directives = this.parseDirectives(true);
|
|
2873
|
-
var fields = this.parseInputFieldsDefinition();
|
|
2874
|
-
|
|
2875
|
-
if (directives.length === 0 && fields.length === 0) {
|
|
2876
|
-
throw this.unexpected();
|
|
2877
|
-
}
|
|
2878
|
-
|
|
2879
|
-
return {
|
|
2880
|
-
kind: Kind.INPUT_OBJECT_TYPE_EXTENSION,
|
|
2881
|
-
name: name,
|
|
2882
|
-
directives: directives,
|
|
2883
|
-
fields: fields,
|
|
2884
|
-
loc: this.loc(start)
|
|
2885
|
-
};
|
|
2886
|
-
}
|
|
2887
|
-
/**
|
|
2888
|
-
* DirectiveDefinition :
|
|
2889
|
-
* - Description? directive @ Name ArgumentsDefinition? `repeatable`? on DirectiveLocations
|
|
2890
|
-
*/
|
|
2891
|
-
;
|
|
2892
|
-
|
|
2893
|
-
_proto.parseDirectiveDefinition = function parseDirectiveDefinition() {
|
|
2894
|
-
var start = this._lexer.token;
|
|
2895
|
-
var description = this.parseDescription();
|
|
2896
|
-
this.expectKeyword('directive');
|
|
2897
|
-
this.expectToken(TokenKind.AT);
|
|
2898
|
-
var name = this.parseName();
|
|
2899
|
-
var args = this.parseArgumentDefs();
|
|
2900
|
-
var repeatable = this.expectOptionalKeyword('repeatable');
|
|
2901
|
-
this.expectKeyword('on');
|
|
2902
|
-
var locations = this.parseDirectiveLocations();
|
|
2903
|
-
return {
|
|
2904
|
-
kind: Kind.DIRECTIVE_DEFINITION,
|
|
2905
|
-
description: description,
|
|
2906
|
-
name: name,
|
|
2907
|
-
arguments: args,
|
|
2908
|
-
repeatable: repeatable,
|
|
2909
|
-
locations: locations,
|
|
2910
|
-
loc: this.loc(start)
|
|
2911
|
-
};
|
|
2912
|
-
}
|
|
2913
|
-
/**
|
|
2914
|
-
* DirectiveLocations :
|
|
2915
|
-
* - `|`? DirectiveLocation
|
|
2916
|
-
* - DirectiveLocations | DirectiveLocation
|
|
2917
|
-
*/
|
|
2918
|
-
;
|
|
2919
|
-
|
|
2920
|
-
_proto.parseDirectiveLocations = function parseDirectiveLocations() {
|
|
2921
|
-
return this.delimitedMany(TokenKind.PIPE, this.parseDirectiveLocation);
|
|
2922
|
-
}
|
|
2923
|
-
/*
|
|
2924
|
-
* DirectiveLocation :
|
|
2925
|
-
* - ExecutableDirectiveLocation
|
|
2926
|
-
* - TypeSystemDirectiveLocation
|
|
2927
|
-
*
|
|
2928
|
-
* ExecutableDirectiveLocation : one of
|
|
2929
|
-
* `QUERY`
|
|
2930
|
-
* `MUTATION`
|
|
2931
|
-
* `SUBSCRIPTION`
|
|
2932
|
-
* `FIELD`
|
|
2933
|
-
* `FRAGMENT_DEFINITION`
|
|
2934
|
-
* `FRAGMENT_SPREAD`
|
|
2935
|
-
* `INLINE_FRAGMENT`
|
|
2936
|
-
*
|
|
2937
|
-
* TypeSystemDirectiveLocation : one of
|
|
2938
|
-
* `SCHEMA`
|
|
2939
|
-
* `SCALAR`
|
|
2940
|
-
* `OBJECT`
|
|
2941
|
-
* `FIELD_DEFINITION`
|
|
2942
|
-
* `ARGUMENT_DEFINITION`
|
|
2943
|
-
* `INTERFACE`
|
|
2944
|
-
* `UNION`
|
|
2945
|
-
* `ENUM`
|
|
2946
|
-
* `ENUM_VALUE`
|
|
2947
|
-
* `INPUT_OBJECT`
|
|
2948
|
-
* `INPUT_FIELD_DEFINITION`
|
|
2949
|
-
*/
|
|
2950
|
-
;
|
|
2951
|
-
|
|
2952
|
-
_proto.parseDirectiveLocation = function parseDirectiveLocation() {
|
|
2953
|
-
var start = this._lexer.token;
|
|
2954
|
-
var name = this.parseName();
|
|
2955
|
-
|
|
2956
|
-
if (DirectiveLocation[name.value] !== undefined) {
|
|
2957
|
-
return name;
|
|
2958
|
-
}
|
|
2959
|
-
|
|
2960
|
-
throw this.unexpected(start);
|
|
2961
|
-
} // Core parsing utility functions
|
|
2962
|
-
|
|
2963
|
-
/**
|
|
2964
|
-
* Returns a location object, used to identify the place in the source that created a given parsed object.
|
|
2965
|
-
*/
|
|
2966
|
-
;
|
|
2967
|
-
|
|
2968
|
-
_proto.loc = function loc(startToken) {
|
|
2969
|
-
var _this$_options4;
|
|
2970
|
-
|
|
2971
|
-
if (((_this$_options4 = this._options) === null || _this$_options4 === void 0 ? void 0 : _this$_options4.noLocation) !== true) {
|
|
2972
|
-
return new Location(startToken, this._lexer.lastToken, this._lexer.source);
|
|
2973
|
-
}
|
|
2974
|
-
}
|
|
2975
|
-
/**
|
|
2976
|
-
* Determines if the next token is of a given kind
|
|
2977
|
-
*/
|
|
2978
|
-
;
|
|
2979
|
-
|
|
2980
|
-
_proto.peek = function peek(kind) {
|
|
2981
|
-
return this._lexer.token.kind === kind;
|
|
2982
|
-
}
|
|
2983
|
-
/**
|
|
2984
|
-
* If the next token is of the given kind, return that token after advancing the lexer.
|
|
2985
|
-
* Otherwise, do not change the parser state and throw an error.
|
|
2986
|
-
*/
|
|
2987
|
-
;
|
|
2988
|
-
|
|
2989
|
-
_proto.expectToken = function expectToken(kind) {
|
|
2990
|
-
var token = this._lexer.token;
|
|
2991
|
-
|
|
2992
|
-
if (token.kind === kind) {
|
|
2993
|
-
this._lexer.advance();
|
|
2994
|
-
|
|
2995
|
-
return token;
|
|
2996
|
-
}
|
|
2997
|
-
|
|
2998
|
-
throw syntaxError(this._lexer.source, token.start, "Expected ".concat(getTokenKindDesc(kind), ", found ").concat(getTokenDesc(token), "."));
|
|
2999
|
-
}
|
|
3000
|
-
/**
|
|
3001
|
-
* If the next token is of the given kind, return that token after advancing the lexer.
|
|
3002
|
-
* Otherwise, do not change the parser state and return undefined.
|
|
3003
|
-
*/
|
|
3004
|
-
;
|
|
3005
|
-
|
|
3006
|
-
_proto.expectOptionalToken = function expectOptionalToken(kind) {
|
|
3007
|
-
var token = this._lexer.token;
|
|
3008
|
-
|
|
3009
|
-
if (token.kind === kind) {
|
|
3010
|
-
this._lexer.advance();
|
|
3011
|
-
|
|
3012
|
-
return token;
|
|
3013
|
-
}
|
|
3014
|
-
|
|
3015
|
-
return undefined;
|
|
3016
|
-
}
|
|
3017
|
-
/**
|
|
3018
|
-
* If the next token is a given keyword, advance the lexer.
|
|
3019
|
-
* Otherwise, do not change the parser state and throw an error.
|
|
3020
|
-
*/
|
|
3021
|
-
;
|
|
3022
|
-
|
|
3023
|
-
_proto.expectKeyword = function expectKeyword(value) {
|
|
3024
|
-
var token = this._lexer.token;
|
|
3025
|
-
|
|
3026
|
-
if (token.kind === TokenKind.NAME && token.value === value) {
|
|
3027
|
-
this._lexer.advance();
|
|
3028
|
-
} else {
|
|
3029
|
-
throw syntaxError(this._lexer.source, token.start, "Expected \"".concat(value, "\", found ").concat(getTokenDesc(token), "."));
|
|
3030
|
-
}
|
|
3031
|
-
}
|
|
3032
|
-
/**
|
|
3033
|
-
* If the next token is a given keyword, return "true" after advancing the lexer.
|
|
3034
|
-
* Otherwise, do not change the parser state and return "false".
|
|
3035
|
-
*/
|
|
3036
|
-
;
|
|
3037
|
-
|
|
3038
|
-
_proto.expectOptionalKeyword = function expectOptionalKeyword(value) {
|
|
3039
|
-
var token = this._lexer.token;
|
|
3040
|
-
|
|
3041
|
-
if (token.kind === TokenKind.NAME && token.value === value) {
|
|
3042
|
-
this._lexer.advance();
|
|
3043
|
-
|
|
3044
|
-
return true;
|
|
3045
|
-
}
|
|
3046
|
-
|
|
3047
|
-
return false;
|
|
3048
|
-
}
|
|
3049
|
-
/**
|
|
3050
|
-
* Helper function for creating an error when an unexpected lexed token is encountered.
|
|
3051
|
-
*/
|
|
3052
|
-
;
|
|
3053
|
-
|
|
3054
|
-
_proto.unexpected = function unexpected(atToken) {
|
|
3055
|
-
var token = atToken !== null && atToken !== void 0 ? atToken : this._lexer.token;
|
|
3056
|
-
return syntaxError(this._lexer.source, token.start, "Unexpected ".concat(getTokenDesc(token), "."));
|
|
3057
|
-
}
|
|
3058
|
-
/**
|
|
3059
|
-
* Returns a possibly empty list of parse nodes, determined by the parseFn.
|
|
3060
|
-
* This list begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
3061
|
-
* Advances the parser to the next lex token after the closing token.
|
|
3062
|
-
*/
|
|
3063
|
-
;
|
|
3064
|
-
|
|
3065
|
-
_proto.any = function any(openKind, parseFn, closeKind) {
|
|
3066
|
-
this.expectToken(openKind);
|
|
3067
|
-
var nodes = [];
|
|
3068
|
-
|
|
3069
|
-
while (!this.expectOptionalToken(closeKind)) {
|
|
3070
|
-
nodes.push(parseFn.call(this));
|
|
3071
|
-
}
|
|
3072
|
-
|
|
3073
|
-
return nodes;
|
|
3074
|
-
}
|
|
3075
|
-
/**
|
|
3076
|
-
* Returns a list of parse nodes, determined by the parseFn.
|
|
3077
|
-
* It can be empty only if open token is missing otherwise it will always return non-empty list
|
|
3078
|
-
* that begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
3079
|
-
* Advances the parser to the next lex token after the closing token.
|
|
3080
|
-
*/
|
|
3081
|
-
;
|
|
3082
|
-
|
|
3083
|
-
_proto.optionalMany = function optionalMany(openKind, parseFn, closeKind) {
|
|
3084
|
-
if (this.expectOptionalToken(openKind)) {
|
|
3085
|
-
var nodes = [];
|
|
3086
|
-
|
|
3087
|
-
do {
|
|
3088
|
-
nodes.push(parseFn.call(this));
|
|
3089
|
-
} while (!this.expectOptionalToken(closeKind));
|
|
3090
|
-
|
|
3091
|
-
return nodes;
|
|
3092
|
-
}
|
|
3093
|
-
|
|
3094
|
-
return [];
|
|
3095
|
-
}
|
|
3096
|
-
/**
|
|
3097
|
-
* Returns a non-empty list of parse nodes, determined by the parseFn.
|
|
3098
|
-
* This list begins with a lex token of openKind and ends with a lex token of closeKind.
|
|
3099
|
-
* Advances the parser to the next lex token after the closing token.
|
|
3100
|
-
*/
|
|
3101
|
-
;
|
|
3102
|
-
|
|
3103
|
-
_proto.many = function many(openKind, parseFn, closeKind) {
|
|
3104
|
-
this.expectToken(openKind);
|
|
3105
|
-
var nodes = [];
|
|
3106
|
-
|
|
3107
|
-
do {
|
|
3108
|
-
nodes.push(parseFn.call(this));
|
|
3109
|
-
} while (!this.expectOptionalToken(closeKind));
|
|
3110
|
-
|
|
3111
|
-
return nodes;
|
|
3112
|
-
}
|
|
3113
|
-
/**
|
|
3114
|
-
* Returns a non-empty list of parse nodes, determined by the parseFn.
|
|
3115
|
-
* This list may begin with a lex token of delimiterKind followed by items separated by lex tokens of tokenKind.
|
|
3116
|
-
* Advances the parser to the next lex token after last item in the list.
|
|
3117
|
-
*/
|
|
3118
|
-
;
|
|
3119
|
-
|
|
3120
|
-
_proto.delimitedMany = function delimitedMany(delimiterKind, parseFn) {
|
|
3121
|
-
this.expectOptionalToken(delimiterKind);
|
|
3122
|
-
var nodes = [];
|
|
3123
|
-
|
|
3124
|
-
do {
|
|
3125
|
-
nodes.push(parseFn.call(this));
|
|
3126
|
-
} while (this.expectOptionalToken(delimiterKind));
|
|
3127
|
-
|
|
3128
|
-
return nodes;
|
|
3129
|
-
};
|
|
3130
|
-
|
|
3131
|
-
return Parser;
|
|
3132
|
-
}();
|
|
3133
|
-
/**
|
|
3134
|
-
* A helper function to describe a token as a string for debugging.
|
|
3135
|
-
*/
|
|
3136
|
-
|
|
3137
|
-
function getTokenDesc(token) {
|
|
3138
|
-
var value = token.value;
|
|
3139
|
-
return getTokenKindDesc(token.kind) + (value != null ? " \"".concat(value, "\"") : '');
|
|
3140
|
-
}
|
|
3141
|
-
/**
|
|
3142
|
-
* A helper function to describe a token kind as a string for debugging.
|
|
3143
|
-
*/
|
|
3144
|
-
|
|
3145
|
-
|
|
3146
|
-
function getTokenKindDesc(kind) {
|
|
3147
|
-
return isPunctuatorTokenKind(kind) ? "\"".concat(kind, "\"") : kind;
|
|
3148
|
-
}
|
|
3149
|
-
|
|
3150
|
-
var docCache = new Map();
|
|
3151
|
-
var fragmentSourceMap = new Map();
|
|
3152
|
-
var printFragmentWarnings = true;
|
|
3153
|
-
var experimentalFragmentVariables = false;
|
|
3154
|
-
function normalize$2(string) {
|
|
3155
|
-
return string.replace(/[\s,]+/g, ' ').trim();
|
|
3156
|
-
}
|
|
3157
|
-
function cacheKeyFromLoc(loc) {
|
|
3158
|
-
return normalize$2(loc.source.body.substring(loc.start, loc.end));
|
|
3159
|
-
}
|
|
3160
|
-
function processFragments(ast) {
|
|
3161
|
-
var seenKeys = new Set();
|
|
3162
|
-
var definitions = [];
|
|
3163
|
-
ast.definitions.forEach(function (fragmentDefinition) {
|
|
3164
|
-
if (fragmentDefinition.kind === 'FragmentDefinition') {
|
|
3165
|
-
var fragmentName = fragmentDefinition.name.value;
|
|
3166
|
-
var sourceKey = cacheKeyFromLoc(fragmentDefinition.loc);
|
|
3167
|
-
var sourceKeySet = fragmentSourceMap.get(fragmentName);
|
|
3168
|
-
if (sourceKeySet && !sourceKeySet.has(sourceKey)) {
|
|
3169
|
-
if (printFragmentWarnings) {
|
|
3170
|
-
console.warn("Warning: fragment with name " + fragmentName + " already exists.\n"
|
|
3171
|
-
+ "graphql-tag enforces all fragment names across your application to be unique; read more about\n"
|
|
3172
|
-
+ "this in the docs: http://dev.apollodata.com/core/fragments.html#unique-names");
|
|
3173
|
-
}
|
|
3174
|
-
}
|
|
3175
|
-
else if (!sourceKeySet) {
|
|
3176
|
-
fragmentSourceMap.set(fragmentName, sourceKeySet = new Set);
|
|
3177
|
-
}
|
|
3178
|
-
sourceKeySet.add(sourceKey);
|
|
3179
|
-
if (!seenKeys.has(sourceKey)) {
|
|
3180
|
-
seenKeys.add(sourceKey);
|
|
3181
|
-
definitions.push(fragmentDefinition);
|
|
3182
|
-
}
|
|
3183
|
-
}
|
|
3184
|
-
else {
|
|
3185
|
-
definitions.push(fragmentDefinition);
|
|
3186
|
-
}
|
|
3187
|
-
});
|
|
3188
|
-
return __assign(__assign({}, ast), { definitions: definitions });
|
|
3189
|
-
}
|
|
3190
|
-
function stripLoc(doc) {
|
|
3191
|
-
var workSet = new Set(doc.definitions);
|
|
3192
|
-
workSet.forEach(function (node) {
|
|
3193
|
-
if (node.loc)
|
|
3194
|
-
delete node.loc;
|
|
3195
|
-
Object.keys(node).forEach(function (key) {
|
|
3196
|
-
var value = node[key];
|
|
3197
|
-
if (value && typeof value === 'object') {
|
|
3198
|
-
workSet.add(value);
|
|
3199
|
-
}
|
|
3200
|
-
});
|
|
3201
|
-
});
|
|
3202
|
-
var loc = doc.loc;
|
|
3203
|
-
if (loc) {
|
|
3204
|
-
delete loc.startToken;
|
|
3205
|
-
delete loc.endToken;
|
|
3206
|
-
}
|
|
3207
|
-
return doc;
|
|
3208
|
-
}
|
|
3209
|
-
function parseDocument(source) {
|
|
3210
|
-
var cacheKey = normalize$2(source);
|
|
3211
|
-
if (!docCache.has(cacheKey)) {
|
|
3212
|
-
var parsed = parse$1(source, {
|
|
3213
|
-
experimentalFragmentVariables: experimentalFragmentVariables,
|
|
3214
|
-
allowLegacyFragmentVariables: experimentalFragmentVariables
|
|
3215
|
-
});
|
|
3216
|
-
if (!parsed || parsed.kind !== 'Document') {
|
|
3217
|
-
throw new Error('Not a valid GraphQL document.');
|
|
3218
|
-
}
|
|
3219
|
-
docCache.set(cacheKey, stripLoc(processFragments(parsed)));
|
|
3220
|
-
}
|
|
3221
|
-
return docCache.get(cacheKey);
|
|
3222
|
-
}
|
|
3223
|
-
function gql(literals) {
|
|
3224
|
-
var args = [];
|
|
3225
|
-
for (var _i = 1; _i < arguments.length; _i++) {
|
|
3226
|
-
args[_i - 1] = arguments[_i];
|
|
3227
|
-
}
|
|
3228
|
-
if (typeof literals === 'string') {
|
|
3229
|
-
literals = [literals];
|
|
3230
|
-
}
|
|
3231
|
-
var result = literals[0];
|
|
3232
|
-
args.forEach(function (arg, i) {
|
|
3233
|
-
if (arg && arg.kind === 'Document') {
|
|
3234
|
-
result += arg.loc.source.body;
|
|
3235
|
-
}
|
|
3236
|
-
else {
|
|
3237
|
-
result += arg;
|
|
3238
|
-
}
|
|
3239
|
-
result += literals[i + 1];
|
|
3240
|
-
});
|
|
3241
|
-
return parseDocument(result);
|
|
3242
|
-
}
|
|
3243
|
-
function resetCaches() {
|
|
3244
|
-
docCache.clear();
|
|
3245
|
-
fragmentSourceMap.clear();
|
|
3246
|
-
}
|
|
3247
|
-
function disableFragmentWarnings() {
|
|
3248
|
-
printFragmentWarnings = false;
|
|
3249
|
-
}
|
|
3250
|
-
function enableExperimentalFragmentVariables() {
|
|
3251
|
-
experimentalFragmentVariables = true;
|
|
3252
|
-
}
|
|
3253
|
-
function disableExperimentalFragmentVariables() {
|
|
3254
|
-
experimentalFragmentVariables = false;
|
|
3255
|
-
}
|
|
3256
|
-
var extras = {
|
|
3257
|
-
gql: gql,
|
|
3258
|
-
resetCaches: resetCaches,
|
|
3259
|
-
disableFragmentWarnings: disableFragmentWarnings,
|
|
3260
|
-
enableExperimentalFragmentVariables: enableExperimentalFragmentVariables,
|
|
3261
|
-
disableExperimentalFragmentVariables: disableExperimentalFragmentVariables
|
|
3262
|
-
};
|
|
3263
|
-
(function (gql_1) {
|
|
3264
|
-
gql_1.gql = extras.gql, gql_1.resetCaches = extras.resetCaches, gql_1.disableFragmentWarnings = extras.disableFragmentWarnings, gql_1.enableExperimentalFragmentVariables = extras.enableExperimentalFragmentVariables, gql_1.disableExperimentalFragmentVariables = extras.disableExperimentalFragmentVariables;
|
|
3265
|
-
})(gql || (gql = {}));
|
|
3266
|
-
gql["default"] = gql;
|
|
3267
|
-
var gql$1 = gql;
|
|
3268
|
-
|
|
3269
22
|
var commonjsGlobal = typeof globalThis !== 'undefined' ? globalThis : typeof window !== 'undefined' ? window : typeof global !== 'undefined' ? global : typeof self !== 'undefined' ? self : {};
|
|
3270
23
|
|
|
3271
24
|
function getAugmentedNamespace(n) {
|
|
@@ -6195,6 +2948,31 @@ fixRegExpWellKnownSymbolLogic$1('replace', function (_, nativeReplace, maybeCall
|
|
|
6195
2948
|
];
|
|
6196
2949
|
}, !REPLACE_SUPPORTS_NAMED_GROUPS || !REPLACE_KEEPS_$0 || REGEXP_REPLACE_SUBSTITUTES_UNDEFINED_CAPTURE);
|
|
6197
2950
|
|
|
2951
|
+
/******************************************************************************
|
|
2952
|
+
Copyright (c) Microsoft Corporation.
|
|
2953
|
+
|
|
2954
|
+
Permission to use, copy, modify, and/or distribute this software for any
|
|
2955
|
+
purpose with or without fee is hereby granted.
|
|
2956
|
+
|
|
2957
|
+
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
2958
|
+
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
2959
|
+
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
2960
|
+
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
2961
|
+
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
2962
|
+
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
2963
|
+
PERFORMANCE OF THIS SOFTWARE.
|
|
2964
|
+
***************************************************************************** */
|
|
2965
|
+
|
|
2966
|
+
function __awaiter(thisArg, _arguments, P, generator) {
|
|
2967
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
2968
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
2969
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
2970
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
2971
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
2972
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
2973
|
+
});
|
|
2974
|
+
}
|
|
2975
|
+
|
|
6198
2976
|
// `SameValue` abstract operation
|
|
6199
2977
|
// https://tc39.es/ecma262/#sec-samevalue
|
|
6200
2978
|
// eslint-disable-next-line es/no-object-is -- safe
|
|
@@ -6262,35 +3040,42 @@ function initBackendsLocations() {
|
|
|
6262
3040
|
switch (api) {
|
|
6263
3041
|
case 'prod':
|
|
6264
3042
|
dBackend = 'https://query.bcrumbs.net';
|
|
3043
|
+
frontend = 'https://app.bcrumbs.net';
|
|
6265
3044
|
apiBackend = 'https://api.bcrumbs.net';
|
|
6266
3045
|
apiV2Backend = 'https://apiv2.bcrumbs.net';
|
|
6267
3046
|
break;
|
|
6268
3047
|
case 'test':
|
|
6269
3048
|
dBackend = 'https://query.bcrumbs.net';
|
|
3049
|
+
frontend = 'https://dev.bcrumbs.net';
|
|
6270
3050
|
apiBackend = 'https://api.bcrumbs.net';
|
|
6271
|
-
apiV2Backend = '
|
|
3051
|
+
apiV2Backend = 'apiv2-dev.bcrumbs.net';
|
|
6272
3052
|
break;
|
|
6273
3053
|
case 'local':
|
|
6274
3054
|
dBackend = 'https://localhost:44322';
|
|
3055
|
+
frontend = 'http://localhost:4200';
|
|
6275
3056
|
apiBackend = 'https://api.bcrumbs.net';
|
|
6276
|
-
apiV2Backend = '
|
|
3057
|
+
apiV2Backend = 'https://apiv2-dev.bcrumbs.net';
|
|
6277
3058
|
break;
|
|
6278
3059
|
default:
|
|
6279
3060
|
if (currentUrl) {
|
|
6280
3061
|
if (currentUrl.indexOf('localhost') > -1) {
|
|
6281
3062
|
dBackend = 'https://query.bcrumbs.net';
|
|
3063
|
+
frontend = 'http://localhost:4200';
|
|
6282
3064
|
apiBackend = 'https://api.bcrumbs.net';
|
|
6283
|
-
apiV2Backend = '
|
|
3065
|
+
apiV2Backend = 'https://apiv2-dev.bcrumbs.net';
|
|
6284
3066
|
} else if (currentUrl.indexOf('dconfig.com') > -1) {
|
|
6285
3067
|
dBackend = 'https://query.bcrumbs.net';
|
|
3068
|
+
frontend = 'https://app.bcrumbs.net';
|
|
6286
3069
|
apiBackend = 'https://api.bcrumbs.net';
|
|
6287
3070
|
apiV2Backend = 'https://apiv2.bcrumbs.net';
|
|
6288
3071
|
} else if (currentUrl.indexOf('dev.bcrumbs.net') > -1) {
|
|
6289
3072
|
dBackend = 'https://query.bcrumbs.net';
|
|
3073
|
+
frontend = 'https://dev.bcrumbs.net';
|
|
6290
3074
|
apiBackend = 'https://api.bcrumbs.net';
|
|
6291
3075
|
apiV2Backend = 'https://apiv2.bcrumbs.net';
|
|
6292
3076
|
} else {
|
|
6293
3077
|
dBackend = 'https://query.bcrumbs.net';
|
|
3078
|
+
frontend = 'https://app.bcrumbs.net';
|
|
6294
3079
|
apiBackend = 'https://api.bcrumbs.net';
|
|
6295
3080
|
apiV2Backend = 'https://apiv2.bcrumbs.net';
|
|
6296
3081
|
}
|
|
@@ -6301,6 +3086,7 @@ function initBackendsLocations() {
|
|
|
6301
3086
|
}
|
|
6302
3087
|
let params;
|
|
6303
3088
|
let currentUrl;
|
|
3089
|
+
let frontend;
|
|
6304
3090
|
let dBackend;
|
|
6305
3091
|
let apiBackend;
|
|
6306
3092
|
let apiV2Backend;
|
|
@@ -6425,10 +3211,10 @@ const tokenClient = new ApolloClient({
|
|
|
6425
3211
|
connectToDevTools: isDevEnv$1
|
|
6426
3212
|
});
|
|
6427
3213
|
|
|
6428
|
-
let _$
|
|
6429
|
-
_t$
|
|
3214
|
+
let _$6 = t => t,
|
|
3215
|
+
_t$6,
|
|
6430
3216
|
_t2$6;
|
|
6431
|
-
const viewTypesQuery = gql
|
|
3217
|
+
const viewTypesQuery = gql(_t$6 || (_t$6 = _$6`
|
|
6432
3218
|
query ($templateContextId: Int!) {
|
|
6433
3219
|
viewTypes(templateContextId: $templateContextId)
|
|
6434
3220
|
@rest(
|
|
@@ -6475,7 +3261,7 @@ const useModelsQuery = templateContextId => useQuery(viewTypesQuery, {
|
|
|
6475
3261
|
templateContextId
|
|
6476
3262
|
}
|
|
6477
3263
|
});
|
|
6478
|
-
const viewTypeChildrenQuery = gql
|
|
3264
|
+
const viewTypeChildrenQuery = gql(_t2$6 || (_t2$6 = _$6`
|
|
6479
3265
|
query ($parentId: Int!, $templateId: Int!) {
|
|
6480
3266
|
viewTypes(parentId: $parentId, templateId: $templateId)
|
|
6481
3267
|
@rest(
|
|
@@ -6528,7 +3314,7 @@ const {
|
|
|
6528
3314
|
networkInterface: uri
|
|
6529
3315
|
} = appConfig.dquery;
|
|
6530
3316
|
const cache = new InMemoryCache();
|
|
6531
|
-
const errorLink = onError
|
|
3317
|
+
const errorLink = onError(({
|
|
6532
3318
|
networkError
|
|
6533
3319
|
}) => {
|
|
6534
3320
|
if (networkError && networkError.statusCode === 401) {
|
|
@@ -6548,7 +3334,6 @@ const link_dquery = createHttpLink({
|
|
|
6548
3334
|
}
|
|
6549
3335
|
});
|
|
6550
3336
|
const dqueryClient = new ApolloClient({
|
|
6551
|
-
// @ts-expect-error TypeScript is complaining
|
|
6552
3337
|
link: from([errorLink, link_dquery]),
|
|
6553
3338
|
cache,
|
|
6554
3339
|
connectToDevTools: isDevEnv,
|
|
@@ -6571,22 +3356,22 @@ const USER_INFO = 'userInfo';
|
|
|
6571
3356
|
const APP_PERSIST_STORES_TYPES = ['localStorage', 'sessionStorage'];
|
|
6572
3357
|
const parse = JSON.parse;
|
|
6573
3358
|
const stringify = JSON.stringify;
|
|
6574
|
-
/*
|
|
6575
|
-
auth object
|
|
6576
|
-
-> store "TOKEN_KEY"
|
|
6577
|
-
- default storage is "localStorage"
|
|
6578
|
-
- default token key is 'token'
|
|
3359
|
+
/*
|
|
3360
|
+
auth object
|
|
3361
|
+
-> store "TOKEN_KEY"
|
|
3362
|
+
- default storage is "localStorage"
|
|
3363
|
+
- default token key is 'token'
|
|
6579
3364
|
*/
|
|
6580
3365
|
const auth = {
|
|
6581
3366
|
// /////////////////////////////////////////////////////////////
|
|
6582
3367
|
// TOKEN
|
|
6583
3368
|
// /////////////////////////////////////////////////////////////
|
|
6584
|
-
/**
|
|
6585
|
-
* get token from localstorage
|
|
6586
|
-
*
|
|
6587
|
-
* @param {'localStorage' | 'sessionStorage'} [fromStorage='localStorage'] specify storage
|
|
6588
|
-
* @param {any} [tokenKey=TOKEN_KEY] optionnal parameter to specify a token key
|
|
6589
|
-
* @returns {string} token value
|
|
3369
|
+
/**
|
|
3370
|
+
* get token from localstorage
|
|
3371
|
+
*
|
|
3372
|
+
* @param {'localStorage' | 'sessionStorage'} [fromStorage='localStorage'] specify storage
|
|
3373
|
+
* @param {any} [tokenKey=TOKEN_KEY] optionnal parameter to specify a token key
|
|
3374
|
+
* @returns {string} token value
|
|
6590
3375
|
*/
|
|
6591
3376
|
getToken(fromStorage = APP_PERSIST_STORES_TYPES[0], tokenKey = TOKEN_KEY) {
|
|
6592
3377
|
// localStorage:
|
|
@@ -6600,13 +3385,13 @@ const auth = {
|
|
|
6600
3385
|
// default:
|
|
6601
3386
|
return null;
|
|
6602
3387
|
},
|
|
6603
|
-
/**
|
|
6604
|
-
* set the token value into localstorage (managed by localforage)
|
|
6605
|
-
*
|
|
6606
|
-
* @param {string} [value=''] token value
|
|
6607
|
-
* @param {'localStorage' | 'sessionStorage'} [toStorage='localStorage'] specify storage
|
|
6608
|
-
* @param {any} [tokenKey='token'] token key
|
|
6609
|
-
* @returns {boolean} success/failure flag
|
|
3388
|
+
/**
|
|
3389
|
+
* set the token value into localstorage (managed by localforage)
|
|
3390
|
+
*
|
|
3391
|
+
* @param {string} [value=''] token value
|
|
3392
|
+
* @param {'localStorage' | 'sessionStorage'} [toStorage='localStorage'] specify storage
|
|
3393
|
+
* @param {any} [tokenKey='token'] token key
|
|
3394
|
+
* @returns {boolean} success/failure flag
|
|
6610
3395
|
*/
|
|
6611
3396
|
setToken(value = '', toStorage = APP_PERSIST_STORES_TYPES[0], tokenKey = TOKEN_KEY) {
|
|
6612
3397
|
if (!value || value.length <= 0) {
|
|
@@ -6625,26 +3410,26 @@ const auth = {
|
|
|
6625
3410
|
}
|
|
6626
3411
|
}
|
|
6627
3412
|
},
|
|
6628
|
-
/**
|
|
6629
|
-
* check
|
|
6630
|
-
* - if token key contains a valid token value (defined and not an empty value)
|
|
6631
|
-
* - if the token expiration date is passed
|
|
6632
|
-
*
|
|
6633
|
-
*
|
|
6634
|
-
* Note: 'isAuthenticated' just checks 'tokenKey' on store (localStorage by default or sessionStorage)
|
|
6635
|
-
*
|
|
6636
|
-
* You may think: 'ok I just put an empty token key and I have access to protected routes?''
|
|
6637
|
-
* -> answer is: YES^^
|
|
6638
|
-
* BUT
|
|
6639
|
-
* -> : your backend will not recognize a wrong token so private data or safe and you protected view could be a bit ugly without any data.
|
|
6640
|
-
*
|
|
6641
|
-
* => ON CONCLUSION: this aim of 'isAuthenticated'
|
|
6642
|
-
* -> is to help for a better "user experience" (= better than displaying a view with no data since server did not accept the user).
|
|
6643
|
-
* -> it is not a security purpose (security comes from backend, since frontend is easily hackable => user has access to all your frontend)
|
|
6644
|
-
*
|
|
6645
|
-
* @param {'localStorage' | 'sessionStorage'} [fromStorage='localStorage'] specify storage
|
|
6646
|
-
* @param {any} [tokenKey=TOKEN_KEY] token key
|
|
6647
|
-
* @returns {bool} is authenticed response
|
|
3413
|
+
/**
|
|
3414
|
+
* check
|
|
3415
|
+
* - if token key contains a valid token value (defined and not an empty value)
|
|
3416
|
+
* - if the token expiration date is passed
|
|
3417
|
+
*
|
|
3418
|
+
*
|
|
3419
|
+
* Note: 'isAuthenticated' just checks 'tokenKey' on store (localStorage by default or sessionStorage)
|
|
3420
|
+
*
|
|
3421
|
+
* You may think: 'ok I just put an empty token key and I have access to protected routes?''
|
|
3422
|
+
* -> answer is: YES^^
|
|
3423
|
+
* BUT
|
|
3424
|
+
* -> : your backend will not recognize a wrong token so private data or safe and you protected view could be a bit ugly without any data.
|
|
3425
|
+
*
|
|
3426
|
+
* => ON CONCLUSION: this aim of 'isAuthenticated'
|
|
3427
|
+
* -> is to help for a better "user experience" (= better than displaying a view with no data since server did not accept the user).
|
|
3428
|
+
* -> it is not a security purpose (security comes from backend, since frontend is easily hackable => user has access to all your frontend)
|
|
3429
|
+
*
|
|
3430
|
+
* @param {'localStorage' | 'sessionStorage'} [fromStorage='localStorage'] specify storage
|
|
3431
|
+
* @param {any} [tokenKey=TOKEN_KEY] token key
|
|
3432
|
+
* @returns {bool} is authenticed response
|
|
6648
3433
|
*/
|
|
6649
3434
|
isAuthenticated(fromStorage = APP_PERSIST_STORES_TYPES[0], tokenKey = TOKEN_KEY) {
|
|
6650
3435
|
// localStorage:
|
|
@@ -6666,11 +3451,11 @@ const auth = {
|
|
|
6666
3451
|
// default:
|
|
6667
3452
|
return false;
|
|
6668
3453
|
},
|
|
6669
|
-
/**
|
|
6670
|
-
* delete token
|
|
6671
|
-
*
|
|
6672
|
-
* @param {any} [tokenKey='token'] token key
|
|
6673
|
-
* @returns {bool} success/failure flag
|
|
3454
|
+
/**
|
|
3455
|
+
* delete token
|
|
3456
|
+
*
|
|
3457
|
+
* @param {any} [tokenKey='token'] token key
|
|
3458
|
+
* @returns {bool} success/failure flag
|
|
6674
3459
|
*/
|
|
6675
3460
|
clearToken(storage = APP_PERSIST_STORES_TYPES[0], tokenKey = TOKEN_KEY) {
|
|
6676
3461
|
// localStorage:
|
|
@@ -6686,11 +3471,11 @@ const auth = {
|
|
|
6686
3471
|
return false;
|
|
6687
3472
|
},
|
|
6688
3473
|
//TODO: Its not working for now while the token is not JWT token
|
|
6689
|
-
/**
|
|
6690
|
-
* return expiration date from token
|
|
6691
|
-
*
|
|
6692
|
-
* @param {string} encodedToken - base 64 token received from server and stored in local storage
|
|
6693
|
-
* @returns {date | null} returns expiration date or null id expired props not found in decoded token
|
|
3474
|
+
/**
|
|
3475
|
+
* return expiration date from token
|
|
3476
|
+
*
|
|
3477
|
+
* @param {string} encodedToken - base 64 token received from server and stored in local storage
|
|
3478
|
+
* @returns {date | null} returns expiration date or null id expired props not found in decoded token
|
|
6694
3479
|
*/
|
|
6695
3480
|
getTokenExpirationDate(encodedToken) {
|
|
6696
3481
|
if (!encodedToken) {
|
|
@@ -6706,12 +3491,12 @@ const auth = {
|
|
|
6706
3491
|
return expirationDate;
|
|
6707
3492
|
},
|
|
6708
3493
|
//TODO: Its not working for now while the token is not JWT token
|
|
6709
|
-
/**
|
|
6710
|
-
*
|
|
6711
|
-
* tell is token is expired (compared to now)
|
|
6712
|
-
*
|
|
6713
|
-
* @param {string} encodedToken - base 64 token received from server and stored in local storage
|
|
6714
|
-
* @returns {bool} returns true if expired else false
|
|
3494
|
+
/**
|
|
3495
|
+
*
|
|
3496
|
+
* tell is token is expired (compared to now)
|
|
3497
|
+
*
|
|
3498
|
+
* @param {string} encodedToken - base 64 token received from server and stored in local storage
|
|
3499
|
+
* @returns {bool} returns true if expired else false
|
|
6715
3500
|
*/
|
|
6716
3501
|
isExpiredToken(encodedToken) {
|
|
6717
3502
|
const expirationDate = this.getTokenExpirationDate(encodedToken);
|
|
@@ -6722,12 +3507,12 @@ const auth = {
|
|
|
6722
3507
|
// /////////////////////////////////////////////////////////////
|
|
6723
3508
|
// USER_INFO
|
|
6724
3509
|
// /////////////////////////////////////////////////////////////
|
|
6725
|
-
/**
|
|
6726
|
-
* get user info from localstorage
|
|
6727
|
-
*
|
|
6728
|
-
* @param {'localStorage' | 'sessionStorage'} [fromStorage='localStorage'] specify storage
|
|
6729
|
-
* @param {any} [userInfoKey='userInfo'] optionnal parameter to specify a token key
|
|
6730
|
-
* @returns {string} token value
|
|
3510
|
+
/**
|
|
3511
|
+
* get user info from localstorage
|
|
3512
|
+
*
|
|
3513
|
+
* @param {'localStorage' | 'sessionStorage'} [fromStorage='localStorage'] specify storage
|
|
3514
|
+
* @param {any} [userInfoKey='userInfo'] optionnal parameter to specify a token key
|
|
3515
|
+
* @returns {string} token value
|
|
6731
3516
|
*/
|
|
6732
3517
|
getUserInfo(fromStorage = APP_PERSIST_STORES_TYPES[0], userInfoKey = USER_INFO) {
|
|
6733
3518
|
if (!window) {
|
|
@@ -6746,13 +3531,13 @@ const auth = {
|
|
|
6746
3531
|
// default:
|
|
6747
3532
|
return null;
|
|
6748
3533
|
},
|
|
6749
|
-
/**
|
|
6750
|
-
* set the userInfo value into localstorage
|
|
6751
|
-
*
|
|
6752
|
-
* @param {object} [value=''] token value
|
|
6753
|
-
* @param {'localStorage' | 'sessionStorage'} [toStorage='localStorage'] specify storage
|
|
6754
|
-
* @param {any} [userInfoKey='userInfo'] token key
|
|
6755
|
-
* @returns {boolean} success/failure flag
|
|
3534
|
+
/**
|
|
3535
|
+
* set the userInfo value into localstorage
|
|
3536
|
+
*
|
|
3537
|
+
* @param {object} [value=''] token value
|
|
3538
|
+
* @param {'localStorage' | 'sessionStorage'} [toStorage='localStorage'] specify storage
|
|
3539
|
+
* @param {any} [userInfoKey='userInfo'] token key
|
|
3540
|
+
* @returns {boolean} success/failure flag
|
|
6756
3541
|
*/
|
|
6757
3542
|
setUserInfo(value, toStorage = APP_PERSIST_STORES_TYPES[0], userInfoKey = USER_INFO) {
|
|
6758
3543
|
if (!value) {
|
|
@@ -6777,11 +3562,11 @@ const auth = {
|
|
|
6777
3562
|
user.surname = value.surname;
|
|
6778
3563
|
this.setUserInfo(user);
|
|
6779
3564
|
},
|
|
6780
|
-
/**
|
|
6781
|
-
* delete userInfo
|
|
6782
|
-
*
|
|
6783
|
-
* @param {string} [userInfoKey='userInfo'] token key
|
|
6784
|
-
* @returns {bool} success/failure flag
|
|
3565
|
+
/**
|
|
3566
|
+
* delete userInfo
|
|
3567
|
+
*
|
|
3568
|
+
* @param {string} [userInfoKey='userInfo'] token key
|
|
3569
|
+
* @returns {bool} success/failure flag
|
|
6785
3570
|
*/
|
|
6786
3571
|
clearUserInfo(userInfoKey = USER_INFO) {
|
|
6787
3572
|
// localStorage:
|
|
@@ -6796,9 +3581,9 @@ const auth = {
|
|
|
6796
3581
|
// /////////////////////////////////////////////////////////////
|
|
6797
3582
|
// COMMON
|
|
6798
3583
|
// /////////////////////////////////////////////////////////////
|
|
6799
|
-
/**
|
|
6800
|
-
* forget me method: clear all
|
|
6801
|
-
* @returns {bool} success/failure flag
|
|
3584
|
+
/**
|
|
3585
|
+
* forget me method: clear all
|
|
3586
|
+
* @returns {bool} success/failure flag
|
|
6802
3587
|
*/
|
|
6803
3588
|
clearAllAppStorage() {
|
|
6804
3589
|
if (window && window.localStorage) {
|
|
@@ -6812,13 +3597,13 @@ const auth = {
|
|
|
6812
3597
|
// /////////////////////////////////////////////////////////////
|
|
6813
3598
|
// Context
|
|
6814
3599
|
// /////////////////////////////////////////////////////////////
|
|
6815
|
-
/**
|
|
6816
|
-
* set the context value into localstorage (managed by localforage)
|
|
6817
|
-
*
|
|
6818
|
-
* @param {string} [value=''] context value
|
|
6819
|
-
* @param {'localStorage' | 'sessionStorage'} [toStorage='localStorage'] specify storage
|
|
6820
|
-
* @param {any} [tokenKey='token'] token key
|
|
6821
|
-
* @returns {boolean} success/failure flag
|
|
3600
|
+
/**
|
|
3601
|
+
* set the context value into localstorage (managed by localforage)
|
|
3602
|
+
*
|
|
3603
|
+
* @param {string} [value=''] context value
|
|
3604
|
+
* @param {'localStorage' | 'sessionStorage'} [toStorage='localStorage'] specify storage
|
|
3605
|
+
* @param {any} [tokenKey='token'] token key
|
|
3606
|
+
* @returns {boolean} success/failure flag
|
|
6822
3607
|
*/
|
|
6823
3608
|
setContext(value = '', toStorage = APP_PERSIST_STORES_TYPES[0], contextKey = CONTEXT_KEY) {
|
|
6824
3609
|
if (!value || value.length <= 0) {
|
|
@@ -6837,12 +3622,12 @@ const auth = {
|
|
|
6837
3622
|
}
|
|
6838
3623
|
}
|
|
6839
3624
|
},
|
|
6840
|
-
/**
|
|
6841
|
-
* get context from localstorage
|
|
6842
|
-
*
|
|
6843
|
-
* @param {'localStorage' | 'sessionStorage'} [fromStorage='localStorage'] specify storage
|
|
6844
|
-
* @param {any} [tokenKey=TOKEN_KEY] optionnal parameter to specify a token key
|
|
6845
|
-
* @returns {string} token value
|
|
3625
|
+
/**
|
|
3626
|
+
* get context from localstorage
|
|
3627
|
+
*
|
|
3628
|
+
* @param {'localStorage' | 'sessionStorage'} [fromStorage='localStorage'] specify storage
|
|
3629
|
+
* @param {any} [tokenKey=TOKEN_KEY] optionnal parameter to specify a token key
|
|
3630
|
+
* @returns {string} token value
|
|
6846
3631
|
*/
|
|
6847
3632
|
getContext(fromStorage = APP_PERSIST_STORES_TYPES[0], contextKey = CONTEXT_KEY) {
|
|
6848
3633
|
// localStorage:
|
|
@@ -6858,14 +3643,15 @@ const auth = {
|
|
|
6858
3643
|
}
|
|
6859
3644
|
};
|
|
6860
3645
|
|
|
6861
|
-
let _$
|
|
6862
|
-
_t$
|
|
3646
|
+
let _$5 = t => t,
|
|
3647
|
+
_t$5,
|
|
6863
3648
|
_t2$5,
|
|
6864
3649
|
_t3$5,
|
|
6865
3650
|
_t4$5,
|
|
6866
3651
|
_t5$5,
|
|
6867
|
-
_t6$
|
|
6868
|
-
|
|
3652
|
+
_t6$4,
|
|
3653
|
+
_t7$2;
|
|
3654
|
+
const showcaseContentsQuery = gql(_t$5 || (_t$5 = _$5`
|
|
6869
3655
|
query ($rootId: Int!, $path: String) {
|
|
6870
3656
|
contents(rootId: $rootId, deep: 4, path: $path) {
|
|
6871
3657
|
name
|
|
@@ -6906,7 +3692,7 @@ const showcaseContentsQuery = gql$1(_t$6 || (_t$6 = _$6`
|
|
|
6906
3692
|
}
|
|
6907
3693
|
}
|
|
6908
3694
|
`));
|
|
6909
|
-
const showcaseTemplatesQuery = gql
|
|
3695
|
+
const showcaseTemplatesQuery = gql(_t2$5 || (_t2$5 = _$5`
|
|
6910
3696
|
query {
|
|
6911
3697
|
showcasetemplates {
|
|
6912
3698
|
category
|
|
@@ -6939,7 +3725,7 @@ const showcaseTemplatesQueryOptions = {
|
|
|
6939
3725
|
};
|
|
6940
3726
|
}
|
|
6941
3727
|
};
|
|
6942
|
-
const showcasePagesQuery = gql
|
|
3728
|
+
const showcasePagesQuery = gql(_t3$5 || (_t3$5 = _$5`
|
|
6943
3729
|
query ($companyId: Int!, $parentId: Int) {
|
|
6944
3730
|
pages(companyId: $companyId, parentId: $parentId) {
|
|
6945
3731
|
id
|
|
@@ -6979,7 +3765,7 @@ const showcasePagesQueryOptions = {
|
|
|
6979
3765
|
};
|
|
6980
3766
|
}
|
|
6981
3767
|
};
|
|
6982
|
-
const
|
|
3768
|
+
const showcaseSectionsQuery = gql(_t4$5 || (_t4$5 = _$5`
|
|
6983
3769
|
query ($companyId: Int!, $parentId: Int!) {
|
|
6984
3770
|
pageResoruces(companyId: $companyId, parentId: $parentId) {
|
|
6985
3771
|
id
|
|
@@ -6993,7 +3779,7 @@ const showcaseSectionQuery = gql$1(_t4$5 || (_t4$5 = _$6`
|
|
|
6993
3779
|
}
|
|
6994
3780
|
}
|
|
6995
3781
|
`));
|
|
6996
|
-
const
|
|
3782
|
+
const showcaseSectionsQueryOptions = {
|
|
6997
3783
|
options: props => {
|
|
6998
3784
|
return {
|
|
6999
3785
|
client: dqueryClient,
|
|
@@ -7019,7 +3805,22 @@ const showcaseSectionQueryOptions = {
|
|
|
7019
3805
|
};
|
|
7020
3806
|
}
|
|
7021
3807
|
};
|
|
7022
|
-
const
|
|
3808
|
+
const showcaseSectionQuery = gql(_t5$5 || (_t5$5 = _$5`
|
|
3809
|
+
query ($companyId: Int!, $id: Int!) {
|
|
3810
|
+
pageResoruce(companyId: $companyId, id: $id) {
|
|
3811
|
+
id
|
|
3812
|
+
name
|
|
3813
|
+
priority
|
|
3814
|
+
parentId
|
|
3815
|
+
createDate
|
|
3816
|
+
modelId
|
|
3817
|
+
online
|
|
3818
|
+
path
|
|
3819
|
+
data
|
|
3820
|
+
}
|
|
3821
|
+
}
|
|
3822
|
+
`));
|
|
3823
|
+
const showcaseDomainsQuery = gql(_t6$4 || (_t6$4 = _$5`
|
|
7023
3824
|
query ($companyId: Int!) {
|
|
7024
3825
|
domains(companyId: $companyId) {
|
|
7025
3826
|
id
|
|
@@ -7059,7 +3860,7 @@ const useDomainsQuery = () => useQuery(showcaseDomainsQuery, {
|
|
|
7059
3860
|
companyId: auth.getContext()
|
|
7060
3861
|
}
|
|
7061
3862
|
});
|
|
7062
|
-
const showcaseConfig = gql
|
|
3863
|
+
const showcaseConfig = gql(_t7$2 || (_t7$2 = _$5`
|
|
7063
3864
|
query($domain: String!) {
|
|
7064
3865
|
configuration(type: "showcase", domain: $domain)
|
|
7065
3866
|
}
|
|
@@ -7072,28 +3873,17 @@ const useShowcaseConfig = domain => useQuery(showcaseConfig, {
|
|
|
7072
3873
|
}
|
|
7073
3874
|
});
|
|
7074
3875
|
|
|
7075
|
-
let _$5 = t => t,
|
|
7076
|
-
_t$5;
|
|
7077
|
-
const usageQuery = gql$1(_t$5 || (_t$5 = _$5`
|
|
7078
|
-
query($body: JSON!) {
|
|
7079
|
-
registerUsage(body: $body)
|
|
7080
|
-
@rest(type: "RegisterUsage", path: "/PaymentsManager/recordShowcaseVisit", method: "POST", bodyKey: "body"){
|
|
7081
|
-
result
|
|
7082
|
-
}
|
|
7083
|
-
}
|
|
7084
|
-
`));
|
|
7085
|
-
|
|
7086
3876
|
let _$4 = t => t,
|
|
7087
3877
|
_t$4,
|
|
7088
3878
|
_t2$4,
|
|
7089
3879
|
_t3$4,
|
|
7090
3880
|
_t4$4,
|
|
7091
3881
|
_t5$4,
|
|
7092
|
-
_t6$
|
|
7093
|
-
_t7,
|
|
3882
|
+
_t6$3,
|
|
3883
|
+
_t7$1,
|
|
7094
3884
|
_t8,
|
|
7095
3885
|
_t9;
|
|
7096
|
-
const login = gql
|
|
3886
|
+
const login = gql(_t$4 || (_t$4 = _$4`
|
|
7097
3887
|
mutation ($body: JSON!) {
|
|
7098
3888
|
login(body: $body)
|
|
7099
3889
|
@rest(
|
|
@@ -7129,15 +3919,6 @@ const loginOptions = {
|
|
|
7129
3919
|
}
|
|
7130
3920
|
};
|
|
7131
3921
|
const result = yield mutate(payload);
|
|
7132
|
-
auth.clearAllAppStorage();
|
|
7133
|
-
// @ts-expect-error will be fixed later
|
|
7134
|
-
auth.setToken(result.data.login.access_token);
|
|
7135
|
-
auth.setUserInfo({
|
|
7136
|
-
// @ts-expect-error will be fixed later
|
|
7137
|
-
username: result.data.login.username,
|
|
7138
|
-
// @ts-expect-error will be fixed later
|
|
7139
|
-
id: result.data.login.userId
|
|
7140
|
-
});
|
|
7141
3922
|
// @ts-expect-error will be fixed later
|
|
7142
3923
|
return Promise.resolve(result.data.login);
|
|
7143
3924
|
} catch (error) {
|
|
@@ -7147,7 +3928,7 @@ const loginOptions = {
|
|
|
7147
3928
|
}
|
|
7148
3929
|
})
|
|
7149
3930
|
};
|
|
7150
|
-
const register = gql
|
|
3931
|
+
const register = gql(_t2$4 || (_t2$4 = _$4`
|
|
7151
3932
|
mutation ($body: JSON!) {
|
|
7152
3933
|
register(body: $body)
|
|
7153
3934
|
@rest(
|
|
@@ -7195,7 +3976,7 @@ const registerOptions = {
|
|
|
7195
3976
|
}
|
|
7196
3977
|
})
|
|
7197
3978
|
};
|
|
7198
|
-
const forgetPassword = gql
|
|
3979
|
+
const forgetPassword = gql(_t3$4 || (_t3$4 = _$4`
|
|
7199
3980
|
mutation ($body: JSON!) {
|
|
7200
3981
|
forgetPassword(body: $body)
|
|
7201
3982
|
@rest(
|
|
@@ -7238,7 +4019,7 @@ const forgetPasswordOptions = {
|
|
|
7238
4019
|
}
|
|
7239
4020
|
})
|
|
7240
4021
|
};
|
|
7241
|
-
const resetPassword = gql
|
|
4022
|
+
const resetPassword = gql(_t4$4 || (_t4$4 = _$4`
|
|
7242
4023
|
mutation ($body: JSON!) {
|
|
7243
4024
|
resetPassword(body: $body)
|
|
7244
4025
|
@rest(
|
|
@@ -7283,7 +4064,7 @@ const resetPasswordOptions = {
|
|
|
7283
4064
|
}
|
|
7284
4065
|
})
|
|
7285
4066
|
};
|
|
7286
|
-
const userInfoQuery = gql
|
|
4067
|
+
const userInfoQuery = gql(_t5$4 || (_t5$4 = _$4`
|
|
7287
4068
|
query {
|
|
7288
4069
|
currentUser
|
|
7289
4070
|
@rest(type: "User", path: "/Membership/getUser", method: "GET") {
|
|
@@ -7317,7 +4098,7 @@ const userInfoQueryOptions = {
|
|
|
7317
4098
|
};
|
|
7318
4099
|
}
|
|
7319
4100
|
};
|
|
7320
|
-
const updateUserProfile = gql
|
|
4101
|
+
const updateUserProfile = gql(_t6$3 || (_t6$3 = _$4`
|
|
7321
4102
|
mutation ($body: JSON!) {
|
|
7322
4103
|
updateProfile(body: $body)
|
|
7323
4104
|
@rest(
|
|
@@ -7358,7 +4139,7 @@ const updateUserProfileOptions = {
|
|
|
7358
4139
|
}
|
|
7359
4140
|
})
|
|
7360
4141
|
};
|
|
7361
|
-
const updateUserPassword = gql$1
|
|
4142
|
+
const updateUserPassword = gql(_t7$1 || (_t7$1 = _$4`
|
|
7362
4143
|
mutation ($body: JSON!) {
|
|
7363
4144
|
updateUserPassword(body: $body)
|
|
7364
4145
|
@rest(
|
|
@@ -7401,7 +4182,7 @@ const updateUserPasswordOptions = {
|
|
|
7401
4182
|
}
|
|
7402
4183
|
})
|
|
7403
4184
|
};
|
|
7404
|
-
const inviteUser = gql
|
|
4185
|
+
const inviteUser = gql(_t8 || (_t8 = _$4`
|
|
7405
4186
|
mutation ($body: JSON!) {
|
|
7406
4187
|
inviteUser(body: $body)
|
|
7407
4188
|
@rest(
|
|
@@ -7444,7 +4225,7 @@ const inviteUserOptions = {
|
|
|
7444
4225
|
}
|
|
7445
4226
|
})
|
|
7446
4227
|
};
|
|
7447
|
-
const removeUserFromCompany = gql
|
|
4228
|
+
const removeUserFromCompany = gql(_t9 || (_t9 = _$4`
|
|
7448
4229
|
mutation ($companyId: String!, $userId: String!) {
|
|
7449
4230
|
removeUserFromCompany(companyId: $companyId, userId: $userId)
|
|
7450
4231
|
@rest(
|
|
@@ -7490,7 +4271,7 @@ let _$3 = t => t,
|
|
|
7490
4271
|
_t3$3,
|
|
7491
4272
|
_t4$3,
|
|
7492
4273
|
_t5$3;
|
|
7493
|
-
const userCompaniesQuery = gql
|
|
4274
|
+
const userCompaniesQuery = gql(_t$3 || (_t$3 = _$3`
|
|
7494
4275
|
query {
|
|
7495
4276
|
userCompanies
|
|
7496
4277
|
@rest(
|
|
@@ -7502,6 +4283,7 @@ const userCompaniesQuery = gql$1(_t$3 || (_t$3 = _$3`
|
|
|
7502
4283
|
Name
|
|
7503
4284
|
AccountId
|
|
7504
4285
|
CreateDate
|
|
4286
|
+
SubscriptionType
|
|
7505
4287
|
}
|
|
7506
4288
|
}
|
|
7507
4289
|
`));
|
|
@@ -7530,7 +4312,7 @@ const userCompaniesQueryOptions = {
|
|
|
7530
4312
|
const useUserCompaniesQuery = () => useQuery(userCompaniesQuery, {
|
|
7531
4313
|
client: dconfigClient
|
|
7532
4314
|
});
|
|
7533
|
-
const companyUsersQuery = gql
|
|
4315
|
+
const companyUsersQuery = gql(_t2$3 || (_t2$3 = _$3`
|
|
7534
4316
|
query ($CompanyId: String!) {
|
|
7535
4317
|
companyUsers(CompanyId: $CompanyId)
|
|
7536
4318
|
@rest(
|
|
@@ -7545,7 +4327,7 @@ const companyUsersQuery = gql$1(_t2$3 || (_t2$3 = _$3`
|
|
|
7545
4327
|
}
|
|
7546
4328
|
}
|
|
7547
4329
|
`));
|
|
7548
|
-
const subscriptionConfigurationQuery = gql
|
|
4330
|
+
const subscriptionConfigurationQuery = gql(_t3$3 || (_t3$3 = _$3`
|
|
7549
4331
|
query {
|
|
7550
4332
|
subscriptionConfiguration(Key: "SubscriptionConfig")
|
|
7551
4333
|
@rest(
|
|
@@ -7576,7 +4358,7 @@ const subscriptionConfigurationQueryOptions = {
|
|
|
7576
4358
|
};
|
|
7577
4359
|
}
|
|
7578
4360
|
};
|
|
7579
|
-
const createCompany = gql
|
|
4361
|
+
const createCompany = gql(_t4$3 || (_t4$3 = _$3`
|
|
7580
4362
|
mutation ($body: JSON!) {
|
|
7581
4363
|
createCompany(body: $body)
|
|
7582
4364
|
@rest(
|
|
@@ -7607,7 +4389,7 @@ const createCompanyOptions = {
|
|
|
7607
4389
|
body: {
|
|
7608
4390
|
Name,
|
|
7609
4391
|
OwnerId: auth.getUserInfo()['id'],
|
|
7610
|
-
SubscriptionType: 'Showcase'
|
|
4392
|
+
SubscriptionType: 'Showcase-free'
|
|
7611
4393
|
}
|
|
7612
4394
|
}
|
|
7613
4395
|
};
|
|
@@ -7623,7 +4405,7 @@ const createCompanyOptions = {
|
|
|
7623
4405
|
}
|
|
7624
4406
|
})
|
|
7625
4407
|
};
|
|
7626
|
-
const updateCompany = gql
|
|
4408
|
+
const updateCompany = gql(_t5$3 || (_t5$3 = _$3`
|
|
7627
4409
|
mutation ($body: JSON!) {
|
|
7628
4410
|
updateCompany(body: $body)
|
|
7629
4411
|
@rest(
|
|
@@ -7676,8 +4458,8 @@ let _$2 = t => t,
|
|
|
7676
4458
|
_t3$2,
|
|
7677
4459
|
_t4$2,
|
|
7678
4460
|
_t5$2,
|
|
7679
|
-
_t6$
|
|
7680
|
-
const contentInstancesQuery = gql
|
|
4461
|
+
_t6$2;
|
|
4462
|
+
const contentInstancesQuery = gql(_t$2 || (_t$2 = _$2`
|
|
7681
4463
|
query contentInstances($contentId: Int!) {
|
|
7682
4464
|
contentInstances(contentId: $contentId)
|
|
7683
4465
|
@rest(
|
|
@@ -7717,7 +4499,7 @@ const useContentInstancesQuery = contentId => useQuery(contentInstancesQuery, {
|
|
|
7717
4499
|
contentId
|
|
7718
4500
|
}
|
|
7719
4501
|
});
|
|
7720
|
-
const updateContentInstanceFieldValuesMutation = gql
|
|
4502
|
+
const updateContentInstanceFieldValuesMutation = gql(_t2$2 || (_t2$2 = _$2`
|
|
7721
4503
|
mutation ($body: JSON!) {
|
|
7722
4504
|
updateContentInstanceFieldValues(body: $body)
|
|
7723
4505
|
@rest(
|
|
@@ -7762,7 +4544,7 @@ const updateContentInstanceFieldValuesMutationOptions = {
|
|
|
7762
4544
|
const useUpdateContentInstanceFieldValuesMutation = () => useMutation(updateContentInstanceFieldValuesMutation, {
|
|
7763
4545
|
client: dconfigClient
|
|
7764
4546
|
});
|
|
7765
|
-
const createContentMutation = gql
|
|
4547
|
+
const createContentMutation = gql(_t3$2 || (_t3$2 = _$2`
|
|
7766
4548
|
mutation ($body: JSON!) {
|
|
7767
4549
|
createContent(body: $body)
|
|
7768
4550
|
@rest(
|
|
@@ -7821,7 +4603,7 @@ const createContentMutationOptions = {
|
|
|
7821
4603
|
const useCreateContentMutation = () => useMutation(createContentMutation, {
|
|
7822
4604
|
client: dconfigClient
|
|
7823
4605
|
});
|
|
7824
|
-
const createContentInstanceMutation = gql
|
|
4606
|
+
const createContentInstanceMutation = gql(_t4$2 || (_t4$2 = _$2`
|
|
7825
4607
|
mutation ($body: JSON!) {
|
|
7826
4608
|
createContent(body: $body)
|
|
7827
4609
|
@rest(
|
|
@@ -7884,7 +4666,7 @@ const createContentInstanceMutationOptions = {
|
|
|
7884
4666
|
const useCreateContentInstanceMutation = () => useMutation(createContentInstanceMutation, {
|
|
7885
4667
|
client: dconfigClient
|
|
7886
4668
|
});
|
|
7887
|
-
const removeContentMutation = gql
|
|
4669
|
+
const removeContentMutation = gql(_t5$2 || (_t5$2 = _$2`
|
|
7888
4670
|
mutation ($Id: Int!, $Name: String!) {
|
|
7889
4671
|
deleteContent(Id: $Id, Name: $Name)
|
|
7890
4672
|
@rest(
|
|
@@ -7900,7 +4682,7 @@ const removeContentMutation = gql$1(_t5$2 || (_t5$2 = _$2`
|
|
|
7900
4682
|
const useDeleteContentMutation = () => useMutation(removeContentMutation, {
|
|
7901
4683
|
client: dconfigClient
|
|
7902
4684
|
});
|
|
7903
|
-
const updateContentsOrderingMutation = gql
|
|
4685
|
+
const updateContentsOrderingMutation = gql(_t6$2 || (_t6$2 = _$2`
|
|
7904
4686
|
mutation ($body: JSON!) {
|
|
7905
4687
|
updateContentsOrdering(body: $body)
|
|
7906
4688
|
@rest(
|
|
@@ -7950,9 +4732,11 @@ let _$1 = t => t,
|
|
|
7950
4732
|
_t2$1,
|
|
7951
4733
|
_t3$1,
|
|
7952
4734
|
_t4$1,
|
|
7953
|
-
_t5$1
|
|
7954
|
-
|
|
7955
|
-
|
|
4735
|
+
_t5$1,
|
|
4736
|
+
_t6$1,
|
|
4737
|
+
_t7;
|
|
4738
|
+
const showcaseConfigurationQuery = gql(_t$1 || (_t$1 = _$1`
|
|
4739
|
+
query ($ContextId: Int) {
|
|
7956
4740
|
showcaseConfiguration(Key: "ShowcaseConfig", ContextId: $ContextId)
|
|
7957
4741
|
@rest(
|
|
7958
4742
|
type: "ShowcaseConfig"
|
|
@@ -7999,7 +4783,7 @@ const showcaseConfigurationQueryOptions = {
|
|
|
7999
4783
|
}
|
|
8000
4784
|
}
|
|
8001
4785
|
};
|
|
8002
|
-
const addDomain = gql
|
|
4786
|
+
const addDomain = gql(_t2$1 || (_t2$1 = _$1`
|
|
8003
4787
|
mutation ($rootContent: String!, $body: JSON!) {
|
|
8004
4788
|
addDomain(rootContent: $rootContent, body: $body)
|
|
8005
4789
|
@rest(
|
|
@@ -8042,7 +4826,7 @@ const addDomainOptions = {
|
|
|
8042
4826
|
}
|
|
8043
4827
|
})
|
|
8044
4828
|
};
|
|
8045
|
-
const removeDomain = gql
|
|
4829
|
+
const removeDomain = gql(_t3$1 || (_t3$1 = _$1`
|
|
8046
4830
|
mutation ($rootContent: String!, $Domain: String!) {
|
|
8047
4831
|
removeDomain(rootContent: $rootContent, Domain: $Domain)
|
|
8048
4832
|
@rest(
|
|
@@ -8083,9 +4867,19 @@ const removeDomainOptions = {
|
|
|
8083
4867
|
}
|
|
8084
4868
|
})
|
|
8085
4869
|
};
|
|
8086
|
-
const useShowcaseTemplate = gql
|
|
8087
|
-
mutation (
|
|
8088
|
-
|
|
4870
|
+
const useShowcaseTemplate = gql(_t4$1 || (_t4$1 = _$1`
|
|
4871
|
+
mutation (
|
|
4872
|
+
$templateId: Int!
|
|
4873
|
+
$companyId: Int!
|
|
4874
|
+
$parentContentId: Int
|
|
4875
|
+
$path: String
|
|
4876
|
+
) {
|
|
4877
|
+
useShowcaseTemplate(
|
|
4878
|
+
templateId: $templateId
|
|
4879
|
+
companyId: $companyId
|
|
4880
|
+
parentContentId: $parentContentId
|
|
4881
|
+
path: $path
|
|
4882
|
+
)
|
|
8089
4883
|
@rest(
|
|
8090
4884
|
type: "UseShowcaseTemplateType"
|
|
8091
4885
|
path: "/DConfig/DConfigModule/duplicateShowcaseInstance?SourceCompanyContext={args.templateId}&DestinationCompanyContext={args.companyId}&DestinationContentId={args.parentContentId}&path={args.path}"
|
|
@@ -8125,8 +4919,8 @@ const useShowcaseTemplateOptions = {
|
|
|
8125
4919
|
}
|
|
8126
4920
|
})
|
|
8127
4921
|
};
|
|
8128
|
-
const useShowcaseTemplateProgress = gql
|
|
8129
|
-
query($templateId: Int!, $companyId: Int!) {
|
|
4922
|
+
const useShowcaseTemplateProgress = gql(_t5$1 || (_t5$1 = _$1`
|
|
4923
|
+
query ($templateId: Int!, $companyId: Int!) {
|
|
8130
4924
|
useShowcaseTemplateProgress(templateId: $templateId, companyId: $companyId)
|
|
8131
4925
|
@rest(
|
|
8132
4926
|
type: "UseShowcaseTemplateProgressType"
|
|
@@ -8146,6 +4940,59 @@ const useShowcaseTemplateProgressQuery = templateId => useLazyQuery(useShowcaseT
|
|
|
8146
4940
|
companyId: auth.getContext()
|
|
8147
4941
|
}
|
|
8148
4942
|
});
|
|
4943
|
+
const registeUsage = gql(_t6$1 || (_t6$1 = _$1`
|
|
4944
|
+
query ($body: JSON!) {
|
|
4945
|
+
registerUsage(body: $body)
|
|
4946
|
+
@rest(
|
|
4947
|
+
type: "RegisterUsage"
|
|
4948
|
+
path: "/DConfig/PaymentsManager/recordShowcaseVisit"
|
|
4949
|
+
method: "POST"
|
|
4950
|
+
bodyKey: "body"
|
|
4951
|
+
) {
|
|
4952
|
+
result
|
|
4953
|
+
}
|
|
4954
|
+
}
|
|
4955
|
+
`));
|
|
4956
|
+
const useRegisterUsage = body => useMutation(registeUsage, {
|
|
4957
|
+
client: dconfigClient,
|
|
4958
|
+
variables: {
|
|
4959
|
+
body
|
|
4960
|
+
}
|
|
4961
|
+
});
|
|
4962
|
+
const queryUsage = gql(_t7 || (_t7 = _$1`
|
|
4963
|
+
query ($AccountId: String!) {
|
|
4964
|
+
queryUsage(AccountId: $AccountId)
|
|
4965
|
+
@rest(
|
|
4966
|
+
type: "Usage"
|
|
4967
|
+
path: "/DConfig/PaymentsManager/getShowcaseVisit?AccountId={args.AccountId}"
|
|
4968
|
+
method: "GET"
|
|
4969
|
+
) {
|
|
4970
|
+
result
|
|
4971
|
+
object
|
|
4972
|
+
data {
|
|
4973
|
+
id
|
|
4974
|
+
object
|
|
4975
|
+
invoice
|
|
4976
|
+
livemode
|
|
4977
|
+
period {
|
|
4978
|
+
end
|
|
4979
|
+
start
|
|
4980
|
+
}
|
|
4981
|
+
subscription_item
|
|
4982
|
+
total_usage
|
|
4983
|
+
}
|
|
4984
|
+
has_more
|
|
4985
|
+
url
|
|
4986
|
+
}
|
|
4987
|
+
}
|
|
4988
|
+
`));
|
|
4989
|
+
const useQueryUsage = AccountId => useQuery(queryUsage, {
|
|
4990
|
+
fetchPolicy: 'no-cache',
|
|
4991
|
+
client: dconfigClient,
|
|
4992
|
+
variables: {
|
|
4993
|
+
AccountId
|
|
4994
|
+
}
|
|
4995
|
+
});
|
|
8149
4996
|
|
|
8150
4997
|
let _ = t => t,
|
|
8151
4998
|
_t,
|
|
@@ -8154,7 +5001,7 @@ let _ = t => t,
|
|
|
8154
5001
|
_t4,
|
|
8155
5002
|
_t5,
|
|
8156
5003
|
_t6;
|
|
8157
|
-
const foldersTreeQuery = gql
|
|
5004
|
+
const foldersTreeQuery = gql(_t || (_t = _`
|
|
8158
5005
|
query foldersTree($rootPath: String) {
|
|
8159
5006
|
foldersTree(rootPath: $rootPath)
|
|
8160
5007
|
@rest(
|
|
@@ -8179,7 +5026,7 @@ const useFoldersTreeQuery = rootPath => useQuery(foldersTreeQuery, {
|
|
|
8179
5026
|
rootPath
|
|
8180
5027
|
}
|
|
8181
5028
|
});
|
|
8182
|
-
const filesQuery = gql
|
|
5029
|
+
const filesQuery = gql(_t2 || (_t2 = _`
|
|
8183
5030
|
query files($path: String) {
|
|
8184
5031
|
files(path: $path)
|
|
8185
5032
|
@rest(
|
|
@@ -8201,7 +5048,7 @@ const useFilesQuery = () => useLazyQuery(filesQuery, {
|
|
|
8201
5048
|
fetchPolicy: 'no-cache',
|
|
8202
5049
|
client: dconfigClient
|
|
8203
5050
|
});
|
|
8204
|
-
const createFolderMutation = gql
|
|
5051
|
+
const createFolderMutation = gql(_t3 || (_t3 = _`
|
|
8205
5052
|
mutation ($body: JSON!) {
|
|
8206
5053
|
createFolder(body: $body)
|
|
8207
5054
|
@rest(
|
|
@@ -8218,7 +5065,7 @@ const createFolderMutation = gql$1(_t3 || (_t3 = _`
|
|
|
8218
5065
|
const useCreateFolderMutation = () => useMutation(createFolderMutation, {
|
|
8219
5066
|
client: dconfigClient
|
|
8220
5067
|
});
|
|
8221
|
-
const deleteFolderMutation = gql
|
|
5068
|
+
const deleteFolderMutation = gql(_t4 || (_t4 = _`
|
|
8222
5069
|
mutation ($path: String) {
|
|
8223
5070
|
deleteFolder(path: $path)
|
|
8224
5071
|
@rest(
|
|
@@ -8234,7 +5081,7 @@ const deleteFolderMutation = gql$1(_t4 || (_t4 = _`
|
|
|
8234
5081
|
const useDeleteFolderMutation = () => useMutation(deleteFolderMutation, {
|
|
8235
5082
|
client: dconfigClient
|
|
8236
5083
|
});
|
|
8237
|
-
const createFileMutation = gql
|
|
5084
|
+
const createFileMutation = gql(_t5 || (_t5 = _`
|
|
8238
5085
|
mutation ($path: String!, $file: Upload!) {
|
|
8239
5086
|
createFolder(path: $path, file: $file)
|
|
8240
5087
|
@rest(
|
|
@@ -8252,7 +5099,7 @@ const createFileMutation = gql$1(_t5 || (_t5 = _`
|
|
|
8252
5099
|
const useCreateFileMutation = () => useMutation(createFileMutation, {
|
|
8253
5100
|
client: dconfigClient
|
|
8254
5101
|
});
|
|
8255
|
-
const deleteFileMutation = gql
|
|
5102
|
+
const deleteFileMutation = gql(_t6 || (_t6 = _`
|
|
8256
5103
|
mutation ($path: String) {
|
|
8257
5104
|
deleteFile(path: $path)
|
|
8258
5105
|
@rest(
|
|
@@ -8272,8 +5119,8 @@ const useDeleteFileMutation = () => useMutation(deleteFileMutation, {
|
|
|
8272
5119
|
function unfetch_module(e,n){return n=n||{},new Promise(function(t,r){var s=new XMLHttpRequest,o=[],u=[],i={},a=function(){return {ok:2==(s.status/100|0),statusText:s.statusText,status:s.status,url:s.responseURL,text:function(){return Promise.resolve(s.responseText)},json:function(){return Promise.resolve(s.responseText).then(JSON.parse)},blob:function(){return Promise.resolve(new Blob([s.response]))},clone:a,headers:{keys:function(){return o},entries:function(){return u},get:function(e){return i[e.toLowerCase()]},has:function(e){return e.toLowerCase()in i}}}};for(var l in s.open(n.method||"get",e,!0),s.onload=function(){s.getAllResponseHeaders().replace(/^(.*?):[^\S\n]*([\s\S]*?)$/gm,function(e,n,t){o.push(n=n.toLowerCase()),u.push([n,t]),i[n]=i[n]?i[n]+","+t:t;}),t(a());},s.onerror=r,s.withCredentials="include"==n.credentials,n.headers)s.setRequestHeader(l,n.headers[l]);s.send(n.body||null);})}
|
|
8273
5120
|
|
|
8274
5121
|
var unfetch_module$1 = /*#__PURE__*/Object.freeze({
|
|
8275
|
-
|
|
8276
|
-
|
|
5122
|
+
__proto__: null,
|
|
5123
|
+
'default': unfetch_module
|
|
8277
5124
|
});
|
|
8278
5125
|
|
|
8279
5126
|
var require$$0 = /*@__PURE__*/getAugmentedNamespace(unfetch_module$1);
|
|
@@ -89453,6 +86300,20 @@ const isDomainOrSubdomain = function isDomainOrSubdomain(destination, original)
|
|
|
89453
86300
|
return orig === dest || orig[orig.length - dest.length - 1] === '.' && orig.endsWith(dest);
|
|
89454
86301
|
};
|
|
89455
86302
|
|
|
86303
|
+
/**
|
|
86304
|
+
* isSameProtocol reports whether the two provided URLs use the same protocol.
|
|
86305
|
+
*
|
|
86306
|
+
* Both domains must already be in canonical form.
|
|
86307
|
+
* @param {string|URL} original
|
|
86308
|
+
* @param {string|URL} destination
|
|
86309
|
+
*/
|
|
86310
|
+
const isSameProtocol = function isSameProtocol(destination, original) {
|
|
86311
|
+
const orig = new URL$1(original).protocol;
|
|
86312
|
+
const dest = new URL$1(destination).protocol;
|
|
86313
|
+
|
|
86314
|
+
return orig === dest;
|
|
86315
|
+
};
|
|
86316
|
+
|
|
89456
86317
|
/**
|
|
89457
86318
|
* Fetch function
|
|
89458
86319
|
*
|
|
@@ -89484,7 +86345,7 @@ function fetch(url, opts) {
|
|
|
89484
86345
|
let error = new AbortError('The user aborted a request.');
|
|
89485
86346
|
reject(error);
|
|
89486
86347
|
if (request.body && request.body instanceof Stream.Readable) {
|
|
89487
|
-
request.body
|
|
86348
|
+
destroyStream(request.body, error);
|
|
89488
86349
|
}
|
|
89489
86350
|
if (!response || !response.body) return;
|
|
89490
86351
|
response.body.emit('error', error);
|
|
@@ -89525,9 +86386,43 @@ function fetch(url, opts) {
|
|
|
89525
86386
|
|
|
89526
86387
|
req.on('error', function (err) {
|
|
89527
86388
|
reject(new FetchError(`request to ${request.url} failed, reason: ${err.message}`, 'system', err));
|
|
86389
|
+
|
|
86390
|
+
if (response && response.body) {
|
|
86391
|
+
destroyStream(response.body, err);
|
|
86392
|
+
}
|
|
86393
|
+
|
|
89528
86394
|
finalize();
|
|
89529
86395
|
});
|
|
89530
86396
|
|
|
86397
|
+
fixResponseChunkedTransferBadEnding(req, function (err) {
|
|
86398
|
+
if (signal && signal.aborted) {
|
|
86399
|
+
return;
|
|
86400
|
+
}
|
|
86401
|
+
|
|
86402
|
+
if (response && response.body) {
|
|
86403
|
+
destroyStream(response.body, err);
|
|
86404
|
+
}
|
|
86405
|
+
});
|
|
86406
|
+
|
|
86407
|
+
/* c8 ignore next 18 */
|
|
86408
|
+
if (parseInt(process.version.substring(1)) < 14) {
|
|
86409
|
+
// Before Node.js 14, pipeline() does not fully support async iterators and does not always
|
|
86410
|
+
// properly handle when the socket close/end events are out of order.
|
|
86411
|
+
req.on('socket', function (s) {
|
|
86412
|
+
s.addListener('close', function (hadError) {
|
|
86413
|
+
// if a data listener is still present we didn't end cleanly
|
|
86414
|
+
const hasDataListener = s.listenerCount('data') > 0;
|
|
86415
|
+
|
|
86416
|
+
// if end happened before close but the socket didn't emit an error, do it now
|
|
86417
|
+
if (response && hasDataListener && !hadError && !(signal && signal.aborted)) {
|
|
86418
|
+
const err = new Error('Premature close');
|
|
86419
|
+
err.code = 'ERR_STREAM_PREMATURE_CLOSE';
|
|
86420
|
+
response.body.emit('error', err);
|
|
86421
|
+
}
|
|
86422
|
+
});
|
|
86423
|
+
});
|
|
86424
|
+
}
|
|
86425
|
+
|
|
89531
86426
|
req.on('response', function (res) {
|
|
89532
86427
|
clearTimeout(reqTimeout);
|
|
89533
86428
|
|
|
@@ -89599,7 +86494,7 @@ function fetch(url, opts) {
|
|
|
89599
86494
|
size: request.size
|
|
89600
86495
|
};
|
|
89601
86496
|
|
|
89602
|
-
if (!isDomainOrSubdomain(request.url, locationURL)) {
|
|
86497
|
+
if (!isDomainOrSubdomain(request.url, locationURL) || !isSameProtocol(request.url, locationURL)) {
|
|
89603
86498
|
for (const name of ['authorization', 'www-authenticate', 'cookie', 'cookie2']) {
|
|
89604
86499
|
requestOpts.headers.delete(name);
|
|
89605
86500
|
}
|
|
@@ -89692,6 +86587,13 @@ function fetch(url, opts) {
|
|
|
89692
86587
|
response = new Response(body, response_options);
|
|
89693
86588
|
resolve(response);
|
|
89694
86589
|
});
|
|
86590
|
+
raw.on('end', function () {
|
|
86591
|
+
// some old IIS servers return zero-length OK deflate responses, so 'data' is never emitted.
|
|
86592
|
+
if (!response) {
|
|
86593
|
+
response = new Response(body, response_options);
|
|
86594
|
+
resolve(response);
|
|
86595
|
+
}
|
|
86596
|
+
});
|
|
89695
86597
|
return;
|
|
89696
86598
|
}
|
|
89697
86599
|
|
|
@@ -89711,6 +86613,41 @@ function fetch(url, opts) {
|
|
|
89711
86613
|
writeToStream(req, request);
|
|
89712
86614
|
});
|
|
89713
86615
|
}
|
|
86616
|
+
function fixResponseChunkedTransferBadEnding(request, errorCallback) {
|
|
86617
|
+
let socket;
|
|
86618
|
+
|
|
86619
|
+
request.on('socket', function (s) {
|
|
86620
|
+
socket = s;
|
|
86621
|
+
});
|
|
86622
|
+
|
|
86623
|
+
request.on('response', function (response) {
|
|
86624
|
+
const headers = response.headers;
|
|
86625
|
+
|
|
86626
|
+
if (headers['transfer-encoding'] === 'chunked' && !headers['content-length']) {
|
|
86627
|
+
response.once('close', function (hadError) {
|
|
86628
|
+
// if a data listener is still present we didn't end cleanly
|
|
86629
|
+
const hasDataListener = socket.listenerCount('data') > 0;
|
|
86630
|
+
|
|
86631
|
+
if (hasDataListener && !hadError) {
|
|
86632
|
+
const err = new Error('Premature close');
|
|
86633
|
+
err.code = 'ERR_STREAM_PREMATURE_CLOSE';
|
|
86634
|
+
errorCallback(err);
|
|
86635
|
+
}
|
|
86636
|
+
});
|
|
86637
|
+
}
|
|
86638
|
+
});
|
|
86639
|
+
}
|
|
86640
|
+
|
|
86641
|
+
function destroyStream(stream, err) {
|
|
86642
|
+
if (stream.destroy) {
|
|
86643
|
+
stream.destroy(err);
|
|
86644
|
+
} else {
|
|
86645
|
+
// node < 8
|
|
86646
|
+
stream.emit('error', err);
|
|
86647
|
+
stream.end();
|
|
86648
|
+
}
|
|
86649
|
+
}
|
|
86650
|
+
|
|
89714
86651
|
/**
|
|
89715
86652
|
* Redirect code matching
|
|
89716
86653
|
*
|
|
@@ -89725,12 +86662,12 @@ fetch.isRedirect = function (code) {
|
|
|
89725
86662
|
fetch.Promise = global.Promise;
|
|
89726
86663
|
|
|
89727
86664
|
var lib = /*#__PURE__*/Object.freeze({
|
|
89728
|
-
|
|
89729
|
-
|
|
89730
|
-
|
|
89731
|
-
|
|
89732
|
-
|
|
89733
|
-
|
|
86665
|
+
__proto__: null,
|
|
86666
|
+
'default': fetch,
|
|
86667
|
+
Headers: Headers,
|
|
86668
|
+
Request: Request,
|
|
86669
|
+
Response: Response,
|
|
86670
|
+
FetchError: FetchError
|
|
89734
86671
|
});
|
|
89735
86672
|
|
|
89736
86673
|
var require$$1 = /*@__PURE__*/getAugmentedNamespace(lib);
|
|
@@ -90159,322 +87096,322 @@ var ModelFieldsTypes;
|
|
|
90159
87096
|
ModelFieldsTypes["MultipleImages"] = "Multiple Images";
|
|
90160
87097
|
})(ModelFieldsTypes || (ModelFieldsTypes = {}));
|
|
90161
87098
|
|
|
90162
|
-
/**
|
|
90163
|
-
* Hypertext Transfer Protocol (HTTP) response status codes.
|
|
90164
|
-
* @see {@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes}
|
|
87099
|
+
/**
|
|
87100
|
+
* Hypertext Transfer Protocol (HTTP) response status codes.
|
|
87101
|
+
* @see {@link https://en.wikipedia.org/wiki/List_of_HTTP_status_codes}
|
|
90165
87102
|
*/
|
|
90166
87103
|
var HttpStatusCode;
|
|
90167
87104
|
(function (HttpStatusCode) {
|
|
90168
|
-
/**
|
|
90169
|
-
* The server has received the request headers and the client should proceed to send the request body
|
|
90170
|
-
* (in the case of a request for which a body needs to be sent; for example, a POST request).
|
|
90171
|
-
* Sending a large request body to a server after a request has been rejected for inappropriate headers would be inefficient.
|
|
90172
|
-
* To have a server check the request's headers, a client must send Expect: 100-continue as a header in its initial request
|
|
90173
|
-
* and receive a 100 Continue status code in response before sending the body. The response 417 Expectation Failed indicates the request should not be continued.
|
|
87105
|
+
/**
|
|
87106
|
+
* The server has received the request headers and the client should proceed to send the request body
|
|
87107
|
+
* (in the case of a request for which a body needs to be sent; for example, a POST request).
|
|
87108
|
+
* Sending a large request body to a server after a request has been rejected for inappropriate headers would be inefficient.
|
|
87109
|
+
* To have a server check the request's headers, a client must send Expect: 100-continue as a header in its initial request
|
|
87110
|
+
* and receive a 100 Continue status code in response before sending the body. The response 417 Expectation Failed indicates the request should not be continued.
|
|
90174
87111
|
*/
|
|
90175
87112
|
HttpStatusCode[HttpStatusCode["CONTINUE"] = 100] = "CONTINUE";
|
|
90176
|
-
/**
|
|
90177
|
-
* The requester has asked the server to switch protocols and the server has agreed to do so.
|
|
87113
|
+
/**
|
|
87114
|
+
* The requester has asked the server to switch protocols and the server has agreed to do so.
|
|
90178
87115
|
*/
|
|
90179
87116
|
HttpStatusCode[HttpStatusCode["SWITCHING_PROTOCOLS"] = 101] = "SWITCHING_PROTOCOLS";
|
|
90180
|
-
/**
|
|
90181
|
-
* A WebDAV request may contain many sub-requests involving file operations, requiring a long time to complete the request.
|
|
90182
|
-
* This code indicates that the server has received and is processing the request, but no response is available yet.
|
|
90183
|
-
* This prevents the client from timing out and assuming the request was lost.
|
|
87117
|
+
/**
|
|
87118
|
+
* A WebDAV request may contain many sub-requests involving file operations, requiring a long time to complete the request.
|
|
87119
|
+
* This code indicates that the server has received and is processing the request, but no response is available yet.
|
|
87120
|
+
* This prevents the client from timing out and assuming the request was lost.
|
|
90184
87121
|
*/
|
|
90185
87122
|
HttpStatusCode[HttpStatusCode["PROCESSING"] = 102] = "PROCESSING";
|
|
90186
|
-
/**
|
|
90187
|
-
* Standard response for successful HTTP requests.
|
|
90188
|
-
* The actual response will depend on the request method used.
|
|
90189
|
-
* In a GET request, the response will contain an entity corresponding to the requested resource.
|
|
90190
|
-
* In a POST request, the response will contain an entity describing or containing the result of the action.
|
|
87123
|
+
/**
|
|
87124
|
+
* Standard response for successful HTTP requests.
|
|
87125
|
+
* The actual response will depend on the request method used.
|
|
87126
|
+
* In a GET request, the response will contain an entity corresponding to the requested resource.
|
|
87127
|
+
* In a POST request, the response will contain an entity describing or containing the result of the action.
|
|
90191
87128
|
*/
|
|
90192
87129
|
HttpStatusCode[HttpStatusCode["OK"] = 200] = "OK";
|
|
90193
|
-
/**
|
|
90194
|
-
* The request has been fulfilled, resulting in the creation of a new resource.
|
|
87130
|
+
/**
|
|
87131
|
+
* The request has been fulfilled, resulting in the creation of a new resource.
|
|
90195
87132
|
*/
|
|
90196
87133
|
HttpStatusCode[HttpStatusCode["CREATED"] = 201] = "CREATED";
|
|
90197
|
-
/**
|
|
90198
|
-
* The request has been accepted for processing, but the processing has not been completed.
|
|
90199
|
-
* The request might or might not be eventually acted upon, and may be disallowed when processing occurs.
|
|
87134
|
+
/**
|
|
87135
|
+
* The request has been accepted for processing, but the processing has not been completed.
|
|
87136
|
+
* The request might or might not be eventually acted upon, and may be disallowed when processing occurs.
|
|
90200
87137
|
*/
|
|
90201
87138
|
HttpStatusCode[HttpStatusCode["ACCEPTED"] = 202] = "ACCEPTED";
|
|
90202
|
-
/**
|
|
90203
|
-
* SINCE HTTP/1.1
|
|
90204
|
-
* The server is a transforming proxy that received a 200 OK from its origin,
|
|
90205
|
-
* but is returning a modified version of the origin's response.
|
|
87139
|
+
/**
|
|
87140
|
+
* SINCE HTTP/1.1
|
|
87141
|
+
* The server is a transforming proxy that received a 200 OK from its origin,
|
|
87142
|
+
* but is returning a modified version of the origin's response.
|
|
90206
87143
|
*/
|
|
90207
87144
|
HttpStatusCode[HttpStatusCode["NON_AUTHORITATIVE_INFORMATION"] = 203] = "NON_AUTHORITATIVE_INFORMATION";
|
|
90208
|
-
/**
|
|
90209
|
-
* The server successfully processed the request and is not returning any content.
|
|
87145
|
+
/**
|
|
87146
|
+
* The server successfully processed the request and is not returning any content.
|
|
90210
87147
|
*/
|
|
90211
87148
|
HttpStatusCode[HttpStatusCode["NO_CONTENT"] = 204] = "NO_CONTENT";
|
|
90212
|
-
/**
|
|
90213
|
-
* The server successfully processed the request, but is not returning any content.
|
|
90214
|
-
* Unlike a 204 response, this response requires that the requester reset the document view.
|
|
87149
|
+
/**
|
|
87150
|
+
* The server successfully processed the request, but is not returning any content.
|
|
87151
|
+
* Unlike a 204 response, this response requires that the requester reset the document view.
|
|
90215
87152
|
*/
|
|
90216
87153
|
HttpStatusCode[HttpStatusCode["RESET_CONTENT"] = 205] = "RESET_CONTENT";
|
|
90217
|
-
/**
|
|
90218
|
-
* The server is delivering only part of the resource (byte serving) due to a range header sent by the client.
|
|
90219
|
-
* The range header is used by HTTP clients to enable resuming of interrupted downloads,
|
|
90220
|
-
* or split a download into multiple simultaneous streams.
|
|
87154
|
+
/**
|
|
87155
|
+
* The server is delivering only part of the resource (byte serving) due to a range header sent by the client.
|
|
87156
|
+
* The range header is used by HTTP clients to enable resuming of interrupted downloads,
|
|
87157
|
+
* or split a download into multiple simultaneous streams.
|
|
90221
87158
|
*/
|
|
90222
87159
|
HttpStatusCode[HttpStatusCode["PARTIAL_CONTENT"] = 206] = "PARTIAL_CONTENT";
|
|
90223
|
-
/**
|
|
90224
|
-
* The message body that follows is an XML message and can contain a number of separate response codes,
|
|
90225
|
-
* depending on how many sub-requests were made.
|
|
87160
|
+
/**
|
|
87161
|
+
* The message body that follows is an XML message and can contain a number of separate response codes,
|
|
87162
|
+
* depending on how many sub-requests were made.
|
|
90226
87163
|
*/
|
|
90227
87164
|
HttpStatusCode[HttpStatusCode["MULTI_STATUS"] = 207] = "MULTI_STATUS";
|
|
90228
|
-
/**
|
|
90229
|
-
* The members of a DAV binding have already been enumerated in a preceding part of the (multistatus) response,
|
|
90230
|
-
* and are not being included again.
|
|
87165
|
+
/**
|
|
87166
|
+
* The members of a DAV binding have already been enumerated in a preceding part of the (multistatus) response,
|
|
87167
|
+
* and are not being included again.
|
|
90231
87168
|
*/
|
|
90232
87169
|
HttpStatusCode[HttpStatusCode["ALREADY_REPORTED"] = 208] = "ALREADY_REPORTED";
|
|
90233
|
-
/**
|
|
90234
|
-
* The server has fulfilled a request for the resource,
|
|
90235
|
-
* and the response is a representation of the result of one or more instance-manipulations applied to the current instance.
|
|
87170
|
+
/**
|
|
87171
|
+
* The server has fulfilled a request for the resource,
|
|
87172
|
+
* and the response is a representation of the result of one or more instance-manipulations applied to the current instance.
|
|
90236
87173
|
*/
|
|
90237
87174
|
HttpStatusCode[HttpStatusCode["IM_USED"] = 226] = "IM_USED";
|
|
90238
|
-
/**
|
|
90239
|
-
* Indicates multiple options for the resource from which the client may choose (via agent-driven content negotiation).
|
|
90240
|
-
* For example, this code could be used to present multiple video format options,
|
|
90241
|
-
* to list files with different filename extensions, or to suggest word-sense disambiguation.
|
|
87175
|
+
/**
|
|
87176
|
+
* Indicates multiple options for the resource from which the client may choose (via agent-driven content negotiation).
|
|
87177
|
+
* For example, this code could be used to present multiple video format options,
|
|
87178
|
+
* to list files with different filename extensions, or to suggest word-sense disambiguation.
|
|
90242
87179
|
*/
|
|
90243
87180
|
HttpStatusCode[HttpStatusCode["MULTIPLE_CHOICES"] = 300] = "MULTIPLE_CHOICES";
|
|
90244
|
-
/**
|
|
90245
|
-
* This and all future requests should be directed to the given URI.
|
|
87181
|
+
/**
|
|
87182
|
+
* This and all future requests should be directed to the given URI.
|
|
90246
87183
|
*/
|
|
90247
87184
|
HttpStatusCode[HttpStatusCode["MOVED_PERMANENTLY"] = 301] = "MOVED_PERMANENTLY";
|
|
90248
|
-
/**
|
|
90249
|
-
* This is an example of industry practice contradicting the standard.
|
|
90250
|
-
* The HTTP/1.0 specification (RFC 1945) required the client to perform a temporary redirect
|
|
90251
|
-
* (the original describing phrase was "Moved Temporarily"), but popular browsers implemented 302
|
|
90252
|
-
* with the functionality of a 303 See Other. Therefore, HTTP/1.1 added status codes 303 and 307
|
|
90253
|
-
* to distinguish between the two behaviours. However, some Web applications and frameworks
|
|
90254
|
-
* use the 302 status code as if it were the 303.
|
|
87185
|
+
/**
|
|
87186
|
+
* This is an example of industry practice contradicting the standard.
|
|
87187
|
+
* The HTTP/1.0 specification (RFC 1945) required the client to perform a temporary redirect
|
|
87188
|
+
* (the original describing phrase was "Moved Temporarily"), but popular browsers implemented 302
|
|
87189
|
+
* with the functionality of a 303 See Other. Therefore, HTTP/1.1 added status codes 303 and 307
|
|
87190
|
+
* to distinguish between the two behaviours. However, some Web applications and frameworks
|
|
87191
|
+
* use the 302 status code as if it were the 303.
|
|
90255
87192
|
*/
|
|
90256
87193
|
HttpStatusCode[HttpStatusCode["FOUND"] = 302] = "FOUND";
|
|
90257
|
-
/**
|
|
90258
|
-
* SINCE HTTP/1.1
|
|
90259
|
-
* The response to the request can be found under another URI using a GET method.
|
|
90260
|
-
* When received in response to a POST (or PUT/DELETE), the client should presume that
|
|
90261
|
-
* the server has received the data and should issue a redirect with a separate GET message.
|
|
87194
|
+
/**
|
|
87195
|
+
* SINCE HTTP/1.1
|
|
87196
|
+
* The response to the request can be found under another URI using a GET method.
|
|
87197
|
+
* When received in response to a POST (or PUT/DELETE), the client should presume that
|
|
87198
|
+
* the server has received the data and should issue a redirect with a separate GET message.
|
|
90262
87199
|
*/
|
|
90263
87200
|
HttpStatusCode[HttpStatusCode["SEE_OTHER"] = 303] = "SEE_OTHER";
|
|
90264
|
-
/**
|
|
90265
|
-
* Indicates that the resource has not been modified since the version specified by the request headers If-Modified-Since or If-None-Match.
|
|
90266
|
-
* In such case, there is no need to retransmit the resource since the client still has a previously-downloaded copy.
|
|
87201
|
+
/**
|
|
87202
|
+
* Indicates that the resource has not been modified since the version specified by the request headers If-Modified-Since or If-None-Match.
|
|
87203
|
+
* In such case, there is no need to retransmit the resource since the client still has a previously-downloaded copy.
|
|
90267
87204
|
*/
|
|
90268
87205
|
HttpStatusCode[HttpStatusCode["NOT_MODIFIED"] = 304] = "NOT_MODIFIED";
|
|
90269
|
-
/**
|
|
90270
|
-
* SINCE HTTP/1.1
|
|
90271
|
-
* The requested resource is available only through a proxy, the address for which is provided in the response.
|
|
90272
|
-
* Many HTTP clients (such as Mozilla and Internet Explorer) do not correctly handle responses with this status code, primarily for security reasons.
|
|
87206
|
+
/**
|
|
87207
|
+
* SINCE HTTP/1.1
|
|
87208
|
+
* The requested resource is available only through a proxy, the address for which is provided in the response.
|
|
87209
|
+
* Many HTTP clients (such as Mozilla and Internet Explorer) do not correctly handle responses with this status code, primarily for security reasons.
|
|
90273
87210
|
*/
|
|
90274
87211
|
HttpStatusCode[HttpStatusCode["USE_PROXY"] = 305] = "USE_PROXY";
|
|
90275
|
-
/**
|
|
90276
|
-
* No longer used. Originally meant "Subsequent requests should use the specified proxy."
|
|
87212
|
+
/**
|
|
87213
|
+
* No longer used. Originally meant "Subsequent requests should use the specified proxy."
|
|
90277
87214
|
*/
|
|
90278
87215
|
HttpStatusCode[HttpStatusCode["SWITCH_PROXY"] = 306] = "SWITCH_PROXY";
|
|
90279
|
-
/**
|
|
90280
|
-
* SINCE HTTP/1.1
|
|
90281
|
-
* In this case, the request should be repeated with another URI; however, future requests should still use the original URI.
|
|
90282
|
-
* In contrast to how 302 was historically implemented, the request method is not allowed to be changed when reissuing the original request.
|
|
90283
|
-
* For example, a POST request should be repeated using another POST request.
|
|
87216
|
+
/**
|
|
87217
|
+
* SINCE HTTP/1.1
|
|
87218
|
+
* In this case, the request should be repeated with another URI; however, future requests should still use the original URI.
|
|
87219
|
+
* In contrast to how 302 was historically implemented, the request method is not allowed to be changed when reissuing the original request.
|
|
87220
|
+
* For example, a POST request should be repeated using another POST request.
|
|
90284
87221
|
*/
|
|
90285
87222
|
HttpStatusCode[HttpStatusCode["TEMPORARY_REDIRECT"] = 307] = "TEMPORARY_REDIRECT";
|
|
90286
|
-
/**
|
|
90287
|
-
* The request and all future requests should be repeated using another URI.
|
|
90288
|
-
* 307 and 308 parallel the behaviors of 302 and 301, but do not allow the HTTP method to change.
|
|
90289
|
-
* So, for example, submitting a form to a permanently redirected resource may continue smoothly.
|
|
87223
|
+
/**
|
|
87224
|
+
* The request and all future requests should be repeated using another URI.
|
|
87225
|
+
* 307 and 308 parallel the behaviors of 302 and 301, but do not allow the HTTP method to change.
|
|
87226
|
+
* So, for example, submitting a form to a permanently redirected resource may continue smoothly.
|
|
90290
87227
|
*/
|
|
90291
87228
|
HttpStatusCode[HttpStatusCode["PERMANENT_REDIRECT"] = 308] = "PERMANENT_REDIRECT";
|
|
90292
|
-
/**
|
|
90293
|
-
* The server cannot or will not process the request due to an apparent client error
|
|
90294
|
-
* (e.g., malformed request syntax, too large size, invalid request message framing, or deceptive request routing).
|
|
87229
|
+
/**
|
|
87230
|
+
* The server cannot or will not process the request due to an apparent client error
|
|
87231
|
+
* (e.g., malformed request syntax, too large size, invalid request message framing, or deceptive request routing).
|
|
90295
87232
|
*/
|
|
90296
87233
|
HttpStatusCode[HttpStatusCode["BAD_REQUEST"] = 400] = "BAD_REQUEST";
|
|
90297
|
-
/**
|
|
90298
|
-
* Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet
|
|
90299
|
-
* been provided. The response must include a WWW-Authenticate header field containing a challenge applicable to the
|
|
90300
|
-
* requested resource. See Basic access authentication and Digest access authentication. 401 semantically means
|
|
90301
|
-
* "unauthenticated",i.e. the user does not have the necessary credentials.
|
|
87234
|
+
/**
|
|
87235
|
+
* Similar to 403 Forbidden, but specifically for use when authentication is required and has failed or has not yet
|
|
87236
|
+
* been provided. The response must include a WWW-Authenticate header field containing a challenge applicable to the
|
|
87237
|
+
* requested resource. See Basic access authentication and Digest access authentication. 401 semantically means
|
|
87238
|
+
* "unauthenticated",i.e. the user does not have the necessary credentials.
|
|
90302
87239
|
*/
|
|
90303
87240
|
HttpStatusCode[HttpStatusCode["UNAUTHORIZED"] = 401] = "UNAUTHORIZED";
|
|
90304
|
-
/**
|
|
90305
|
-
* Reserved for future use. The original intention was that this code might be used as part of some form of digital
|
|
90306
|
-
* cash or micro payment scheme, but that has not happened, and this code is not usually used.
|
|
90307
|
-
* Google Developers API uses this status if a particular developer has exceeded the daily limit on requests.
|
|
87241
|
+
/**
|
|
87242
|
+
* Reserved for future use. The original intention was that this code might be used as part of some form of digital
|
|
87243
|
+
* cash or micro payment scheme, but that has not happened, and this code is not usually used.
|
|
87244
|
+
* Google Developers API uses this status if a particular developer has exceeded the daily limit on requests.
|
|
90308
87245
|
*/
|
|
90309
87246
|
HttpStatusCode[HttpStatusCode["PAYMENT_REQUIRED"] = 402] = "PAYMENT_REQUIRED";
|
|
90310
|
-
/**
|
|
90311
|
-
* The request was valid, but the server is refusing action.
|
|
90312
|
-
* The user might not have the necessary permissions for a resource.
|
|
87247
|
+
/**
|
|
87248
|
+
* The request was valid, but the server is refusing action.
|
|
87249
|
+
* The user might not have the necessary permissions for a resource.
|
|
90313
87250
|
*/
|
|
90314
87251
|
HttpStatusCode[HttpStatusCode["FORBIDDEN"] = 403] = "FORBIDDEN";
|
|
90315
|
-
/**
|
|
90316
|
-
* The requested resource could not be found but may be available in the future.
|
|
90317
|
-
* Subsequent requests by the client are permissible.
|
|
87252
|
+
/**
|
|
87253
|
+
* The requested resource could not be found but may be available in the future.
|
|
87254
|
+
* Subsequent requests by the client are permissible.
|
|
90318
87255
|
*/
|
|
90319
87256
|
HttpStatusCode[HttpStatusCode["NOT_FOUND"] = 404] = "NOT_FOUND";
|
|
90320
|
-
/**
|
|
90321
|
-
* A request method is not supported for the requested resource;
|
|
90322
|
-
* for example, a GET request on a form that requires data to be presented via POST, or a PUT request on a read-only resource.
|
|
87257
|
+
/**
|
|
87258
|
+
* A request method is not supported for the requested resource;
|
|
87259
|
+
* for example, a GET request on a form that requires data to be presented via POST, or a PUT request on a read-only resource.
|
|
90323
87260
|
*/
|
|
90324
87261
|
HttpStatusCode[HttpStatusCode["METHOD_NOT_ALLOWED"] = 405] = "METHOD_NOT_ALLOWED";
|
|
90325
|
-
/**
|
|
90326
|
-
* The requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.
|
|
87262
|
+
/**
|
|
87263
|
+
* The requested resource is capable of generating only content not acceptable according to the Accept headers sent in the request.
|
|
90327
87264
|
*/
|
|
90328
87265
|
HttpStatusCode[HttpStatusCode["NOT_ACCEPTABLE"] = 406] = "NOT_ACCEPTABLE";
|
|
90329
|
-
/**
|
|
90330
|
-
* The client must first authenticate itself with the proxy.
|
|
87266
|
+
/**
|
|
87267
|
+
* The client must first authenticate itself with the proxy.
|
|
90331
87268
|
*/
|
|
90332
87269
|
HttpStatusCode[HttpStatusCode["PROXY_AUTHENTICATION_REQUIRED"] = 407] = "PROXY_AUTHENTICATION_REQUIRED";
|
|
90333
|
-
/**
|
|
90334
|
-
* The server timed out waiting for the request.
|
|
90335
|
-
* According to HTTP specifications:
|
|
90336
|
-
* "The client did not produce a request within the time that the server was prepared to wait. The client MAY repeat the request without modifications at any later time."
|
|
87270
|
+
/**
|
|
87271
|
+
* The server timed out waiting for the request.
|
|
87272
|
+
* According to HTTP specifications:
|
|
87273
|
+
* "The client did not produce a request within the time that the server was prepared to wait. The client MAY repeat the request without modifications at any later time."
|
|
90337
87274
|
*/
|
|
90338
87275
|
HttpStatusCode[HttpStatusCode["REQUEST_TIMEOUT"] = 408] = "REQUEST_TIMEOUT";
|
|
90339
|
-
/**
|
|
90340
|
-
* Indicates that the request could not be processed because of conflict in the request,
|
|
90341
|
-
* such as an edit conflict between multiple simultaneous updates.
|
|
87276
|
+
/**
|
|
87277
|
+
* Indicates that the request could not be processed because of conflict in the request,
|
|
87278
|
+
* such as an edit conflict between multiple simultaneous updates.
|
|
90342
87279
|
*/
|
|
90343
87280
|
HttpStatusCode[HttpStatusCode["CONFLICT"] = 409] = "CONFLICT";
|
|
90344
|
-
/**
|
|
90345
|
-
* Indicates that the resource requested is no longer available and will not be available again.
|
|
90346
|
-
* This should be used when a resource has been intentionally removed and the resource should be purged.
|
|
90347
|
-
* Upon receiving a 410 status code, the client should not request the resource in the future.
|
|
90348
|
-
* Clients such as search engines should remove the resource from their indices.
|
|
90349
|
-
* Most use cases do not require clients and search engines to purge the resource, and a "404 Not Found" may be used instead.
|
|
87281
|
+
/**
|
|
87282
|
+
* Indicates that the resource requested is no longer available and will not be available again.
|
|
87283
|
+
* This should be used when a resource has been intentionally removed and the resource should be purged.
|
|
87284
|
+
* Upon receiving a 410 status code, the client should not request the resource in the future.
|
|
87285
|
+
* Clients such as search engines should remove the resource from their indices.
|
|
87286
|
+
* Most use cases do not require clients and search engines to purge the resource, and a "404 Not Found" may be used instead.
|
|
90350
87287
|
*/
|
|
90351
87288
|
HttpStatusCode[HttpStatusCode["GONE"] = 410] = "GONE";
|
|
90352
|
-
/**
|
|
90353
|
-
* The request did not specify the length of its content, which is required by the requested resource.
|
|
87289
|
+
/**
|
|
87290
|
+
* The request did not specify the length of its content, which is required by the requested resource.
|
|
90354
87291
|
*/
|
|
90355
87292
|
HttpStatusCode[HttpStatusCode["LENGTH_REQUIRED"] = 411] = "LENGTH_REQUIRED";
|
|
90356
|
-
/**
|
|
90357
|
-
* The server does not meet one of the preconditions that the requester put on the request.
|
|
87293
|
+
/**
|
|
87294
|
+
* The server does not meet one of the preconditions that the requester put on the request.
|
|
90358
87295
|
*/
|
|
90359
87296
|
HttpStatusCode[HttpStatusCode["PRECONDITION_FAILED"] = 412] = "PRECONDITION_FAILED";
|
|
90360
|
-
/**
|
|
90361
|
-
* The request is larger than the server is willing or able to process. Previously called "Request Entity Too Large".
|
|
87297
|
+
/**
|
|
87298
|
+
* The request is larger than the server is willing or able to process. Previously called "Request Entity Too Large".
|
|
90362
87299
|
*/
|
|
90363
87300
|
HttpStatusCode[HttpStatusCode["PAYLOAD_TOO_LARGE"] = 413] = "PAYLOAD_TOO_LARGE";
|
|
90364
|
-
/**
|
|
90365
|
-
* The URI provided was too long for the server to process. Often the result of too much data being encoded as a query-string of a GET request,
|
|
90366
|
-
* in which case it should be converted to a POST request.
|
|
90367
|
-
* Called "Request-URI Too Long" previously.
|
|
87301
|
+
/**
|
|
87302
|
+
* The URI provided was too long for the server to process. Often the result of too much data being encoded as a query-string of a GET request,
|
|
87303
|
+
* in which case it should be converted to a POST request.
|
|
87304
|
+
* Called "Request-URI Too Long" previously.
|
|
90368
87305
|
*/
|
|
90369
87306
|
HttpStatusCode[HttpStatusCode["URI_TOO_LONG"] = 414] = "URI_TOO_LONG";
|
|
90370
|
-
/**
|
|
90371
|
-
* The request entity has a media type which the server or resource does not support.
|
|
90372
|
-
* For example, the client uploads an image as image/svg+xml, but the server requires that images use a different format.
|
|
87307
|
+
/**
|
|
87308
|
+
* The request entity has a media type which the server or resource does not support.
|
|
87309
|
+
* For example, the client uploads an image as image/svg+xml, but the server requires that images use a different format.
|
|
90373
87310
|
*/
|
|
90374
87311
|
HttpStatusCode[HttpStatusCode["UNSUPPORTED_MEDIA_TYPE"] = 415] = "UNSUPPORTED_MEDIA_TYPE";
|
|
90375
|
-
/**
|
|
90376
|
-
* The client has asked for a portion of the file (byte serving), but the server cannot supply that portion.
|
|
90377
|
-
* For example, if the client asked for a part of the file that lies beyond the end of the file.
|
|
90378
|
-
* Called "Requested Range Not Satisfiable" previously.
|
|
87312
|
+
/**
|
|
87313
|
+
* The client has asked for a portion of the file (byte serving), but the server cannot supply that portion.
|
|
87314
|
+
* For example, if the client asked for a part of the file that lies beyond the end of the file.
|
|
87315
|
+
* Called "Requested Range Not Satisfiable" previously.
|
|
90379
87316
|
*/
|
|
90380
87317
|
HttpStatusCode[HttpStatusCode["RANGE_NOT_SATISFIABLE"] = 416] = "RANGE_NOT_SATISFIABLE";
|
|
90381
|
-
/**
|
|
90382
|
-
* The server cannot meet the requirements of the Expect request-header field.
|
|
87318
|
+
/**
|
|
87319
|
+
* The server cannot meet the requirements of the Expect request-header field.
|
|
90383
87320
|
*/
|
|
90384
87321
|
HttpStatusCode[HttpStatusCode["EXPECTATION_FAILED"] = 417] = "EXPECTATION_FAILED";
|
|
90385
|
-
/**
|
|
90386
|
-
* This code was defined in 1998 as one of the traditional IETF April Fools' jokes, in RFC 2324, Hyper Text Coffee Pot Control Protocol,
|
|
90387
|
-
* and is not expected to be implemented by actual HTTP servers. The RFC specifies this code should be returned by
|
|
90388
|
-
* teapots requested to brew coffee. This HTTP status is used as an Easter egg in some websites, including Google.com.
|
|
87322
|
+
/**
|
|
87323
|
+
* This code was defined in 1998 as one of the traditional IETF April Fools' jokes, in RFC 2324, Hyper Text Coffee Pot Control Protocol,
|
|
87324
|
+
* and is not expected to be implemented by actual HTTP servers. The RFC specifies this code should be returned by
|
|
87325
|
+
* teapots requested to brew coffee. This HTTP status is used as an Easter egg in some websites, including Google.com.
|
|
90389
87326
|
*/
|
|
90390
87327
|
HttpStatusCode[HttpStatusCode["I_AM_A_TEAPOT"] = 418] = "I_AM_A_TEAPOT";
|
|
90391
|
-
/**
|
|
90392
|
-
* The request was directed at a server that is not able to produce a response (for example because a connection reuse).
|
|
87328
|
+
/**
|
|
87329
|
+
* The request was directed at a server that is not able to produce a response (for example because a connection reuse).
|
|
90393
87330
|
*/
|
|
90394
87331
|
HttpStatusCode[HttpStatusCode["MISDIRECTED_REQUEST"] = 421] = "MISDIRECTED_REQUEST";
|
|
90395
|
-
/**
|
|
90396
|
-
* The request was well-formed but was unable to be followed due to semantic errors.
|
|
87332
|
+
/**
|
|
87333
|
+
* The request was well-formed but was unable to be followed due to semantic errors.
|
|
90397
87334
|
*/
|
|
90398
87335
|
HttpStatusCode[HttpStatusCode["UNPROCESSABLE_ENTITY"] = 422] = "UNPROCESSABLE_ENTITY";
|
|
90399
|
-
/**
|
|
90400
|
-
* The resource that is being accessed is locked.
|
|
87336
|
+
/**
|
|
87337
|
+
* The resource that is being accessed is locked.
|
|
90401
87338
|
*/
|
|
90402
87339
|
HttpStatusCode[HttpStatusCode["LOCKED"] = 423] = "LOCKED";
|
|
90403
|
-
/**
|
|
90404
|
-
* The request failed due to failure of a previous request (e.g., a PROPPATCH).
|
|
87340
|
+
/**
|
|
87341
|
+
* The request failed due to failure of a previous request (e.g., a PROPPATCH).
|
|
90405
87342
|
*/
|
|
90406
87343
|
HttpStatusCode[HttpStatusCode["FAILED_DEPENDENCY"] = 424] = "FAILED_DEPENDENCY";
|
|
90407
|
-
/**
|
|
90408
|
-
* The client should switch to a different protocol such as TLS/1.0, given in the Upgrade header field.
|
|
87344
|
+
/**
|
|
87345
|
+
* The client should switch to a different protocol such as TLS/1.0, given in the Upgrade header field.
|
|
90409
87346
|
*/
|
|
90410
87347
|
HttpStatusCode[HttpStatusCode["UPGRADE_REQUIRED"] = 426] = "UPGRADE_REQUIRED";
|
|
90411
|
-
/**
|
|
90412
|
-
* The origin server requires the request to be conditional.
|
|
90413
|
-
* Intended to prevent "the 'lost update' problem, where a client
|
|
90414
|
-
* GETs a resource's state, modifies it, and PUTs it back to the server,
|
|
90415
|
-
* when meanwhile a third party has modified the state on the server, leading to a conflict."
|
|
87348
|
+
/**
|
|
87349
|
+
* The origin server requires the request to be conditional.
|
|
87350
|
+
* Intended to prevent "the 'lost update' problem, where a client
|
|
87351
|
+
* GETs a resource's state, modifies it, and PUTs it back to the server,
|
|
87352
|
+
* when meanwhile a third party has modified the state on the server, leading to a conflict."
|
|
90416
87353
|
*/
|
|
90417
87354
|
HttpStatusCode[HttpStatusCode["PRECONDITION_REQUIRED"] = 428] = "PRECONDITION_REQUIRED";
|
|
90418
|
-
/**
|
|
90419
|
-
* The user has sent too many requests in a given amount of time. Intended for use with rate-limiting schemes.
|
|
87355
|
+
/**
|
|
87356
|
+
* The user has sent too many requests in a given amount of time. Intended for use with rate-limiting schemes.
|
|
90420
87357
|
*/
|
|
90421
87358
|
HttpStatusCode[HttpStatusCode["TOO_MANY_REQUESTS"] = 429] = "TOO_MANY_REQUESTS";
|
|
90422
|
-
/**
|
|
90423
|
-
* The server is unwilling to process the request because either an individual header field,
|
|
90424
|
-
* or all the header fields collectively, are too large.
|
|
87359
|
+
/**
|
|
87360
|
+
* The server is unwilling to process the request because either an individual header field,
|
|
87361
|
+
* or all the header fields collectively, are too large.
|
|
90425
87362
|
*/
|
|
90426
87363
|
HttpStatusCode[HttpStatusCode["REQUEST_HEADER_FIELDS_TOO_LARGE"] = 431] = "REQUEST_HEADER_FIELDS_TOO_LARGE";
|
|
90427
|
-
/**
|
|
90428
|
-
* A server operator has received a legal demand to deny access to a resource or to a set of resources
|
|
90429
|
-
* that includes the requested resource. The code 451 was chosen as a reference to the novel Fahrenheit 451.
|
|
87364
|
+
/**
|
|
87365
|
+
* A server operator has received a legal demand to deny access to a resource or to a set of resources
|
|
87366
|
+
* that includes the requested resource. The code 451 was chosen as a reference to the novel Fahrenheit 451.
|
|
90430
87367
|
*/
|
|
90431
87368
|
HttpStatusCode[HttpStatusCode["UNAVAILABLE_FOR_LEGAL_REASONS"] = 451] = "UNAVAILABLE_FOR_LEGAL_REASONS";
|
|
90432
|
-
/**
|
|
90433
|
-
* A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.
|
|
87369
|
+
/**
|
|
87370
|
+
* A generic error message, given when an unexpected condition was encountered and no more specific message is suitable.
|
|
90434
87371
|
*/
|
|
90435
87372
|
HttpStatusCode[HttpStatusCode["INTERNAL_SERVER_ERROR"] = 500] = "INTERNAL_SERVER_ERROR";
|
|
90436
|
-
/**
|
|
90437
|
-
* The server either does not recognize the request method, or it lacks the ability to fulfill the request.
|
|
90438
|
-
* Usually this implies future availability (e.g., a new feature of a web-service API).
|
|
87373
|
+
/**
|
|
87374
|
+
* The server either does not recognize the request method, or it lacks the ability to fulfill the request.
|
|
87375
|
+
* Usually this implies future availability (e.g., a new feature of a web-service API).
|
|
90439
87376
|
*/
|
|
90440
87377
|
HttpStatusCode[HttpStatusCode["NOT_IMPLEMENTED"] = 501] = "NOT_IMPLEMENTED";
|
|
90441
|
-
/**
|
|
90442
|
-
* The server was acting as a gateway or proxy and received an invalid response from the upstream server.
|
|
87378
|
+
/**
|
|
87379
|
+
* The server was acting as a gateway or proxy and received an invalid response from the upstream server.
|
|
90443
87380
|
*/
|
|
90444
87381
|
HttpStatusCode[HttpStatusCode["BAD_GATEWAY"] = 502] = "BAD_GATEWAY";
|
|
90445
|
-
/**
|
|
90446
|
-
* The server is currently unavailable (because it is overloaded or down for maintenance).
|
|
90447
|
-
* Generally, this is a temporary state.
|
|
87382
|
+
/**
|
|
87383
|
+
* The server is currently unavailable (because it is overloaded or down for maintenance).
|
|
87384
|
+
* Generally, this is a temporary state.
|
|
90448
87385
|
*/
|
|
90449
87386
|
HttpStatusCode[HttpStatusCode["SERVICE_UNAVAILABLE"] = 503] = "SERVICE_UNAVAILABLE";
|
|
90450
|
-
/**
|
|
90451
|
-
* The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.
|
|
87387
|
+
/**
|
|
87388
|
+
* The server was acting as a gateway or proxy and did not receive a timely response from the upstream server.
|
|
90452
87389
|
*/
|
|
90453
87390
|
HttpStatusCode[HttpStatusCode["GATEWAY_TIMEOUT"] = 504] = "GATEWAY_TIMEOUT";
|
|
90454
|
-
/**
|
|
90455
|
-
* The server does not support the HTTP protocol version used in the request
|
|
87391
|
+
/**
|
|
87392
|
+
* The server does not support the HTTP protocol version used in the request
|
|
90456
87393
|
*/
|
|
90457
87394
|
HttpStatusCode[HttpStatusCode["HTTP_VERSION_NOT_SUPPORTED"] = 505] = "HTTP_VERSION_NOT_SUPPORTED";
|
|
90458
|
-
/**
|
|
90459
|
-
* Transparent content negotiation for the request results in a circular reference.
|
|
87395
|
+
/**
|
|
87396
|
+
* Transparent content negotiation for the request results in a circular reference.
|
|
90460
87397
|
*/
|
|
90461
87398
|
HttpStatusCode[HttpStatusCode["VARIANT_ALSO_NEGOTIATES"] = 506] = "VARIANT_ALSO_NEGOTIATES";
|
|
90462
|
-
/**
|
|
90463
|
-
* The server is unable to store the representation needed to complete the request.
|
|
87399
|
+
/**
|
|
87400
|
+
* The server is unable to store the representation needed to complete the request.
|
|
90464
87401
|
*/
|
|
90465
87402
|
HttpStatusCode[HttpStatusCode["INSUFFICIENT_STORAGE"] = 507] = "INSUFFICIENT_STORAGE";
|
|
90466
|
-
/**
|
|
90467
|
-
* The server detected an infinite loop while processing the request.
|
|
87403
|
+
/**
|
|
87404
|
+
* The server detected an infinite loop while processing the request.
|
|
90468
87405
|
*/
|
|
90469
87406
|
HttpStatusCode[HttpStatusCode["LOOP_DETECTED"] = 508] = "LOOP_DETECTED";
|
|
90470
|
-
/**
|
|
90471
|
-
* Further extensions to the request are required for the server to fulfill it.
|
|
87407
|
+
/**
|
|
87408
|
+
* Further extensions to the request are required for the server to fulfill it.
|
|
90472
87409
|
*/
|
|
90473
87410
|
HttpStatusCode[HttpStatusCode["NOT_EXTENDED"] = 510] = "NOT_EXTENDED";
|
|
90474
|
-
/**
|
|
90475
|
-
* The client needs to authenticate to gain network access.
|
|
90476
|
-
* Intended for use by intercepting proxies used to control access to the network (e.g., "captive portals" used
|
|
90477
|
-
* to require agreement to Terms of Service before granting full Internet access via a Wi-Fi hotspot).
|
|
87411
|
+
/**
|
|
87412
|
+
* The client needs to authenticate to gain network access.
|
|
87413
|
+
* Intended for use by intercepting proxies used to control access to the network (e.g., "captive portals" used
|
|
87414
|
+
* to require agreement to Terms of Service before granting full Internet access via a Wi-Fi hotspot).
|
|
90478
87415
|
*/
|
|
90479
87416
|
HttpStatusCode[HttpStatusCode["NETWORK_AUTHENTICATION_REQUIRED"] = 511] = "NETWORK_AUTHENTICATION_REQUIRED";
|
|
90480
87417
|
})(HttpStatusCode || (HttpStatusCode = {}));
|
|
@@ -90682,4 +87619,4 @@ if (typeof window !== 'undefined') {
|
|
|
90682
87619
|
window.global = window;
|
|
90683
87620
|
}
|
|
90684
87621
|
|
|
90685
|
-
export { CreateCheckoutSessionUri, CreatePortalSessionUri, HttpStatusCode, HttpStatusCodeName, LOCAL_STORAGE_I18N_STRING, LangService, Languages, ModelFieldsTypes, ModelUtilities, StringsUtils, addDomain, addDomainOptions, auth, companyUsersQuery, contentInstancesQuery, createCompany, createCompanyOptions, createContentInstanceMutation, createContentInstanceMutationOptions, createContentMutation, createContentMutationOptions, createFileMutation, createFolderMutation, dconfigClient, deleteFileMutation, deleteFolderMutation, dqueryClient, filesQuery, foldersTreeQuery, forgetPassword, forgetPasswordOptions, inviteUser, inviteUserOptions, login, loginOptions, register, registerOptions, removeContentMutation, removeDomain, removeDomainOptions, removeUserFromCompany, removeUserFromCompanyOptions, resetPassword, resetPasswordOptions, showcaseClient, showcaseConfig, showcaseConfigurationQuery, showcaseConfigurationQueryOptions, showcaseContentsQuery, showcaseDomainsQuery, showcaseDomainsQueryOptions, showcasePagesQuery, showcasePagesQueryOptions, showcaseSectionQuery,
|
|
87622
|
+
export { CreateCheckoutSessionUri, CreatePortalSessionUri, HttpStatusCode, HttpStatusCodeName, LOCAL_STORAGE_I18N_STRING, LangService, Languages, ModelFieldsTypes, ModelUtilities, StringsUtils, addDomain, addDomainOptions, apiBackend, apiV2Backend, appConfig, auth, companyUsersQuery, contentInstancesQuery, createCompany, createCompanyOptions, createContentInstanceMutation, createContentInstanceMutationOptions, createContentMutation, createContentMutationOptions, createFileMutation, createFolderMutation, dconfigClient, deleteFileMutation, deleteFolderMutation, dqueryClient, filesQuery, foldersTreeQuery, forgetPassword, forgetPasswordOptions, frontend, inviteUser, inviteUserOptions, login, loginOptions, queryUsage, registeUsage, register, registerOptions, removeContentMutation, removeDomain, removeDomainOptions, removeUserFromCompany, removeUserFromCompanyOptions, resetPassword, resetPasswordOptions, showcaseClient, showcaseConfig, showcaseConfigurationQuery, showcaseConfigurationQueryOptions, showcaseContentsQuery, showcaseDomainsQuery, showcaseDomainsQueryOptions, showcasePagesQuery, showcasePagesQueryOptions, showcaseSectionQuery, showcaseSectionsQuery, showcaseSectionsQueryOptions, showcaseTemplatesQuery, showcaseTemplatesQueryOptions, subscriptionConfigurationQuery, subscriptionConfigurationQueryOptions, tokenClient, updateCompany, updateCompanyOptions, updateContentInstanceFieldValuesMutation, updateContentInstanceFieldValuesMutationOptions, updateContentsOrderingMutation, updateContentsOrderingMutationOptions, updateUserPassword, updateUserPasswordOptions, updateUserProfile, updateUserProfileOptions, useContentInstancesQuery, useCreateContentInstanceMutation, useCreateContentMutation, useCreateFileMutation, useCreateFolderMutation, useDeleteContentMutation, useDeleteFileMutation, useDeleteFolderMutation, useDomainsQuery, useFilesQuery, useFoldersTreeQuery, useModelChildrenQuery, useModelsQuery, useQueryUsage, useRegisterUsage, useShowcaseConfig, useShowcaseConfigurationQuery, useShowcaseTemplate, useShowcaseTemplateOptions, useShowcaseTemplateProgress, useShowcaseTemplateProgressQuery, useUpdateContentInstanceFieldValuesMutation, useUpdateContentsOrderingMutation, useUserCompaniesQuery, userCompaniesQuery, userCompaniesQueryOptions, userInfoQuery, userInfoQueryOptions, viewTypeChildrenQuery, viewTypeChildrenQueryOptions, viewTypesQuery, viewTypesQueryOptions, withDQueryClient, withShowcaseClient };
|