andoncloud-widget-preview 1.0.3 → 1.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/dist/index.js +2066 -3
- package/dist/index.js.map +1 -1
- package/dist/types.d.ts +1 -1
- package/dist/version.d.ts +1 -1
- package/package.json +9 -9
package/dist/index.js
CHANGED
|
@@ -3012,7 +3012,7 @@ function createCommonjsModule(fn) {
|
|
|
3012
3012
|
return fn(module, module.exports), module.exports;
|
|
3013
3013
|
}
|
|
3014
3014
|
|
|
3015
|
-
var
|
|
3015
|
+
var dist_1 = createCommonjsModule(function (module, exports) {
|
|
3016
3016
|
function _interopDefault (ex) { return (ex && (typeof ex === 'object') && 'default' in ex) ? ex['default'] : ex; }
|
|
3017
3017
|
|
|
3018
3018
|
|
|
@@ -7675,6 +7675,10 @@ function createCommonjsModule(fn, module) {
|
|
|
7675
7675
|
return module = { exports: {} }, fn(module, module.exports), module.exports;
|
|
7676
7676
|
}
|
|
7677
7677
|
|
|
7678
|
+
function getCjsExportFromNamespace (n) {
|
|
7679
|
+
return n && n['default'] || n;
|
|
7680
|
+
}
|
|
7681
|
+
|
|
7678
7682
|
function commonjsRequire () {
|
|
7679
7683
|
throw new Error('Dynamic requires are not currently supported by @rollup/plugin-commonjs');
|
|
7680
7684
|
}
|
|
@@ -11125,6 +11129,13 @@ var Token = /*#__PURE__*/function () {
|
|
|
11125
11129
|
}(); // Print a simplified form when appearing in `inspect` and `util.inspect`.
|
|
11126
11130
|
|
|
11127
11131
|
defineInspect(Token);
|
|
11132
|
+
/**
|
|
11133
|
+
* @internal
|
|
11134
|
+
*/
|
|
11135
|
+
|
|
11136
|
+
function isNode(maybeNode) {
|
|
11137
|
+
return maybeNode != null && typeof maybeNode.kind === 'string';
|
|
11138
|
+
}
|
|
11128
11139
|
/**
|
|
11129
11140
|
* The list of all possible AST node types.
|
|
11130
11141
|
*/
|
|
@@ -11496,6 +11507,36 @@ function getBlockStringIndentation(value) {
|
|
|
11496
11507
|
|
|
11497
11508
|
return (_commonIndent = commonIndent) !== null && _commonIndent !== void 0 ? _commonIndent : 0;
|
|
11498
11509
|
}
|
|
11510
|
+
/**
|
|
11511
|
+
* Print a block string in the indented block form by adding a leading and
|
|
11512
|
+
* trailing blank line. However, if a block string starts with whitespace and is
|
|
11513
|
+
* a single-line, adding a leading blank line would strip that whitespace.
|
|
11514
|
+
*
|
|
11515
|
+
* @internal
|
|
11516
|
+
*/
|
|
11517
|
+
|
|
11518
|
+
function printBlockString(value) {
|
|
11519
|
+
var indentation = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
11520
|
+
var preferMultipleLines = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : false;
|
|
11521
|
+
var isSingleLine = value.indexOf('\n') === -1;
|
|
11522
|
+
var hasLeadingSpace = value[0] === ' ' || value[0] === '\t';
|
|
11523
|
+
var hasTrailingQuote = value[value.length - 1] === '"';
|
|
11524
|
+
var hasTrailingSlash = value[value.length - 1] === '\\';
|
|
11525
|
+
var printAsMultipleLines = !isSingleLine || hasTrailingQuote || hasTrailingSlash || preferMultipleLines;
|
|
11526
|
+
var result = ''; // Format a multi-line block quote to account for leading space.
|
|
11527
|
+
|
|
11528
|
+
if (printAsMultipleLines && !(isSingleLine && hasLeadingSpace)) {
|
|
11529
|
+
result += '\n' + indentation;
|
|
11530
|
+
}
|
|
11531
|
+
|
|
11532
|
+
result += indentation ? value.replace(/\n/g, '\n' + indentation) : value;
|
|
11533
|
+
|
|
11534
|
+
if (printAsMultipleLines) {
|
|
11535
|
+
result += '\n';
|
|
11536
|
+
}
|
|
11537
|
+
|
|
11538
|
+
return '"""' + result.replace(/"""/g, '\\"""') + '"""';
|
|
11539
|
+
}
|
|
11499
11540
|
|
|
11500
11541
|
/**
|
|
11501
11542
|
* Given a Source object, creates a Lexer for that source.
|
|
@@ -12182,6 +12223,42 @@ function parse(source, options) {
|
|
|
12182
12223
|
var parser = new Parser(source, options);
|
|
12183
12224
|
return parser.parseDocument();
|
|
12184
12225
|
}
|
|
12226
|
+
/**
|
|
12227
|
+
* Given a string containing a GraphQL value (ex. `[42]`), parse the AST for
|
|
12228
|
+
* that value.
|
|
12229
|
+
* Throws GraphQLError if a syntax error is encountered.
|
|
12230
|
+
*
|
|
12231
|
+
* This is useful within tools that operate upon GraphQL Values directly and
|
|
12232
|
+
* in isolation of complete GraphQL documents.
|
|
12233
|
+
*
|
|
12234
|
+
* Consider providing the results to the utility function: valueFromAST().
|
|
12235
|
+
*/
|
|
12236
|
+
|
|
12237
|
+
function parseValue(source, options) {
|
|
12238
|
+
var parser = new Parser(source, options);
|
|
12239
|
+
parser.expectToken(TokenKind.SOF);
|
|
12240
|
+
var value = parser.parseValueLiteral(false);
|
|
12241
|
+
parser.expectToken(TokenKind.EOF);
|
|
12242
|
+
return value;
|
|
12243
|
+
}
|
|
12244
|
+
/**
|
|
12245
|
+
* Given a string containing a GraphQL Type (ex. `[Int!]`), parse the AST for
|
|
12246
|
+
* that type.
|
|
12247
|
+
* Throws GraphQLError if a syntax error is encountered.
|
|
12248
|
+
*
|
|
12249
|
+
* This is useful within tools that operate upon GraphQL Types directly and
|
|
12250
|
+
* in isolation of complete GraphQL documents.
|
|
12251
|
+
*
|
|
12252
|
+
* Consider providing the results to the utility function: typeFromAST().
|
|
12253
|
+
*/
|
|
12254
|
+
|
|
12255
|
+
function parseType(source, options) {
|
|
12256
|
+
var parser = new Parser(source, options);
|
|
12257
|
+
parser.expectToken(TokenKind.SOF);
|
|
12258
|
+
var type = parser.parseTypeReference();
|
|
12259
|
+
parser.expectToken(TokenKind.EOF);
|
|
12260
|
+
return type;
|
|
12261
|
+
}
|
|
12185
12262
|
/**
|
|
12186
12263
|
* This class is exported only to assist people in implementing their own parsers
|
|
12187
12264
|
* without duplicating too much code and should be used only as last resort for cases
|
|
@@ -13675,6 +13752,659 @@ function getTokenKindDesc(kind) {
|
|
|
13675
13752
|
return isPunctuatorTokenKind(kind) ? "\"".concat(kind, "\"") : kind;
|
|
13676
13753
|
}
|
|
13677
13754
|
|
|
13755
|
+
var parser = {
|
|
13756
|
+
__proto__: null,
|
|
13757
|
+
parse: parse,
|
|
13758
|
+
parseValue: parseValue,
|
|
13759
|
+
parseType: parseType,
|
|
13760
|
+
Parser: Parser
|
|
13761
|
+
};
|
|
13762
|
+
|
|
13763
|
+
/**
|
|
13764
|
+
* A visitor is provided to visit, it contains the collection of
|
|
13765
|
+
* relevant functions to be called during the visitor's traversal.
|
|
13766
|
+
*/
|
|
13767
|
+
|
|
13768
|
+
var QueryDocumentKeys = {
|
|
13769
|
+
Name: [],
|
|
13770
|
+
Document: ['definitions'],
|
|
13771
|
+
OperationDefinition: ['name', 'variableDefinitions', 'directives', 'selectionSet'],
|
|
13772
|
+
VariableDefinition: ['variable', 'type', 'defaultValue', 'directives'],
|
|
13773
|
+
Variable: ['name'],
|
|
13774
|
+
SelectionSet: ['selections'],
|
|
13775
|
+
Field: ['alias', 'name', 'arguments', 'directives', 'selectionSet'],
|
|
13776
|
+
Argument: ['name', 'value'],
|
|
13777
|
+
FragmentSpread: ['name', 'directives'],
|
|
13778
|
+
InlineFragment: ['typeCondition', 'directives', 'selectionSet'],
|
|
13779
|
+
FragmentDefinition: ['name', // Note: fragment variable definitions are experimental and may be changed
|
|
13780
|
+
// or removed in the future.
|
|
13781
|
+
'variableDefinitions', 'typeCondition', 'directives', 'selectionSet'],
|
|
13782
|
+
IntValue: [],
|
|
13783
|
+
FloatValue: [],
|
|
13784
|
+
StringValue: [],
|
|
13785
|
+
BooleanValue: [],
|
|
13786
|
+
NullValue: [],
|
|
13787
|
+
EnumValue: [],
|
|
13788
|
+
ListValue: ['values'],
|
|
13789
|
+
ObjectValue: ['fields'],
|
|
13790
|
+
ObjectField: ['name', 'value'],
|
|
13791
|
+
Directive: ['name', 'arguments'],
|
|
13792
|
+
NamedType: ['name'],
|
|
13793
|
+
ListType: ['type'],
|
|
13794
|
+
NonNullType: ['type'],
|
|
13795
|
+
SchemaDefinition: ['description', 'directives', 'operationTypes'],
|
|
13796
|
+
OperationTypeDefinition: ['type'],
|
|
13797
|
+
ScalarTypeDefinition: ['description', 'name', 'directives'],
|
|
13798
|
+
ObjectTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'],
|
|
13799
|
+
FieldDefinition: ['description', 'name', 'arguments', 'type', 'directives'],
|
|
13800
|
+
InputValueDefinition: ['description', 'name', 'type', 'defaultValue', 'directives'],
|
|
13801
|
+
InterfaceTypeDefinition: ['description', 'name', 'interfaces', 'directives', 'fields'],
|
|
13802
|
+
UnionTypeDefinition: ['description', 'name', 'directives', 'types'],
|
|
13803
|
+
EnumTypeDefinition: ['description', 'name', 'directives', 'values'],
|
|
13804
|
+
EnumValueDefinition: ['description', 'name', 'directives'],
|
|
13805
|
+
InputObjectTypeDefinition: ['description', 'name', 'directives', 'fields'],
|
|
13806
|
+
DirectiveDefinition: ['description', 'name', 'arguments', 'locations'],
|
|
13807
|
+
SchemaExtension: ['directives', 'operationTypes'],
|
|
13808
|
+
ScalarTypeExtension: ['name', 'directives'],
|
|
13809
|
+
ObjectTypeExtension: ['name', 'interfaces', 'directives', 'fields'],
|
|
13810
|
+
InterfaceTypeExtension: ['name', 'interfaces', 'directives', 'fields'],
|
|
13811
|
+
UnionTypeExtension: ['name', 'directives', 'types'],
|
|
13812
|
+
EnumTypeExtension: ['name', 'directives', 'values'],
|
|
13813
|
+
InputObjectTypeExtension: ['name', 'directives', 'fields']
|
|
13814
|
+
};
|
|
13815
|
+
var BREAK = Object.freeze({});
|
|
13816
|
+
/**
|
|
13817
|
+
* visit() will walk through an AST using a depth-first traversal, calling
|
|
13818
|
+
* the visitor's enter function at each node in the traversal, and calling the
|
|
13819
|
+
* leave function after visiting that node and all of its child nodes.
|
|
13820
|
+
*
|
|
13821
|
+
* By returning different values from the enter and leave functions, the
|
|
13822
|
+
* behavior of the visitor can be altered, including skipping over a sub-tree of
|
|
13823
|
+
* the AST (by returning false), editing the AST by returning a value or null
|
|
13824
|
+
* to remove the value, or to stop the whole traversal by returning BREAK.
|
|
13825
|
+
*
|
|
13826
|
+
* When using visit() to edit an AST, the original AST will not be modified, and
|
|
13827
|
+
* a new version of the AST with the changes applied will be returned from the
|
|
13828
|
+
* visit function.
|
|
13829
|
+
*
|
|
13830
|
+
* const editedAST = visit(ast, {
|
|
13831
|
+
* enter(node, key, parent, path, ancestors) {
|
|
13832
|
+
* // @return
|
|
13833
|
+
* // undefined: no action
|
|
13834
|
+
* // false: skip visiting this node
|
|
13835
|
+
* // visitor.BREAK: stop visiting altogether
|
|
13836
|
+
* // null: delete this node
|
|
13837
|
+
* // any value: replace this node with the returned value
|
|
13838
|
+
* },
|
|
13839
|
+
* leave(node, key, parent, path, ancestors) {
|
|
13840
|
+
* // @return
|
|
13841
|
+
* // undefined: no action
|
|
13842
|
+
* // false: no action
|
|
13843
|
+
* // visitor.BREAK: stop visiting altogether
|
|
13844
|
+
* // null: delete this node
|
|
13845
|
+
* // any value: replace this node with the returned value
|
|
13846
|
+
* }
|
|
13847
|
+
* });
|
|
13848
|
+
*
|
|
13849
|
+
* Alternatively to providing enter() and leave() functions, a visitor can
|
|
13850
|
+
* instead provide functions named the same as the kinds of AST nodes, or
|
|
13851
|
+
* enter/leave visitors at a named key, leading to four permutations of the
|
|
13852
|
+
* visitor API:
|
|
13853
|
+
*
|
|
13854
|
+
* 1) Named visitors triggered when entering a node of a specific kind.
|
|
13855
|
+
*
|
|
13856
|
+
* visit(ast, {
|
|
13857
|
+
* Kind(node) {
|
|
13858
|
+
* // enter the "Kind" node
|
|
13859
|
+
* }
|
|
13860
|
+
* })
|
|
13861
|
+
*
|
|
13862
|
+
* 2) Named visitors that trigger upon entering and leaving a node of
|
|
13863
|
+
* a specific kind.
|
|
13864
|
+
*
|
|
13865
|
+
* visit(ast, {
|
|
13866
|
+
* Kind: {
|
|
13867
|
+
* enter(node) {
|
|
13868
|
+
* // enter the "Kind" node
|
|
13869
|
+
* }
|
|
13870
|
+
* leave(node) {
|
|
13871
|
+
* // leave the "Kind" node
|
|
13872
|
+
* }
|
|
13873
|
+
* }
|
|
13874
|
+
* })
|
|
13875
|
+
*
|
|
13876
|
+
* 3) Generic visitors that trigger upon entering and leaving any node.
|
|
13877
|
+
*
|
|
13878
|
+
* visit(ast, {
|
|
13879
|
+
* enter(node) {
|
|
13880
|
+
* // enter any node
|
|
13881
|
+
* },
|
|
13882
|
+
* leave(node) {
|
|
13883
|
+
* // leave any node
|
|
13884
|
+
* }
|
|
13885
|
+
* })
|
|
13886
|
+
*
|
|
13887
|
+
* 4) Parallel visitors for entering and leaving nodes of a specific kind.
|
|
13888
|
+
*
|
|
13889
|
+
* visit(ast, {
|
|
13890
|
+
* enter: {
|
|
13891
|
+
* Kind(node) {
|
|
13892
|
+
* // enter the "Kind" node
|
|
13893
|
+
* }
|
|
13894
|
+
* },
|
|
13895
|
+
* leave: {
|
|
13896
|
+
* Kind(node) {
|
|
13897
|
+
* // leave the "Kind" node
|
|
13898
|
+
* }
|
|
13899
|
+
* }
|
|
13900
|
+
* })
|
|
13901
|
+
*/
|
|
13902
|
+
|
|
13903
|
+
function visit(root, visitor) {
|
|
13904
|
+
var visitorKeys = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : QueryDocumentKeys;
|
|
13905
|
+
|
|
13906
|
+
/* eslint-disable no-undef-init */
|
|
13907
|
+
var stack = undefined;
|
|
13908
|
+
var inArray = Array.isArray(root);
|
|
13909
|
+
var keys = [root];
|
|
13910
|
+
var index = -1;
|
|
13911
|
+
var edits = [];
|
|
13912
|
+
var node = undefined;
|
|
13913
|
+
var key = undefined;
|
|
13914
|
+
var parent = undefined;
|
|
13915
|
+
var path = [];
|
|
13916
|
+
var ancestors = [];
|
|
13917
|
+
var newRoot = root;
|
|
13918
|
+
/* eslint-enable no-undef-init */
|
|
13919
|
+
|
|
13920
|
+
do {
|
|
13921
|
+
index++;
|
|
13922
|
+
var isLeaving = index === keys.length;
|
|
13923
|
+
var isEdited = isLeaving && edits.length !== 0;
|
|
13924
|
+
|
|
13925
|
+
if (isLeaving) {
|
|
13926
|
+
key = ancestors.length === 0 ? undefined : path[path.length - 1];
|
|
13927
|
+
node = parent;
|
|
13928
|
+
parent = ancestors.pop();
|
|
13929
|
+
|
|
13930
|
+
if (isEdited) {
|
|
13931
|
+
if (inArray) {
|
|
13932
|
+
node = node.slice();
|
|
13933
|
+
} else {
|
|
13934
|
+
var clone = {};
|
|
13935
|
+
|
|
13936
|
+
for (var _i2 = 0, _Object$keys2 = Object.keys(node); _i2 < _Object$keys2.length; _i2++) {
|
|
13937
|
+
var k = _Object$keys2[_i2];
|
|
13938
|
+
clone[k] = node[k];
|
|
13939
|
+
}
|
|
13940
|
+
|
|
13941
|
+
node = clone;
|
|
13942
|
+
}
|
|
13943
|
+
|
|
13944
|
+
var editOffset = 0;
|
|
13945
|
+
|
|
13946
|
+
for (var ii = 0; ii < edits.length; ii++) {
|
|
13947
|
+
var editKey = edits[ii][0];
|
|
13948
|
+
var editValue = edits[ii][1];
|
|
13949
|
+
|
|
13950
|
+
if (inArray) {
|
|
13951
|
+
editKey -= editOffset;
|
|
13952
|
+
}
|
|
13953
|
+
|
|
13954
|
+
if (inArray && editValue === null) {
|
|
13955
|
+
node.splice(editKey, 1);
|
|
13956
|
+
editOffset++;
|
|
13957
|
+
} else {
|
|
13958
|
+
node[editKey] = editValue;
|
|
13959
|
+
}
|
|
13960
|
+
}
|
|
13961
|
+
}
|
|
13962
|
+
|
|
13963
|
+
index = stack.index;
|
|
13964
|
+
keys = stack.keys;
|
|
13965
|
+
edits = stack.edits;
|
|
13966
|
+
inArray = stack.inArray;
|
|
13967
|
+
stack = stack.prev;
|
|
13968
|
+
} else {
|
|
13969
|
+
key = parent ? inArray ? index : keys[index] : undefined;
|
|
13970
|
+
node = parent ? parent[key] : newRoot;
|
|
13971
|
+
|
|
13972
|
+
if (node === null || node === undefined) {
|
|
13973
|
+
continue;
|
|
13974
|
+
}
|
|
13975
|
+
|
|
13976
|
+
if (parent) {
|
|
13977
|
+
path.push(key);
|
|
13978
|
+
}
|
|
13979
|
+
}
|
|
13980
|
+
|
|
13981
|
+
var result = void 0;
|
|
13982
|
+
|
|
13983
|
+
if (!Array.isArray(node)) {
|
|
13984
|
+
if (!isNode(node)) {
|
|
13985
|
+
throw new Error("Invalid AST Node: ".concat(inspect(node), "."));
|
|
13986
|
+
}
|
|
13987
|
+
|
|
13988
|
+
var visitFn = getVisitFn(visitor, node.kind, isLeaving);
|
|
13989
|
+
|
|
13990
|
+
if (visitFn) {
|
|
13991
|
+
result = visitFn.call(visitor, node, key, parent, path, ancestors);
|
|
13992
|
+
|
|
13993
|
+
if (result === BREAK) {
|
|
13994
|
+
break;
|
|
13995
|
+
}
|
|
13996
|
+
|
|
13997
|
+
if (result === false) {
|
|
13998
|
+
if (!isLeaving) {
|
|
13999
|
+
path.pop();
|
|
14000
|
+
continue;
|
|
14001
|
+
}
|
|
14002
|
+
} else if (result !== undefined) {
|
|
14003
|
+
edits.push([key, result]);
|
|
14004
|
+
|
|
14005
|
+
if (!isLeaving) {
|
|
14006
|
+
if (isNode(result)) {
|
|
14007
|
+
node = result;
|
|
14008
|
+
} else {
|
|
14009
|
+
path.pop();
|
|
14010
|
+
continue;
|
|
14011
|
+
}
|
|
14012
|
+
}
|
|
14013
|
+
}
|
|
14014
|
+
}
|
|
14015
|
+
}
|
|
14016
|
+
|
|
14017
|
+
if (result === undefined && isEdited) {
|
|
14018
|
+
edits.push([key, node]);
|
|
14019
|
+
}
|
|
14020
|
+
|
|
14021
|
+
if (isLeaving) {
|
|
14022
|
+
path.pop();
|
|
14023
|
+
} else {
|
|
14024
|
+
var _visitorKeys$node$kin;
|
|
14025
|
+
|
|
14026
|
+
stack = {
|
|
14027
|
+
inArray: inArray,
|
|
14028
|
+
index: index,
|
|
14029
|
+
keys: keys,
|
|
14030
|
+
edits: edits,
|
|
14031
|
+
prev: stack
|
|
14032
|
+
};
|
|
14033
|
+
inArray = Array.isArray(node);
|
|
14034
|
+
keys = inArray ? node : (_visitorKeys$node$kin = visitorKeys[node.kind]) !== null && _visitorKeys$node$kin !== void 0 ? _visitorKeys$node$kin : [];
|
|
14035
|
+
index = -1;
|
|
14036
|
+
edits = [];
|
|
14037
|
+
|
|
14038
|
+
if (parent) {
|
|
14039
|
+
ancestors.push(parent);
|
|
14040
|
+
}
|
|
14041
|
+
|
|
14042
|
+
parent = node;
|
|
14043
|
+
}
|
|
14044
|
+
} while (stack !== undefined);
|
|
14045
|
+
|
|
14046
|
+
if (edits.length !== 0) {
|
|
14047
|
+
newRoot = edits[edits.length - 1][1];
|
|
14048
|
+
}
|
|
14049
|
+
|
|
14050
|
+
return newRoot;
|
|
14051
|
+
}
|
|
14052
|
+
/**
|
|
14053
|
+
* Given a visitor instance, if it is leaving or not, and a node kind, return
|
|
14054
|
+
* the function the visitor runtime should call.
|
|
14055
|
+
*/
|
|
14056
|
+
|
|
14057
|
+
function getVisitFn(visitor, kind, isLeaving) {
|
|
14058
|
+
var kindVisitor = visitor[kind];
|
|
14059
|
+
|
|
14060
|
+
if (kindVisitor) {
|
|
14061
|
+
if (!isLeaving && typeof kindVisitor === 'function') {
|
|
14062
|
+
// { Kind() {} }
|
|
14063
|
+
return kindVisitor;
|
|
14064
|
+
}
|
|
14065
|
+
|
|
14066
|
+
var kindSpecificVisitor = isLeaving ? kindVisitor.leave : kindVisitor.enter;
|
|
14067
|
+
|
|
14068
|
+
if (typeof kindSpecificVisitor === 'function') {
|
|
14069
|
+
// { Kind: { enter() {}, leave() {} } }
|
|
14070
|
+
return kindSpecificVisitor;
|
|
14071
|
+
}
|
|
14072
|
+
} else {
|
|
14073
|
+
var specificVisitor = isLeaving ? visitor.leave : visitor.enter;
|
|
14074
|
+
|
|
14075
|
+
if (specificVisitor) {
|
|
14076
|
+
if (typeof specificVisitor === 'function') {
|
|
14077
|
+
// { enter() {}, leave() {} }
|
|
14078
|
+
return specificVisitor;
|
|
14079
|
+
}
|
|
14080
|
+
|
|
14081
|
+
var specificKindVisitor = specificVisitor[kind];
|
|
14082
|
+
|
|
14083
|
+
if (typeof specificKindVisitor === 'function') {
|
|
14084
|
+
// { enter: { Kind() {} }, leave: { Kind() {} } }
|
|
14085
|
+
return specificKindVisitor;
|
|
14086
|
+
}
|
|
14087
|
+
}
|
|
14088
|
+
}
|
|
14089
|
+
}
|
|
14090
|
+
|
|
14091
|
+
/**
|
|
14092
|
+
* Converts an AST into a string, using one set of reasonable
|
|
14093
|
+
* formatting rules.
|
|
14094
|
+
*/
|
|
14095
|
+
|
|
14096
|
+
function print(ast) {
|
|
14097
|
+
return visit(ast, {
|
|
14098
|
+
leave: printDocASTReducer
|
|
14099
|
+
});
|
|
14100
|
+
}
|
|
14101
|
+
var MAX_LINE_LENGTH = 80; // TODO: provide better type coverage in future
|
|
14102
|
+
|
|
14103
|
+
var printDocASTReducer = {
|
|
14104
|
+
Name: function Name(node) {
|
|
14105
|
+
return node.value;
|
|
14106
|
+
},
|
|
14107
|
+
Variable: function Variable(node) {
|
|
14108
|
+
return '$' + node.name;
|
|
14109
|
+
},
|
|
14110
|
+
// Document
|
|
14111
|
+
Document: function Document(node) {
|
|
14112
|
+
return join(node.definitions, '\n\n') + '\n';
|
|
14113
|
+
},
|
|
14114
|
+
OperationDefinition: function OperationDefinition(node) {
|
|
14115
|
+
var op = node.operation;
|
|
14116
|
+
var name = node.name;
|
|
14117
|
+
var varDefs = wrap('(', join(node.variableDefinitions, ', '), ')');
|
|
14118
|
+
var directives = join(node.directives, ' ');
|
|
14119
|
+
var selectionSet = node.selectionSet; // Anonymous queries with no directives or variable definitions can use
|
|
14120
|
+
// the query short form.
|
|
14121
|
+
|
|
14122
|
+
return !name && !directives && !varDefs && op === 'query' ? selectionSet : join([op, join([name, varDefs]), directives, selectionSet], ' ');
|
|
14123
|
+
},
|
|
14124
|
+
VariableDefinition: function VariableDefinition(_ref) {
|
|
14125
|
+
var variable = _ref.variable,
|
|
14126
|
+
type = _ref.type,
|
|
14127
|
+
defaultValue = _ref.defaultValue,
|
|
14128
|
+
directives = _ref.directives;
|
|
14129
|
+
return variable + ': ' + type + wrap(' = ', defaultValue) + wrap(' ', join(directives, ' '));
|
|
14130
|
+
},
|
|
14131
|
+
SelectionSet: function SelectionSet(_ref2) {
|
|
14132
|
+
var selections = _ref2.selections;
|
|
14133
|
+
return block(selections);
|
|
14134
|
+
},
|
|
14135
|
+
Field: function Field(_ref3) {
|
|
14136
|
+
var alias = _ref3.alias,
|
|
14137
|
+
name = _ref3.name,
|
|
14138
|
+
args = _ref3.arguments,
|
|
14139
|
+
directives = _ref3.directives,
|
|
14140
|
+
selectionSet = _ref3.selectionSet;
|
|
14141
|
+
var prefix = wrap('', alias, ': ') + name;
|
|
14142
|
+
var argsLine = prefix + wrap('(', join(args, ', '), ')');
|
|
14143
|
+
|
|
14144
|
+
if (argsLine.length > MAX_LINE_LENGTH) {
|
|
14145
|
+
argsLine = prefix + wrap('(\n', indent(join(args, '\n')), '\n)');
|
|
14146
|
+
}
|
|
14147
|
+
|
|
14148
|
+
return join([argsLine, join(directives, ' '), selectionSet], ' ');
|
|
14149
|
+
},
|
|
14150
|
+
Argument: function Argument(_ref4) {
|
|
14151
|
+
var name = _ref4.name,
|
|
14152
|
+
value = _ref4.value;
|
|
14153
|
+
return name + ': ' + value;
|
|
14154
|
+
},
|
|
14155
|
+
// Fragments
|
|
14156
|
+
FragmentSpread: function FragmentSpread(_ref5) {
|
|
14157
|
+
var name = _ref5.name,
|
|
14158
|
+
directives = _ref5.directives;
|
|
14159
|
+
return '...' + name + wrap(' ', join(directives, ' '));
|
|
14160
|
+
},
|
|
14161
|
+
InlineFragment: function InlineFragment(_ref6) {
|
|
14162
|
+
var typeCondition = _ref6.typeCondition,
|
|
14163
|
+
directives = _ref6.directives,
|
|
14164
|
+
selectionSet = _ref6.selectionSet;
|
|
14165
|
+
return join(['...', wrap('on ', typeCondition), join(directives, ' '), selectionSet], ' ');
|
|
14166
|
+
},
|
|
14167
|
+
FragmentDefinition: function FragmentDefinition(_ref7) {
|
|
14168
|
+
var name = _ref7.name,
|
|
14169
|
+
typeCondition = _ref7.typeCondition,
|
|
14170
|
+
variableDefinitions = _ref7.variableDefinitions,
|
|
14171
|
+
directives = _ref7.directives,
|
|
14172
|
+
selectionSet = _ref7.selectionSet;
|
|
14173
|
+
return (// Note: fragment variable definitions are experimental and may be changed
|
|
14174
|
+
// or removed in the future.
|
|
14175
|
+
"fragment ".concat(name).concat(wrap('(', join(variableDefinitions, ', '), ')'), " ") + "on ".concat(typeCondition, " ").concat(wrap('', join(directives, ' '), ' ')) + selectionSet
|
|
14176
|
+
);
|
|
14177
|
+
},
|
|
14178
|
+
// Value
|
|
14179
|
+
IntValue: function IntValue(_ref8) {
|
|
14180
|
+
var value = _ref8.value;
|
|
14181
|
+
return value;
|
|
14182
|
+
},
|
|
14183
|
+
FloatValue: function FloatValue(_ref9) {
|
|
14184
|
+
var value = _ref9.value;
|
|
14185
|
+
return value;
|
|
14186
|
+
},
|
|
14187
|
+
StringValue: function StringValue(_ref10, key) {
|
|
14188
|
+
var value = _ref10.value,
|
|
14189
|
+
isBlockString = _ref10.block;
|
|
14190
|
+
return isBlockString ? printBlockString(value, key === 'description' ? '' : ' ') : JSON.stringify(value);
|
|
14191
|
+
},
|
|
14192
|
+
BooleanValue: function BooleanValue(_ref11) {
|
|
14193
|
+
var value = _ref11.value;
|
|
14194
|
+
return value ? 'true' : 'false';
|
|
14195
|
+
},
|
|
14196
|
+
NullValue: function NullValue() {
|
|
14197
|
+
return 'null';
|
|
14198
|
+
},
|
|
14199
|
+
EnumValue: function EnumValue(_ref12) {
|
|
14200
|
+
var value = _ref12.value;
|
|
14201
|
+
return value;
|
|
14202
|
+
},
|
|
14203
|
+
ListValue: function ListValue(_ref13) {
|
|
14204
|
+
var values = _ref13.values;
|
|
14205
|
+
return '[' + join(values, ', ') + ']';
|
|
14206
|
+
},
|
|
14207
|
+
ObjectValue: function ObjectValue(_ref14) {
|
|
14208
|
+
var fields = _ref14.fields;
|
|
14209
|
+
return '{' + join(fields, ', ') + '}';
|
|
14210
|
+
},
|
|
14211
|
+
ObjectField: function ObjectField(_ref15) {
|
|
14212
|
+
var name = _ref15.name,
|
|
14213
|
+
value = _ref15.value;
|
|
14214
|
+
return name + ': ' + value;
|
|
14215
|
+
},
|
|
14216
|
+
// Directive
|
|
14217
|
+
Directive: function Directive(_ref16) {
|
|
14218
|
+
var name = _ref16.name,
|
|
14219
|
+
args = _ref16.arguments;
|
|
14220
|
+
return '@' + name + wrap('(', join(args, ', '), ')');
|
|
14221
|
+
},
|
|
14222
|
+
// Type
|
|
14223
|
+
NamedType: function NamedType(_ref17) {
|
|
14224
|
+
var name = _ref17.name;
|
|
14225
|
+
return name;
|
|
14226
|
+
},
|
|
14227
|
+
ListType: function ListType(_ref18) {
|
|
14228
|
+
var type = _ref18.type;
|
|
14229
|
+
return '[' + type + ']';
|
|
14230
|
+
},
|
|
14231
|
+
NonNullType: function NonNullType(_ref19) {
|
|
14232
|
+
var type = _ref19.type;
|
|
14233
|
+
return type + '!';
|
|
14234
|
+
},
|
|
14235
|
+
// Type System Definitions
|
|
14236
|
+
SchemaDefinition: addDescription(function (_ref20) {
|
|
14237
|
+
var directives = _ref20.directives,
|
|
14238
|
+
operationTypes = _ref20.operationTypes;
|
|
14239
|
+
return join(['schema', join(directives, ' '), block(operationTypes)], ' ');
|
|
14240
|
+
}),
|
|
14241
|
+
OperationTypeDefinition: function OperationTypeDefinition(_ref21) {
|
|
14242
|
+
var operation = _ref21.operation,
|
|
14243
|
+
type = _ref21.type;
|
|
14244
|
+
return operation + ': ' + type;
|
|
14245
|
+
},
|
|
14246
|
+
ScalarTypeDefinition: addDescription(function (_ref22) {
|
|
14247
|
+
var name = _ref22.name,
|
|
14248
|
+
directives = _ref22.directives;
|
|
14249
|
+
return join(['scalar', name, join(directives, ' ')], ' ');
|
|
14250
|
+
}),
|
|
14251
|
+
ObjectTypeDefinition: addDescription(function (_ref23) {
|
|
14252
|
+
var name = _ref23.name,
|
|
14253
|
+
interfaces = _ref23.interfaces,
|
|
14254
|
+
directives = _ref23.directives,
|
|
14255
|
+
fields = _ref23.fields;
|
|
14256
|
+
return join(['type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');
|
|
14257
|
+
}),
|
|
14258
|
+
FieldDefinition: addDescription(function (_ref24) {
|
|
14259
|
+
var name = _ref24.name,
|
|
14260
|
+
args = _ref24.arguments,
|
|
14261
|
+
type = _ref24.type,
|
|
14262
|
+
directives = _ref24.directives;
|
|
14263
|
+
return name + (hasMultilineItems(args) ? wrap('(\n', indent(join(args, '\n')), '\n)') : wrap('(', join(args, ', '), ')')) + ': ' + type + wrap(' ', join(directives, ' '));
|
|
14264
|
+
}),
|
|
14265
|
+
InputValueDefinition: addDescription(function (_ref25) {
|
|
14266
|
+
var name = _ref25.name,
|
|
14267
|
+
type = _ref25.type,
|
|
14268
|
+
defaultValue = _ref25.defaultValue,
|
|
14269
|
+
directives = _ref25.directives;
|
|
14270
|
+
return join([name + ': ' + type, wrap('= ', defaultValue), join(directives, ' ')], ' ');
|
|
14271
|
+
}),
|
|
14272
|
+
InterfaceTypeDefinition: addDescription(function (_ref26) {
|
|
14273
|
+
var name = _ref26.name,
|
|
14274
|
+
interfaces = _ref26.interfaces,
|
|
14275
|
+
directives = _ref26.directives,
|
|
14276
|
+
fields = _ref26.fields;
|
|
14277
|
+
return join(['interface', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');
|
|
14278
|
+
}),
|
|
14279
|
+
UnionTypeDefinition: addDescription(function (_ref27) {
|
|
14280
|
+
var name = _ref27.name,
|
|
14281
|
+
directives = _ref27.directives,
|
|
14282
|
+
types = _ref27.types;
|
|
14283
|
+
return join(['union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ');
|
|
14284
|
+
}),
|
|
14285
|
+
EnumTypeDefinition: addDescription(function (_ref28) {
|
|
14286
|
+
var name = _ref28.name,
|
|
14287
|
+
directives = _ref28.directives,
|
|
14288
|
+
values = _ref28.values;
|
|
14289
|
+
return join(['enum', name, join(directives, ' '), block(values)], ' ');
|
|
14290
|
+
}),
|
|
14291
|
+
EnumValueDefinition: addDescription(function (_ref29) {
|
|
14292
|
+
var name = _ref29.name,
|
|
14293
|
+
directives = _ref29.directives;
|
|
14294
|
+
return join([name, join(directives, ' ')], ' ');
|
|
14295
|
+
}),
|
|
14296
|
+
InputObjectTypeDefinition: addDescription(function (_ref30) {
|
|
14297
|
+
var name = _ref30.name,
|
|
14298
|
+
directives = _ref30.directives,
|
|
14299
|
+
fields = _ref30.fields;
|
|
14300
|
+
return join(['input', name, join(directives, ' '), block(fields)], ' ');
|
|
14301
|
+
}),
|
|
14302
|
+
DirectiveDefinition: addDescription(function (_ref31) {
|
|
14303
|
+
var name = _ref31.name,
|
|
14304
|
+
args = _ref31.arguments,
|
|
14305
|
+
repeatable = _ref31.repeatable,
|
|
14306
|
+
locations = _ref31.locations;
|
|
14307
|
+
return 'directive @' + name + (hasMultilineItems(args) ? wrap('(\n', indent(join(args, '\n')), '\n)') : wrap('(', join(args, ', '), ')')) + (repeatable ? ' repeatable' : '') + ' on ' + join(locations, ' | ');
|
|
14308
|
+
}),
|
|
14309
|
+
SchemaExtension: function SchemaExtension(_ref32) {
|
|
14310
|
+
var directives = _ref32.directives,
|
|
14311
|
+
operationTypes = _ref32.operationTypes;
|
|
14312
|
+
return join(['extend schema', join(directives, ' '), block(operationTypes)], ' ');
|
|
14313
|
+
},
|
|
14314
|
+
ScalarTypeExtension: function ScalarTypeExtension(_ref33) {
|
|
14315
|
+
var name = _ref33.name,
|
|
14316
|
+
directives = _ref33.directives;
|
|
14317
|
+
return join(['extend scalar', name, join(directives, ' ')], ' ');
|
|
14318
|
+
},
|
|
14319
|
+
ObjectTypeExtension: function ObjectTypeExtension(_ref34) {
|
|
14320
|
+
var name = _ref34.name,
|
|
14321
|
+
interfaces = _ref34.interfaces,
|
|
14322
|
+
directives = _ref34.directives,
|
|
14323
|
+
fields = _ref34.fields;
|
|
14324
|
+
return join(['extend type', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');
|
|
14325
|
+
},
|
|
14326
|
+
InterfaceTypeExtension: function InterfaceTypeExtension(_ref35) {
|
|
14327
|
+
var name = _ref35.name,
|
|
14328
|
+
interfaces = _ref35.interfaces,
|
|
14329
|
+
directives = _ref35.directives,
|
|
14330
|
+
fields = _ref35.fields;
|
|
14331
|
+
return join(['extend interface', name, wrap('implements ', join(interfaces, ' & ')), join(directives, ' '), block(fields)], ' ');
|
|
14332
|
+
},
|
|
14333
|
+
UnionTypeExtension: function UnionTypeExtension(_ref36) {
|
|
14334
|
+
var name = _ref36.name,
|
|
14335
|
+
directives = _ref36.directives,
|
|
14336
|
+
types = _ref36.types;
|
|
14337
|
+
return join(['extend union', name, join(directives, ' '), types && types.length !== 0 ? '= ' + join(types, ' | ') : ''], ' ');
|
|
14338
|
+
},
|
|
14339
|
+
EnumTypeExtension: function EnumTypeExtension(_ref37) {
|
|
14340
|
+
var name = _ref37.name,
|
|
14341
|
+
directives = _ref37.directives,
|
|
14342
|
+
values = _ref37.values;
|
|
14343
|
+
return join(['extend enum', name, join(directives, ' '), block(values)], ' ');
|
|
14344
|
+
},
|
|
14345
|
+
InputObjectTypeExtension: function InputObjectTypeExtension(_ref38) {
|
|
14346
|
+
var name = _ref38.name,
|
|
14347
|
+
directives = _ref38.directives,
|
|
14348
|
+
fields = _ref38.fields;
|
|
14349
|
+
return join(['extend input', name, join(directives, ' '), block(fields)], ' ');
|
|
14350
|
+
}
|
|
14351
|
+
};
|
|
14352
|
+
|
|
14353
|
+
function addDescription(cb) {
|
|
14354
|
+
return function (node) {
|
|
14355
|
+
return join([node.description, cb(node)], '\n');
|
|
14356
|
+
};
|
|
14357
|
+
}
|
|
14358
|
+
/**
|
|
14359
|
+
* Given maybeArray, print an empty string if it is null or empty, otherwise
|
|
14360
|
+
* print all items together separated by separator if provided
|
|
14361
|
+
*/
|
|
14362
|
+
|
|
14363
|
+
|
|
14364
|
+
function join(maybeArray) {
|
|
14365
|
+
var _maybeArray$filter$jo;
|
|
14366
|
+
|
|
14367
|
+
var separator = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : '';
|
|
14368
|
+
return (_maybeArray$filter$jo = maybeArray === null || maybeArray === void 0 ? void 0 : maybeArray.filter(function (x) {
|
|
14369
|
+
return x;
|
|
14370
|
+
}).join(separator)) !== null && _maybeArray$filter$jo !== void 0 ? _maybeArray$filter$jo : '';
|
|
14371
|
+
}
|
|
14372
|
+
/**
|
|
14373
|
+
* Given array, print each item on its own line, wrapped in an
|
|
14374
|
+
* indented "{ }" block.
|
|
14375
|
+
*/
|
|
14376
|
+
|
|
14377
|
+
|
|
14378
|
+
function block(array) {
|
|
14379
|
+
return wrap('{\n', indent(join(array, '\n')), '\n}');
|
|
14380
|
+
}
|
|
14381
|
+
/**
|
|
14382
|
+
* If maybeString is not null or empty, then wrap with start and end, otherwise print an empty string.
|
|
14383
|
+
*/
|
|
14384
|
+
|
|
14385
|
+
|
|
14386
|
+
function wrap(start, maybeString) {
|
|
14387
|
+
var end = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : '';
|
|
14388
|
+
return maybeString != null && maybeString !== '' ? start + maybeString + end : '';
|
|
14389
|
+
}
|
|
14390
|
+
|
|
14391
|
+
function indent(str) {
|
|
14392
|
+
return wrap(' ', str.replace(/\n/g, '\n '));
|
|
14393
|
+
}
|
|
14394
|
+
|
|
14395
|
+
function isMultiline(str) {
|
|
14396
|
+
return str.indexOf('\n') !== -1;
|
|
14397
|
+
}
|
|
14398
|
+
|
|
14399
|
+
function hasMultilineItems(maybeArray) {
|
|
14400
|
+
return maybeArray != null && maybeArray.some(isMultiline);
|
|
14401
|
+
}
|
|
14402
|
+
|
|
14403
|
+
var printer = {
|
|
14404
|
+
__proto__: null,
|
|
14405
|
+
print: print
|
|
14406
|
+
};
|
|
14407
|
+
|
|
13678
14408
|
var docCache = new Map();
|
|
13679
14409
|
var fragmentSourceMap = new Map();
|
|
13680
14410
|
var printFragmentWarnings = true;
|
|
@@ -16011,6 +16741,1338 @@ var getGqlWsClient = function getGqlWsClient(url, token, lang) {
|
|
|
16011
16741
|
return new GraphqlWsClient(url, token, lang);
|
|
16012
16742
|
};
|
|
16013
16743
|
|
|
16744
|
+
var browserPonyfill = createCommonjsModule(function (module, exports) {
|
|
16745
|
+
var global = typeof self !== 'undefined' ? self : commonjsGlobal$1;
|
|
16746
|
+
var __self__ = (function () {
|
|
16747
|
+
function F() {
|
|
16748
|
+
this.fetch = false;
|
|
16749
|
+
this.DOMException = global.DOMException;
|
|
16750
|
+
}
|
|
16751
|
+
F.prototype = global;
|
|
16752
|
+
return new F();
|
|
16753
|
+
})();
|
|
16754
|
+
(function(self) {
|
|
16755
|
+
|
|
16756
|
+
((function (exports) {
|
|
16757
|
+
|
|
16758
|
+
var support = {
|
|
16759
|
+
searchParams: 'URLSearchParams' in self,
|
|
16760
|
+
iterable: 'Symbol' in self && 'iterator' in Symbol,
|
|
16761
|
+
blob:
|
|
16762
|
+
'FileReader' in self &&
|
|
16763
|
+
'Blob' in self &&
|
|
16764
|
+
(function() {
|
|
16765
|
+
try {
|
|
16766
|
+
new Blob();
|
|
16767
|
+
return true
|
|
16768
|
+
} catch (e) {
|
|
16769
|
+
return false
|
|
16770
|
+
}
|
|
16771
|
+
})(),
|
|
16772
|
+
formData: 'FormData' in self,
|
|
16773
|
+
arrayBuffer: 'ArrayBuffer' in self
|
|
16774
|
+
};
|
|
16775
|
+
|
|
16776
|
+
function isDataView(obj) {
|
|
16777
|
+
return obj && DataView.prototype.isPrototypeOf(obj)
|
|
16778
|
+
}
|
|
16779
|
+
|
|
16780
|
+
if (support.arrayBuffer) {
|
|
16781
|
+
var viewClasses = [
|
|
16782
|
+
'[object Int8Array]',
|
|
16783
|
+
'[object Uint8Array]',
|
|
16784
|
+
'[object Uint8ClampedArray]',
|
|
16785
|
+
'[object Int16Array]',
|
|
16786
|
+
'[object Uint16Array]',
|
|
16787
|
+
'[object Int32Array]',
|
|
16788
|
+
'[object Uint32Array]',
|
|
16789
|
+
'[object Float32Array]',
|
|
16790
|
+
'[object Float64Array]'
|
|
16791
|
+
];
|
|
16792
|
+
|
|
16793
|
+
var isArrayBufferView =
|
|
16794
|
+
ArrayBuffer.isView ||
|
|
16795
|
+
function(obj) {
|
|
16796
|
+
return obj && viewClasses.indexOf(Object.prototype.toString.call(obj)) > -1
|
|
16797
|
+
};
|
|
16798
|
+
}
|
|
16799
|
+
|
|
16800
|
+
function normalizeName(name) {
|
|
16801
|
+
if (typeof name !== 'string') {
|
|
16802
|
+
name = String(name);
|
|
16803
|
+
}
|
|
16804
|
+
if (/[^a-z0-9\-#$%&'*+.^_`|~]/i.test(name)) {
|
|
16805
|
+
throw new TypeError('Invalid character in header field name')
|
|
16806
|
+
}
|
|
16807
|
+
return name.toLowerCase()
|
|
16808
|
+
}
|
|
16809
|
+
|
|
16810
|
+
function normalizeValue(value) {
|
|
16811
|
+
if (typeof value !== 'string') {
|
|
16812
|
+
value = String(value);
|
|
16813
|
+
}
|
|
16814
|
+
return value
|
|
16815
|
+
}
|
|
16816
|
+
|
|
16817
|
+
// Build a destructive iterator for the value list
|
|
16818
|
+
function iteratorFor(items) {
|
|
16819
|
+
var iterator = {
|
|
16820
|
+
next: function() {
|
|
16821
|
+
var value = items.shift();
|
|
16822
|
+
return {done: value === undefined, value: value}
|
|
16823
|
+
}
|
|
16824
|
+
};
|
|
16825
|
+
|
|
16826
|
+
if (support.iterable) {
|
|
16827
|
+
iterator[Symbol.iterator] = function() {
|
|
16828
|
+
return iterator
|
|
16829
|
+
};
|
|
16830
|
+
}
|
|
16831
|
+
|
|
16832
|
+
return iterator
|
|
16833
|
+
}
|
|
16834
|
+
|
|
16835
|
+
function Headers(headers) {
|
|
16836
|
+
this.map = {};
|
|
16837
|
+
|
|
16838
|
+
if (headers instanceof Headers) {
|
|
16839
|
+
headers.forEach(function(value, name) {
|
|
16840
|
+
this.append(name, value);
|
|
16841
|
+
}, this);
|
|
16842
|
+
} else if (Array.isArray(headers)) {
|
|
16843
|
+
headers.forEach(function(header) {
|
|
16844
|
+
this.append(header[0], header[1]);
|
|
16845
|
+
}, this);
|
|
16846
|
+
} else if (headers) {
|
|
16847
|
+
Object.getOwnPropertyNames(headers).forEach(function(name) {
|
|
16848
|
+
this.append(name, headers[name]);
|
|
16849
|
+
}, this);
|
|
16850
|
+
}
|
|
16851
|
+
}
|
|
16852
|
+
|
|
16853
|
+
Headers.prototype.append = function(name, value) {
|
|
16854
|
+
name = normalizeName(name);
|
|
16855
|
+
value = normalizeValue(value);
|
|
16856
|
+
var oldValue = this.map[name];
|
|
16857
|
+
this.map[name] = oldValue ? oldValue + ', ' + value : value;
|
|
16858
|
+
};
|
|
16859
|
+
|
|
16860
|
+
Headers.prototype['delete'] = function(name) {
|
|
16861
|
+
delete this.map[normalizeName(name)];
|
|
16862
|
+
};
|
|
16863
|
+
|
|
16864
|
+
Headers.prototype.get = function(name) {
|
|
16865
|
+
name = normalizeName(name);
|
|
16866
|
+
return this.has(name) ? this.map[name] : null
|
|
16867
|
+
};
|
|
16868
|
+
|
|
16869
|
+
Headers.prototype.has = function(name) {
|
|
16870
|
+
return this.map.hasOwnProperty(normalizeName(name))
|
|
16871
|
+
};
|
|
16872
|
+
|
|
16873
|
+
Headers.prototype.set = function(name, value) {
|
|
16874
|
+
this.map[normalizeName(name)] = normalizeValue(value);
|
|
16875
|
+
};
|
|
16876
|
+
|
|
16877
|
+
Headers.prototype.forEach = function(callback, thisArg) {
|
|
16878
|
+
for (var name in this.map) {
|
|
16879
|
+
if (this.map.hasOwnProperty(name)) {
|
|
16880
|
+
callback.call(thisArg, this.map[name], name, this);
|
|
16881
|
+
}
|
|
16882
|
+
}
|
|
16883
|
+
};
|
|
16884
|
+
|
|
16885
|
+
Headers.prototype.keys = function() {
|
|
16886
|
+
var items = [];
|
|
16887
|
+
this.forEach(function(value, name) {
|
|
16888
|
+
items.push(name);
|
|
16889
|
+
});
|
|
16890
|
+
return iteratorFor(items)
|
|
16891
|
+
};
|
|
16892
|
+
|
|
16893
|
+
Headers.prototype.values = function() {
|
|
16894
|
+
var items = [];
|
|
16895
|
+
this.forEach(function(value) {
|
|
16896
|
+
items.push(value);
|
|
16897
|
+
});
|
|
16898
|
+
return iteratorFor(items)
|
|
16899
|
+
};
|
|
16900
|
+
|
|
16901
|
+
Headers.prototype.entries = function() {
|
|
16902
|
+
var items = [];
|
|
16903
|
+
this.forEach(function(value, name) {
|
|
16904
|
+
items.push([name, value]);
|
|
16905
|
+
});
|
|
16906
|
+
return iteratorFor(items)
|
|
16907
|
+
};
|
|
16908
|
+
|
|
16909
|
+
if (support.iterable) {
|
|
16910
|
+
Headers.prototype[Symbol.iterator] = Headers.prototype.entries;
|
|
16911
|
+
}
|
|
16912
|
+
|
|
16913
|
+
function consumed(body) {
|
|
16914
|
+
if (body.bodyUsed) {
|
|
16915
|
+
return Promise.reject(new TypeError('Already read'))
|
|
16916
|
+
}
|
|
16917
|
+
body.bodyUsed = true;
|
|
16918
|
+
}
|
|
16919
|
+
|
|
16920
|
+
function fileReaderReady(reader) {
|
|
16921
|
+
return new Promise(function(resolve, reject) {
|
|
16922
|
+
reader.onload = function() {
|
|
16923
|
+
resolve(reader.result);
|
|
16924
|
+
};
|
|
16925
|
+
reader.onerror = function() {
|
|
16926
|
+
reject(reader.error);
|
|
16927
|
+
};
|
|
16928
|
+
})
|
|
16929
|
+
}
|
|
16930
|
+
|
|
16931
|
+
function readBlobAsArrayBuffer(blob) {
|
|
16932
|
+
var reader = new FileReader();
|
|
16933
|
+
var promise = fileReaderReady(reader);
|
|
16934
|
+
reader.readAsArrayBuffer(blob);
|
|
16935
|
+
return promise
|
|
16936
|
+
}
|
|
16937
|
+
|
|
16938
|
+
function readBlobAsText(blob) {
|
|
16939
|
+
var reader = new FileReader();
|
|
16940
|
+
var promise = fileReaderReady(reader);
|
|
16941
|
+
reader.readAsText(blob);
|
|
16942
|
+
return promise
|
|
16943
|
+
}
|
|
16944
|
+
|
|
16945
|
+
function readArrayBufferAsText(buf) {
|
|
16946
|
+
var view = new Uint8Array(buf);
|
|
16947
|
+
var chars = new Array(view.length);
|
|
16948
|
+
|
|
16949
|
+
for (var i = 0; i < view.length; i++) {
|
|
16950
|
+
chars[i] = String.fromCharCode(view[i]);
|
|
16951
|
+
}
|
|
16952
|
+
return chars.join('')
|
|
16953
|
+
}
|
|
16954
|
+
|
|
16955
|
+
function bufferClone(buf) {
|
|
16956
|
+
if (buf.slice) {
|
|
16957
|
+
return buf.slice(0)
|
|
16958
|
+
} else {
|
|
16959
|
+
var view = new Uint8Array(buf.byteLength);
|
|
16960
|
+
view.set(new Uint8Array(buf));
|
|
16961
|
+
return view.buffer
|
|
16962
|
+
}
|
|
16963
|
+
}
|
|
16964
|
+
|
|
16965
|
+
function Body() {
|
|
16966
|
+
this.bodyUsed = false;
|
|
16967
|
+
|
|
16968
|
+
this._initBody = function(body) {
|
|
16969
|
+
this._bodyInit = body;
|
|
16970
|
+
if (!body) {
|
|
16971
|
+
this._bodyText = '';
|
|
16972
|
+
} else if (typeof body === 'string') {
|
|
16973
|
+
this._bodyText = body;
|
|
16974
|
+
} else if (support.blob && Blob.prototype.isPrototypeOf(body)) {
|
|
16975
|
+
this._bodyBlob = body;
|
|
16976
|
+
} else if (support.formData && FormData.prototype.isPrototypeOf(body)) {
|
|
16977
|
+
this._bodyFormData = body;
|
|
16978
|
+
} else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
|
|
16979
|
+
this._bodyText = body.toString();
|
|
16980
|
+
} else if (support.arrayBuffer && support.blob && isDataView(body)) {
|
|
16981
|
+
this._bodyArrayBuffer = bufferClone(body.buffer);
|
|
16982
|
+
// IE 10-11 can't handle a DataView body.
|
|
16983
|
+
this._bodyInit = new Blob([this._bodyArrayBuffer]);
|
|
16984
|
+
} else if (support.arrayBuffer && (ArrayBuffer.prototype.isPrototypeOf(body) || isArrayBufferView(body))) {
|
|
16985
|
+
this._bodyArrayBuffer = bufferClone(body);
|
|
16986
|
+
} else {
|
|
16987
|
+
this._bodyText = body = Object.prototype.toString.call(body);
|
|
16988
|
+
}
|
|
16989
|
+
|
|
16990
|
+
if (!this.headers.get('content-type')) {
|
|
16991
|
+
if (typeof body === 'string') {
|
|
16992
|
+
this.headers.set('content-type', 'text/plain;charset=UTF-8');
|
|
16993
|
+
} else if (this._bodyBlob && this._bodyBlob.type) {
|
|
16994
|
+
this.headers.set('content-type', this._bodyBlob.type);
|
|
16995
|
+
} else if (support.searchParams && URLSearchParams.prototype.isPrototypeOf(body)) {
|
|
16996
|
+
this.headers.set('content-type', 'application/x-www-form-urlencoded;charset=UTF-8');
|
|
16997
|
+
}
|
|
16998
|
+
}
|
|
16999
|
+
};
|
|
17000
|
+
|
|
17001
|
+
if (support.blob) {
|
|
17002
|
+
this.blob = function() {
|
|
17003
|
+
var rejected = consumed(this);
|
|
17004
|
+
if (rejected) {
|
|
17005
|
+
return rejected
|
|
17006
|
+
}
|
|
17007
|
+
|
|
17008
|
+
if (this._bodyBlob) {
|
|
17009
|
+
return Promise.resolve(this._bodyBlob)
|
|
17010
|
+
} else if (this._bodyArrayBuffer) {
|
|
17011
|
+
return Promise.resolve(new Blob([this._bodyArrayBuffer]))
|
|
17012
|
+
} else if (this._bodyFormData) {
|
|
17013
|
+
throw new Error('could not read FormData body as blob')
|
|
17014
|
+
} else {
|
|
17015
|
+
return Promise.resolve(new Blob([this._bodyText]))
|
|
17016
|
+
}
|
|
17017
|
+
};
|
|
17018
|
+
|
|
17019
|
+
this.arrayBuffer = function() {
|
|
17020
|
+
if (this._bodyArrayBuffer) {
|
|
17021
|
+
return consumed(this) || Promise.resolve(this._bodyArrayBuffer)
|
|
17022
|
+
} else {
|
|
17023
|
+
return this.blob().then(readBlobAsArrayBuffer)
|
|
17024
|
+
}
|
|
17025
|
+
};
|
|
17026
|
+
}
|
|
17027
|
+
|
|
17028
|
+
this.text = function() {
|
|
17029
|
+
var rejected = consumed(this);
|
|
17030
|
+
if (rejected) {
|
|
17031
|
+
return rejected
|
|
17032
|
+
}
|
|
17033
|
+
|
|
17034
|
+
if (this._bodyBlob) {
|
|
17035
|
+
return readBlobAsText(this._bodyBlob)
|
|
17036
|
+
} else if (this._bodyArrayBuffer) {
|
|
17037
|
+
return Promise.resolve(readArrayBufferAsText(this._bodyArrayBuffer))
|
|
17038
|
+
} else if (this._bodyFormData) {
|
|
17039
|
+
throw new Error('could not read FormData body as text')
|
|
17040
|
+
} else {
|
|
17041
|
+
return Promise.resolve(this._bodyText)
|
|
17042
|
+
}
|
|
17043
|
+
};
|
|
17044
|
+
|
|
17045
|
+
if (support.formData) {
|
|
17046
|
+
this.formData = function() {
|
|
17047
|
+
return this.text().then(decode)
|
|
17048
|
+
};
|
|
17049
|
+
}
|
|
17050
|
+
|
|
17051
|
+
this.json = function() {
|
|
17052
|
+
return this.text().then(JSON.parse)
|
|
17053
|
+
};
|
|
17054
|
+
|
|
17055
|
+
return this
|
|
17056
|
+
}
|
|
17057
|
+
|
|
17058
|
+
// HTTP methods whose capitalization should be normalized
|
|
17059
|
+
var methods = ['DELETE', 'GET', 'HEAD', 'OPTIONS', 'POST', 'PUT'];
|
|
17060
|
+
|
|
17061
|
+
function normalizeMethod(method) {
|
|
17062
|
+
var upcased = method.toUpperCase();
|
|
17063
|
+
return methods.indexOf(upcased) > -1 ? upcased : method
|
|
17064
|
+
}
|
|
17065
|
+
|
|
17066
|
+
function Request(input, options) {
|
|
17067
|
+
options = options || {};
|
|
17068
|
+
var body = options.body;
|
|
17069
|
+
|
|
17070
|
+
if (input instanceof Request) {
|
|
17071
|
+
if (input.bodyUsed) {
|
|
17072
|
+
throw new TypeError('Already read')
|
|
17073
|
+
}
|
|
17074
|
+
this.url = input.url;
|
|
17075
|
+
this.credentials = input.credentials;
|
|
17076
|
+
if (!options.headers) {
|
|
17077
|
+
this.headers = new Headers(input.headers);
|
|
17078
|
+
}
|
|
17079
|
+
this.method = input.method;
|
|
17080
|
+
this.mode = input.mode;
|
|
17081
|
+
this.signal = input.signal;
|
|
17082
|
+
if (!body && input._bodyInit != null) {
|
|
17083
|
+
body = input._bodyInit;
|
|
17084
|
+
input.bodyUsed = true;
|
|
17085
|
+
}
|
|
17086
|
+
} else {
|
|
17087
|
+
this.url = String(input);
|
|
17088
|
+
}
|
|
17089
|
+
|
|
17090
|
+
this.credentials = options.credentials || this.credentials || 'same-origin';
|
|
17091
|
+
if (options.headers || !this.headers) {
|
|
17092
|
+
this.headers = new Headers(options.headers);
|
|
17093
|
+
}
|
|
17094
|
+
this.method = normalizeMethod(options.method || this.method || 'GET');
|
|
17095
|
+
this.mode = options.mode || this.mode || null;
|
|
17096
|
+
this.signal = options.signal || this.signal;
|
|
17097
|
+
this.referrer = null;
|
|
17098
|
+
|
|
17099
|
+
if ((this.method === 'GET' || this.method === 'HEAD') && body) {
|
|
17100
|
+
throw new TypeError('Body not allowed for GET or HEAD requests')
|
|
17101
|
+
}
|
|
17102
|
+
this._initBody(body);
|
|
17103
|
+
}
|
|
17104
|
+
|
|
17105
|
+
Request.prototype.clone = function() {
|
|
17106
|
+
return new Request(this, {body: this._bodyInit})
|
|
17107
|
+
};
|
|
17108
|
+
|
|
17109
|
+
function decode(body) {
|
|
17110
|
+
var form = new FormData();
|
|
17111
|
+
body
|
|
17112
|
+
.trim()
|
|
17113
|
+
.split('&')
|
|
17114
|
+
.forEach(function(bytes) {
|
|
17115
|
+
if (bytes) {
|
|
17116
|
+
var split = bytes.split('=');
|
|
17117
|
+
var name = split.shift().replace(/\+/g, ' ');
|
|
17118
|
+
var value = split.join('=').replace(/\+/g, ' ');
|
|
17119
|
+
form.append(decodeURIComponent(name), decodeURIComponent(value));
|
|
17120
|
+
}
|
|
17121
|
+
});
|
|
17122
|
+
return form
|
|
17123
|
+
}
|
|
17124
|
+
|
|
17125
|
+
function parseHeaders(rawHeaders) {
|
|
17126
|
+
var headers = new Headers();
|
|
17127
|
+
// Replace instances of \r\n and \n followed by at least one space or horizontal tab with a space
|
|
17128
|
+
// https://tools.ietf.org/html/rfc7230#section-3.2
|
|
17129
|
+
var preProcessedHeaders = rawHeaders.replace(/\r?\n[\t ]+/g, ' ');
|
|
17130
|
+
preProcessedHeaders.split(/\r?\n/).forEach(function(line) {
|
|
17131
|
+
var parts = line.split(':');
|
|
17132
|
+
var key = parts.shift().trim();
|
|
17133
|
+
if (key) {
|
|
17134
|
+
var value = parts.join(':').trim();
|
|
17135
|
+
headers.append(key, value);
|
|
17136
|
+
}
|
|
17137
|
+
});
|
|
17138
|
+
return headers
|
|
17139
|
+
}
|
|
17140
|
+
|
|
17141
|
+
Body.call(Request.prototype);
|
|
17142
|
+
|
|
17143
|
+
function Response(bodyInit, options) {
|
|
17144
|
+
if (!options) {
|
|
17145
|
+
options = {};
|
|
17146
|
+
}
|
|
17147
|
+
|
|
17148
|
+
this.type = 'default';
|
|
17149
|
+
this.status = options.status === undefined ? 200 : options.status;
|
|
17150
|
+
this.ok = this.status >= 200 && this.status < 300;
|
|
17151
|
+
this.statusText = 'statusText' in options ? options.statusText : 'OK';
|
|
17152
|
+
this.headers = new Headers(options.headers);
|
|
17153
|
+
this.url = options.url || '';
|
|
17154
|
+
this._initBody(bodyInit);
|
|
17155
|
+
}
|
|
17156
|
+
|
|
17157
|
+
Body.call(Response.prototype);
|
|
17158
|
+
|
|
17159
|
+
Response.prototype.clone = function() {
|
|
17160
|
+
return new Response(this._bodyInit, {
|
|
17161
|
+
status: this.status,
|
|
17162
|
+
statusText: this.statusText,
|
|
17163
|
+
headers: new Headers(this.headers),
|
|
17164
|
+
url: this.url
|
|
17165
|
+
})
|
|
17166
|
+
};
|
|
17167
|
+
|
|
17168
|
+
Response.error = function() {
|
|
17169
|
+
var response = new Response(null, {status: 0, statusText: ''});
|
|
17170
|
+
response.type = 'error';
|
|
17171
|
+
return response
|
|
17172
|
+
};
|
|
17173
|
+
|
|
17174
|
+
var redirectStatuses = [301, 302, 303, 307, 308];
|
|
17175
|
+
|
|
17176
|
+
Response.redirect = function(url, status) {
|
|
17177
|
+
if (redirectStatuses.indexOf(status) === -1) {
|
|
17178
|
+
throw new RangeError('Invalid status code')
|
|
17179
|
+
}
|
|
17180
|
+
|
|
17181
|
+
return new Response(null, {status: status, headers: {location: url}})
|
|
17182
|
+
};
|
|
17183
|
+
|
|
17184
|
+
exports.DOMException = self.DOMException;
|
|
17185
|
+
try {
|
|
17186
|
+
new exports.DOMException();
|
|
17187
|
+
} catch (err) {
|
|
17188
|
+
exports.DOMException = function(message, name) {
|
|
17189
|
+
this.message = message;
|
|
17190
|
+
this.name = name;
|
|
17191
|
+
var error = Error(message);
|
|
17192
|
+
this.stack = error.stack;
|
|
17193
|
+
};
|
|
17194
|
+
exports.DOMException.prototype = Object.create(Error.prototype);
|
|
17195
|
+
exports.DOMException.prototype.constructor = exports.DOMException;
|
|
17196
|
+
}
|
|
17197
|
+
|
|
17198
|
+
function fetch(input, init) {
|
|
17199
|
+
return new Promise(function(resolve, reject) {
|
|
17200
|
+
var request = new Request(input, init);
|
|
17201
|
+
|
|
17202
|
+
if (request.signal && request.signal.aborted) {
|
|
17203
|
+
return reject(new exports.DOMException('Aborted', 'AbortError'))
|
|
17204
|
+
}
|
|
17205
|
+
|
|
17206
|
+
var xhr = new XMLHttpRequest();
|
|
17207
|
+
|
|
17208
|
+
function abortXhr() {
|
|
17209
|
+
xhr.abort();
|
|
17210
|
+
}
|
|
17211
|
+
|
|
17212
|
+
xhr.onload = function() {
|
|
17213
|
+
var options = {
|
|
17214
|
+
status: xhr.status,
|
|
17215
|
+
statusText: xhr.statusText,
|
|
17216
|
+
headers: parseHeaders(xhr.getAllResponseHeaders() || '')
|
|
17217
|
+
};
|
|
17218
|
+
options.url = 'responseURL' in xhr ? xhr.responseURL : options.headers.get('X-Request-URL');
|
|
17219
|
+
var body = 'response' in xhr ? xhr.response : xhr.responseText;
|
|
17220
|
+
resolve(new Response(body, options));
|
|
17221
|
+
};
|
|
17222
|
+
|
|
17223
|
+
xhr.onerror = function() {
|
|
17224
|
+
reject(new TypeError('Network request failed'));
|
|
17225
|
+
};
|
|
17226
|
+
|
|
17227
|
+
xhr.ontimeout = function() {
|
|
17228
|
+
reject(new TypeError('Network request failed'));
|
|
17229
|
+
};
|
|
17230
|
+
|
|
17231
|
+
xhr.onabort = function() {
|
|
17232
|
+
reject(new exports.DOMException('Aborted', 'AbortError'));
|
|
17233
|
+
};
|
|
17234
|
+
|
|
17235
|
+
xhr.open(request.method, request.url, true);
|
|
17236
|
+
|
|
17237
|
+
if (request.credentials === 'include') {
|
|
17238
|
+
xhr.withCredentials = true;
|
|
17239
|
+
} else if (request.credentials === 'omit') {
|
|
17240
|
+
xhr.withCredentials = false;
|
|
17241
|
+
}
|
|
17242
|
+
|
|
17243
|
+
if ('responseType' in xhr && support.blob) {
|
|
17244
|
+
xhr.responseType = 'blob';
|
|
17245
|
+
}
|
|
17246
|
+
|
|
17247
|
+
request.headers.forEach(function(value, name) {
|
|
17248
|
+
xhr.setRequestHeader(name, value);
|
|
17249
|
+
});
|
|
17250
|
+
|
|
17251
|
+
if (request.signal) {
|
|
17252
|
+
request.signal.addEventListener('abort', abortXhr);
|
|
17253
|
+
|
|
17254
|
+
xhr.onreadystatechange = function() {
|
|
17255
|
+
// DONE (success or failure)
|
|
17256
|
+
if (xhr.readyState === 4) {
|
|
17257
|
+
request.signal.removeEventListener('abort', abortXhr);
|
|
17258
|
+
}
|
|
17259
|
+
};
|
|
17260
|
+
}
|
|
17261
|
+
|
|
17262
|
+
xhr.send(typeof request._bodyInit === 'undefined' ? null : request._bodyInit);
|
|
17263
|
+
})
|
|
17264
|
+
}
|
|
17265
|
+
|
|
17266
|
+
fetch.polyfill = true;
|
|
17267
|
+
|
|
17268
|
+
if (!self.fetch) {
|
|
17269
|
+
self.fetch = fetch;
|
|
17270
|
+
self.Headers = Headers;
|
|
17271
|
+
self.Request = Request;
|
|
17272
|
+
self.Response = Response;
|
|
17273
|
+
}
|
|
17274
|
+
|
|
17275
|
+
exports.Headers = Headers;
|
|
17276
|
+
exports.Request = Request;
|
|
17277
|
+
exports.Response = Response;
|
|
17278
|
+
exports.fetch = fetch;
|
|
17279
|
+
|
|
17280
|
+
Object.defineProperty(exports, '__esModule', { value: true });
|
|
17281
|
+
|
|
17282
|
+
return exports;
|
|
17283
|
+
|
|
17284
|
+
}))({});
|
|
17285
|
+
})(__self__);
|
|
17286
|
+
__self__.fetch.ponyfill = true;
|
|
17287
|
+
// Remove "polyfill" property added by whatwg-fetch
|
|
17288
|
+
delete __self__.fetch.polyfill;
|
|
17289
|
+
// Choose between native implementation (global) or custom implementation (__self__)
|
|
17290
|
+
// var ctx = global.fetch ? global : __self__;
|
|
17291
|
+
var ctx = __self__; // this line disable service worker support temporarily
|
|
17292
|
+
exports = ctx.fetch; // To enable: import fetch from 'cross-fetch'
|
|
17293
|
+
exports.default = ctx.fetch; // For TypeScript consumers without esModuleInterop.
|
|
17294
|
+
exports.fetch = ctx.fetch; // To enable: import {fetch} from 'cross-fetch'
|
|
17295
|
+
exports.Headers = ctx.Headers;
|
|
17296
|
+
exports.Request = ctx.Request;
|
|
17297
|
+
exports.Response = ctx.Response;
|
|
17298
|
+
module.exports = exports;
|
|
17299
|
+
});
|
|
17300
|
+
|
|
17301
|
+
unwrapExports(browserPonyfill);
|
|
17302
|
+
|
|
17303
|
+
var ReactNativeFile = function ReactNativeFile(_ref) {
|
|
17304
|
+
var uri = _ref.uri,
|
|
17305
|
+
name = _ref.name,
|
|
17306
|
+
type = _ref.type;
|
|
17307
|
+
this.uri = uri;
|
|
17308
|
+
this.name = name;
|
|
17309
|
+
this.type = type;
|
|
17310
|
+
};
|
|
17311
|
+
|
|
17312
|
+
var isExtractableFile = function isExtractableFile(value) {
|
|
17313
|
+
return (
|
|
17314
|
+
(typeof File !== 'undefined' && value instanceof File) ||
|
|
17315
|
+
(typeof Blob !== 'undefined' && value instanceof Blob) ||
|
|
17316
|
+
value instanceof ReactNativeFile
|
|
17317
|
+
);
|
|
17318
|
+
};
|
|
17319
|
+
|
|
17320
|
+
var extractFiles = function extractFiles(value, path, isExtractableFile$1) {
|
|
17321
|
+
if (path === void 0) {
|
|
17322
|
+
path = '';
|
|
17323
|
+
}
|
|
17324
|
+
|
|
17325
|
+
if (isExtractableFile$1 === void 0) {
|
|
17326
|
+
isExtractableFile$1 = isExtractableFile;
|
|
17327
|
+
}
|
|
17328
|
+
|
|
17329
|
+
var clone;
|
|
17330
|
+
var files = new Map();
|
|
17331
|
+
|
|
17332
|
+
function addFile(paths, file) {
|
|
17333
|
+
var storedPaths = files.get(file);
|
|
17334
|
+
if (storedPaths) storedPaths.push.apply(storedPaths, paths);
|
|
17335
|
+
else files.set(file, paths);
|
|
17336
|
+
}
|
|
17337
|
+
|
|
17338
|
+
if (isExtractableFile$1(value)) {
|
|
17339
|
+
clone = null;
|
|
17340
|
+
addFile([path], value);
|
|
17341
|
+
} else {
|
|
17342
|
+
var prefix = path ? path + '.' : '';
|
|
17343
|
+
if (typeof FileList !== 'undefined' && value instanceof FileList)
|
|
17344
|
+
clone = Array.prototype.map.call(value, function (file, i) {
|
|
17345
|
+
addFile(['' + prefix + i], file);
|
|
17346
|
+
return null;
|
|
17347
|
+
});
|
|
17348
|
+
else if (Array.isArray(value))
|
|
17349
|
+
clone = value.map(function (child, i) {
|
|
17350
|
+
var result = extractFiles(child, '' + prefix + i, isExtractableFile$1);
|
|
17351
|
+
result.files.forEach(addFile);
|
|
17352
|
+
return result.clone;
|
|
17353
|
+
});
|
|
17354
|
+
else if (value && value.constructor === Object) {
|
|
17355
|
+
clone = {};
|
|
17356
|
+
|
|
17357
|
+
for (var i in value) {
|
|
17358
|
+
var result = extractFiles(value[i], '' + prefix + i, isExtractableFile$1);
|
|
17359
|
+
result.files.forEach(addFile);
|
|
17360
|
+
clone[i] = result.clone;
|
|
17361
|
+
}
|
|
17362
|
+
} else clone = value;
|
|
17363
|
+
}
|
|
17364
|
+
|
|
17365
|
+
return {
|
|
17366
|
+
clone: clone,
|
|
17367
|
+
files: files,
|
|
17368
|
+
};
|
|
17369
|
+
};
|
|
17370
|
+
|
|
17371
|
+
|
|
17372
|
+
|
|
17373
|
+
var _public = {
|
|
17374
|
+
__proto__: null,
|
|
17375
|
+
ReactNativeFile: ReactNativeFile,
|
|
17376
|
+
extractFiles: extractFiles,
|
|
17377
|
+
isExtractableFile: isExtractableFile
|
|
17378
|
+
};
|
|
17379
|
+
|
|
17380
|
+
/* eslint-env browser */
|
|
17381
|
+
var browser$1 = typeof self == 'object' ? self.FormData : window.FormData;
|
|
17382
|
+
|
|
17383
|
+
var defaultJsonSerializer = createCommonjsModule(function (module, exports) {
|
|
17384
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17385
|
+
exports.defaultJsonSerializer = void 0;
|
|
17386
|
+
exports.defaultJsonSerializer = {
|
|
17387
|
+
parse: JSON.parse,
|
|
17388
|
+
stringify: JSON.stringify
|
|
17389
|
+
};
|
|
17390
|
+
|
|
17391
|
+
});
|
|
17392
|
+
|
|
17393
|
+
unwrapExports(defaultJsonSerializer);
|
|
17394
|
+
|
|
17395
|
+
var extract_files_1 = getCjsExportFromNamespace(_public);
|
|
17396
|
+
|
|
17397
|
+
var createRequestBody_1 = createCommonjsModule(function (module, exports) {
|
|
17398
|
+
var __importDefault = (commonjsGlobal$1 && commonjsGlobal$1.__importDefault) || function (mod) {
|
|
17399
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17400
|
+
};
|
|
17401
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17402
|
+
|
|
17403
|
+
var form_data_1 = __importDefault(browser$1);
|
|
17404
|
+
|
|
17405
|
+
/**
|
|
17406
|
+
* Duck type if NodeJS stream
|
|
17407
|
+
* https://github.com/sindresorhus/is-stream/blob/3750505b0727f6df54324784fe369365ef78841e/index.js#L3
|
|
17408
|
+
*/
|
|
17409
|
+
var isExtractableFileEnhanced = function (value) {
|
|
17410
|
+
return extract_files_1.isExtractableFile(value) ||
|
|
17411
|
+
(value !== null && typeof value === 'object' && typeof value.pipe === 'function');
|
|
17412
|
+
};
|
|
17413
|
+
/**
|
|
17414
|
+
* Returns Multipart Form if body contains files
|
|
17415
|
+
* (https://github.com/jaydenseric/graphql-multipart-request-spec)
|
|
17416
|
+
* Otherwise returns JSON
|
|
17417
|
+
*/
|
|
17418
|
+
function createRequestBody(query, variables, operationName, jsonSerializer) {
|
|
17419
|
+
if (jsonSerializer === void 0) { jsonSerializer = defaultJsonSerializer.defaultJsonSerializer; }
|
|
17420
|
+
var _a = extract_files_1.extractFiles({ query: query, variables: variables, operationName: operationName }, '', isExtractableFileEnhanced), clone = _a.clone, files = _a.files;
|
|
17421
|
+
if (files.size === 0) {
|
|
17422
|
+
if (!Array.isArray(query)) {
|
|
17423
|
+
return jsonSerializer.stringify(clone);
|
|
17424
|
+
}
|
|
17425
|
+
if (typeof variables !== 'undefined' && !Array.isArray(variables)) {
|
|
17426
|
+
throw new Error('Cannot create request body with given variable type, array expected');
|
|
17427
|
+
}
|
|
17428
|
+
// Batch support
|
|
17429
|
+
var payload = query.reduce(function (accu, currentQuery, index) {
|
|
17430
|
+
accu.push({ query: currentQuery, variables: variables ? variables[index] : undefined });
|
|
17431
|
+
return accu;
|
|
17432
|
+
}, []);
|
|
17433
|
+
return jsonSerializer.stringify(payload);
|
|
17434
|
+
}
|
|
17435
|
+
var Form = typeof FormData === 'undefined' ? form_data_1.default : FormData;
|
|
17436
|
+
var form = new Form();
|
|
17437
|
+
form.append('operations', jsonSerializer.stringify(clone));
|
|
17438
|
+
var map = {};
|
|
17439
|
+
var i = 0;
|
|
17440
|
+
files.forEach(function (paths) {
|
|
17441
|
+
map[++i] = paths;
|
|
17442
|
+
});
|
|
17443
|
+
form.append('map', jsonSerializer.stringify(map));
|
|
17444
|
+
i = 0;
|
|
17445
|
+
files.forEach(function (paths, file) {
|
|
17446
|
+
form.append("" + ++i, file);
|
|
17447
|
+
});
|
|
17448
|
+
return form;
|
|
17449
|
+
}
|
|
17450
|
+
exports.default = createRequestBody;
|
|
17451
|
+
|
|
17452
|
+
});
|
|
17453
|
+
|
|
17454
|
+
unwrapExports(createRequestBody_1);
|
|
17455
|
+
|
|
17456
|
+
var parseArgs = createCommonjsModule(function (module, exports) {
|
|
17457
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17458
|
+
exports.parseBatchRequestsExtendedArgs = exports.parseRawRequestExtendedArgs = exports.parseRequestExtendedArgs = exports.parseBatchRequestArgs = exports.parseRawRequestArgs = exports.parseRequestArgs = void 0;
|
|
17459
|
+
function parseRequestArgs(documentOrOptions, variables, requestHeaders) {
|
|
17460
|
+
return documentOrOptions.document
|
|
17461
|
+
? documentOrOptions
|
|
17462
|
+
: {
|
|
17463
|
+
document: documentOrOptions,
|
|
17464
|
+
variables: variables,
|
|
17465
|
+
requestHeaders: requestHeaders,
|
|
17466
|
+
signal: undefined,
|
|
17467
|
+
};
|
|
17468
|
+
}
|
|
17469
|
+
exports.parseRequestArgs = parseRequestArgs;
|
|
17470
|
+
function parseRawRequestArgs(queryOrOptions, variables, requestHeaders) {
|
|
17471
|
+
return queryOrOptions.query
|
|
17472
|
+
? queryOrOptions
|
|
17473
|
+
: {
|
|
17474
|
+
query: queryOrOptions,
|
|
17475
|
+
variables: variables,
|
|
17476
|
+
requestHeaders: requestHeaders,
|
|
17477
|
+
signal: undefined,
|
|
17478
|
+
};
|
|
17479
|
+
}
|
|
17480
|
+
exports.parseRawRequestArgs = parseRawRequestArgs;
|
|
17481
|
+
function parseBatchRequestArgs(documentsOrOptions, requestHeaders) {
|
|
17482
|
+
return documentsOrOptions.documents
|
|
17483
|
+
? documentsOrOptions
|
|
17484
|
+
: {
|
|
17485
|
+
documents: documentsOrOptions,
|
|
17486
|
+
requestHeaders: requestHeaders,
|
|
17487
|
+
signal: undefined,
|
|
17488
|
+
};
|
|
17489
|
+
}
|
|
17490
|
+
exports.parseBatchRequestArgs = parseBatchRequestArgs;
|
|
17491
|
+
function parseRequestExtendedArgs(urlOrOptions, document, variables, requestHeaders) {
|
|
17492
|
+
return urlOrOptions.document
|
|
17493
|
+
? urlOrOptions
|
|
17494
|
+
: {
|
|
17495
|
+
url: urlOrOptions,
|
|
17496
|
+
document: document,
|
|
17497
|
+
variables: variables,
|
|
17498
|
+
requestHeaders: requestHeaders,
|
|
17499
|
+
signal: undefined,
|
|
17500
|
+
};
|
|
17501
|
+
}
|
|
17502
|
+
exports.parseRequestExtendedArgs = parseRequestExtendedArgs;
|
|
17503
|
+
function parseRawRequestExtendedArgs(urlOrOptions, query, variables, requestHeaders) {
|
|
17504
|
+
return urlOrOptions.query
|
|
17505
|
+
? urlOrOptions
|
|
17506
|
+
: {
|
|
17507
|
+
url: urlOrOptions,
|
|
17508
|
+
query: query,
|
|
17509
|
+
variables: variables,
|
|
17510
|
+
requestHeaders: requestHeaders,
|
|
17511
|
+
signal: undefined,
|
|
17512
|
+
};
|
|
17513
|
+
}
|
|
17514
|
+
exports.parseRawRequestExtendedArgs = parseRawRequestExtendedArgs;
|
|
17515
|
+
function parseBatchRequestsExtendedArgs(urlOrOptions, documents, requestHeaders) {
|
|
17516
|
+
return urlOrOptions.documents
|
|
17517
|
+
? urlOrOptions
|
|
17518
|
+
: {
|
|
17519
|
+
url: urlOrOptions,
|
|
17520
|
+
documents: documents,
|
|
17521
|
+
requestHeaders: requestHeaders,
|
|
17522
|
+
signal: undefined,
|
|
17523
|
+
};
|
|
17524
|
+
}
|
|
17525
|
+
exports.parseBatchRequestsExtendedArgs = parseBatchRequestsExtendedArgs;
|
|
17526
|
+
|
|
17527
|
+
});
|
|
17528
|
+
|
|
17529
|
+
unwrapExports(parseArgs);
|
|
17530
|
+
|
|
17531
|
+
var types = createCommonjsModule(function (module, exports) {
|
|
17532
|
+
var __extends = (commonjsGlobal$1 && commonjsGlobal$1.__extends) || (function () {
|
|
17533
|
+
var extendStatics = function (d, b) {
|
|
17534
|
+
extendStatics = Object.setPrototypeOf ||
|
|
17535
|
+
({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||
|
|
17536
|
+
function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };
|
|
17537
|
+
return extendStatics(d, b);
|
|
17538
|
+
};
|
|
17539
|
+
return function (d, b) {
|
|
17540
|
+
if (typeof b !== "function" && b !== null)
|
|
17541
|
+
throw new TypeError("Class extends value " + String(b) + " is not a constructor or null");
|
|
17542
|
+
extendStatics(d, b);
|
|
17543
|
+
function __() { this.constructor = d; }
|
|
17544
|
+
d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
|
|
17545
|
+
};
|
|
17546
|
+
})();
|
|
17547
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17548
|
+
exports.ClientError = void 0;
|
|
17549
|
+
var ClientError = /** @class */ (function (_super) {
|
|
17550
|
+
__extends(ClientError, _super);
|
|
17551
|
+
function ClientError(response, request) {
|
|
17552
|
+
var _this = this;
|
|
17553
|
+
var message = ClientError.extractMessage(response) + ": " + JSON.stringify({
|
|
17554
|
+
response: response,
|
|
17555
|
+
request: request,
|
|
17556
|
+
});
|
|
17557
|
+
_this = _super.call(this, message) || this;
|
|
17558
|
+
Object.setPrototypeOf(_this, ClientError.prototype);
|
|
17559
|
+
_this.response = response;
|
|
17560
|
+
_this.request = request;
|
|
17561
|
+
// this is needed as Safari doesn't support .captureStackTrace
|
|
17562
|
+
if (typeof Error.captureStackTrace === 'function') {
|
|
17563
|
+
Error.captureStackTrace(_this, ClientError);
|
|
17564
|
+
}
|
|
17565
|
+
return _this;
|
|
17566
|
+
}
|
|
17567
|
+
ClientError.extractMessage = function (response) {
|
|
17568
|
+
try {
|
|
17569
|
+
return response.errors[0].message;
|
|
17570
|
+
}
|
|
17571
|
+
catch (e) {
|
|
17572
|
+
return "GraphQL Error (Code: " + response.status + ")";
|
|
17573
|
+
}
|
|
17574
|
+
};
|
|
17575
|
+
return ClientError;
|
|
17576
|
+
}(Error));
|
|
17577
|
+
exports.ClientError = ClientError;
|
|
17578
|
+
|
|
17579
|
+
});
|
|
17580
|
+
|
|
17581
|
+
unwrapExports(types);
|
|
17582
|
+
|
|
17583
|
+
var parser_1 = getCjsExportFromNamespace(parser);
|
|
17584
|
+
|
|
17585
|
+
var printer_1 = getCjsExportFromNamespace(printer);
|
|
17586
|
+
|
|
17587
|
+
var dist = createCommonjsModule(function (module, exports) {
|
|
17588
|
+
var __assign = (commonjsGlobal$1 && commonjsGlobal$1.__assign) || function () {
|
|
17589
|
+
__assign = Object.assign || function(t) {
|
|
17590
|
+
for (var s, i = 1, n = arguments.length; i < n; i++) {
|
|
17591
|
+
s = arguments[i];
|
|
17592
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))
|
|
17593
|
+
t[p] = s[p];
|
|
17594
|
+
}
|
|
17595
|
+
return t;
|
|
17596
|
+
};
|
|
17597
|
+
return __assign.apply(this, arguments);
|
|
17598
|
+
};
|
|
17599
|
+
var __createBinding = (commonjsGlobal$1 && commonjsGlobal$1.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
17600
|
+
if (k2 === undefined) k2 = k;
|
|
17601
|
+
Object.defineProperty(o, k2, { enumerable: true, get: function() { return m[k]; } });
|
|
17602
|
+
}) : (function(o, m, k, k2) {
|
|
17603
|
+
if (k2 === undefined) k2 = k;
|
|
17604
|
+
o[k2] = m[k];
|
|
17605
|
+
}));
|
|
17606
|
+
var __setModuleDefault = (commonjsGlobal$1 && commonjsGlobal$1.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
17607
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
17608
|
+
}) : function(o, v) {
|
|
17609
|
+
o["default"] = v;
|
|
17610
|
+
});
|
|
17611
|
+
var __importStar = (commonjsGlobal$1 && commonjsGlobal$1.__importStar) || function (mod) {
|
|
17612
|
+
if (mod && mod.__esModule) return mod;
|
|
17613
|
+
var result = {};
|
|
17614
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
17615
|
+
__setModuleDefault(result, mod);
|
|
17616
|
+
return result;
|
|
17617
|
+
};
|
|
17618
|
+
var __awaiter = (commonjsGlobal$1 && commonjsGlobal$1.__awaiter) || function (thisArg, _arguments, P, generator) {
|
|
17619
|
+
function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }
|
|
17620
|
+
return new (P || (P = Promise))(function (resolve, reject) {
|
|
17621
|
+
function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }
|
|
17622
|
+
function rejected(value) { try { step(generator["throw"](value)); } catch (e) { reject(e); } }
|
|
17623
|
+
function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }
|
|
17624
|
+
step((generator = generator.apply(thisArg, _arguments || [])).next());
|
|
17625
|
+
});
|
|
17626
|
+
};
|
|
17627
|
+
var __generator = (commonjsGlobal$1 && commonjsGlobal$1.__generator) || function (thisArg, body) {
|
|
17628
|
+
var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;
|
|
17629
|
+
return g = { next: verb(0), "throw": verb(1), "return": verb(2) }, typeof Symbol === "function" && (g[Symbol.iterator] = function() { return this; }), g;
|
|
17630
|
+
function verb(n) { return function (v) { return step([n, v]); }; }
|
|
17631
|
+
function step(op) {
|
|
17632
|
+
if (f) throw new TypeError("Generator is already executing.");
|
|
17633
|
+
while (_) try {
|
|
17634
|
+
if (f = 1, y && (t = op[0] & 2 ? y["return"] : op[0] ? y["throw"] || ((t = y["return"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;
|
|
17635
|
+
if (y = 0, t) op = [op[0] & 2, t.value];
|
|
17636
|
+
switch (op[0]) {
|
|
17637
|
+
case 0: case 1: t = op; break;
|
|
17638
|
+
case 4: _.label++; return { value: op[1], done: false };
|
|
17639
|
+
case 5: _.label++; y = op[1]; op = [0]; continue;
|
|
17640
|
+
case 7: op = _.ops.pop(); _.trys.pop(); continue;
|
|
17641
|
+
default:
|
|
17642
|
+
if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }
|
|
17643
|
+
if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }
|
|
17644
|
+
if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }
|
|
17645
|
+
if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }
|
|
17646
|
+
if (t[2]) _.ops.pop();
|
|
17647
|
+
_.trys.pop(); continue;
|
|
17648
|
+
}
|
|
17649
|
+
op = body.call(thisArg, _);
|
|
17650
|
+
} catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }
|
|
17651
|
+
if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };
|
|
17652
|
+
}
|
|
17653
|
+
};
|
|
17654
|
+
var __rest = (commonjsGlobal$1 && commonjsGlobal$1.__rest) || function (s, e) {
|
|
17655
|
+
var t = {};
|
|
17656
|
+
for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
|
|
17657
|
+
t[p] = s[p];
|
|
17658
|
+
if (s != null && typeof Object.getOwnPropertySymbols === "function")
|
|
17659
|
+
for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
|
|
17660
|
+
if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
|
|
17661
|
+
t[p[i]] = s[p[i]];
|
|
17662
|
+
}
|
|
17663
|
+
return t;
|
|
17664
|
+
};
|
|
17665
|
+
var __importDefault = (commonjsGlobal$1 && commonjsGlobal$1.__importDefault) || function (mod) {
|
|
17666
|
+
return (mod && mod.__esModule) ? mod : { "default": mod };
|
|
17667
|
+
};
|
|
17668
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
17669
|
+
exports.gql = exports.batchRequests = exports.request = exports.rawRequest = exports.GraphQLClient = exports.ClientError = void 0;
|
|
17670
|
+
var cross_fetch_1 = __importStar(browserPonyfill), CrossFetch = cross_fetch_1;
|
|
17671
|
+
|
|
17672
|
+
|
|
17673
|
+
var createRequestBody_1$1 = __importDefault(createRequestBody_1);
|
|
17674
|
+
|
|
17675
|
+
|
|
17676
|
+
|
|
17677
|
+
Object.defineProperty(exports, "ClientError", { enumerable: true, get: function () { return types.ClientError; } });
|
|
17678
|
+
/**
|
|
17679
|
+
* Convert the given headers configuration into a plain object.
|
|
17680
|
+
*/
|
|
17681
|
+
var resolveHeaders = function (headers) {
|
|
17682
|
+
var oHeaders = {};
|
|
17683
|
+
if (headers) {
|
|
17684
|
+
if ((typeof Headers !== 'undefined' && headers instanceof Headers) ||
|
|
17685
|
+
headers instanceof CrossFetch.Headers) {
|
|
17686
|
+
oHeaders = HeadersInstanceToPlainObject(headers);
|
|
17687
|
+
}
|
|
17688
|
+
else if (Array.isArray(headers)) {
|
|
17689
|
+
headers.forEach(function (_a) {
|
|
17690
|
+
var name = _a[0], value = _a[1];
|
|
17691
|
+
oHeaders[name] = value;
|
|
17692
|
+
});
|
|
17693
|
+
}
|
|
17694
|
+
else {
|
|
17695
|
+
oHeaders = headers;
|
|
17696
|
+
}
|
|
17697
|
+
}
|
|
17698
|
+
return oHeaders;
|
|
17699
|
+
};
|
|
17700
|
+
/**
|
|
17701
|
+
* Clean a GraphQL document to send it via a GET query
|
|
17702
|
+
*
|
|
17703
|
+
* @param {string} str GraphQL query
|
|
17704
|
+
* @returns {string} Cleaned query
|
|
17705
|
+
*/
|
|
17706
|
+
var queryCleanner = function (str) { return str.replace(/([\s,]|#[^\n\r]+)+/g, ' ').trim(); };
|
|
17707
|
+
/**
|
|
17708
|
+
* Create query string for GraphQL request
|
|
17709
|
+
*
|
|
17710
|
+
* @param {object} param0 -
|
|
17711
|
+
*
|
|
17712
|
+
* @param {string|string[]} param0.query the GraphQL document or array of document if it's a batch request
|
|
17713
|
+
* @param {string|undefined} param0.operationName the GraphQL operation name
|
|
17714
|
+
* @param {any|any[]} param0.variables the GraphQL variables to use
|
|
17715
|
+
*/
|
|
17716
|
+
var buildGetQueryParams = function (_a) {
|
|
17717
|
+
var query = _a.query, variables = _a.variables, operationName = _a.operationName, jsonSerializer = _a.jsonSerializer;
|
|
17718
|
+
if (!Array.isArray(query)) {
|
|
17719
|
+
var search = ["query=" + encodeURIComponent(queryCleanner(query))];
|
|
17720
|
+
if (variables) {
|
|
17721
|
+
search.push("variables=" + encodeURIComponent(jsonSerializer.stringify(variables)));
|
|
17722
|
+
}
|
|
17723
|
+
if (operationName) {
|
|
17724
|
+
search.push("operationName=" + encodeURIComponent(operationName));
|
|
17725
|
+
}
|
|
17726
|
+
return search.join('&');
|
|
17727
|
+
}
|
|
17728
|
+
if (typeof variables !== 'undefined' && !Array.isArray(variables)) {
|
|
17729
|
+
throw new Error('Cannot create query with given variable type, array expected');
|
|
17730
|
+
}
|
|
17731
|
+
// Batch support
|
|
17732
|
+
var payload = query.reduce(function (accu, currentQuery, index) {
|
|
17733
|
+
accu.push({
|
|
17734
|
+
query: queryCleanner(currentQuery),
|
|
17735
|
+
variables: variables ? jsonSerializer.stringify(variables[index]) : undefined,
|
|
17736
|
+
});
|
|
17737
|
+
return accu;
|
|
17738
|
+
}, []);
|
|
17739
|
+
return "query=" + encodeURIComponent(jsonSerializer.stringify(payload));
|
|
17740
|
+
};
|
|
17741
|
+
/**
|
|
17742
|
+
* Fetch data using POST method
|
|
17743
|
+
*/
|
|
17744
|
+
var post = function (_a) {
|
|
17745
|
+
var url = _a.url, query = _a.query, variables = _a.variables, operationName = _a.operationName, headers = _a.headers, fetch = _a.fetch, fetchOptions = _a.fetchOptions;
|
|
17746
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
17747
|
+
var body;
|
|
17748
|
+
return __generator(this, function (_b) {
|
|
17749
|
+
switch (_b.label) {
|
|
17750
|
+
case 0:
|
|
17751
|
+
body = createRequestBody_1$1.default(query, variables, operationName, fetchOptions.jsonSerializer);
|
|
17752
|
+
return [4 /*yield*/, fetch(url, __assign({ method: 'POST', headers: __assign(__assign({}, (typeof body === 'string' ? { 'Content-Type': 'application/json' } : {})), headers), body: body }, fetchOptions))];
|
|
17753
|
+
case 1: return [2 /*return*/, _b.sent()];
|
|
17754
|
+
}
|
|
17755
|
+
});
|
|
17756
|
+
});
|
|
17757
|
+
};
|
|
17758
|
+
/**
|
|
17759
|
+
* Fetch data using GET method
|
|
17760
|
+
*/
|
|
17761
|
+
var get = function (_a) {
|
|
17762
|
+
var url = _a.url, query = _a.query, variables = _a.variables, operationName = _a.operationName, headers = _a.headers, fetch = _a.fetch, fetchOptions = _a.fetchOptions;
|
|
17763
|
+
return __awaiter(void 0, void 0, void 0, function () {
|
|
17764
|
+
var queryParams;
|
|
17765
|
+
return __generator(this, function (_b) {
|
|
17766
|
+
switch (_b.label) {
|
|
17767
|
+
case 0:
|
|
17768
|
+
queryParams = buildGetQueryParams({
|
|
17769
|
+
query: query,
|
|
17770
|
+
variables: variables,
|
|
17771
|
+
operationName: operationName,
|
|
17772
|
+
jsonSerializer: fetchOptions.jsonSerializer
|
|
17773
|
+
});
|
|
17774
|
+
return [4 /*yield*/, fetch(url + "?" + queryParams, __assign({ method: 'GET', headers: headers }, fetchOptions))];
|
|
17775
|
+
case 1: return [2 /*return*/, _b.sent()];
|
|
17776
|
+
}
|
|
17777
|
+
});
|
|
17778
|
+
});
|
|
17779
|
+
};
|
|
17780
|
+
/**
|
|
17781
|
+
* GraphQL Client.
|
|
17782
|
+
*/
|
|
17783
|
+
var GraphQLClient = /** @class */ (function () {
|
|
17784
|
+
function GraphQLClient(url, options) {
|
|
17785
|
+
this.url = url;
|
|
17786
|
+
this.options = options || {};
|
|
17787
|
+
}
|
|
17788
|
+
GraphQLClient.prototype.rawRequest = function (queryOrOptions, variables, requestHeaders) {
|
|
17789
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
17790
|
+
var rawRequestOptions, _a, headers, _b, fetch, _c, method, fetchOptions, url, operationName;
|
|
17791
|
+
return __generator(this, function (_d) {
|
|
17792
|
+
rawRequestOptions = parseArgs.parseRawRequestArgs(queryOrOptions, variables, requestHeaders);
|
|
17793
|
+
_a = this.options, headers = _a.headers, _b = _a.fetch, fetch = _b === void 0 ? cross_fetch_1.default : _b, _c = _a.method, method = _c === void 0 ? 'POST' : _c, fetchOptions = __rest(_a, ["headers", "fetch", "method"]);
|
|
17794
|
+
url = this.url;
|
|
17795
|
+
if (rawRequestOptions.signal !== undefined) {
|
|
17796
|
+
fetchOptions.signal = rawRequestOptions.signal;
|
|
17797
|
+
}
|
|
17798
|
+
operationName = resolveRequestDocument(rawRequestOptions.query).operationName;
|
|
17799
|
+
return [2 /*return*/, makeRequest({
|
|
17800
|
+
url: url,
|
|
17801
|
+
query: rawRequestOptions.query,
|
|
17802
|
+
variables: rawRequestOptions.variables,
|
|
17803
|
+
headers: __assign(__assign({}, resolveHeaders(headers)), resolveHeaders(rawRequestOptions.requestHeaders)),
|
|
17804
|
+
operationName: operationName,
|
|
17805
|
+
fetch: fetch,
|
|
17806
|
+
method: method,
|
|
17807
|
+
fetchOptions: fetchOptions,
|
|
17808
|
+
})];
|
|
17809
|
+
});
|
|
17810
|
+
});
|
|
17811
|
+
};
|
|
17812
|
+
GraphQLClient.prototype.request = function (documentOrOptions, variables, requestHeaders) {
|
|
17813
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
17814
|
+
var requestOptions, _a, headers, _b, fetch, _c, method, fetchOptions, url, _d, query, operationName, data;
|
|
17815
|
+
return __generator(this, function (_e) {
|
|
17816
|
+
switch (_e.label) {
|
|
17817
|
+
case 0:
|
|
17818
|
+
requestOptions = parseArgs.parseRequestArgs(documentOrOptions, variables, requestHeaders);
|
|
17819
|
+
_a = this.options, headers = _a.headers, _b = _a.fetch, fetch = _b === void 0 ? cross_fetch_1.default : _b, _c = _a.method, method = _c === void 0 ? 'POST' : _c, fetchOptions = __rest(_a, ["headers", "fetch", "method"]);
|
|
17820
|
+
url = this.url;
|
|
17821
|
+
if (requestOptions.signal !== undefined) {
|
|
17822
|
+
fetchOptions.signal = requestOptions.signal;
|
|
17823
|
+
}
|
|
17824
|
+
_d = resolveRequestDocument(requestOptions.document), query = _d.query, operationName = _d.operationName;
|
|
17825
|
+
return [4 /*yield*/, makeRequest({
|
|
17826
|
+
url: url,
|
|
17827
|
+
query: query,
|
|
17828
|
+
variables: requestOptions.variables,
|
|
17829
|
+
headers: __assign(__assign({}, resolveHeaders(headers)), resolveHeaders(requestOptions.requestHeaders)),
|
|
17830
|
+
operationName: operationName,
|
|
17831
|
+
fetch: fetch,
|
|
17832
|
+
method: method,
|
|
17833
|
+
fetchOptions: fetchOptions,
|
|
17834
|
+
})];
|
|
17835
|
+
case 1:
|
|
17836
|
+
data = (_e.sent()).data;
|
|
17837
|
+
return [2 /*return*/, data];
|
|
17838
|
+
}
|
|
17839
|
+
});
|
|
17840
|
+
});
|
|
17841
|
+
};
|
|
17842
|
+
GraphQLClient.prototype.batchRequests = function (documentsOrOptions, requestHeaders) {
|
|
17843
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
17844
|
+
var batchRequestOptions, _a, headers, _b, fetch, _c, method, fetchOptions, url, queries, variables, data;
|
|
17845
|
+
return __generator(this, function (_d) {
|
|
17846
|
+
switch (_d.label) {
|
|
17847
|
+
case 0:
|
|
17848
|
+
batchRequestOptions = parseArgs.parseBatchRequestArgs(documentsOrOptions, requestHeaders);
|
|
17849
|
+
_a = this.options, headers = _a.headers, _b = _a.fetch, fetch = _b === void 0 ? cross_fetch_1.default : _b, _c = _a.method, method = _c === void 0 ? 'POST' : _c, fetchOptions = __rest(_a, ["headers", "fetch", "method"]);
|
|
17850
|
+
url = this.url;
|
|
17851
|
+
if (batchRequestOptions.signal !== undefined) {
|
|
17852
|
+
fetchOptions.signal = batchRequestOptions.signal;
|
|
17853
|
+
}
|
|
17854
|
+
queries = batchRequestOptions.documents.map(function (_a) {
|
|
17855
|
+
var document = _a.document;
|
|
17856
|
+
return resolveRequestDocument(document).query;
|
|
17857
|
+
});
|
|
17858
|
+
variables = batchRequestOptions.documents.map(function (_a) {
|
|
17859
|
+
var variables = _a.variables;
|
|
17860
|
+
return variables;
|
|
17861
|
+
});
|
|
17862
|
+
return [4 /*yield*/, makeRequest({
|
|
17863
|
+
url: url,
|
|
17864
|
+
query: queries,
|
|
17865
|
+
variables: variables,
|
|
17866
|
+
headers: __assign(__assign({}, resolveHeaders(headers)), resolveHeaders(batchRequestOptions.requestHeaders)),
|
|
17867
|
+
operationName: undefined,
|
|
17868
|
+
fetch: fetch,
|
|
17869
|
+
method: method,
|
|
17870
|
+
fetchOptions: fetchOptions,
|
|
17871
|
+
})];
|
|
17872
|
+
case 1:
|
|
17873
|
+
data = (_d.sent()).data;
|
|
17874
|
+
return [2 /*return*/, data];
|
|
17875
|
+
}
|
|
17876
|
+
});
|
|
17877
|
+
});
|
|
17878
|
+
};
|
|
17879
|
+
GraphQLClient.prototype.setHeaders = function (headers) {
|
|
17880
|
+
this.options.headers = headers;
|
|
17881
|
+
return this;
|
|
17882
|
+
};
|
|
17883
|
+
/**
|
|
17884
|
+
* Attach a header to the client. All subsequent requests will have this header.
|
|
17885
|
+
*/
|
|
17886
|
+
GraphQLClient.prototype.setHeader = function (key, value) {
|
|
17887
|
+
var _a;
|
|
17888
|
+
var headers = this.options.headers;
|
|
17889
|
+
if (headers) {
|
|
17890
|
+
// todo what if headers is in nested array form... ?
|
|
17891
|
+
//@ts-ignore
|
|
17892
|
+
headers[key] = value;
|
|
17893
|
+
}
|
|
17894
|
+
else {
|
|
17895
|
+
this.options.headers = (_a = {}, _a[key] = value, _a);
|
|
17896
|
+
}
|
|
17897
|
+
return this;
|
|
17898
|
+
};
|
|
17899
|
+
/**
|
|
17900
|
+
* Change the client endpoint. All subsequent requests will send to this endpoint.
|
|
17901
|
+
*/
|
|
17902
|
+
GraphQLClient.prototype.setEndpoint = function (value) {
|
|
17903
|
+
this.url = value;
|
|
17904
|
+
return this;
|
|
17905
|
+
};
|
|
17906
|
+
return GraphQLClient;
|
|
17907
|
+
}());
|
|
17908
|
+
exports.GraphQLClient = GraphQLClient;
|
|
17909
|
+
function makeRequest(_a) {
|
|
17910
|
+
var url = _a.url, query = _a.query, variables = _a.variables, headers = _a.headers, operationName = _a.operationName, fetch = _a.fetch, _b = _a.method, method = _b === void 0 ? 'POST' : _b, fetchOptions = _a.fetchOptions;
|
|
17911
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
17912
|
+
var fetcher, isBathchingQuery, response, result, successfullyReceivedData, headers_1, status_1, errorResult;
|
|
17913
|
+
return __generator(this, function (_c) {
|
|
17914
|
+
switch (_c.label) {
|
|
17915
|
+
case 0:
|
|
17916
|
+
fetcher = method.toUpperCase() === 'POST' ? post : get;
|
|
17917
|
+
isBathchingQuery = Array.isArray(query);
|
|
17918
|
+
return [4 /*yield*/, fetcher({
|
|
17919
|
+
url: url,
|
|
17920
|
+
query: query,
|
|
17921
|
+
variables: variables,
|
|
17922
|
+
operationName: operationName,
|
|
17923
|
+
headers: headers,
|
|
17924
|
+
fetch: fetch,
|
|
17925
|
+
fetchOptions: fetchOptions,
|
|
17926
|
+
})];
|
|
17927
|
+
case 1:
|
|
17928
|
+
response = _c.sent();
|
|
17929
|
+
return [4 /*yield*/, getResult(response, fetchOptions.jsonSerializer)];
|
|
17930
|
+
case 2:
|
|
17931
|
+
result = _c.sent();
|
|
17932
|
+
successfullyReceivedData = isBathchingQuery && Array.isArray(result) ? !result.some(function (_a) {
|
|
17933
|
+
var data = _a.data;
|
|
17934
|
+
return !data;
|
|
17935
|
+
}) : !!result.data;
|
|
17936
|
+
if (response.ok && !result.errors && successfullyReceivedData) {
|
|
17937
|
+
headers_1 = response.headers, status_1 = response.status;
|
|
17938
|
+
return [2 /*return*/, __assign(__assign({}, (isBathchingQuery ? { data: result } : result)), { headers: headers_1, status: status_1 })];
|
|
17939
|
+
}
|
|
17940
|
+
else {
|
|
17941
|
+
errorResult = typeof result === 'string' ? { error: result } : result;
|
|
17942
|
+
throw new types.ClientError(__assign(__assign({}, errorResult), { status: response.status, headers: response.headers }), { query: query, variables: variables });
|
|
17943
|
+
}
|
|
17944
|
+
}
|
|
17945
|
+
});
|
|
17946
|
+
});
|
|
17947
|
+
}
|
|
17948
|
+
function rawRequest(urlOrOptions, query, variables, requestHeaders) {
|
|
17949
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
17950
|
+
var requestOptions, client;
|
|
17951
|
+
return __generator(this, function (_a) {
|
|
17952
|
+
requestOptions = parseArgs.parseRawRequestExtendedArgs(urlOrOptions, query, variables, requestHeaders);
|
|
17953
|
+
client = new GraphQLClient(requestOptions.url);
|
|
17954
|
+
return [2 /*return*/, client.rawRequest(__assign({}, requestOptions))];
|
|
17955
|
+
});
|
|
17956
|
+
});
|
|
17957
|
+
}
|
|
17958
|
+
exports.rawRequest = rawRequest;
|
|
17959
|
+
function request(urlOrOptions, document, variables, requestHeaders) {
|
|
17960
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
17961
|
+
var requestOptions, client;
|
|
17962
|
+
return __generator(this, function (_a) {
|
|
17963
|
+
requestOptions = parseArgs.parseRequestExtendedArgs(urlOrOptions, document, variables, requestHeaders);
|
|
17964
|
+
client = new GraphQLClient(requestOptions.url);
|
|
17965
|
+
return [2 /*return*/, client.request(__assign({}, requestOptions))];
|
|
17966
|
+
});
|
|
17967
|
+
});
|
|
17968
|
+
}
|
|
17969
|
+
exports.request = request;
|
|
17970
|
+
function batchRequests(urlOrOptions, documents, requestHeaders) {
|
|
17971
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
17972
|
+
var requestOptions, client;
|
|
17973
|
+
return __generator(this, function (_a) {
|
|
17974
|
+
requestOptions = parseArgs.parseBatchRequestsExtendedArgs(urlOrOptions, documents, requestHeaders);
|
|
17975
|
+
client = new GraphQLClient(requestOptions.url);
|
|
17976
|
+
return [2 /*return*/, client.batchRequests(__assign({}, requestOptions))];
|
|
17977
|
+
});
|
|
17978
|
+
});
|
|
17979
|
+
}
|
|
17980
|
+
exports.batchRequests = batchRequests;
|
|
17981
|
+
exports.default = request;
|
|
17982
|
+
/**
|
|
17983
|
+
* todo
|
|
17984
|
+
*/
|
|
17985
|
+
function getResult(response, jsonSerializer) {
|
|
17986
|
+
if (jsonSerializer === void 0) { jsonSerializer = defaultJsonSerializer.defaultJsonSerializer; }
|
|
17987
|
+
return __awaiter(this, void 0, void 0, function () {
|
|
17988
|
+
var contentType, _a, _b;
|
|
17989
|
+
return __generator(this, function (_c) {
|
|
17990
|
+
switch (_c.label) {
|
|
17991
|
+
case 0:
|
|
17992
|
+
response.headers.forEach(function (value, key) {
|
|
17993
|
+
if (key.toLowerCase() === 'content-type') {
|
|
17994
|
+
contentType = value;
|
|
17995
|
+
}
|
|
17996
|
+
});
|
|
17997
|
+
if (!(contentType && contentType.toLowerCase().startsWith('application/json'))) return [3 /*break*/, 2];
|
|
17998
|
+
_b = (_a = jsonSerializer).parse;
|
|
17999
|
+
return [4 /*yield*/, response.text()];
|
|
18000
|
+
case 1: return [2 /*return*/, _b.apply(_a, [_c.sent()])];
|
|
18001
|
+
case 2: return [2 /*return*/, response.text()];
|
|
18002
|
+
}
|
|
18003
|
+
});
|
|
18004
|
+
});
|
|
18005
|
+
}
|
|
18006
|
+
/**
|
|
18007
|
+
* helpers
|
|
18008
|
+
*/
|
|
18009
|
+
function extractOperationName(document) {
|
|
18010
|
+
var _a;
|
|
18011
|
+
var operationName = undefined;
|
|
18012
|
+
var operationDefinitions = document.definitions.filter(function (definition) { return definition.kind === 'OperationDefinition'; });
|
|
18013
|
+
if (operationDefinitions.length === 1) {
|
|
18014
|
+
operationName = (_a = operationDefinitions[0].name) === null || _a === void 0 ? void 0 : _a.value;
|
|
18015
|
+
}
|
|
18016
|
+
return operationName;
|
|
18017
|
+
}
|
|
18018
|
+
function resolveRequestDocument(document) {
|
|
18019
|
+
if (typeof document === 'string') {
|
|
18020
|
+
var operationName_1 = undefined;
|
|
18021
|
+
try {
|
|
18022
|
+
var parsedDocument = parser_1.parse(document);
|
|
18023
|
+
operationName_1 = extractOperationName(parsedDocument);
|
|
18024
|
+
}
|
|
18025
|
+
catch (err) {
|
|
18026
|
+
// Failed parsing the document, the operationName will be undefined
|
|
18027
|
+
}
|
|
18028
|
+
return { query: document, operationName: operationName_1 };
|
|
18029
|
+
}
|
|
18030
|
+
var operationName = extractOperationName(document);
|
|
18031
|
+
return { query: printer_1.print(document), operationName: operationName };
|
|
18032
|
+
}
|
|
18033
|
+
/**
|
|
18034
|
+
* Convenience passthrough template tag to get the benefits of tooling for the gql template tag. This does not actually parse the input into a GraphQL DocumentNode like graphql-tag package does. It just returns the string with any variables given interpolated. Can save you a bit of performance and having to install another package.
|
|
18035
|
+
*
|
|
18036
|
+
* @example
|
|
18037
|
+
*
|
|
18038
|
+
* import { gql } from 'graphql-request'
|
|
18039
|
+
*
|
|
18040
|
+
* await request('https://foo.bar/graphql', gql`...`)
|
|
18041
|
+
*
|
|
18042
|
+
* @remarks
|
|
18043
|
+
*
|
|
18044
|
+
* Several tools in the Node GraphQL ecosystem are hardcoded to specially treat any template tag named "gql". For example see this prettier issue: https://github.com/prettier/prettier/issues/4360. Using this template tag has no runtime effect beyond variable interpolation.
|
|
18045
|
+
*/
|
|
18046
|
+
function gql(chunks) {
|
|
18047
|
+
var variables = [];
|
|
18048
|
+
for (var _i = 1; _i < arguments.length; _i++) {
|
|
18049
|
+
variables[_i - 1] = arguments[_i];
|
|
18050
|
+
}
|
|
18051
|
+
return chunks.reduce(function (accumulator, chunk, index) { return "" + accumulator + chunk + (index in variables ? variables[index] : ''); }, '');
|
|
18052
|
+
}
|
|
18053
|
+
exports.gql = gql;
|
|
18054
|
+
/**
|
|
18055
|
+
* Convert Headers instance into regular object
|
|
18056
|
+
*/
|
|
18057
|
+
function HeadersInstanceToPlainObject(headers) {
|
|
18058
|
+
var o = {};
|
|
18059
|
+
headers.forEach(function (v, k) {
|
|
18060
|
+
o[k] = v;
|
|
18061
|
+
});
|
|
18062
|
+
return o;
|
|
18063
|
+
}
|
|
18064
|
+
|
|
18065
|
+
});
|
|
18066
|
+
|
|
18067
|
+
unwrapExports(dist);
|
|
18068
|
+
var dist_5 = dist.GraphQLClient;
|
|
18069
|
+
|
|
18070
|
+
var getGraphqlSdk = function getGraphqlSdk(url, token) {
|
|
18071
|
+
var graphqlClient = new dist_5(url);
|
|
18072
|
+
graphqlClient.setHeader('Authorization', "Bearer " + token);
|
|
18073
|
+
return getSdk(graphqlClient);
|
|
18074
|
+
};
|
|
18075
|
+
|
|
16014
18076
|
var moment = createCommonjsModule(function (module, exports) {
|
|
16015
18077
|
(function (global, factory) {
|
|
16016
18078
|
module.exports = factory() ;
|
|
@@ -21784,6 +23846,7 @@ exports.WorkplaceEventDocument = WorkplaceEventDocument;
|
|
|
21784
23846
|
exports.WorkplacesDocument = WorkplacesDocument;
|
|
21785
23847
|
exports.getCurrentShift = getCurrentShift;
|
|
21786
23848
|
exports.getGqlWsClient = getGqlWsClient;
|
|
23849
|
+
exports.getGraphqlSdk = getGraphqlSdk;
|
|
21787
23850
|
exports.getRecentShift = getRecentShift;
|
|
21788
23851
|
exports.getSdk = getSdk;
|
|
21789
23852
|
exports.normalizeShifts = normalizeShifts;
|
|
@@ -23038,7 +25101,7 @@ var Dashboard = function Dashboard(_ref) {
|
|
|
23038
25101
|
}]
|
|
23039
25102
|
}, (authResponse == null ? void 0 : authResponse.accessToken) && React__default["default"].createElement(material.Box, {
|
|
23040
25103
|
key: widgetId
|
|
23041
|
-
}, React__default["default"].createElement(
|
|
25104
|
+
}, React__default["default"].createElement(dist_1.WidgetSettingsButton, {
|
|
23042
25105
|
onClick: function onClick() {
|
|
23043
25106
|
return setSettingsModalOpened(function (current) {
|
|
23044
25107
|
return !current;
|
|
@@ -23141,7 +25204,7 @@ var WidgetPreview = function WidgetPreview(_ref) {
|
|
|
23141
25204
|
};
|
|
23142
25205
|
var headerProps = {
|
|
23143
25206
|
position: 'static',
|
|
23144
|
-
leadingText: widgetDisplayName,
|
|
25207
|
+
leadingText: widgetDisplayName(lang),
|
|
23145
25208
|
menuProps: {
|
|
23146
25209
|
items: menuItems,
|
|
23147
25210
|
buttonColor: 'white'
|