MessagesForMacintosh/JS/node_modules/apollo-link-http/lib/bundle.cjs.js.map

1 line
12 KiB
Plaintext

{"version":3,"file":"bundle.cjs.js","sources":["bundle.esm.js"],"sourcesContent":["import { __rest, __assign, __extends } from 'tslib';\nimport { ApolloLink, fromError, Observable } from 'apollo-link';\nimport { checkFetcher, selectURI, selectHttpOptionsAndBody, fallbackHttpConfig, createSignalIfSupported, serializeFetchParameter, parseAndCheckHttpResponse } from 'apollo-link-http-common';\n\nvar createHttpLink = function (linkOptions) {\n if (linkOptions === void 0) { linkOptions = {}; }\n var _a = linkOptions.uri, uri = _a === void 0 ? '/graphql' : _a, fetcher = linkOptions.fetch, includeExtensions = linkOptions.includeExtensions, useGETForQueries = linkOptions.useGETForQueries, requestOptions = __rest(linkOptions, [\"uri\", \"fetch\", \"includeExtensions\", \"useGETForQueries\"]);\n checkFetcher(fetcher);\n if (!fetcher) {\n fetcher = fetch;\n }\n var linkConfig = {\n http: { includeExtensions: includeExtensions },\n options: requestOptions.fetchOptions,\n credentials: requestOptions.credentials,\n headers: requestOptions.headers,\n };\n return new ApolloLink(function (operation) {\n var chosenURI = selectURI(operation, uri);\n var context = operation.getContext();\n var clientAwarenessHeaders = {};\n if (context.clientAwareness) {\n var _a = context.clientAwareness, name_1 = _a.name, version = _a.version;\n if (name_1) {\n clientAwarenessHeaders['apollographql-client-name'] = name_1;\n }\n if (version) {\n clientAwarenessHeaders['apollographql-client-version'] = version;\n }\n }\n var contextHeaders = __assign({}, clientAwarenessHeaders, context.headers);\n var contextConfig = {\n http: context.http,\n options: context.fetchOptions,\n credentials: context.credentials,\n headers: contextHeaders,\n };\n var _b = selectHttpOptionsAndBody(operation, fallbackHttpConfig, linkConfig, contextConfig), options = _b.options, body = _b.body;\n var controller;\n if (!options.signal) {\n var _c = createSignalIfSupported(), _controller = _c.controller, signal = _c.signal;\n controller = _controller;\n if (controller)\n options.signal = signal;\n }\n var definitionIsMutation = function (d) {\n return d.kind === 'OperationDefinition' && d.operation === 'mutation';\n };\n if (useGETForQueries &&\n !operation.query.definitions.some(definitionIsMutation)) {\n options.method = 'GET';\n }\n if (options.method === 'GET') {\n var _d = rewriteURIForGET(chosenURI, body), newURI = _d.newURI, parseError = _d.parseError;\n if (parseError) {\n return fromError(parseError);\n }\n chosenURI = newURI;\n }\n else {\n try {\n options.body = serializeFetchParameter(body, 'Payload');\n }\n catch (parseError) {\n return fromError(parseError);\n }\n }\n return new Observable(function (observer) {\n fetcher(chosenURI, options)\n .then(function (response) {\n operation.setContext({ response: response });\n return response;\n })\n .then(parseAndCheckHttpResponse(operation))\n .then(function (result) {\n observer.next(result);\n observer.complete();\n return result;\n })\n .catch(function (err) {\n if (err.name === 'AbortError')\n return;\n if (err.result && err.result.errors && err.result.data) {\n observer.next(err.result);\n }\n observer.error(err);\n });\n return function () {\n if (controller)\n controller.abort();\n };\n });\n });\n};\nfunction rewriteURIForGET(chosenURI, body) {\n var queryParams = [];\n var addQueryParam = function (key, value) {\n queryParams.push(key + \"=\" + encodeURIComponent(value));\n };\n if ('query' in body) {\n addQueryParam('query', body.query);\n }\n if (body.operationName) {\n addQueryParam('operationName', body.operationName);\n }\n if (body.variables) {\n var serializedVariables = void 0;\n try {\n serializedVariables = serializeFetchParameter(body.variables, 'Variables map');\n }\n catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('variables', serializedVariables);\n }\n if (body.extensions) {\n var serializedExtensions = void 0;\n try {\n serializedExtensions = serializeFetchParameter(body.extensions, 'Extensions map');\n }\n catch (parseError) {\n return { parseError: parseError };\n }\n addQueryParam('extensions', serializedExtensions);\n }\n var fragment = '', preFragment = chosenURI;\n var fragmentStart = chosenURI.indexOf('#');\n if (fragmentStart !== -1) {\n fragment = chosenURI.substr(fragmentStart);\n preFragment = chosenURI.substr(0, fragmentStart);\n }\n var queryParamsPrefix = preFragment.indexOf('?') === -1 ? '?' : '&';\n var newURI = preFragment + queryParamsPrefix + queryParams.join('&') + fragment;\n return { newURI: newURI };\n}\nvar HttpLink = (function (_super) {\n __extends(HttpLink, _super);\n function HttpLink(opts) {\n return _super.call(this, createHttpLink(opts).request) || this;\n }\n return HttpLink;\n}(ApolloLink));\n\nexport { HttpLink, createHttpLink };\n//# sourceMappingURL=bundle.esm.js.map\n"],"names":["__rest","checkFetcher","ApolloLink","selectURI","__assign","selectHttpOptionsAndBody","fallbackHttpConfig","createSignalIfSupported","fromError","serializeFetchParameter","Observable","parseAndCheckHttpResponse","__extends"],"mappings":";;;;;;;;AAIG,IAAC,cAAc,GAAG,UAAU,WAAW,EAAE;AAC5C,IAAI,IAAI,WAAW,KAAK,KAAK,CAAC,EAAE,EAAE,WAAW,GAAG,EAAE,CAAC,EAAE;AACrD,IAAI,IAAI,EAAE,GAAG,WAAW,CAAC,GAAG,EAAE,GAAG,GAAG,EAAE,KAAK,KAAK,CAAC,GAAG,UAAU,GAAG,EAAE,EAAE,OAAO,GAAG,WAAW,CAAC,KAAK,EAAE,iBAAiB,GAAG,WAAW,CAAC,iBAAiB,EAAE,gBAAgB,GAAG,WAAW,CAAC,gBAAgB,EAAE,cAAc,GAAGA,YAAM,CAAC,WAAW,EAAE,CAAC,KAAK,EAAE,OAAO,EAAE,mBAAmB,EAAE,kBAAkB,CAAC,CAAC,CAAC;AACtS,IAAIC,iCAAY,CAAC,OAAO,CAAC,CAAC;AAC1B,IAAI,IAAI,CAAC,OAAO,EAAE;AAClB,QAAQ,OAAO,GAAG,KAAK,CAAC;AACxB,KAAK;AACL,IAAI,IAAI,UAAU,GAAG;AACrB,QAAQ,IAAI,EAAE,EAAE,iBAAiB,EAAE,iBAAiB,EAAE;AACtD,QAAQ,OAAO,EAAE,cAAc,CAAC,YAAY;AAC5C,QAAQ,WAAW,EAAE,cAAc,CAAC,WAAW;AAC/C,QAAQ,OAAO,EAAE,cAAc,CAAC,OAAO;AACvC,KAAK,CAAC;AACN,IAAI,OAAO,IAAIC,qBAAU,CAAC,UAAU,SAAS,EAAE;AAC/C,QAAQ,IAAI,SAAS,GAAGC,8BAA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