mirror of
https://github.com/CamHenlin/MessagesForMacintosh.git
synced 2024-11-26 20:50:30 +00:00
1 line
9.9 KiB
Plaintext
1 line
9.9 KiB
Plaintext
{"version":3,"sources":["../src/index.ts"],"names":["ApolloClient"],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAyDA,IAAM,kBAAkB,GAAG,CACzB,SADyB,EAEzB,KAFyB,EAGzB,aAHyB,EAIzB,SAJyB,EAKzB,OALyB,EAMzB,cANyB,EAOzB,aAPyB,EAQzB,SARyB,EASzB,gBATyB,EAUzB,OAVyB,EAWzB,MAXyB,EAYzB,SAZyB,EAazB,WAbyB,EAczB,UAdyB,EAezB,iBAfyB,CAA3B;;AAkBA,IAAA,aAAA,GAAA,UAAA,MAAA,EAAA;AAAmDA,wBAAAA,aAAAA,EAAAA,MAAAA;;AACjD,WAAA,aAAA,CAAY,MAAZ,EAAqC;AAAzB,QAAA,MAAA,KAAA,KAAA,CAAA,EAAA;AAAA,MAAA,MAAA,GAAA,EAAA;AAAyB;;AAArC,QAAA,KAAA,GAAA,IAAA;;AACE,QAAI,MAAJ,EAAY;AACV,UAAM,IAAI,GAAG,MAAM,CAAC,IAAP,CAAY,MAAZ,EAAoB,MAApB,CACX,UAAA,GAAA,EAAG;AAAI,eAAA,kBAAkB,CAAC,OAAnB,CAA2B,GAA3B,MAAoC,CAAC,CAArC;AAAsC,OADlC,CAAb;;AAIA,UAAI,IAAI,CAAC,MAAL,GAAc,CAAlB,EAAqB;AACnB,QAAA,OAAA,CAAA,GAAA,CAAA,QAAA,KAAA,YAAA,IAAA,uBAAA,IAAA,CAAA,4DAEI,KAAG,IAAI,CAAC,IAAL,CAAU,GAAV,CAFP,CAAA,CAAA;AAID;AACF;;AAGC,QAAA,OAAA,GAAA,MAAA,CAAA,OAAA;AAAA,QACA,GAAA,GAAA,MAAA,CAAA,GADA;AAAA,QAEA,WAAA,GAAA,MAAA,CAAA,WAFA;AAAA,QAGA,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AAK,EAAA,KAFuB;AAG5B,MAAA,YAAY,EAAE,YAAY,IAAI,EAHF;AAI5B,MAAA,WAAW,EAAE,WAAW,IAAI,aAJA;AAK5B,MAAA,OAAO,EAAE,OAAO,IAAI;AALQ,KAAb,CAAjB;;AAQA,QAAM,IAAI,GAAG,uBAAW,IAAX,CAAgB,CAAC,SAAD,EAAY,cAAZ,EAA4B,QAA5B,EAAsC,MAAtC,CAC3B,UAAA,CAAA,EAAC;AAAI,aAAA,CAAC,CAAC,CAAF;AAAG,KADmB,CAAhB,CAAb;;AAIA,QAAI,eAAe,GAAG,SAAtB;AACA,QAAI,cAAc,GAAG,QAArB;AACA,QAAI,qBAAqB,GAAG,eAA5B;;AACA,QAAI,WAAJ,EAAiB;AACf,UAAI,WAAW,CAAC,QAAhB,EAA0B;AACxB,QAAA,KAAK,CAAC,SAAN,CAAgB;AACd,UAAA,IAAI,EAAE,WAAW,CAAC;AADJ,SAAhB;AAGD;;AACD,MAAA,eAAe,GAAG,WAAW,CAAC,SAA9B;AACA,MAAA,cAAc,GAAG,WAAW,CAAC,QAA7B;AACA,MAAA,qBAAqB,GAAG,WAAW,CAAC,eAApC;AACD;;AAGD,IAAA,KAAA,GAAA,MAAA,CAAA,IAAA,CAAA,IAAA,EAAM;AACJ,MAAA,KAAK,EAAA,KADD;AAEJ,MAAA,IAAI,EAAA,IAFA;AAGJ,MAAA,IAAI,EAAA,IAHA;AAIJ,MAAA,OAAO,EAAA,OAJH;AAKJ,MAAA,SAAS,EAAE,eALP;AAMJ,MAAA,QAAQ,EAAE,cANN;AAOJ,MAAA,eAAe,EAAE;AAPb,KAAN,KAQS,IART;;AASD;;AACH,SAAA,aAAA;AA9HA,CAAA,CAAmDA,qBAAnD,CAAA","sourcesContent":["/* necessary for backward compat */\nexport * from 'apollo-client';\nexport * from 'apollo-link';\nexport * from 'apollo-cache-inmemory';\n\nimport { Operation, ApolloLink, Observable } from 'apollo-link';\nimport { HttpLink, UriFunction } from 'apollo-link-http';\nimport { onError, ErrorLink } from 'apollo-link-error';\nimport { ApolloCache } from 'apollo-cache';\nimport { InMemoryCache, CacheResolverMap } from 'apollo-cache-inmemory';\nimport gql from 'graphql-tag';\nimport ApolloClient, {\n Resolvers,\n LocalStateFragmentMatcher,\n} from 'apollo-client';\nimport { DocumentNode } from 'graphql';\nimport { invariant } from 'ts-invariant';\n\nexport { gql, HttpLink };\n\ntype ClientStateConfig = {\n cache?: ApolloCache<any>;\n defaults?: Record<string, any>;\n resolvers?: Resolvers | Resolvers[];\n typeDefs?: string | string[] | DocumentNode | DocumentNode[];\n fragmentMatcher?: LocalStateFragmentMatcher;\n};\n\nexport interface PresetConfig {\n request?: (operation: Operation) => Promise<void> | void;\n uri?: string | UriFunction;\n credentials?: string;\n headers?: any;\n fetch?: WindowOrWorkerGlobalScope['fetch'];\n fetchOptions?: HttpLink.Options;\n clientState?: ClientStateConfig;\n onError?: ErrorLink.ErrorHandler;\n cacheRedirects?: CacheResolverMap;\n cache?: ApolloCache<any>;\n name?: string;\n version?: string;\n resolvers?: Resolvers | Resolvers[];\n typeDefs?: string | string[] | DocumentNode | DocumentNode[];\n fragmentMatcher?: LocalStateFragmentMatcher;\n assumeImmutableResults?: boolean;\n}\n\n// Yes, these are the exact same as the `PresetConfig` interface. We're\n// defining these again so they can be used to verify that valid config\n// options are being used in the `DefaultClient` constructor, for clients\n// that aren't using Typescript. This duplication is unfortunate, and at\n// some point can likely be adjusted so these items are inferred from\n// the `PresetConfig` interface using a Typescript transform at compilation\n// time. Unfortunately, TS transforms with rollup don't appear to be quite\n// working properly, so this will have to be re-visited at some point.\n// For now, when updating the properties of the `PresetConfig` interface,\n// please also update this constant.\nconst PRESET_CONFIG_KEYS = [\n 'request',\n 'uri',\n 'credentials',\n 'headers',\n 'fetch',\n 'fetchOptions',\n 'clientState',\n 'onError',\n 'cacheRedirects',\n 'cache',\n 'name',\n 'version',\n 'resolvers',\n 'typeDefs',\n 'fragmentMatcher',\n];\n\nexport default class DefaultClient<TCache> extends ApolloClient<TCache> {\n constructor(config: PresetConfig = {}) {\n if (config) {\n const diff = Object.keys(config).filter(\n key => PRESET_CONFIG_KEYS.indexOf(key) === -1,\n );\n\n if (diff.length > 0) {\n invariant.warn(\n 'ApolloBoost was initialized with unsupported options: ' +\n `${diff.join(' ')}`,\n );\n }\n }\n\n const {\n request,\n uri,\n credentials,\n headers,\n fetch,\n fetchOptions,\n clientState,\n cacheRedirects,\n onError: errorCallback,\n name,\n version,\n resolvers,\n typeDefs,\n fragmentMatcher,\n } = config;\n\n let { cache } = config;\n\n invariant(\n !cache || !cacheRedirects,\n 'Incompatible cache configuration. When not providing `cache`, ' +\n 'configure the provided instance with `cacheRedirects` instead.',\n );\n\n if (!cache) {\n cache = cacheRedirects\n ? new InMemoryCache({ cacheRedirects })\n : new InMemoryCache();\n }\n\n const errorLink = errorCallback\n ? onError(errorCallback)\n : onError(({ graphQLErrors, networkError }) => {\n if (graphQLErrors) {\n graphQLErrors.forEach(({ message, locations, path }) =>\n // tslint:disable-next-line\n invariant.warn(\n `[GraphQL error]: Message: ${message}, Location: ` +\n `${locations}, Path: ${path}`,\n ),\n );\n }\n if (networkError) {\n // tslint:disable-next-line\n invariant.warn(`[Network error]: ${networkError}`);\n }\n });\n\n const requestHandler = request\n ? new ApolloLink(\n (operation, forward) =>\n new Observable(observer => {\n let handle: any;\n Promise.resolve(operation)\n .then(oper => request(oper))\n .then(() => {\n handle = forward(operation).subscribe({\n next: observer.next.bind(observer),\n error: observer.error.bind(observer),\n complete: observer.complete.bind(observer),\n });\n })\n .catch(observer.error.bind(observer));\n\n return () => {\n if (handle) {\n handle.unsubscribe();\n }\n };\n }),\n )\n : false;\n\n const httpLink = new HttpLink({\n uri: uri || '/graphql',\n fetch,\n fetchOptions: fetchOptions || {},\n credentials: credentials || 'same-origin',\n headers: headers || {},\n });\n\n const link = ApolloLink.from([errorLink, requestHandler, httpLink].filter(\n x => !!x,\n ) as ApolloLink[]);\n\n let activeResolvers = resolvers;\n let activeTypeDefs = typeDefs;\n let activeFragmentMatcher = fragmentMatcher;\n if (clientState) {\n if (clientState.defaults) {\n cache.writeData({\n data: clientState.defaults,\n });\n }\n activeResolvers = clientState.resolvers;\n activeTypeDefs = clientState.typeDefs;\n activeFragmentMatcher = clientState.fragmentMatcher;\n }\n\n // super hacky, we will fix the types eventually\n super({\n cache,\n link,\n name,\n version,\n resolvers: activeResolvers,\n typeDefs: activeTypeDefs,\n fragmentMatcher: activeFragmentMatcher,\n } as any);\n }\n}\n"]} |